Add summary text to Lock screen preferences.
Each time we refresh the security preference page, get the current summary text from "On the lock screen" and populate to Lock screen preferences summary. Bug: 36540633 Test: make RunSettingsRoboTests Change-Id: I317e3892b35b30981b62f7b7aee9cfdacd04a3ed
This commit is contained in:
@@ -267,16 +267,20 @@ public class LockScreenNotificationPreferenceController extends PreferenceContro
|
||||
}
|
||||
}
|
||||
|
||||
public int getSummaryResource() {
|
||||
final boolean enabled = getLockscreenNotificationsEnabled(UserHandle.myUserId());
|
||||
final boolean allowPrivate = !mSecure
|
||||
|| getLockscreenAllowPrivateNotifications(UserHandle.myUserId());
|
||||
return !enabled ? R.string.lock_screen_notifications_summary_disable :
|
||||
allowPrivate ? R.string.lock_screen_notifications_summary_show :
|
||||
R.string.lock_screen_notifications_summary_hide;
|
||||
}
|
||||
|
||||
private void updateLockscreenNotifications() {
|
||||
if (mLockscreen == null) {
|
||||
return;
|
||||
}
|
||||
final boolean enabled = getLockscreenNotificationsEnabled(UserHandle.myUserId());
|
||||
final boolean allowPrivate = !mSecure
|
||||
|| getLockscreenAllowPrivateNotifications(UserHandle.myUserId());
|
||||
mLockscreenSelectedValue = !enabled ? R.string.lock_screen_notifications_summary_disable :
|
||||
allowPrivate ? R.string.lock_screen_notifications_summary_show :
|
||||
R.string.lock_screen_notifications_summary_hide;
|
||||
mLockscreenSelectedValue = getSummaryResource();
|
||||
mLockscreen.setValue(Integer.toString(mLockscreenSelectedValue));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user