Silent notifs appear on lockscreen by default

Test: atest
Bug: 134613164
Change-Id: I1ee39a1302010a2a29ba6d0060f19565e41859a2
diff --git a/src/com/android/settings/notification/GentleDrawablePreferenceController.java b/src/com/android/settings/notification/GentleDrawablePreferenceController.java
index cdadf5a..b4e18db 100644
--- a/src/com/android/settings/notification/GentleDrawablePreferenceController.java
+++ b/src/com/android/settings/notification/GentleDrawablePreferenceController.java
@@ -72,7 +72,7 @@
 
     private boolean showOnLockscreen() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) == ON;
+                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, ON) == ON;
     }
 
     private boolean showOnStatusBar() {
diff --git a/src/com/android/settings/notification/GentleNotificationsPreferenceController.java b/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
index 97e4e25..ea16e72 100644
--- a/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
+++ b/src/com/android/settings/notification/GentleNotificationsPreferenceController.java
@@ -69,7 +69,7 @@
 
     private boolean showOnLockscreen() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) == ON;
+                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, ON) == ON;
     }
 
     private boolean showOnStatusBar() {
diff --git a/src/com/android/settings/notification/ImportancePreferenceController.java b/src/com/android/settings/notification/ImportancePreferenceController.java
index dc59275..4ef4593 100644
--- a/src/com/android/settings/notification/ImportancePreferenceController.java
+++ b/src/com/android/settings/notification/ImportancePreferenceController.java
@@ -66,7 +66,7 @@
             pref.setImportance(mChannel.getImportance());
             pref.setDisplayInStatusBar(mBackend.showSilentInStatusBar(mContext.getPackageName()));
             pref.setDisplayOnLockscreen(Settings.Secure.getInt(mContext.getContentResolver(),
-                    Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) == 1);
+                    Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1) == 1);
         }
     }
 
diff --git a/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java b/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
index 5d08ac7..df1f4a2 100644
--- a/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
+++ b/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
@@ -150,11 +150,11 @@
 
     private boolean getLockscreenNotificationsEnabled() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0) != 0;
+                Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1) != 0;
     }
 
     private boolean getLockscreenSilentNotificationsEnabled() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) != 0;
+                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1) != 0;
     }
 }
diff --git a/src/com/android/settings/notification/SilentLockscreenPreferenceController.java b/src/com/android/settings/notification/SilentLockscreenPreferenceController.java
index 219d312..317f7da 100644
--- a/src/com/android/settings/notification/SilentLockscreenPreferenceController.java
+++ b/src/com/android/settings/notification/SilentLockscreenPreferenceController.java
@@ -38,7 +38,7 @@
     @Override
     public boolean isChecked() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) == 1;
+                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1) == 1;
     }
 
     @Override
diff --git a/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
index 6907051..a341def 100644
--- a/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
@@ -133,6 +133,18 @@
     }
 
     @Test
+    public void updateState_allNotifsOnLockscreen_isDefault() {
+        // settings don't exist
+
+        mController.updateState(mPreference);
+
+        assertThat(mPreference.getValue()).isEqualTo(
+                String.valueOf(R.string.lock_screen_notifs_show_all));
+        assertThat(mPreference.getSummary())
+                .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_all));
+    }
+
+    @Test
     public void updateState_dpmSaysNo() {
         Settings.Secure.putInt(mContext.getContentResolver(),
                 LOCK_SCREEN_SHOW_NOTIFICATIONS,