Merge "Use primary user's LOCK_SCREEN_SHOW_NOTIFICATIONS." into pi-dev

am: dc2db6c6c9

Change-Id: Id0362b8917255d81dfc83ecccc913aaa8c8349a2
This commit is contained in:
Pavel Grafov
2018-07-09 10:49:22 -07:00
committed by android-build-merger
2 changed files with 29 additions and 2 deletions

View File

@@ -147,8 +147,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() {