Categorize some system notifications.
Change-Id: Ia343bc276f50f488e2165056cff249a02f01d45a
This commit is contained in:
@@ -172,6 +172,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
|
|||||||
.setContentTitle(r.getString(R.string.screenshot_saving_title))
|
.setContentTitle(r.getString(R.string.screenshot_saving_title))
|
||||||
.setContentText(r.getString(R.string.screenshot_saving_text))
|
.setContentText(r.getString(R.string.screenshot_saving_text))
|
||||||
.setSmallIcon(R.drawable.stat_notify_image)
|
.setSmallIcon(R.drawable.stat_notify_image)
|
||||||
|
.setCategory(Notification.CATEGORY_PROGRESS)
|
||||||
.setWhen(now);
|
.setWhen(now);
|
||||||
|
|
||||||
mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
|
mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
|
||||||
@@ -694,6 +695,7 @@ class GlobalScreenshot {
|
|||||||
.setSmallIcon(R.drawable.stat_notify_image_error)
|
.setSmallIcon(R.drawable.stat_notify_image_error)
|
||||||
.setWhen(System.currentTimeMillis())
|
.setWhen(System.currentTimeMillis())
|
||||||
.setVisibility(Notification.VISIBILITY_PUBLIC) // ok to show outside lockscreen
|
.setVisibility(Notification.VISIBILITY_PUBLIC) // ok to show outside lockscreen
|
||||||
|
.setCategory(Notification.CATEGORY_ERROR)
|
||||||
.setAutoCancel(true);
|
.setAutoCancel(true);
|
||||||
Notification n =
|
Notification n =
|
||||||
new Notification.BigTextStyle(b)
|
new Notification.BigTextStyle(b)
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ public class StorageNotification extends SystemUI {
|
|||||||
|
|
||||||
mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
|
mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
|
||||||
mUsbStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
mUsbStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
||||||
|
mUsbStorageNotification.category = Notification.CATEGORY_SYSTEM;
|
||||||
|
|
||||||
final boolean adbOn = 1 == Settings.Global.getInt(
|
final boolean adbOn = 1 == Settings.Global.getInt(
|
||||||
mContext.getContentResolver(),
|
mContext.getContentResolver(),
|
||||||
@@ -404,6 +405,7 @@ public class StorageNotification extends SystemUI {
|
|||||||
mMediaStorageNotification.icon = icon;
|
mMediaStorageNotification.icon = icon;
|
||||||
mMediaStorageNotification.setLatestEventInfo(mContext, title, message, pi);
|
mMediaStorageNotification.setLatestEventInfo(mContext, title, message, pi);
|
||||||
mMediaStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
mMediaStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
||||||
|
mMediaStorageNotification.category = Notification.CATEGORY_SYSTEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int notificationId = mMediaStorageNotification.icon;
|
final int notificationId = mMediaStorageNotification.icon;
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ public class Tethering extends BaseNetworkObserver {
|
|||||||
mTetheredNotification.tickerText = title;
|
mTetheredNotification.tickerText = title;
|
||||||
mTetheredNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
mTetheredNotification.visibility = Notification.VISIBILITY_PUBLIC;
|
||||||
mTetheredNotification.setLatestEventInfo(mContext, title, message, pi);
|
mTetheredNotification.setLatestEventInfo(mContext, title, message, pi);
|
||||||
|
mTetheredNotification.category = Notification.CATEGORY_STATUS;
|
||||||
|
|
||||||
notificationManager.notifyAsUser(null, mTetheredNotification.icon,
|
notificationManager.notifyAsUser(null, mTetheredNotification.icon,
|
||||||
mTetheredNotification, UserHandle.ALL);
|
mTetheredNotification, UserHandle.ALL);
|
||||||
|
|||||||
@@ -455,6 +455,7 @@ public class DeviceStorageMonitorService extends SystemService {
|
|||||||
notification.flags |= Notification.FLAG_NO_CLEAR;
|
notification.flags |= Notification.FLAG_NO_CLEAR;
|
||||||
notification.setLatestEventInfo(context, title, details, intent);
|
notification.setLatestEventInfo(context, title, details, intent);
|
||||||
notification.visibility = Notification.VISIBILITY_PUBLIC;
|
notification.visibility = Notification.VISIBILITY_PUBLIC;
|
||||||
|
notification.category = Notification.CATEGORY_SYSTEM;
|
||||||
mNotificationMgr.notifyAsUser(null, LOW_MEMORY_NOTIFICATION_ID, notification,
|
mNotificationMgr.notifyAsUser(null, LOW_MEMORY_NOTIFICATION_ID, notification,
|
||||||
UserHandle.ALL);
|
UserHandle.ALL);
|
||||||
context.sendStickyBroadcastAsUser(mStorageLowIntent, UserHandle.ALL);
|
context.sendStickyBroadcastAsUser(mStorageLowIntent, UserHandle.ALL);
|
||||||
|
|||||||
Reference in New Issue
Block a user