Use channel warning development setting.
Defaults to enabled for debuggable builds. Bug: 37945054 Bug: 38380608 Test: manual Change-Id: I1b67f55d507e31349908953abbf04ac764835915
This commit is contained in:
@@ -684,6 +684,12 @@
|
||||
<string name="show_all_anrs_summary">Show App Not Responding dialog
|
||||
for background apps</string>
|
||||
|
||||
<!-- UI debug setting: show all ANRs? [CHAR LIMIT=25] -->
|
||||
<string name="show_notification_channel_warnings">Show notification channel warnings</string>
|
||||
<!-- UI debug setting: show all ANRs summary [CHAR LIMIT=50] -->
|
||||
<string name="show_notification_channel_warnings_summary">Displays on-screen warning when an app posts a notification without a valid channel</string>
|
||||
|
||||
|
||||
<!-- UI debug setting: force allow apps on external storage [CHAR LIMIT=50] -->
|
||||
<string name="force_allow_on_external">Force allow apps on external</string>
|
||||
<!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
|
||||
|
||||
@@ -3282,9 +3282,10 @@ public class NotificationManagerService extends SystemService {
|
||||
}
|
||||
|
||||
private void doChannelWarningToast(CharSequence toastText) {
|
||||
final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0;
|
||||
final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(),
|
||||
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, 0) != 0;
|
||||
if (warningEnabled || Build.IS_DEBUGGABLE) {
|
||||
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0;
|
||||
if (warningEnabled) {
|
||||
Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText,
|
||||
Toast.LENGTH_LONG);
|
||||
toast.show();
|
||||
|
||||
Reference in New Issue
Block a user