Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -4659,6 +4659,14 @@ public final class Settings { public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications"; /** * When set by a user, allows notification remote input atop a securely locked screen * without having to unlock * @hide */ public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = "lock_screen_allow_remote_input"; /** * Set by the system to track if the user needs to see the call to action for * the lockscreen notification policy. Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +34 −1 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected int mState; protected boolean mBouncerShowing; protected boolean mShowLockscreenNotifications; protected boolean mAllowLockscreenRemoteInput; protected NotificationOverflowContainer mKeyguardIconOverflowContainer; protected DismissView mDismissView; Loading Loading @@ -400,11 +401,26 @@ public abstract class BaseStatusBar extends SystemUI implements } p = p.getParent(); } ExpandableNotificationRow row = null; while (p != null) { if (p instanceof ExpandableNotificationRow) { row = (ExpandableNotificationRow) p; break; } p = p.getParent(); } if (riv == null) { if (riv == null || row == null) { return false; } row.setUserExpanded(true); if (isLockscreenPublicMode() && !mAllowLockscreenRemoteInput) { onLockedRemoteInput(row, view); return true; } riv.setVisibility(View.VISIBLE); int cx = view.getLeft() + view.getWidth() / 2; int cy = view.getTop() + view.getHeight() / 2; Loading Loading @@ -619,6 +635,10 @@ public abstract class BaseStatusBar extends SystemUI implements Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS), false, mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT), false, mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS), Loading Loading @@ -1300,6 +1320,8 @@ public abstract class BaseStatusBar extends SystemUI implements } } protected void onLockedRemoteInput(ExpandableNotificationRow row, View clickedView) {} @Override public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) { } Loading Loading @@ -1936,6 +1958,10 @@ public abstract class BaseStatusBar extends SystemUI implements mShowLockscreenNotifications = show; } protected void setLockScreenAllowRemoteInput(boolean allowLockscreenRemoteInput) { mAllowLockscreenRemoteInput = allowLockscreenRemoteInput; } private void updateLockscreenNotificationSetting() { final boolean show = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, Loading @@ -1945,7 +1971,14 @@ public abstract class BaseStatusBar extends SystemUI implements null /* admin */, mCurrentUserId); final boolean allowedByDpm = (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0; final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT, 0, mCurrentUserId) != 0; setShowLockscreenNotifications(show && allowedByDpm); setLockScreenAllowRemoteInput(remoteInput); } protected abstract void setAreThereNotifications(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +20 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ import android.view.ThreadedRenderer; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewStub; import android.view.WindowManager; import android.view.WindowManagerGlobal; Loading Loading @@ -342,6 +343,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private long mKeyguardFadingAwayDelay; private long mKeyguardFadingAwayDuration; // RemoteInputView to be activated after unlock private View mPendingRemoteInputView; int mMaxAllowedKeyguardNotifications; boolean mExpandedVisible; Loading Loading @@ -3567,6 +3571,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mDraggedDownRow.notifyHeightChanged(false /* needsAnimation */); mDraggedDownRow = null; } mPendingRemoteInputView = null; mAssistManager.onLockscreenShown(); } Loading Loading @@ -3683,6 +3688,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public boolean hideKeyguard() { boolean staying = mLeaveOpenOnKeyguardHide; setBarState(StatusBarState.SHADE); View viewToClick = null; if (mLeaveOpenOnKeyguardHide) { mLeaveOpenOnKeyguardHide = false; long delay = calculateGoingToFullShadeDelay(); Loading @@ -3691,6 +3697,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mDraggedDownRow.setUserLocked(false); mDraggedDownRow = null; } viewToClick = mPendingRemoteInputView; mPendingRemoteInputView = null; // Disable layout transitions in navbar for this transition because the load is just // too heavy for the CPU and GPU on any device. Loading @@ -3708,6 +3716,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } updateKeyguardState(staying, false /* fromShadeLocked */); if (viewToClick != null) { viewToClick.callOnClick(); } // Keyguard state has changed, but QS is not listening anymore. Make sure to update the tile // visibilities so next time we open the panel we know the correct height already. if (mQSPanel != null) { Loading Loading @@ -4071,6 +4083,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mLeaveOpenOnKeyguardHide = true; showBouncer(); mDraggedDownRow = row; mPendingRemoteInputView = null; } else { mNotificationPanel.animateToFullShade(0 /* delay */); setBarState(StatusBarState.SHADE_LOCKED); Loading @@ -4078,6 +4091,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } @Override protected void onLockedRemoteInput(ExpandableNotificationRow row, View clicked) { mLeaveOpenOnKeyguardHide = true; showBouncer(); mPendingRemoteInputView = clicked; } @Override public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) { mHeadsUpManager.setExpanded(clickedEntry, nowExpanded); Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -4659,6 +4659,14 @@ public final class Settings { public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications"; /** * When set by a user, allows notification remote input atop a securely locked screen * without having to unlock * @hide */ public static final String LOCK_SCREEN_ALLOW_REMOTE_INPUT = "lock_screen_allow_remote_input"; /** * Set by the system to track if the user needs to see the call to action for * the lockscreen notification policy. Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +34 −1 Original line number Diff line number Diff line Loading @@ -229,6 +229,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected int mState; protected boolean mBouncerShowing; protected boolean mShowLockscreenNotifications; protected boolean mAllowLockscreenRemoteInput; protected NotificationOverflowContainer mKeyguardIconOverflowContainer; protected DismissView mDismissView; Loading Loading @@ -400,11 +401,26 @@ public abstract class BaseStatusBar extends SystemUI implements } p = p.getParent(); } ExpandableNotificationRow row = null; while (p != null) { if (p instanceof ExpandableNotificationRow) { row = (ExpandableNotificationRow) p; break; } p = p.getParent(); } if (riv == null) { if (riv == null || row == null) { return false; } row.setUserExpanded(true); if (isLockscreenPublicMode() && !mAllowLockscreenRemoteInput) { onLockedRemoteInput(row, view); return true; } riv.setVisibility(View.VISIBLE); int cx = view.getLeft() + view.getWidth() / 2; int cy = view.getTop() + view.getHeight() / 2; Loading Loading @@ -619,6 +635,10 @@ public abstract class BaseStatusBar extends SystemUI implements Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS), false, mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT), false, mSettingsObserver, UserHandle.USER_ALL); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS), Loading Loading @@ -1300,6 +1320,8 @@ public abstract class BaseStatusBar extends SystemUI implements } } protected void onLockedRemoteInput(ExpandableNotificationRow row, View clickedView) {} @Override public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) { } Loading Loading @@ -1936,6 +1958,10 @@ public abstract class BaseStatusBar extends SystemUI implements mShowLockscreenNotifications = show; } protected void setLockScreenAllowRemoteInput(boolean allowLockscreenRemoteInput) { mAllowLockscreenRemoteInput = allowLockscreenRemoteInput; } private void updateLockscreenNotificationSetting() { final boolean show = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, Loading @@ -1945,7 +1971,14 @@ public abstract class BaseStatusBar extends SystemUI implements null /* admin */, mCurrentUserId); final boolean allowedByDpm = (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0; final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT, 0, mCurrentUserId) != 0; setShowLockscreenNotifications(show && allowedByDpm); setLockScreenAllowRemoteInput(remoteInput); } protected abstract void setAreThereNotifications(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +20 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ import android.view.ThreadedRenderer; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewStub; import android.view.WindowManager; import android.view.WindowManagerGlobal; Loading Loading @@ -342,6 +343,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private long mKeyguardFadingAwayDelay; private long mKeyguardFadingAwayDuration; // RemoteInputView to be activated after unlock private View mPendingRemoteInputView; int mMaxAllowedKeyguardNotifications; boolean mExpandedVisible; Loading Loading @@ -3567,6 +3571,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mDraggedDownRow.notifyHeightChanged(false /* needsAnimation */); mDraggedDownRow = null; } mPendingRemoteInputView = null; mAssistManager.onLockscreenShown(); } Loading Loading @@ -3683,6 +3688,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public boolean hideKeyguard() { boolean staying = mLeaveOpenOnKeyguardHide; setBarState(StatusBarState.SHADE); View viewToClick = null; if (mLeaveOpenOnKeyguardHide) { mLeaveOpenOnKeyguardHide = false; long delay = calculateGoingToFullShadeDelay(); Loading @@ -3691,6 +3697,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mDraggedDownRow.setUserLocked(false); mDraggedDownRow = null; } viewToClick = mPendingRemoteInputView; mPendingRemoteInputView = null; // Disable layout transitions in navbar for this transition because the load is just // too heavy for the CPU and GPU on any device. Loading @@ -3708,6 +3716,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } updateKeyguardState(staying, false /* fromShadeLocked */); if (viewToClick != null) { viewToClick.callOnClick(); } // Keyguard state has changed, but QS is not listening anymore. Make sure to update the tile // visibilities so next time we open the panel we know the correct height already. if (mQSPanel != null) { Loading Loading @@ -4071,6 +4083,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mLeaveOpenOnKeyguardHide = true; showBouncer(); mDraggedDownRow = row; mPendingRemoteInputView = null; } else { mNotificationPanel.animateToFullShade(0 /* delay */); setBarState(StatusBarState.SHADE_LOCKED); Loading @@ -4078,6 +4091,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } @Override protected void onLockedRemoteInput(ExpandableNotificationRow row, View clicked) { mLeaveOpenOnKeyguardHide = true; showBouncer(); mPendingRemoteInputView = clicked; } @Override public void onExpandClicked(Entry clickedEntry, boolean nowExpanded) { mHeadsUpManager.setExpanded(clickedEntry, nowExpanded); Loading