Loading core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java +31 −3 Original line number Diff line number Diff line Loading @@ -1737,6 +1737,20 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } catch (IllegalStateException e) { // This is possible in case the client disconnects from the output surface // abruptly. Log.w(TAG, "Output surface likely abandoned, dropping buffer!"); img.close(); } catch (RuntimeException e) { // NOTE: This is intended to catch RuntimeException from ImageReader.detachImage // ImageReader.detachImage is not supposed to throw RuntimeExceptions but the // bug went unchecked for a few years and now its behavior cannot be changed // without breaking backwards compatibility. if (!e.getClass().equals(RuntimeException.class)) { // re-throw any exceptions that aren't base RuntimeException since they are // coming from elsewhere, and we shouldn't silently drop those. throw e; } Log.w(TAG, "Output surface likely abandoned, dropping buffer!"); img.close(); } Loading Loading @@ -1773,9 +1787,23 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } try { reader.detachImage(img); } catch (Exception e) { Log.e(TAG, "Failed to detach image!"); } catch (IllegalStateException e) { Log.e(TAG, "Failed to detach image!"); img.close(); return; } catch (RuntimeException e) { // NOTE: This is intended to catch RuntimeException from ImageReader.detachImage // ImageReader.detachImage is not supposed to throw RuntimeExceptions but the // bug went unchecked for a few years and now its behavior cannot be changed // without breaking backwards compatibility. if (!e.getClass().equals(RuntimeException.class)) { // re-throw any exceptions that aren't base RuntimeException since they are // coming from elsewhere, and we shouldn't silently drop those. throw e; } Log.e(TAG, "Failed to detach image!"); img.close(); return; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/RootDisplayAreaOrganizer.java +2 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,8 @@ public class RootDisplayAreaOrganizer extends DisplayAreaOrganizer { } mDisplayAreasInfo.remove(displayId); mLeashes.get(displayId).release(); mLeashes.remove(displayId); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java +6 −1 Original line number Diff line number Diff line Loading @@ -529,7 +529,8 @@ public class ShellTaskOrganizer extends TaskOrganizer implements } final int taskId = taskInfo.taskId; final TaskListener listener = getTaskListener(mTasks.get(taskId).getTaskInfo()); final TaskAppearedInfo appearedInfo = mTasks.get(taskId); final TaskListener listener = getTaskListener(appearedInfo.getTaskInfo()); mTasks.remove(taskId); if (listener != null) { listener.onTaskVanished(taskInfo); Loading @@ -539,6 +540,10 @@ public class ShellTaskOrganizer extends TaskOrganizer implements notifyCompatUI(taskInfo, null /* taskListener */); // Notify the recent tasks that a task has been removed mRecentTasks.ifPresent(recentTasks -> recentTasks.onTaskRemoved(taskInfo)); if (appearedInfo.getLeash() != null) { appearedInfo.getLeash().release(); } } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +3 −1 Original line number Diff line number Diff line Loading @@ -403,7 +403,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont private boolean shouldDispatchToLauncher(int backType) { return backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && mBackToLauncherCallback != null && mEnableAnimations.get(); && mEnableAnimations.get() && mBackNavigationInfo != null && mBackNavigationInfo.getDepartingAnimationTarget() != null; } private static void dispatchOnBackStarted(IOnBackInvokedCallback callback) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java +3 −2 Original line number Diff line number Diff line Loading @@ -128,9 +128,10 @@ class HideDisplayCutoutOrganizer extends DisplayAreaOrganizer { final WindowContainerTransaction wct = new WindowContainerTransaction(); final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); applyBoundsAndOffsets( displayAreaInfo.token, mDisplayAreaMap.get(displayAreaInfo.token), wct, t); final SurfaceControl leash = mDisplayAreaMap.get(displayAreaInfo.token); applyBoundsAndOffsets(displayAreaInfo.token, leash, wct, t); applyTransaction(wct, t); leash.release(); mDisplayAreaMap.remove(displayAreaInfo.token); } } Loading Loading
core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java +31 −3 Original line number Diff line number Diff line Loading @@ -1737,6 +1737,20 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } catch (IllegalStateException e) { // This is possible in case the client disconnects from the output surface // abruptly. Log.w(TAG, "Output surface likely abandoned, dropping buffer!"); img.close(); } catch (RuntimeException e) { // NOTE: This is intended to catch RuntimeException from ImageReader.detachImage // ImageReader.detachImage is not supposed to throw RuntimeExceptions but the // bug went unchecked for a few years and now its behavior cannot be changed // without breaking backwards compatibility. if (!e.getClass().equals(RuntimeException.class)) { // re-throw any exceptions that aren't base RuntimeException since they are // coming from elsewhere, and we shouldn't silently drop those. throw e; } Log.w(TAG, "Output surface likely abandoned, dropping buffer!"); img.close(); } Loading Loading @@ -1773,9 +1787,23 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } try { reader.detachImage(img); } catch (Exception e) { Log.e(TAG, "Failed to detach image!"); } catch (IllegalStateException e) { Log.e(TAG, "Failed to detach image!"); img.close(); return; } catch (RuntimeException e) { // NOTE: This is intended to catch RuntimeException from ImageReader.detachImage // ImageReader.detachImage is not supposed to throw RuntimeExceptions but the // bug went unchecked for a few years and now its behavior cannot be changed // without breaking backwards compatibility. if (!e.getClass().equals(RuntimeException.class)) { // re-throw any exceptions that aren't base RuntimeException since they are // coming from elsewhere, and we shouldn't silently drop those. throw e; } Log.e(TAG, "Failed to detach image!"); img.close(); return; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/RootDisplayAreaOrganizer.java +2 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,8 @@ public class RootDisplayAreaOrganizer extends DisplayAreaOrganizer { } mDisplayAreasInfo.remove(displayId); mLeashes.get(displayId).release(); mLeashes.remove(displayId); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java +6 −1 Original line number Diff line number Diff line Loading @@ -529,7 +529,8 @@ public class ShellTaskOrganizer extends TaskOrganizer implements } final int taskId = taskInfo.taskId; final TaskListener listener = getTaskListener(mTasks.get(taskId).getTaskInfo()); final TaskAppearedInfo appearedInfo = mTasks.get(taskId); final TaskListener listener = getTaskListener(appearedInfo.getTaskInfo()); mTasks.remove(taskId); if (listener != null) { listener.onTaskVanished(taskInfo); Loading @@ -539,6 +540,10 @@ public class ShellTaskOrganizer extends TaskOrganizer implements notifyCompatUI(taskInfo, null /* taskListener */); // Notify the recent tasks that a task has been removed mRecentTasks.ifPresent(recentTasks -> recentTasks.onTaskRemoved(taskInfo)); if (appearedInfo.getLeash() != null) { appearedInfo.getLeash().release(); } } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +3 −1 Original line number Diff line number Diff line Loading @@ -403,7 +403,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont private boolean shouldDispatchToLauncher(int backType) { return backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && mBackToLauncherCallback != null && mEnableAnimations.get(); && mEnableAnimations.get() && mBackNavigationInfo != null && mBackNavigationInfo.getDepartingAnimationTarget() != null; } private static void dispatchOnBackStarted(IOnBackInvokedCallback callback) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizer.java +3 −2 Original line number Diff line number Diff line Loading @@ -128,9 +128,10 @@ class HideDisplayCutoutOrganizer extends DisplayAreaOrganizer { final WindowContainerTransaction wct = new WindowContainerTransaction(); final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); applyBoundsAndOffsets( displayAreaInfo.token, mDisplayAreaMap.get(displayAreaInfo.token), wct, t); final SurfaceControl leash = mDisplayAreaMap.get(displayAreaInfo.token); applyBoundsAndOffsets(displayAreaInfo.token, leash, wct, t); applyTransaction(wct, t); leash.release(); mDisplayAreaMap.remove(displayAreaInfo.token); } } Loading