Loading packages/SystemUI/shared/src/com/android/systemui/shared/rotation/FloatingRotationButton.java +22 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,28 @@ public class FloatingRotationButton implements RotationButton { return true; } @Override public void onDestroy() { setRotationButtonController(null); setOnClickListener(null); setOnHoverListener(null); setUpdatesCallback(null); if (mKeyButtonContainer.isAttachedToWindow()) { mWindowManager.removeViewImmediate(mKeyButtonContainer); } mKeyButtonView.animate().cancel(); mAnimatedDrawable.stop(); mKeyButtonView.setImageDrawable(null); // Calling AnimatedDrawable#stop() and ImageView.setImageDrawable(null) above will not let // RenderThread clear ref to view (via AnimatedVectorDrawable$VectorDrawableAnimatorRT) // quick enough for LeakCanary to ignore the leak. To mute LeakCanary, a workaround is to // clear the mKeyButtonView.mParent so that LeakCanary won't complain the leak on // mKeyButtonContainer. mKeyButtonContainer.removeView(mKeyButtonView); } @Override public boolean isVisible() { return mIsShowing; Loading packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButton.java +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public interface RotationButton { } default boolean show() { return false; } default boolean hide() { return false; } default void onDestroy() {} default boolean isVisible() { return false; } Loading packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java +1 −4 Original line number Diff line number Diff line Loading @@ -206,10 +206,7 @@ public class RotationButtonController { if (mRotationButton == null) { return; } mRotationButton.setRotationButtonController(null); mRotationButton.setOnClickListener(null); mRotationButton.setOnHoverListener(null); mRotationButton.setUpdatesCallback(null); mRotationButton.onDestroy(); mRotationButton = null; } Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/rotation/FloatingRotationButton.java +22 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,28 @@ public class FloatingRotationButton implements RotationButton { return true; } @Override public void onDestroy() { setRotationButtonController(null); setOnClickListener(null); setOnHoverListener(null); setUpdatesCallback(null); if (mKeyButtonContainer.isAttachedToWindow()) { mWindowManager.removeViewImmediate(mKeyButtonContainer); } mKeyButtonView.animate().cancel(); mAnimatedDrawable.stop(); mKeyButtonView.setImageDrawable(null); // Calling AnimatedDrawable#stop() and ImageView.setImageDrawable(null) above will not let // RenderThread clear ref to view (via AnimatedVectorDrawable$VectorDrawableAnimatorRT) // quick enough for LeakCanary to ignore the leak. To mute LeakCanary, a workaround is to // clear the mKeyButtonView.mParent so that LeakCanary won't complain the leak on // mKeyButtonContainer. mKeyButtonContainer.removeView(mKeyButtonView); } @Override public boolean isVisible() { return mIsShowing; Loading
packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButton.java +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ public interface RotationButton { } default boolean show() { return false; } default boolean hide() { return false; } default void onDestroy() {} default boolean isVisible() { return false; } Loading
packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java +1 −4 Original line number Diff line number Diff line Loading @@ -206,10 +206,7 @@ public class RotationButtonController { if (mRotationButton == null) { return; } mRotationButton.setRotationButtonController(null); mRotationButton.setOnClickListener(null); mRotationButton.setOnHoverListener(null); mRotationButton.setUpdatesCallback(null); mRotationButton.onDestroy(); mRotationButton = null; } Loading