Merge "Return the default touch mode for dead displays" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7b8a655a8b
@@ -3922,15 +3922,17 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the touch mode state for the display id passed as argument.
|
* Returns the touch mode state for the display id passed as argument.
|
||||||
|
*
|
||||||
|
* This method will return the default touch mode state (represented by
|
||||||
|
* {@code com.android.internal.R.bool.config_defaultInTouchMode}) if the display passed as
|
||||||
|
* argument is no longer registered in {@RootWindowContainer}).
|
||||||
*/
|
*/
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
public boolean isInTouchMode(int displayId) {
|
public boolean isInTouchMode(int displayId) {
|
||||||
synchronized (mGlobalLock) {
|
synchronized (mGlobalLock) {
|
||||||
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
|
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
|
||||||
if (displayContent == null) {
|
if (displayContent == null) {
|
||||||
throw new IllegalStateException("Failed to retrieve the touch mode state for"
|
return mContext.getResources().getBoolean(R.bool.config_defaultInTouchMode);
|
||||||
+ "display {" + displayId + "}: display is not registered in "
|
|
||||||
+ "WindowRootContainer");
|
|
||||||
}
|
}
|
||||||
return displayContent.isInTouchMode();
|
return displayContent.isInTouchMode();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user