Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfe61f69 authored by Dan Sandler's avatar Dan Sandler
Browse files

Make some notifications public (safe for secure lockscreens):

 - USB connected
 - ADB enabled
 - Low storage
 - USB mass storage status
 - Tethering status

Change-Id: I8224d7bcc8141fc90ac5e28d4392c52724c524a7
parent 87b9ef52
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -311,6 +311,8 @@ public class StorageNotification extends SystemUI {
            }

            mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
            mUsbStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;

            final boolean adbOn = 1 == Settings.Global.getInt(
                mContext.getContentResolver(),
                Settings.Global.ADB_ENABLED,
@@ -401,6 +403,7 @@ public class StorageNotification extends SystemUI {

            mMediaStorageNotification.icon = icon;
            mMediaStorageNotification.setLatestEventInfo(mContext, title, message, pi);
            mMediaStorageNotification.visibility = Notification.VISIBILITY_PUBLIC;
        }

        final int notificationId = mMediaStorageNotification.icon;
+1 −0
Original line number Diff line number Diff line
@@ -470,6 +470,7 @@ public class Tethering extends BaseNetworkObserver {
        mTetheredNotification.defaults &= ~Notification.DEFAULT_SOUND;
        mTetheredNotification.flags = Notification.FLAG_ONGOING_EVENT;
        mTetheredNotification.tickerText = title;
        mTetheredNotification.visibility = Notification.VISIBILITY_PUBLIC;
        mTetheredNotification.setLatestEventInfo(mContext, title, message, pi);

        notificationManager.notifyAsUser(null, mTetheredNotification.icon,
+1 −0
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@ public class DeviceStorageMonitorService extends SystemService {
        notification.tickerText = title;
        notification.flags |= Notification.FLAG_NO_CLEAR;
        notification.setLatestEventInfo(context, title, details, intent);
        notification.visibility = Notification.VISIBILITY_PUBLIC;
        mNotificationMgr.notifyAsUser(null, LOW_MEMORY_NOTIFICATION_ID, notification,
                UserHandle.ALL);
        context.sendStickyBroadcastAsUser(mStorageLowIntent, UserHandle.ALL);
+2 −0
Original line number Diff line number Diff line
@@ -697,6 +697,7 @@ public class UsbDeviceManager {
                    PendingIntent pi = PendingIntent.getActivityAsUser(mContext, 0,
                            intent, 0, null, UserHandle.CURRENT);
                    notification.setLatestEventInfo(mContext, title, message, pi);
                    notification.visibility = Notification.VISIBILITY_PUBLIC;
                    mNotificationManager.notifyAsUser(null, id, notification,
                            UserHandle.ALL);
                    mUsbNotificationId = id;
@@ -732,6 +733,7 @@ public class UsbDeviceManager {
                    PendingIntent pi = PendingIntent.getActivityAsUser(mContext, 0,
                            intent, 0, null, UserHandle.CURRENT);
                    notification.setLatestEventInfo(mContext, title, message, pi);
                    notification.visibility = Notification.VISIBILITY_PUBLIC;
                    mAdbNotificationShown = true;
                    mNotificationManager.notifyAsUser(null, id, notification,
                            UserHandle.ALL);