Merge "Post channel error toasts as android"
This commit is contained in:
committed by
Android (Google) Code Review
commit
cd317f422b
@@ -4282,14 +4282,16 @@ 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, defaultWarningEnabled) != 0;
|
||||
if (warningEnabled) {
|
||||
Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText,
|
||||
Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
Binder.withCleanCallingIdentity(() -> {
|
||||
final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0;
|
||||
final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(),
|
||||
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, defaultWarningEnabled) != 0;
|
||||
if (warningEnabled) {
|
||||
Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText,
|
||||
Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Reference in New Issue
Block a user