Loading core/java/android/view/TextureView.java +2 −2 Original line number Diff line number Diff line Loading @@ -231,8 +231,8 @@ public class TextureView extends View { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mLayer != null && mAttachInfo != null && mAttachInfo.mHardwareRenderer != null) { boolean success = mAttachInfo.mHardwareRenderer.safelyRun(new Runnable() { if (mLayer != null) { boolean success = executeHardwareAction(new Runnable() { @Override public void run() { destroySurface(); Loading core/java/android/view/View.java +27 −0 Original line number Diff line number Diff line Loading @@ -12509,6 +12509,33 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * This method ensures the hardware renderer is in a valid state * before executing the specified action. * * This method will attempt to set a valid state even if the window * the renderer is attached to was destroyed. * * This method is not guaranteed to work. If the hardware renderer * does not exist or cannot be put in a valid state, this method * will not executed the specified action. * * The specified action is executed synchronously. * * @param action The action to execute after the renderer is in a valid state * * @return True if the specified Runnable was executed, false otherwise * * @hide */ public boolean executeHardwareAction(Runnable action) { //noinspection SimplifiableIfStatement if (mAttachInfo != null && mAttachInfo.mHardwareRenderer != null) { return mAttachInfo.mHardwareRenderer.safelyRun(action); } return false; } void invalidateInheritedLayoutMode(int layoutModeOfRoot) { } Loading Loading
core/java/android/view/TextureView.java +2 −2 Original line number Diff line number Diff line Loading @@ -231,8 +231,8 @@ public class TextureView extends View { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mLayer != null && mAttachInfo != null && mAttachInfo.mHardwareRenderer != null) { boolean success = mAttachInfo.mHardwareRenderer.safelyRun(new Runnable() { if (mLayer != null) { boolean success = executeHardwareAction(new Runnable() { @Override public void run() { destroySurface(); Loading
core/java/android/view/View.java +27 −0 Original line number Diff line number Diff line Loading @@ -12509,6 +12509,33 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * This method ensures the hardware renderer is in a valid state * before executing the specified action. * * This method will attempt to set a valid state even if the window * the renderer is attached to was destroyed. * * This method is not guaranteed to work. If the hardware renderer * does not exist or cannot be put in a valid state, this method * will not executed the specified action. * * The specified action is executed synchronously. * * @param action The action to execute after the renderer is in a valid state * * @return True if the specified Runnable was executed, false otherwise * * @hide */ public boolean executeHardwareAction(Runnable action) { //noinspection SimplifiableIfStatement if (mAttachInfo != null && mAttachInfo.mHardwareRenderer != null) { return mAttachInfo.mHardwareRenderer.safelyRun(action); } return false; } void invalidateInheritedLayoutMode(int layoutModeOfRoot) { } Loading