Merge "PiP: Update accessibility window as menu shows/hides." into sc-dev
This commit is contained in:
@@ -133,6 +133,18 @@ public class SystemWindows {
|
|||||||
root.relayout((WindowManager.LayoutParams) params);
|
root.relayout((WindowManager.LayoutParams) params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the accessibility window for the given {@param shellRootLayer}.
|
||||||
|
*/
|
||||||
|
public void setShellRootAccessibilityWindow(int displayId,
|
||||||
|
@WindowManager.ShellRootLayer int shellRootLayer, View view) {
|
||||||
|
PerDisplay pd = mPerDisplay.get(displayId);
|
||||||
|
if (pd == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pd.setShellRootAccessibilityWindow(shellRootLayer, view);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the touchable region of a view's window. This will be cropped to the window size.
|
* Sets the touchable region of a view's window. This will be cropped to the window size.
|
||||||
* @param view
|
* @param view
|
||||||
@@ -202,15 +214,9 @@ public class SystemWindows {
|
|||||||
attrs.flags |= FLAG_HARDWARE_ACCELERATED;
|
attrs.flags |= FLAG_HARDWARE_ACCELERATED;
|
||||||
viewRoot.setView(view, attrs);
|
viewRoot.setView(view, attrs);
|
||||||
mViewRoots.put(view, viewRoot);
|
mViewRoots.put(view, viewRoot);
|
||||||
|
setShellRootAccessibilityWindow(shellRootLayer, view);
|
||||||
try {
|
|
||||||
mWmService.setShellRootAccessibilityWindow(mDisplayId, shellRootLayer,
|
|
||||||
viewRoot.getWindowToken());
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Slog.e(TAG, "Error setting accessibility window for " + mDisplayId + ":"
|
|
||||||
+ shellRootLayer, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SysUiWindowManager addRoot(@WindowManager.ShellRootLayer int shellRootLayer) {
|
SysUiWindowManager addRoot(@WindowManager.ShellRootLayer int shellRootLayer) {
|
||||||
SysUiWindowManager wwm = mWwms.get(shellRootLayer);
|
SysUiWindowManager wwm = mWwms.get(shellRootLayer);
|
||||||
if (wwm != null) {
|
if (wwm != null) {
|
||||||
@@ -240,6 +246,21 @@ public class SystemWindows {
|
|||||||
return wwm.mContainerWindow;
|
return wwm.mContainerWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setShellRootAccessibilityWindow(@WindowManager.ShellRootLayer int shellRootLayer,
|
||||||
|
View view) {
|
||||||
|
SysUiWindowManager wwm = mWwms.get(shellRootLayer);
|
||||||
|
if (wwm == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
mWmService.setShellRootAccessibilityWindow(mDisplayId, shellRootLayer,
|
||||||
|
view != null ? mViewRoots.get(view).getWindowToken() : null);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Slog.e(TAG, "Error setting accessibility window for " + mDisplayId + ":"
|
||||||
|
+ shellRootLayer, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateConfiguration(Configuration configuration) {
|
void updateConfiguration(Configuration configuration) {
|
||||||
for (int i = 0; i < mWwms.size(); ++i) {
|
for (int i = 0; i < mWwms.size(); ++i) {
|
||||||
mWwms.valueAt(i).updateConfiguration(configuration);
|
mWwms.valueAt(i).updateConfiguration(configuration);
|
||||||
|
|||||||
@@ -524,6 +524,15 @@ public class PhonePipMenuController implements PipMenuController {
|
|||||||
mListeners.forEach(l -> l.onPipMenuStateChangeFinish(menuState));
|
mListeners.forEach(l -> l.onPipMenuStateChangeFinish(menuState));
|
||||||
}
|
}
|
||||||
mMenuState = menuState;
|
mMenuState = menuState;
|
||||||
|
switch (mMenuState) {
|
||||||
|
case MENU_STATE_NONE:
|
||||||
|
mSystemWindows.setShellRootAccessibilityWindow(0, SHELL_ROOT_LAYER_PIP, null);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mSystemWindows.setShellRootAccessibilityWindow(0, SHELL_ROOT_LAYER_PIP,
|
||||||
|
mPipMenuView);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user