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

Commit 6d07baf4 authored by Andrew Zeng's avatar Andrew Zeng
Browse files

Add null check for wireless charging animation.

StatusBarManagerService is not started in SystemServer on
wearable devices.

Bug: 78357692
Change-Id: I0e30a4996addb599b8c90aa86b5ccb5ee7d80490
parent 3f888482
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package com.android.server.power;
package com.android.server.power;


import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.annotation.UserIdInt;
import android.app.ActivityManagerInternal;
import android.app.ActivityManagerInternal;
import android.app.AppOpsManager;
import android.app.AppOpsManager;
@@ -97,7 +98,7 @@ final class Notifier {
    private final ActivityManagerInternal mActivityManagerInternal;
    private final ActivityManagerInternal mActivityManagerInternal;
    private final InputManagerInternal mInputManagerInternal;
    private final InputManagerInternal mInputManagerInternal;
    private final InputMethodManagerInternal mInputMethodManagerInternal;
    private final InputMethodManagerInternal mInputMethodManagerInternal;
    private final StatusBarManagerInternal mStatusBarManagerInternal;
    @Nullable private final StatusBarManagerInternal mStatusBarManagerInternal;
    private final TrustManager mTrustManager;
    private final TrustManager mTrustManager;


    private final NotifierHandler mHandler;
    private final NotifierHandler mHandler;
@@ -738,7 +739,9 @@ final class Notifier {


    private void showWirelessChargingStarted(int batteryLevel) {
    private void showWirelessChargingStarted(int batteryLevel) {
        playChargingStartedSound();
        playChargingStartedSound();
        if (mStatusBarManagerInternal != null) {
            mStatusBarManagerInternal.showChargingAnimation(batteryLevel);
            mStatusBarManagerInternal.showChargingAnimation(batteryLevel);
        }
        mSuspendBlocker.release();
        mSuspendBlocker.release();
    }
    }