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
This commit is contained in:
@@ -21,6 +21,7 @@ import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_INIT;
|
||||
import android.os.Build;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Pair;
|
||||
import android.view.SurfaceControl;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
@@ -75,6 +76,7 @@ public class ShellInit {
|
||||
@VisibleForTesting
|
||||
public void init() {
|
||||
ProtoLog.v(WM_SHELL_INIT, "Initializing Shell Components: %d", mInitCallbacks.size());
|
||||
SurfaceControl.setDebugUsageAfterRelease(true);
|
||||
// Init in order of registration
|
||||
for (int i = 0; i < mInitCallbacks.size(); i++) {
|
||||
final Pair<String, Runnable> info = mInitCallbacks.get(i);
|
||||
|
||||
@@ -1007,7 +1007,11 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
|
||||
|
||||
private void notifyNavigationBarSurface() {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user