Merge "Developer setting to enable notification channel warnings" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
77bb0aaf96
@@ -423,6 +423,11 @@
|
|||||||
android:title="@string/show_all_anrs"
|
android:title="@string/show_all_anrs"
|
||||||
android:summary="@string/show_all_anrs_summary"/>
|
android:summary="@string/show_all_anrs_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="show_notification_channel_warnings"
|
||||||
|
android:title="@string/show_notification_channel_warnings"
|
||||||
|
android:summary="@string/show_notification_channel_warnings_summary"/>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="inactive_apps"
|
android:key="inactive_apps"
|
||||||
android:title="@string/inactive_apps_title"
|
android:title="@string/inactive_apps_title"
|
||||||
|
@@ -226,6 +226,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs";
|
private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs";
|
||||||
|
|
||||||
|
private static final String SHOW_NOTIFICATION_CHANNEL_WARNINGS_KEY = "show_notification_channel_warnings";
|
||||||
|
|
||||||
private static final String TERMINAL_APP_PACKAGE = "com.android.terminal";
|
private static final String TERMINAL_APP_PACKAGE = "com.android.terminal";
|
||||||
|
|
||||||
private static final String KEY_CONVERT_FBE = "convert_to_file_encryption";
|
private static final String KEY_CONVERT_FBE = "convert_to_file_encryption";
|
||||||
@@ -326,6 +328,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
private SwitchPreference mShowAllANRs;
|
private SwitchPreference mShowAllANRs;
|
||||||
|
|
||||||
|
private SwitchPreference mShowNotificationChannelWarnings;
|
||||||
|
|
||||||
private ColorModePreference mColorModePreference;
|
private ColorModePreference mColorModePreference;
|
||||||
|
|
||||||
private SwitchPreference mForceResizable;
|
private SwitchPreference mForceResizable;
|
||||||
@@ -523,6 +527,11 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mAllPrefs.add(mShowAllANRs);
|
mAllPrefs.add(mShowAllANRs);
|
||||||
mResetSwitchPrefs.add(mShowAllANRs);
|
mResetSwitchPrefs.add(mShowAllANRs);
|
||||||
|
|
||||||
|
mShowNotificationChannelWarnings = (SwitchPreference) findPreference(
|
||||||
|
SHOW_NOTIFICATION_CHANNEL_WARNINGS_KEY);
|
||||||
|
mAllPrefs.add(mShowNotificationChannelWarnings);
|
||||||
|
mResetSwitchPrefs.add(mShowNotificationChannelWarnings);
|
||||||
|
|
||||||
Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY);
|
Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY);
|
||||||
if (hdcpChecking != null) {
|
if (hdcpChecking != null) {
|
||||||
mAllPrefs.add(hdcpChecking);
|
mAllPrefs.add(hdcpChecking);
|
||||||
@@ -788,6 +797,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateImmediatelyDestroyActivitiesOptions();
|
updateImmediatelyDestroyActivitiesOptions();
|
||||||
updateAppProcessLimitOptions();
|
updateAppProcessLimitOptions();
|
||||||
updateShowAllANRsOptions();
|
updateShowAllANRsOptions();
|
||||||
|
updateShowNotificationChannelWarningsOptions();
|
||||||
mVerifyAppsOverUsbController.updatePreference();
|
mVerifyAppsOverUsbController.updatePreference();
|
||||||
updateOtaDisableAutomaticUpdateOptions();
|
updateOtaDisableAutomaticUpdateOptions();
|
||||||
updateBugreportOptions();
|
updateBugreportOptions();
|
||||||
@@ -2268,6 +2278,19 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0);
|
getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void writeShowNotificationChannelWarningsOptions() {
|
||||||
|
Settings.Global.putInt(getActivity().getContentResolver(),
|
||||||
|
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS,
|
||||||
|
mShowNotificationChannelWarnings.isChecked() ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateShowNotificationChannelWarningsOptions() {
|
||||||
|
final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0;
|
||||||
|
updateSwitchPreference(mShowNotificationChannelWarnings, Settings.Global.getInt(
|
||||||
|
getActivity().getContentResolver(),
|
||||||
|
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
private void confirmEnableOemUnlock() {
|
private void confirmEnableOemUnlock() {
|
||||||
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
|
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -2454,6 +2477,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
writeImmediatelyDestroyActivitiesOptions();
|
writeImmediatelyDestroyActivitiesOptions();
|
||||||
} else if (preference == mShowAllANRs) {
|
} else if (preference == mShowAllANRs) {
|
||||||
writeShowAllANRsOptions();
|
writeShowAllANRsOptions();
|
||||||
|
} else if (preference == mShowNotificationChannelWarnings) {
|
||||||
|
writeShowNotificationChannelWarningsOptions();
|
||||||
} else if (preference == mForceHardwareUi) {
|
} else if (preference == mForceHardwareUi) {
|
||||||
writeHardwareUiOptions();
|
writeHardwareUiOptions();
|
||||||
} else if (preference == mForceMsaa) {
|
} else if (preference == mForceMsaa) {
|
||||||
|
Reference in New Issue
Block a user