From b27d7a5e2e2ca6a5dcae6dba581078bfeb74d4aa Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 16 Jun 2016 13:04:47 -0700 Subject: [PATCH] Remove RemoteInput on lockscreen setting Bug: 29370898 Change-Id: I8686c2266f13e7e131c2330673ec98c26037edaa --- .../systemui/statusbar/BaseStatusBar.java | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 91889d3b91adc..542b258590365 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -134,6 +134,7 @@ public abstract class BaseStatusBar extends SystemUI implements = SystemProperties.getBoolean("debug.child_notifs", true); public static final boolean FORCE_REMOTE_INPUT_HISTORY = SystemProperties.getBoolean("debug.force_remoteinput_history", false); + private static boolean ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT = false; protected static final int MSG_SHOW_RECENT_APPS = 1019; protected static final int MSG_HIDE_RECENT_APPS = 1020; @@ -704,10 +705,13 @@ 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); + if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) { + 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), @@ -2304,16 +2308,20 @@ public abstract class BaseStatusBar extends SystemUI implements 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; - final boolean remoteInputDpm = (dpmFlags - & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0; - - setShowLockscreenNotifications(show && allowedByDpm); - setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm); + + if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) { + final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT, + 0, + mCurrentUserId) != 0; + final boolean remoteInputDpm = + (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0; + + setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm); + } else { + setLockScreenAllowRemoteInput(false); + } } protected abstract void setAreThereNotifications();