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();
|
mCallback.onServiceConnected();
|
||||||
} else {
|
} else {
|
||||||
AccessibilityInteractionClient.getInstance().removeConnection(connectionId);
|
AccessibilityInteractionClient.getInstance().removeConnection(connectionId);
|
||||||
|
AccessibilityInteractionClient.getInstance().clearCache();
|
||||||
mCallback.onSetConnectionId(AccessibilityInteractionClient.NO_ID);
|
mCallback.onSetConnectionId(AccessibilityInteractionClient.NO_ID);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -228,6 +228,10 @@ final class DisplayMagnifier {
|
|||||||
return spec;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroyLocked() {
|
||||||
|
mMagnifedViewport.destroyWindow();
|
||||||
|
}
|
||||||
|
|
||||||
/** NOTE: This has to be called within a surface transaction. */
|
/** NOTE: This has to be called within a surface transaction. */
|
||||||
public void drawMagnifiedRegionBorderIfNeededLocked() {
|
public void drawMagnifiedRegionBorderIfNeededLocked() {
|
||||||
mMagnifedViewport.drawWindowIfNeededLocked();
|
mMagnifedViewport.drawWindowIfNeededLocked();
|
||||||
@@ -258,7 +262,7 @@ final class DisplayMagnifier {
|
|||||||
private final int mBorderWidth;
|
private final int mBorderWidth;
|
||||||
private final int mHalfBorderWidth;
|
private final int mHalfBorderWidth;
|
||||||
|
|
||||||
private ViewportWindow mWindow;
|
private final ViewportWindow mWindow;
|
||||||
|
|
||||||
private boolean mFullRedrawNeeded;
|
private boolean mFullRedrawNeeded;
|
||||||
|
|
||||||
@@ -459,6 +463,10 @@ final class DisplayMagnifier {
|
|||||||
mWindow.drawIfNeeded();
|
mWindow.drawIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroyWindow() {
|
||||||
|
mWindow.releaseSurface();
|
||||||
|
}
|
||||||
|
|
||||||
private final class ViewportWindow {
|
private final class ViewportWindow {
|
||||||
private static final String SURFACE_TITLE = "Magnification Overlay";
|
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);
|
mDisplayMagnifier = new DisplayMagnifier(this, callbacks);
|
||||||
} else {
|
} else {
|
||||||
if (callbacks == null) {
|
if (callbacks == null) {
|
||||||
mDisplayMagnifier = null;
|
if (mDisplayMagnifier != null) {
|
||||||
|
mDisplayMagnifier.destroyLocked();
|
||||||
|
mDisplayMagnifier = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("Magnification callbacks already set!");
|
throw new IllegalStateException("Magnification callbacks already set!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user