Loading packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ public interface ViewMediatorCallback { */ void playTrustedSound(); /** * When the bouncer is shown or hides * @param shown */ void onBouncerVisiblityChanged(boolean shown); /** * @return true if the screen is on */ Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +15 −9 Original line number Diff line number Diff line Loading @@ -612,6 +612,13 @@ public class KeyguardViewMediator extends SystemUI { resetStateLocked(); } @Override public void onBouncerVisiblityChanged(boolean shown) { synchronized (KeyguardViewMediator.this) { adjustStatusBarLocked(shown); } } @Override public void playTrustedSound() { KeyguardViewMediator.this.playTrustedSound(); Loading Loading @@ -1862,6 +1869,10 @@ public class KeyguardViewMediator extends SystemUI { } private void adjustStatusBarLocked() { adjustStatusBarLocked(false /* forceHideHomeRecentsButtons */); } private void adjustStatusBarLocked(boolean forceHideHomeRecentsButtons) { if (mStatusBarManager == null) { mStatusBarManager = (StatusBarManager) mContext.getSystemService(Context.STATUS_BAR_SERVICE); Loading @@ -1872,19 +1883,14 @@ public class KeyguardViewMediator extends SystemUI { // Disable aspects of the system/status/navigation bars that must not be re-enabled by // windows that appear on top, ever int flags = StatusBarManager.DISABLE_NONE; if (mShowing) { // Permanently disable components not available when keyguard is enabled // (like recents). Temporary enable/disable (e.g. the "back" button) are // done in KeyguardHostView. flags |= StatusBarManager.DISABLE_RECENT; } if (isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME; if (forceHideHomeRecentsButtons || isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_RECENT; } if (DEBUG) { Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded + " isSecure=" + isSecure() + " --> flags=0x" + Integer.toHexString(flags)); + " isSecure=" + isSecure() + " force=" + forceHideHomeRecentsButtons + " --> flags=0x" + Integer.toHexString(flags)); } mStatusBarManager.disable(flags); Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +41 −8 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASO import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.KeyguardManager; import android.app.trust.TrustManager; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; Loading @@ -32,6 +34,7 @@ import android.graphics.Bitmap; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.AsyncTask.Status; import android.os.Handler; import android.os.SystemClock; import android.util.ArraySet; Loading Loading @@ -225,6 +228,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } }; private TrustManager mTrustManager; protected Context mContext; protected Handler mHandler; TaskStackListenerImpl mTaskStackListener; Loading Loading @@ -271,6 +275,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Initialize the static configuration resources mDummyStackView = new TaskStackView(mContext); reloadResources(); mTrustManager = (TrustManager) mContext.getSystemService(Context.TRUST_SERVICE); } public void onBootCompleted() { Loading Loading @@ -309,8 +315,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * {@link Recents#onBusEvent(ScreenPinningRequestEvent)}. */ public void onStartScreenPinning(Context context, int taskId) { SystemUIApplication app = (SystemUIApplication) context; StatusBar statusBar = app.getComponent(StatusBar.class); final StatusBar statusBar = getStatusBar(); if (statusBar != null) { statusBar.showScreenPinningRequest(taskId, false); } Loading Loading @@ -350,8 +355,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener if (forceVisible || !ssp.isRecentsActivityVisible(isHomeStackVisible)) { ActivityManager.RunningTaskInfo runningTask = ActivityManagerWrapper.getInstance().getRunningTask(); startRecentsActivity(runningTask, isHomeStackVisible.value || fromHome, animate, growTarget); startRecentsActivityAndDismissKeyguardIfNeeded(runningTask, isHomeStackVisible.value || fromHome, animate, growTarget); } } catch (ActivityNotFoundException e) { Log.e(TAG, "Failed to launch RecentsActivity", e); Loading Loading @@ -442,8 +447,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Otherwise, start the recents activity ActivityManager.RunningTaskInfo runningTask = ActivityManagerWrapper.getInstance().getRunningTask(); startRecentsActivity(runningTask, isHomeStackVisible.value, true /* animate */, growTarget); startRecentsActivityAndDismissKeyguardIfNeeded(runningTask, isHomeStackVisible.value, true /* animate */, growTarget); // Only close the other system windows if we are actually showing recents ActivityManagerWrapper.getInstance().closeSystemWindows( Loading @@ -462,6 +467,12 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener return; } // Skip preloading recents when keyguard is showing final StatusBar statusBar = getStatusBar(); if (statusBar != null && statusBar.isKeyguardShowing()) { return; } // Preload only the raw task list into a new load plan (which will be consumed by the // RecentsActivity) only if there is a task to animate to. Post this to ensure that we // don't block the touch feedback on the nav bar button which triggers this. Loading Loading @@ -942,9 +953,27 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } /** * Shows the recents activity * Shows the recents activity after dismissing the keyguard if visible */ protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask, protected void startRecentsActivityAndDismissKeyguardIfNeeded( final ActivityManager.RunningTaskInfo runningTask, final boolean isHomeStackVisible, final boolean animate, final int growTarget) { // Preload only if device for current user is unlocked final StatusBar statusBar = getStatusBar(); if (statusBar != null && statusBar.isKeyguardShowing()) { statusBar.executeRunnableDismissingKeyguard(() -> { // Flush trustmanager before checking device locked per user when preloading mTrustManager.reportKeyguardShowingChanged(); mHandler.post(() -> startRecentsActivity(runningTask, isHomeStackVisible, animate, growTarget)); }, null, true /* dismissShade */, false /* afterKeyguardGone */, true /* deferred */); } else { startRecentsActivity(runningTask, isHomeStackVisible, animate, growTarget); } } private void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask, boolean isHomeStackVisible, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); Loading Loading @@ -1033,6 +1062,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener return result; } private StatusBar getStatusBar() { return ((SystemUIApplication) mContext).getComponent(StatusBar.class); } /** * Starts the recents activity. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +3 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.phone; import android.app.ActivityManager; import android.content.Context; import android.os.Handler; import android.os.UserHandle; Loading Loading @@ -122,6 +121,8 @@ public class KeyguardBouncer { // Split up the work over multiple frames. DejankUtils.postAfterTraversal(mShowRunnable); mCallback.onBouncerVisiblityChanged(true /* shown */); } private final Runnable mShowRunnable = new Runnable() { Loading Loading @@ -182,6 +183,7 @@ public class KeyguardBouncer { mDismissCallbackRegistry.notifyDismissCancelled(); } mFalsingManager.onBouncerHidden(); mCallback.onBouncerVisiblityChanged(false /* shown */); cancelShowRunnable(); if (mKeyguardView != null) { mKeyguardView.cancelDismissAction(); Loading Loading
packages/SystemUI/src/com/android/keyguard/ViewMediatorCallback.java +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ public interface ViewMediatorCallback { */ void playTrustedSound(); /** * When the bouncer is shown or hides * @param shown */ void onBouncerVisiblityChanged(boolean shown); /** * @return true if the screen is on */ Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +15 −9 Original line number Diff line number Diff line Loading @@ -612,6 +612,13 @@ public class KeyguardViewMediator extends SystemUI { resetStateLocked(); } @Override public void onBouncerVisiblityChanged(boolean shown) { synchronized (KeyguardViewMediator.this) { adjustStatusBarLocked(shown); } } @Override public void playTrustedSound() { KeyguardViewMediator.this.playTrustedSound(); Loading Loading @@ -1862,6 +1869,10 @@ public class KeyguardViewMediator extends SystemUI { } private void adjustStatusBarLocked() { adjustStatusBarLocked(false /* forceHideHomeRecentsButtons */); } private void adjustStatusBarLocked(boolean forceHideHomeRecentsButtons) { if (mStatusBarManager == null) { mStatusBarManager = (StatusBarManager) mContext.getSystemService(Context.STATUS_BAR_SERVICE); Loading @@ -1872,19 +1883,14 @@ public class KeyguardViewMediator extends SystemUI { // Disable aspects of the system/status/navigation bars that must not be re-enabled by // windows that appear on top, ever int flags = StatusBarManager.DISABLE_NONE; if (mShowing) { // Permanently disable components not available when keyguard is enabled // (like recents). Temporary enable/disable (e.g. the "back" button) are // done in KeyguardHostView. flags |= StatusBarManager.DISABLE_RECENT; } if (isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME; if (forceHideHomeRecentsButtons || isShowingAndNotOccluded()) { flags |= StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_RECENT; } if (DEBUG) { Log.d(TAG, "adjustStatusBarLocked: mShowing=" + mShowing + " mOccluded=" + mOccluded + " isSecure=" + isSecure() + " --> flags=0x" + Integer.toHexString(flags)); + " isSecure=" + isSecure() + " force=" + forceHideHomeRecentsButtons + " --> flags=0x" + Integer.toHexString(flags)); } mStatusBarManager.disable(flags); Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +41 −8 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASO import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.KeyguardManager; import android.app.trust.TrustManager; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; Loading @@ -32,6 +34,7 @@ import android.graphics.Bitmap; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.AsyncTask.Status; import android.os.Handler; import android.os.SystemClock; import android.util.ArraySet; Loading Loading @@ -225,6 +228,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } }; private TrustManager mTrustManager; protected Context mContext; protected Handler mHandler; TaskStackListenerImpl mTaskStackListener; Loading Loading @@ -271,6 +275,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Initialize the static configuration resources mDummyStackView = new TaskStackView(mContext); reloadResources(); mTrustManager = (TrustManager) mContext.getSystemService(Context.TRUST_SERVICE); } public void onBootCompleted() { Loading Loading @@ -309,8 +315,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener * {@link Recents#onBusEvent(ScreenPinningRequestEvent)}. */ public void onStartScreenPinning(Context context, int taskId) { SystemUIApplication app = (SystemUIApplication) context; StatusBar statusBar = app.getComponent(StatusBar.class); final StatusBar statusBar = getStatusBar(); if (statusBar != null) { statusBar.showScreenPinningRequest(taskId, false); } Loading Loading @@ -350,8 +355,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener if (forceVisible || !ssp.isRecentsActivityVisible(isHomeStackVisible)) { ActivityManager.RunningTaskInfo runningTask = ActivityManagerWrapper.getInstance().getRunningTask(); startRecentsActivity(runningTask, isHomeStackVisible.value || fromHome, animate, growTarget); startRecentsActivityAndDismissKeyguardIfNeeded(runningTask, isHomeStackVisible.value || fromHome, animate, growTarget); } } catch (ActivityNotFoundException e) { Log.e(TAG, "Failed to launch RecentsActivity", e); Loading Loading @@ -442,8 +447,8 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener // Otherwise, start the recents activity ActivityManager.RunningTaskInfo runningTask = ActivityManagerWrapper.getInstance().getRunningTask(); startRecentsActivity(runningTask, isHomeStackVisible.value, true /* animate */, growTarget); startRecentsActivityAndDismissKeyguardIfNeeded(runningTask, isHomeStackVisible.value, true /* animate */, growTarget); // Only close the other system windows if we are actually showing recents ActivityManagerWrapper.getInstance().closeSystemWindows( Loading @@ -462,6 +467,12 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener return; } // Skip preloading recents when keyguard is showing final StatusBar statusBar = getStatusBar(); if (statusBar != null && statusBar.isKeyguardShowing()) { return; } // Preload only the raw task list into a new load plan (which will be consumed by the // RecentsActivity) only if there is a task to animate to. Post this to ensure that we // don't block the touch feedback on the nav bar button which triggers this. Loading Loading @@ -942,9 +953,27 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } /** * Shows the recents activity * Shows the recents activity after dismissing the keyguard if visible */ protected void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask, protected void startRecentsActivityAndDismissKeyguardIfNeeded( final ActivityManager.RunningTaskInfo runningTask, final boolean isHomeStackVisible, final boolean animate, final int growTarget) { // Preload only if device for current user is unlocked final StatusBar statusBar = getStatusBar(); if (statusBar != null && statusBar.isKeyguardShowing()) { statusBar.executeRunnableDismissingKeyguard(() -> { // Flush trustmanager before checking device locked per user when preloading mTrustManager.reportKeyguardShowingChanged(); mHandler.post(() -> startRecentsActivity(runningTask, isHomeStackVisible, animate, growTarget)); }, null, true /* dismissShade */, false /* afterKeyguardGone */, true /* deferred */); } else { startRecentsActivity(runningTask, isHomeStackVisible, animate, growTarget); } } private void startRecentsActivity(ActivityManager.RunningTaskInfo runningTask, boolean isHomeStackVisible, boolean animate, int growTarget) { RecentsTaskLoader loader = Recents.getTaskLoader(); RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState(); Loading Loading @@ -1033,6 +1062,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener return result; } private StatusBar getStatusBar() { return ((SystemUIApplication) mContext).getComponent(StatusBar.class); } /** * Starts the recents activity. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +3 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.phone; import android.app.ActivityManager; import android.content.Context; import android.os.Handler; import android.os.UserHandle; Loading Loading @@ -122,6 +121,8 @@ public class KeyguardBouncer { // Split up the work over multiple frames. DejankUtils.postAfterTraversal(mShowRunnable); mCallback.onBouncerVisiblityChanged(true /* shown */); } private final Runnable mShowRunnable = new Runnable() { Loading Loading @@ -182,6 +183,7 @@ public class KeyguardBouncer { mDismissCallbackRegistry.notifyDismissCancelled(); } mFalsingManager.onBouncerHidden(); mCallback.onBouncerVisiblityChanged(false /* shown */); cancelShowRunnable(); if (mKeyguardView != null) { mKeyguardView.cancelDismissAction(); Loading