OSDN Git Service

Use primary user's LOCK_SCREEN_SHOW_NOTIFICATIONS.
[android-x86/packages-apps-Settings.git] / src / com / android / settings / notification / VisibilityPreferenceController.java
index dac90ef..8dc802c 100644 (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() {