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

Commit 08885a3c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Do not post notification when system boot is not ready." into main am:...

Merge "Do not post notification when system boot is not ready." into main am: 7f16bfb5 am: 6e0a096b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3464559



Change-Id: I3b286da4178de2bf91e5fb69f2b2ac667f0981fc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a2dff5f2 6e0a096b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -200,7 +200,11 @@ public class UsbPortManager implements IBinder.DeathRecipient {
        mHandler.sendEmptyMessage(MSG_SYSTEM_READY);
    }

    private void updateContaminantNotification() {
    private void updateContaminantNotificationLocked() {
        if (mNotificationManager == null) {
            return;
        }

        PortInfo currentPortInfo = null;
        Resources r = mContext.getResources();
        int contaminantStatus = UsbPortStatus.CONTAMINANT_DETECTION_NOT_DETECTED;
@@ -1171,7 +1175,7 @@ public class UsbPortManager implements IBinder.DeathRecipient {
    private void handlePortLocked(PortInfo portInfo, IndentingPrintWriter pw) {
        sendPortChangedBroadcastLocked(portInfo);
        logToStatsd(portInfo, pw);
        updateContaminantNotification();
        updateContaminantNotificationLocked();
    }

    private void handlePortAddedLocked(PortInfo portInfo, IndentingPrintWriter pw) {
@@ -1433,6 +1437,9 @@ public class UsbPortManager implements IBinder.DeathRecipient {
                case MSG_SYSTEM_READY: {
                    mNotificationManager = (NotificationManager)
                            mContext.getSystemService(Context.NOTIFICATION_SERVICE);
                    synchronized (mLock) {
                        updateContaminantNotificationLocked();
                    }
                    break;
                }
            }