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

Commit df3fd3c7 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Stop watching for system property changes when all view is removed." into main

parents 06b69be5 86fa49a4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ public final class WindowManagerGlobal {
    }

    void doRemoveView(ViewRootImpl root) {
        boolean allViewsRemoved;
        final boolean allViewsRemoved;
        synchronized (mLock) {
            final int index = mRoots.indexOf(root);
            if (index >= 0) {
@@ -608,6 +608,13 @@ public final class WindowManagerGlobal {
            }
            allViewsRemoved = mRoots.isEmpty();
            mWindowViewsListenerGroup.accept(getWindowViews());

            // If we don't have any views anymore in our process, stop watching
            // for system property changes.
            if (allViewsRemoved && mSystemPropertyUpdater != null) {
                SystemProperties.removeChangeCallback(mSystemPropertyUpdater);
                mSystemPropertyUpdater = null;
            }
        }

        // If we don't have any views anymore in our process, we no longer need the