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

Commit 6e0a096b 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: 7f16bfb5

parents b310d164 7f16bfb5
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;
                }
            }