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

Commit 2bb0736c authored by Winson Chung's avatar Winson Chung
Browse files

Enable usage-after-release tracking in the Shell

- Fix one case where we're passing an invalid surface
  from SysUI to Launcher

Bug: 266978825
Test: Presubmit
Change-Id: I6a680f216ec44b75894d6a1934700935d22973db
parent 5c6c5829
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_INIT;
import android.os.Build;
import android.os.Build;
import android.os.SystemClock;
import android.os.SystemClock;
import android.util.Pair;
import android.util.Pair;
import android.view.SurfaceControl;


import androidx.annotation.VisibleForTesting;
import androidx.annotation.VisibleForTesting;


@@ -75,6 +76,7 @@ public class ShellInit {
    @VisibleForTesting
    @VisibleForTesting
    public void init() {
    public void init() {
        ProtoLog.v(WM_SHELL_INIT, "Initializing Shell Components: %d", mInitCallbacks.size());
        ProtoLog.v(WM_SHELL_INIT, "Initializing Shell Components: %d", mInitCallbacks.size());
        SurfaceControl.setDebugUsageAfterRelease(true);
        // Init in order of registration
        // Init in order of registration
        for (int i = 0; i < mInitCallbacks.size(); i++) {
        for (int i = 0; i < mInitCallbacks.size(); i++) {
            final Pair<String, Runnable> info = mInitCallbacks.get(i);
            final Pair<String, Runnable> info = mInitCallbacks.get(i);
+5 −1
Original line number Original line Diff line number Diff line
@@ -1007,7 +1007,11 @@ public class NavigationBar extends ViewController<NavigationBarView> implements


    private void notifyNavigationBarSurface() {
    private void notifyNavigationBarSurface() {
        ViewRootImpl viewRoot = mView.getViewRootImpl();
        ViewRootImpl viewRoot = mView.getViewRootImpl();
        SurfaceControl surface = viewRoot != null ? viewRoot.getSurfaceControl() : null;
        SurfaceControl surface = viewRoot != null
                && viewRoot.getSurfaceControl() != null
                && viewRoot.getSurfaceControl().isValid()
                        ? viewRoot.getSurfaceControl()
                        : null;
        mOverviewProxyService.onNavigationBarSurfaceChanged(surface);
        mOverviewProxyService.onNavigationBarSurfaceChanged(surface);
    }
    }