Loading core/java/android/view/ViewRootImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -9349,6 +9349,16 @@ public final class ViewRootImpl implements ViewParent, return mVibrator; } /** * Clears the system vibrator. * * <p>This method releases the reference to the system vibrator. It's crucial to call this * method when the vibrator is no longer needed to prevent any potential memory leaks. */ public void clearSystemVibrator() { mVibrator = null; } private @Nullable AutofillManager getAutofillManager() { if (mView instanceof ViewGroup) { ViewGroup decorView = (ViewGroup) mView; Loading core/java/android/window/flags/windowing_frontend.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -461,3 +461,14 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "clear_system_vibrator" namespace: "windowing_frontend" description: "Clears the system vibrator before attaching new window, to avoid leaks." bug: "393190314" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file core/java/com/android/internal/policy/PhoneWindow.java +3 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (viewRoot != null) { // Clear the old callbacks and attach to the new window. viewRoot.getOnBackInvokedDispatcher().clear(); if (Flags.clearSystemVibrator()) { viewRoot.clearSystemVibrator(); } onViewRootImplSet(viewRoot); } } Loading Loading
core/java/android/view/ViewRootImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -9349,6 +9349,16 @@ public final class ViewRootImpl implements ViewParent, return mVibrator; } /** * Clears the system vibrator. * * <p>This method releases the reference to the system vibrator. It's crucial to call this * method when the vibrator is no longer needed to prevent any potential memory leaks. */ public void clearSystemVibrator() { mVibrator = null; } private @Nullable AutofillManager getAutofillManager() { if (mView instanceof ViewGroup) { ViewGroup decorView = (ViewGroup) mView; Loading
core/java/android/window/flags/windowing_frontend.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -461,3 +461,14 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "clear_system_vibrator" namespace: "windowing_frontend" description: "Clears the system vibrator before attaching new window, to avoid leaks." bug: "393190314" is_fixed_read_only: true metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
core/java/com/android/internal/policy/PhoneWindow.java +3 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (viewRoot != null) { // Clear the old callbacks and attach to the new window. viewRoot.getOnBackInvokedDispatcher().clear(); if (Flags.clearSystemVibrator()) { viewRoot.clearSystemVibrator(); } onViewRootImplSet(viewRoot); } } Loading