Merge "Use primary user's LOCK_SCREEN_SHOW_NOTIFICATIONS."

This commit is contained in:
TreeHugger Robot
2018-07-03 20:54:29 +00:00
committed by Android (Google) Code Review
2 changed files with 29 additions and 2 deletions

View File

@@ -148,8 +148,10 @@ public class VisibilityPreferenceController extends NotificationPreferenceContro
}
private boolean getLockscreenNotificationsEnabled() {
return Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0) != 0;
final UserInfo parentUser = mUm.getProfileParent(UserHandle.myUserId());
final int primaryUserId = parentUser != null ? parentUser.id : UserHandle.myUserId();
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0, primaryUserId) != 0;
}
private boolean getLockscreenAllowPrivateNotifications() {