Merge "Handle pointer location setting in InputSettingsObserver" into udc-qpr-dev am: 3830afc12d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23751947 Change-Id: I0e6c642522234767238d4853ea70c1bbae7ea89e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2804,6 +2804,11 @@ public class InputManagerService extends IInputManager.Stub
|
|||||||
*/
|
*/
|
||||||
void notifyConfigurationChanged();
|
void notifyConfigurationChanged();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This callback is invoked when the pointer location changes.
|
||||||
|
*/
|
||||||
|
void notifyPointerLocationChanged(boolean pointerLocationEnabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This callback is invoked when the camera lens cover switch changes state.
|
* This callback is invoked when the camera lens cover switch changes state.
|
||||||
* @param whenNanos the time when the change occurred
|
* @param whenNanos the time when the change occurred
|
||||||
@@ -3386,6 +3391,10 @@ public class InputManagerService extends IInputManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updatePointerLocationEnabled(boolean enabled) {
|
||||||
|
mWindowManagerCallbacks.notifyPointerLocationChanged(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void updateFocusEventDebugViewEnabled(boolean enabled) {
|
void updateFocusEventDebugViewEnabled(boolean enabled) {
|
||||||
FocusEventDebugView view;
|
FocusEventDebugView view;
|
||||||
synchronized (mFocusEventDebugViewLock) {
|
synchronized (mFocusEventDebugViewLock) {
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class InputSettingsObserver extends ContentObserver {
|
|||||||
(reason) -> updateTouchpadRightClickZoneEnabled()),
|
(reason) -> updateTouchpadRightClickZoneEnabled()),
|
||||||
Map.entry(Settings.System.getUriFor(Settings.System.SHOW_TOUCHES),
|
Map.entry(Settings.System.getUriFor(Settings.System.SHOW_TOUCHES),
|
||||||
(reason) -> updateShowTouches()),
|
(reason) -> updateShowTouches()),
|
||||||
|
Map.entry(Settings.System.getUriFor(Settings.System.POINTER_LOCATION),
|
||||||
|
(reason) -> updatePointerLocation()),
|
||||||
Map.entry(
|
Map.entry(
|
||||||
Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON),
|
Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON),
|
||||||
(reason) -> updateAccessibilityLargePointer()),
|
(reason) -> updateAccessibilityLargePointer()),
|
||||||
@@ -149,6 +151,11 @@ class InputSettingsObserver extends ContentObserver {
|
|||||||
mNative.setShowTouches(getBoolean(Settings.System.SHOW_TOUCHES, false));
|
mNative.setShowTouches(getBoolean(Settings.System.SHOW_TOUCHES, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updatePointerLocation() {
|
||||||
|
mService.updatePointerLocationEnabled(
|
||||||
|
getBoolean(Settings.System.POINTER_LOCATION, false));
|
||||||
|
}
|
||||||
|
|
||||||
private void updateShowKeyPresses() {
|
private void updateShowKeyPresses() {
|
||||||
mService.updateFocusEventDebugViewEnabled(
|
mService.updateFocusEventDebugViewEnabled(
|
||||||
getBoolean(Settings.System.SHOW_KEY_PRESSES, false));
|
getBoolean(Settings.System.SHOW_KEY_PRESSES, false));
|
||||||
|
|||||||
@@ -128,6 +128,21 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Notifies that the pointer location configuration has changed. */
|
||||||
|
@Override
|
||||||
|
public void notifyPointerLocationChanged(boolean pointerLocationEnabled) {
|
||||||
|
if (mService.mPointerLocationEnabled == pointerLocationEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (mService.mGlobalLock) {
|
||||||
|
mService.mPointerLocationEnabled = pointerLocationEnabled;
|
||||||
|
mService.mRoot.forAllDisplayPolicies(
|
||||||
|
p -> p.setPointerLocationEnabled(mService.mPointerLocationEnabled)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Notifies that the lid switch changed state. */
|
/** Notifies that the lid switch changed state. */
|
||||||
@Override
|
@Override
|
||||||
public void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) {
|
public void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) {
|
||||||
|
|||||||
@@ -763,8 +763,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
Settings.Secure.getUriFor(Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS);
|
Settings.Secure.getUriFor(Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS);
|
||||||
private final Uri mPolicyControlUri =
|
private final Uri mPolicyControlUri =
|
||||||
Settings.Global.getUriFor(Settings.Global.POLICY_CONTROL);
|
Settings.Global.getUriFor(Settings.Global.POLICY_CONTROL);
|
||||||
private final Uri mPointerLocationUri =
|
|
||||||
Settings.System.getUriFor(Settings.System.POINTER_LOCATION);
|
|
||||||
private final Uri mForceDesktopModeOnExternalDisplaysUri = Settings.Global.getUriFor(
|
private final Uri mForceDesktopModeOnExternalDisplaysUri = Settings.Global.getUriFor(
|
||||||
Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS);
|
Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS);
|
||||||
private final Uri mFreeformWindowUri = Settings.Global.getUriFor(
|
private final Uri mFreeformWindowUri = Settings.Global.getUriFor(
|
||||||
@@ -792,7 +790,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
resolver.registerContentObserver(mImmersiveModeConfirmationsUri, false, this,
|
resolver.registerContentObserver(mImmersiveModeConfirmationsUri, false, this,
|
||||||
UserHandle.USER_ALL);
|
UserHandle.USER_ALL);
|
||||||
resolver.registerContentObserver(mPolicyControlUri, false, this, UserHandle.USER_ALL);
|
resolver.registerContentObserver(mPolicyControlUri, false, this, UserHandle.USER_ALL);
|
||||||
resolver.registerContentObserver(mPointerLocationUri, false, this, UserHandle.USER_ALL);
|
|
||||||
resolver.registerContentObserver(mForceDesktopModeOnExternalDisplaysUri, false, this,
|
resolver.registerContentObserver(mForceDesktopModeOnExternalDisplaysUri, false, this,
|
||||||
UserHandle.USER_ALL);
|
UserHandle.USER_ALL);
|
||||||
resolver.registerContentObserver(mFreeformWindowUri, false, this, UserHandle.USER_ALL);
|
resolver.registerContentObserver(mFreeformWindowUri, false, this, UserHandle.USER_ALL);
|
||||||
@@ -816,11 +813,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mPointerLocationUri.equals(uri)) {
|
|
||||||
updatePointerLocation();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mForceDesktopModeOnExternalDisplaysUri.equals(uri)) {
|
if (mForceDesktopModeOnExternalDisplaysUri.equals(uri)) {
|
||||||
updateForceDesktopModeOnExternalDisplays();
|
updateForceDesktopModeOnExternalDisplays();
|
||||||
return;
|
return;
|
||||||
@@ -869,7 +861,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
|
|
||||||
void loadSettings() {
|
void loadSettings() {
|
||||||
updateSystemUiSettings(false /* handleChange */);
|
updateSystemUiSettings(false /* handleChange */);
|
||||||
updatePointerLocation();
|
|
||||||
updateMaximumObscuringOpacityForTouch();
|
updateMaximumObscuringOpacityForTouch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,21 +891,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void updatePointerLocation() {
|
|
||||||
ContentResolver resolver = mContext.getContentResolver();
|
|
||||||
final boolean enablePointerLocation = Settings.System.getIntForUser(resolver,
|
|
||||||
Settings.System.POINTER_LOCATION, 0, UserHandle.USER_CURRENT) != 0;
|
|
||||||
|
|
||||||
if (mPointerLocationEnabled == enablePointerLocation) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mPointerLocationEnabled = enablePointerLocation;
|
|
||||||
synchronized (mGlobalLock) {
|
|
||||||
mRoot.forAllDisplayPolicies(
|
|
||||||
p -> p.setPointerLocationEnabled(mPointerLocationEnabled));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateForceDesktopModeOnExternalDisplays() {
|
void updateForceDesktopModeOnExternalDisplays() {
|
||||||
ContentResolver resolver = mContext.getContentResolver();
|
ContentResolver resolver = mContext.getContentResolver();
|
||||||
final boolean enableForceDesktopMode = Settings.Global.getInt(resolver,
|
final boolean enableForceDesktopMode = Settings.Global.getInt(resolver,
|
||||||
|
|||||||
Reference in New Issue
Block a user