Loading services/core/java/com/android/server/wm/WindowManagerService.java +9 −11 Original line number Original line Diff line number Diff line Loading @@ -2446,17 +2446,15 @@ public class WindowManagerService extends IWindowManager.Stub if (controls != null) { if (controls != null) { final int length = Math.min(controls.length, outControls.length); final int length = Math.min(controls.length, outControls.length); for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) { final InsetsSourceControl control = controls[i]; // We will leave the critical section before returning the leash to the client, // so we need to copy the leash to prevent others release the one that we are // Check if we are sending invalid leashes. // about to return. final SurfaceControl leash = control != null ? control.getLeash() : null; // TODO: We will have an extra copy if the client is not local. if (leash != null && !leash.isValid()) { // For now, we rely on GC to release it. Slog.wtf(TAG, leash + " is not valid before sending to " + win, // Maybe we can modify InsetsSourceControl.writeToParcel so it can release leash.getReleaseStack()); // the extra leash as soon as possible. } outControls[i] = controls[i] != null ? new InsetsSourceControl(controls[i]) : null; outControls[i] = win.isClientLocal() && control != null ? new InsetsSourceControl(control) : control; } } } } } } Loading Loading
services/core/java/com/android/server/wm/WindowManagerService.java +9 −11 Original line number Original line Diff line number Diff line Loading @@ -2446,17 +2446,15 @@ public class WindowManagerService extends IWindowManager.Stub if (controls != null) { if (controls != null) { final int length = Math.min(controls.length, outControls.length); final int length = Math.min(controls.length, outControls.length); for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) { final InsetsSourceControl control = controls[i]; // We will leave the critical section before returning the leash to the client, // so we need to copy the leash to prevent others release the one that we are // Check if we are sending invalid leashes. // about to return. final SurfaceControl leash = control != null ? control.getLeash() : null; // TODO: We will have an extra copy if the client is not local. if (leash != null && !leash.isValid()) { // For now, we rely on GC to release it. Slog.wtf(TAG, leash + " is not valid before sending to " + win, // Maybe we can modify InsetsSourceControl.writeToParcel so it can release leash.getReleaseStack()); // the extra leash as soon as possible. } outControls[i] = controls[i] != null ? new InsetsSourceControl(controls[i]) : null; outControls[i] = win.isClientLocal() && control != null ? new InsetsSourceControl(control) : control; } } } } } } Loading