Merge "Silent notifs appear on lockscreen by default" into qt-dev
am: f58cd0fb51
Change-Id: I446708aba61c268375257280341a1ff5b33aa81d
This commit is contained in:
@@ -72,7 +72,7 @@ public class GentleDrawablePreferenceController extends BasePreferenceController
|
||||
|
||||
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() {
|
||||
|
@@ -69,7 +69,7 @@ public class GentleNotificationsPreferenceController extends BasePreferenceContr
|
||||
|
||||
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() {
|
||||
|
@@ -66,7 +66,7 @@ public class ImportancePreferenceController extends NotificationPreferenceContro
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,11 +150,11 @@ public class ShowOnLockScreenNotificationPreferenceController extends AbstractPr
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ public class SilentLockscreenPreferenceController extends TogglePreferenceContro
|
||||
@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
|
||||
|
@@ -132,6 +132,18 @@ public class ShowOnLockscreenNotificationPreferenceControllerTest {
|
||||
.isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_all));
|
||||
}
|
||||
|
||||
@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(),
|
||||
|
Reference in New Issue
Block a user