Merge "Remove RemoteInput on lockscreen setting" into nyc-dev
This commit is contained in:
@@ -134,6 +134,7 @@ public abstract class BaseStatusBar extends SystemUI implements
|
|||||||
= SystemProperties.getBoolean("debug.child_notifs", true);
|
= SystemProperties.getBoolean("debug.child_notifs", true);
|
||||||
public static final boolean FORCE_REMOTE_INPUT_HISTORY =
|
public static final boolean FORCE_REMOTE_INPUT_HISTORY =
|
||||||
SystemProperties.getBoolean("debug.force_remoteinput_history", false);
|
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_SHOW_RECENT_APPS = 1019;
|
||||||
protected static final int MSG_HIDE_RECENT_APPS = 1020;
|
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,
|
Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS), false,
|
||||||
mSettingsObserver,
|
mSettingsObserver,
|
||||||
UserHandle.USER_ALL);
|
UserHandle.USER_ALL);
|
||||||
|
if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) {
|
||||||
mContext.getContentResolver().registerContentObserver(
|
mContext.getContentResolver().registerContentObserver(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT), false,
|
Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT),
|
||||||
|
false,
|
||||||
mSettingsObserver,
|
mSettingsObserver,
|
||||||
UserHandle.USER_ALL);
|
UserHandle.USER_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
mContext.getContentResolver().registerContentObserver(
|
mContext.getContentResolver().registerContentObserver(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS),
|
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
|
final boolean allowedByDpm = (dpmFlags
|
||||||
& DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0;
|
& DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0;
|
||||||
|
|
||||||
|
setShowLockscreenNotifications(show && allowedByDpm);
|
||||||
|
|
||||||
|
if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) {
|
||||||
final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT,
|
Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT,
|
||||||
0,
|
0,
|
||||||
mCurrentUserId) != 0;
|
mCurrentUserId) != 0;
|
||||||
final boolean remoteInputDpm = (dpmFlags
|
final boolean remoteInputDpm =
|
||||||
& DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0;
|
(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0;
|
||||||
|
|
||||||
|
|
||||||
setShowLockscreenNotifications(show && allowedByDpm);
|
|
||||||
setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm);
|
setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm);
|
||||||
|
} else {
|
||||||
|
setLockScreenAllowRemoteInput(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void setAreThereNotifications();
|
protected abstract void setAreThereNotifications();
|
||||||
|
|||||||
Reference in New Issue
Block a user