Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements related to surfaceflinger #10

Open
wants to merge 5 commits into
base: arrow-13.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AndroidManifest-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<!-- for rotating surface by arbitrary degree -->
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_HOME_APP_SEARCH_DATA" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class SurfaceTransactionApplier extends ReleaseCheck {
*/
public SurfaceTransactionApplier(View targetView) {
mTargetViewRootImpl = targetView.getViewRootImpl();
mBarrierSurfaceControl = mTargetViewRootImpl.getSurfaceControl();
mBarrierSurfaceControl =
mTargetViewRootImpl != null ? mTargetViewRootImpl.getSurfaceControl() : null;
mApplyHandler = new Handler(this::onApplyMessage);
setCanRelease(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ public void apply(TransformParams params) {
mInversePositionMatrix.mapRect(mTempRectF);
mTempRectF.roundOut(mTmpCropRect);

params.applySurfaceParams(params.createSurfaceParams(this));
if (params.getTargetSet() != null) {
params.applySurfaceParams(params.createSurfaceParams(this));
}

if (!DEBUG) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private void animateToSearchState(boolean goingToSearch, long durationMs) {
// Fade out the button to pause work apps.
mWorkManager.onActivePageChanged(SEARCH);
}
setScrollbarVisibility(!goingToSearch);
mSearchTransitionController.animateToSearchState(goingToSearch, durationMs,
/* onEndRunnable = */ () -> {
mIsSearching = goingToSearch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,13 @@ protected void rebindAdapters(boolean force) {
mAllAppsStore.registerIconContainer(mAH.get(AdapterHolder.SEARCH).mRecyclerView);
}

protected void setScrollbarVisibility(boolean visible) {
final RecyclerViewFastScroller scrollbar = getScrollBar();
if (scrollbar != null) {
scrollbar.setVisibility(visible ? VISIBLE : GONE);
}
}

protected void updateSearchResultsVisibility() {
if (isSearching()) {
getSearchRecyclerView().setVisibility(VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public void setScroll(int currentScroll, int totalScroll) {
mTotalScroll = totalScroll;

int scrollPerPage = totalScroll / (mNumPages - 1);
if (scrollPerPage == 0) {
return;
}

int pageToLeft = currentScroll / scrollPerPage;
int pageToLeftScroll = pageToLeft * scrollPerPage;
int pageToRightScroll = pageToLeftScroll + scrollPerPage;
Expand Down