Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -121,6 +122,7 @@ public class NotificationRemoteInputManager implements Dumpable { protected final Context mContext; private final UserManager mUserManager; private final KeyguardManager mKeyguardManager; private final StatusBarStateController mStatusBarStateController; protected RemoteInputController mRemoteInputController; protected NotificationLifetimeExtender.NotificationSafeToRemoveCallback Loading Loading @@ -259,6 +261,7 @@ public class NotificationRemoteInputManager implements Dumpable { SmartReplyController smartReplyController, NotificationEntryManager notificationEntryManager, Lazy<ShadeController> shadeController, StatusBarStateController statusBarStateController, @Named(MAIN_HANDLER_NAME) Handler mainHandler) { mContext = context; mLockscreenUserManager = lockscreenUserManager; Loading @@ -271,6 +274,7 @@ public class NotificationRemoteInputManager implements Dumpable { mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); addLifetimeExtenders(); mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override Loading Loading @@ -380,7 +384,10 @@ public class NotificationRemoteInputManager implements Dumpable { if (!mLockscreenUserManager.shouldAllowLockscreenRemoteInput()) { final int userId = pendingIntent.getCreatorUserHandle().getIdentifier(); if (mLockscreenUserManager.isLockscreenPublicMode(userId)) { if (mLockscreenUserManager.isLockscreenPublicMode(userId) || mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { // Even if we don't have security we should go through this flow, otherwise we won't // go to the shade mCallback.onLockedRemoteInput(row, view); return true; } Loading @@ -391,6 +398,11 @@ public class NotificationRemoteInputManager implements Dumpable { } } if (!riv.isAttachedToWindow()) { // the remoteInput isn't attached to the window anymore :/ Let's focus on the expanded // one instead if it's available riv = null; } if (riv == null) { riv = findRemoteInputView(row.getPrivateLayout().getExpandedChild()); if (riv == null) { Loading @@ -405,6 +417,10 @@ public class NotificationRemoteInputManager implements Dumpable { return true; } if (!riv.isAttachedToWindow()) { // if we still didn't find a view that is attached, let's abort. return false; } int width = view.getWidth(); if (view instanceof TextView) { // Center the reveal on the text which might be off-center from the TextView Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissHandler.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ public interface KeyguardDismissHandler { /** * Executes an action that requres the screen to be unlocked, showing the keyguard if * necessary. Does not close the notification shade (in case it was open). * @param requiresShadeOpen does the shade need to be forced open when hiding the keyguard? */ void executeWhenUnlocked(OnDismissAction action); void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen); } packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissUtil.java +5 −3 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { public KeyguardDismissUtil() { } /** Sets the actual {@link DismissHandler} implementation. */ /** Sets the actual {@link KeyguardDismissHandler} implementation. */ public void setDismissHandler(KeyguardDismissHandler dismissHandler) { mDismissHandler = dismissHandler; } Loading @@ -46,15 +46,17 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { * Executes an action that requires the screen to be unlocked. * * <p>Must be called after {@link #setDismissHandler}. * * @param requiresShadeOpen does the shade need to be forced open when hiding the keyguard? */ @Override public void executeWhenUnlocked(OnDismissAction action) { public void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen) { KeyguardDismissHandler dismissHandler = mDismissHandler; if (dismissHandler == null) { Log.wtf(TAG, "KeyguardDismissHandler not set."); action.onDismiss(); return; } dismissHandler.executeWhenUnlocked(action); dismissHandler.executeWhenUnlocked(action, requiresShadeOpen); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -2618,8 +2618,8 @@ public class StatusBar extends SystemUI implements DemoMode, } } private void executeWhenUnlocked(OnDismissAction action) { if (mStatusBarKeyguardViewManager.isShowing()) { private void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen) { if (mStatusBarKeyguardViewManager.isShowing() && requiresShadeOpen) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); } dismissKeyguardThenExecute(action, null /* cancelAction */, false /* afterKeyguardGone */); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +8 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.policy.KeyguardMonitor; import com.android.systemui.statusbar.policy.RemoteInputView; import javax.inject.Inject; import javax.inject.Singleton; Loading Loading @@ -93,9 +94,11 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, @Override public void onStateChanged(int state) { if (state == StatusBarState.SHADE && mStatusBarStateController.leaveOpenOnKeyguardHide()) { boolean hasPendingRemoteInput = mPendingRemoteInputView != null; if (state == StatusBarState.SHADE && (mStatusBarStateController.leaveOpenOnKeyguardHide() || hasPendingRemoteInput)) { if (!mStatusBarStateController.isKeyguardRequested()) { if (mPendingRemoteInputView != null) { if (hasPendingRemoteInput) { mMainHandler.post(mPendingRemoteInputView::callOnClick); } mPendingRemoteInputView = null; Loading @@ -105,7 +108,9 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, @Override public void onLockedRemoteInput(ExpandableNotificationRow row, View clicked) { if (!row.isPinned()) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); } mShadeController.showBouncer(true /* scrimmed */); mPendingRemoteInputView = clicked; } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.Dumpable; import com.android.systemui.R; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; Loading Loading @@ -121,6 +122,7 @@ public class NotificationRemoteInputManager implements Dumpable { protected final Context mContext; private final UserManager mUserManager; private final KeyguardManager mKeyguardManager; private final StatusBarStateController mStatusBarStateController; protected RemoteInputController mRemoteInputController; protected NotificationLifetimeExtender.NotificationSafeToRemoveCallback Loading Loading @@ -259,6 +261,7 @@ public class NotificationRemoteInputManager implements Dumpable { SmartReplyController smartReplyController, NotificationEntryManager notificationEntryManager, Lazy<ShadeController> shadeController, StatusBarStateController statusBarStateController, @Named(MAIN_HANDLER_NAME) Handler mainHandler) { mContext = context; mLockscreenUserManager = lockscreenUserManager; Loading @@ -271,6 +274,7 @@ public class NotificationRemoteInputManager implements Dumpable { mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); addLifetimeExtenders(); mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override Loading Loading @@ -380,7 +384,10 @@ public class NotificationRemoteInputManager implements Dumpable { if (!mLockscreenUserManager.shouldAllowLockscreenRemoteInput()) { final int userId = pendingIntent.getCreatorUserHandle().getIdentifier(); if (mLockscreenUserManager.isLockscreenPublicMode(userId)) { if (mLockscreenUserManager.isLockscreenPublicMode(userId) || mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { // Even if we don't have security we should go through this flow, otherwise we won't // go to the shade mCallback.onLockedRemoteInput(row, view); return true; } Loading @@ -391,6 +398,11 @@ public class NotificationRemoteInputManager implements Dumpable { } } if (!riv.isAttachedToWindow()) { // the remoteInput isn't attached to the window anymore :/ Let's focus on the expanded // one instead if it's available riv = null; } if (riv == null) { riv = findRemoteInputView(row.getPrivateLayout().getExpandedChild()); if (riv == null) { Loading @@ -405,6 +417,10 @@ public class NotificationRemoteInputManager implements Dumpable { return true; } if (!riv.isAttachedToWindow()) { // if we still didn't find a view that is attached, let's abort. return false; } int width = view.getWidth(); if (view instanceof TextView) { // Center the reveal on the text which might be off-center from the TextView Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissHandler.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ public interface KeyguardDismissHandler { /** * Executes an action that requres the screen to be unlocked, showing the keyguard if * necessary. Does not close the notification shade (in case it was open). * @param requiresShadeOpen does the shade need to be forced open when hiding the keyguard? */ void executeWhenUnlocked(OnDismissAction action); void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen); }
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardDismissUtil.java +5 −3 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { public KeyguardDismissUtil() { } /** Sets the actual {@link DismissHandler} implementation. */ /** Sets the actual {@link KeyguardDismissHandler} implementation. */ public void setDismissHandler(KeyguardDismissHandler dismissHandler) { mDismissHandler = dismissHandler; } Loading @@ -46,15 +46,17 @@ public class KeyguardDismissUtil implements KeyguardDismissHandler { * Executes an action that requires the screen to be unlocked. * * <p>Must be called after {@link #setDismissHandler}. * * @param requiresShadeOpen does the shade need to be forced open when hiding the keyguard? */ @Override public void executeWhenUnlocked(OnDismissAction action) { public void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen) { KeyguardDismissHandler dismissHandler = mDismissHandler; if (dismissHandler == null) { Log.wtf(TAG, "KeyguardDismissHandler not set."); action.onDismiss(); return; } dismissHandler.executeWhenUnlocked(action); dismissHandler.executeWhenUnlocked(action, requiresShadeOpen); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +2 −2 Original line number Diff line number Diff line Loading @@ -2618,8 +2618,8 @@ public class StatusBar extends SystemUI implements DemoMode, } } private void executeWhenUnlocked(OnDismissAction action) { if (mStatusBarKeyguardViewManager.isShowing()) { private void executeWhenUnlocked(OnDismissAction action, boolean requiresShadeOpen) { if (mStatusBarKeyguardViewManager.isShowing() && requiresShadeOpen) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); } dismissKeyguardThenExecute(action, null /* cancelAction */, false /* afterKeyguardGone */); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +8 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.policy.KeyguardMonitor; import com.android.systemui.statusbar.policy.RemoteInputView; import javax.inject.Inject; import javax.inject.Singleton; Loading Loading @@ -93,9 +94,11 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, @Override public void onStateChanged(int state) { if (state == StatusBarState.SHADE && mStatusBarStateController.leaveOpenOnKeyguardHide()) { boolean hasPendingRemoteInput = mPendingRemoteInputView != null; if (state == StatusBarState.SHADE && (mStatusBarStateController.leaveOpenOnKeyguardHide() || hasPendingRemoteInput)) { if (!mStatusBarStateController.isKeyguardRequested()) { if (mPendingRemoteInputView != null) { if (hasPendingRemoteInput) { mMainHandler.post(mPendingRemoteInputView::callOnClick); } mPendingRemoteInputView = null; Loading @@ -105,7 +108,9 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, @Override public void onLockedRemoteInput(ExpandableNotificationRow row, View clicked) { if (!row.isPinned()) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); } mShadeController.showBouncer(true /* scrimmed */); mPendingRemoteInputView = clicked; } Loading