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

Commit f79810b5 authored by jiayongqiang's avatar jiayongqiang
Browse files

Add package name to WorkSource for Wakelock acquired from WindowManage.



The PowerManager.SCREEN_BRIGHT_WAKE_LOCK wakelocks that acquired from WindowManager show
the package name when the approach of WakeLock.toString() is called. This is more useful to
check which app is holding a type of SCREEN_BRIGHT_WAKE_LOCK wakelock.

Bug: 274493538

Test: adb shell dumpsys power | grep -Ei "Wake Locks:" -A<n>

Change-Id: If4722c73136835771a1eb26a1b6f411b28550009
Signed-off-by: default avatarjiayongqiang <jiayongqiang@xiaomi.com>
parent cb23451c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1161,7 +1161,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    private void finishHoldScreenUpdate() {
        final boolean hold = mTmpHoldScreenWindow != null;
        if (hold && mTmpHoldScreenWindow != mHoldScreenWindow) {
            mHoldScreenWakeLock.setWorkSource(new WorkSource(mTmpHoldScreenWindow.mSession.mUid));
            mHoldScreenWakeLock.setWorkSource(new WorkSource(mTmpHoldScreenWindow.mSession.mUid,
                    mTmpHoldScreenWindow.mSession.mPackageName));
        }
        mHoldScreenWindow = mTmpHoldScreenWindow;
        mTmpHoldScreenWindow = null;
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
    private boolean mShowingAlertWindowNotificationAllowed;
    private boolean mClientDead = false;
    private float mLastReportedAnimatorScale;
    private String mPackageName;
    protected String mPackageName;
    private String mRelayoutTag;
    private final InsetsVisibilities mDummyRequestedVisibilities = new InsetsVisibilities();
    private final InsetsSourceControl[] mDummyControls =  new InsetsSourceControl[0];