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

Commit fca79abe authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Only initialize Session's package name once." into sc-dev

parents f083dae5 634da079
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -640,9 +640,16 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
        }
    }

    void windowAddedLocked(String packageName) {
        mPackageName = packageName;
    void windowAddedLocked() {
        if (mPackageName == null) {
            final WindowProcessController wpc = mService.mAtmService.mProcessMap.getProcess(mPid);
            if (wpc != null) {
                mPackageName = wpc.mInfo.packageName;
                mRelayoutTag = "relayoutWindow: " + mPackageName;
            } else {
                Slog.e(TAG_WM, "Unknown process pid=" + mPid);
            }
        }
        if (mSurfaceSession == null) {
            if (DEBUG) {
                Slog.v(TAG_WM, "First window added to " + this + ", creating SurfaceSession");
+1 −1
Original line number Diff line number Diff line
@@ -1140,7 +1140,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

    void attach() {
        if (DEBUG) Slog.v(TAG, "Attaching " + this + " token=" + mToken);
        mSession.windowAddedLocked(mAttrs.packageName);
        mSession.windowAddedLocked();
    }

    /**