Loading packages/SystemUI/src/com/android/systemui/RecentsComponent.java +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.view.View; public interface RecentsComponent { void showRecentApps(boolean triggeredFromAltTab, boolean fromHome); void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(Display display); void toggleRecents(); void preloadRecents(); void showNextAffiliatedTask(); void showPrevAffiliatedTask(); Loading packages/SystemUI/src/com/android/systemui/recents/Recents.java +2 −2 Original line number Diff line number Diff line Loading @@ -324,14 +324,14 @@ public class Recents extends SystemUI @Override public void toggleRecentApps() { toggleRecents(mContext.getSystemService(WindowManager.class).getDefaultDisplay()); toggleRecents(); } /** * Toggles the Recents activity. */ @Override public void toggleRecents(Display display) { public void toggleRecents() { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +4 −2 Original line number Diff line number Diff line Loading @@ -222,6 +222,10 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD getApplicationContext()).onActionEnd( LatencyTracker.ACTION_TOGGLE_RECENTS)); } DejankUtils.postAfterTraversal(() -> { Recents.getTaskLoader().startLoader(RecentsActivity.this); Recents.getTaskLoader().getHighResThumbnailLoader().setVisible(true); }); return true; } }; Loading Loading @@ -378,8 +382,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mRecentsView.onStart(); // Notify of the next draw mRecentsView.getViewTreeObserver().addOnPreDrawListener(mRecentsDrawnEventListener); Recents.getTaskLoader().getHighResThumbnailLoader().setVisible(true); } @Override Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +25 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDO import android.annotation.NonNull; import android.app.ActivityManager; import android.app.ActivityManager.StackInfo; import android.app.ActivityManager.TaskSnapshot; import android.app.ActivityOptions; import android.app.AppGlobals; Loading Loading @@ -95,6 +96,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * Acts as a shim around the real system services that we need to access data from, and provides Loading Loading @@ -143,6 +146,7 @@ public class SystemServicesProxy { Canvas mBgProtectionCanvas; private final Handler mHandler = new H(); private final ExecutorService mOnewayExecutor = Executors.newSingleThreadExecutor(); /** * An abstract class to track task stack changes. Loading Loading @@ -466,13 +470,20 @@ public class SystemServicesProxy { if (mIam == null) return false; try { ActivityManager.StackInfo homeStackInfo = mIam.getStackInfo( ActivityManager.StackId.HOME_STACK_ID); ActivityManager.StackInfo fullscreenStackInfo = mIam.getStackInfo( ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID); ActivityManager.StackInfo recentsStackInfo = mIam.getStackInfo( ActivityManager.StackId.RECENTS_STACK_ID); List<StackInfo> stackInfos = mIam.getAllStackInfos(); ActivityManager.StackInfo homeStackInfo = null; ActivityManager.StackInfo fullscreenStackInfo = null; ActivityManager.StackInfo recentsStackInfo = null; for (int i = 0; i < stackInfos.size(); i++) { StackInfo stackInfo = stackInfos.get(i); if (stackInfo.stackId == HOME_STACK_ID) { homeStackInfo = stackInfo; } else if (stackInfo.stackId == FULLSCREEN_WORKSPACE_STACK_ID) { fullscreenStackInfo = stackInfo; } else if (stackInfo.stackId == RECENTS_STACK_ID) { recentsStackInfo = stackInfo; } } boolean homeStackVisibleNotOccluded = isStackNotOccluded(homeStackInfo, fullscreenStackInfo); boolean recentsStackVisibleNotOccluded = isStackNotOccluded(recentsStackInfo, Loading Loading @@ -755,10 +766,12 @@ public class SystemServicesProxy { * Sends a message to close other system windows. */ public void sendCloseSystemWindows(String reason) { mOnewayExecutor.submit(() -> { try { mIam.closeSystemDialogs(reason); } catch (RemoteException e) { } }); } /** Loading Loading @@ -998,9 +1011,7 @@ public class SystemServicesProxy { * Returns the current user id. */ public int getCurrentUser() { if (mAm == null) return 0; return mAm.getCurrentUser(); return KeyguardUpdateMonitor.getCurrentUser(); } /** Loading packages/SystemUI/src/com/android/systemui/recents/model/HighResThumbnailLoader.java +11 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class HighResThumbnailLoader implements TaskCallbacks { private boolean mLoading; private boolean mVisible; private boolean mFlingingFast; private boolean mTaskLoadQueueIdle; public HighResThumbnailLoader(SystemServicesProxy ssp, Looper looper) { mMainThreadHandler = new Handler(looper); Loading @@ -71,13 +72,22 @@ public class HighResThumbnailLoader implements TaskCallbacks { updateLoading(); } /** * Sets whether the other task load queue is idling. Avoid double-loading bitmaps by not * starting this queue until the other queue is idling. */ public void setTaskLoadQueueIdle(boolean idle) { mTaskLoadQueueIdle = idle; updateLoading(); } @VisibleForTesting boolean isLoading() { return mLoading; } private void updateLoading() { setLoading(mVisible && !mFlingingFast); setLoading(mVisible && !mFlingingFast && mTaskLoadQueueIdle); } private void setLoading(boolean loading) { Loading Loading
packages/SystemUI/src/com/android/systemui/RecentsComponent.java +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.view.View; public interface RecentsComponent { void showRecentApps(boolean triggeredFromAltTab, boolean fromHome); void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); void toggleRecents(Display display); void toggleRecents(); void preloadRecents(); void showNextAffiliatedTask(); void showPrevAffiliatedTask(); Loading
packages/SystemUI/src/com/android/systemui/recents/Recents.java +2 −2 Original line number Diff line number Diff line Loading @@ -324,14 +324,14 @@ public class Recents extends SystemUI @Override public void toggleRecentApps() { toggleRecents(mContext.getSystemService(WindowManager.class).getDefaultDisplay()); toggleRecents(); } /** * Toggles the Recents activity. */ @Override public void toggleRecents(Display display) { public void toggleRecents() { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +4 −2 Original line number Diff line number Diff line Loading @@ -222,6 +222,10 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD getApplicationContext()).onActionEnd( LatencyTracker.ACTION_TOGGLE_RECENTS)); } DejankUtils.postAfterTraversal(() -> { Recents.getTaskLoader().startLoader(RecentsActivity.this); Recents.getTaskLoader().getHighResThumbnailLoader().setVisible(true); }); return true; } }; Loading Loading @@ -378,8 +382,6 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD mRecentsView.onStart(); // Notify of the next draw mRecentsView.getViewTreeObserver().addOnPreDrawListener(mRecentsDrawnEventListener); Recents.getTaskLoader().getHighResThumbnailLoader().setVisible(true); } @Override Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +25 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDO import android.annotation.NonNull; import android.app.ActivityManager; import android.app.ActivityManager.StackInfo; import android.app.ActivityManager.TaskSnapshot; import android.app.ActivityOptions; import android.app.AppGlobals; Loading Loading @@ -95,6 +96,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Random; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * Acts as a shim around the real system services that we need to access data from, and provides Loading Loading @@ -143,6 +146,7 @@ public class SystemServicesProxy { Canvas mBgProtectionCanvas; private final Handler mHandler = new H(); private final ExecutorService mOnewayExecutor = Executors.newSingleThreadExecutor(); /** * An abstract class to track task stack changes. Loading Loading @@ -466,13 +470,20 @@ public class SystemServicesProxy { if (mIam == null) return false; try { ActivityManager.StackInfo homeStackInfo = mIam.getStackInfo( ActivityManager.StackId.HOME_STACK_ID); ActivityManager.StackInfo fullscreenStackInfo = mIam.getStackInfo( ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID); ActivityManager.StackInfo recentsStackInfo = mIam.getStackInfo( ActivityManager.StackId.RECENTS_STACK_ID); List<StackInfo> stackInfos = mIam.getAllStackInfos(); ActivityManager.StackInfo homeStackInfo = null; ActivityManager.StackInfo fullscreenStackInfo = null; ActivityManager.StackInfo recentsStackInfo = null; for (int i = 0; i < stackInfos.size(); i++) { StackInfo stackInfo = stackInfos.get(i); if (stackInfo.stackId == HOME_STACK_ID) { homeStackInfo = stackInfo; } else if (stackInfo.stackId == FULLSCREEN_WORKSPACE_STACK_ID) { fullscreenStackInfo = stackInfo; } else if (stackInfo.stackId == RECENTS_STACK_ID) { recentsStackInfo = stackInfo; } } boolean homeStackVisibleNotOccluded = isStackNotOccluded(homeStackInfo, fullscreenStackInfo); boolean recentsStackVisibleNotOccluded = isStackNotOccluded(recentsStackInfo, Loading Loading @@ -755,10 +766,12 @@ public class SystemServicesProxy { * Sends a message to close other system windows. */ public void sendCloseSystemWindows(String reason) { mOnewayExecutor.submit(() -> { try { mIam.closeSystemDialogs(reason); } catch (RemoteException e) { } }); } /** Loading Loading @@ -998,9 +1011,7 @@ public class SystemServicesProxy { * Returns the current user id. */ public int getCurrentUser() { if (mAm == null) return 0; return mAm.getCurrentUser(); return KeyguardUpdateMonitor.getCurrentUser(); } /** Loading
packages/SystemUI/src/com/android/systemui/recents/model/HighResThumbnailLoader.java +11 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class HighResThumbnailLoader implements TaskCallbacks { private boolean mLoading; private boolean mVisible; private boolean mFlingingFast; private boolean mTaskLoadQueueIdle; public HighResThumbnailLoader(SystemServicesProxy ssp, Looper looper) { mMainThreadHandler = new Handler(looper); Loading @@ -71,13 +72,22 @@ public class HighResThumbnailLoader implements TaskCallbacks { updateLoading(); } /** * Sets whether the other task load queue is idling. Avoid double-loading bitmaps by not * starting this queue until the other queue is idling. */ public void setTaskLoadQueueIdle(boolean idle) { mTaskLoadQueueIdle = idle; updateLoading(); } @VisibleForTesting boolean isLoading() { return mLoading; } private void updateLoading() { setLoading(mVisible && !mFlingingFast); setLoading(mVisible && !mFlingingFast && mTaskLoadQueueIdle); } private void setLoading(boolean loading) { Loading