Merge changes Ie674e8b2,I0b9448c8
* changes: AccessibilityNodeINfo cache not cleared when accessibility is disabled. Display magnifier does not release its surface on destroy.
This commit is contained in:
@@ -615,6 +615,7 @@ public abstract class AccessibilityService extends Service {
|
||||
mCallback.onServiceConnected();
|
||||
} else {
|
||||
AccessibilityInteractionClient.getInstance().removeConnection(connectionId);
|
||||
AccessibilityInteractionClient.getInstance().clearCache();
|
||||
mCallback.onSetConnectionId(AccessibilityInteractionClient.NO_ID);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -228,6 +228,10 @@ final class DisplayMagnifier {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void destroyLocked() {
|
||||
mMagnifedViewport.destroyWindow();
|
||||
}
|
||||
|
||||
/** NOTE: This has to be called within a surface transaction. */
|
||||
public void drawMagnifiedRegionBorderIfNeededLocked() {
|
||||
mMagnifedViewport.drawWindowIfNeededLocked();
|
||||
@@ -258,7 +262,7 @@ final class DisplayMagnifier {
|
||||
private final int mBorderWidth;
|
||||
private final int mHalfBorderWidth;
|
||||
|
||||
private ViewportWindow mWindow;
|
||||
private final ViewportWindow mWindow;
|
||||
|
||||
private boolean mFullRedrawNeeded;
|
||||
|
||||
@@ -459,6 +463,10 @@ final class DisplayMagnifier {
|
||||
mWindow.drawIfNeeded();
|
||||
}
|
||||
|
||||
public void destroyWindow() {
|
||||
mWindow.releaseSurface();
|
||||
}
|
||||
|
||||
private final class ViewportWindow {
|
||||
private static final String SURFACE_TITLE = "Magnification Overlay";
|
||||
|
||||
@@ -640,6 +648,10 @@ final class DisplayMagnifier {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void releaseSurface() {
|
||||
mSurface.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3039,7 +3039,10 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
mDisplayMagnifier = new DisplayMagnifier(this, callbacks);
|
||||
} else {
|
||||
if (callbacks == null) {
|
||||
mDisplayMagnifier = null;
|
||||
if (mDisplayMagnifier != null) {
|
||||
mDisplayMagnifier.destroyLocked();
|
||||
mDisplayMagnifier = null;
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException("Magnification callbacks already set!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user