summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-10-20 15:31:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-20 15:31:01 +0000
commit57a5cba606e5d58cc4ad1c5c1cf4918dc16fe819 (patch)
tree9b0a8e5225992b4272d3a572a1e1f3a8d74d808d /services
parentad968cf4e55afdd897ea84a44b7450442aea1e1d (diff)
parent9209c9cd9a6f779d0d9d86f9b2e368df564fa6bb (diff)
downloadframeworks_base-57a5cba606e5d58cc4ad1c5c1cf4918dc16fe819.zip
frameworks_base-57a5cba606e5d58cc4ad1c5c1cf4918dc16fe819.tar.gz
frameworks_base-57a5cba606e5d58cc4ad1c5c1cf4918dc16fe819.tar.bz2
Merge "Add SystemUI component to watch for keyboard attachment." into mnc-dr-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/input/InputManagerService.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 5a13672..0205a20 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -792,8 +792,17 @@ public class InputManagerService extends IInputManager.Stub
}
@Override // Binder call
+ public int isInTabletMode() {
+ if (!checkCallingPermission(android.Manifest.permission.TABLET_MODE,
+ "isInTabletMode()")) {
+ throw new SecurityException("Requires TABLET_MODE permission");
+ }
+ return getSwitchState(-1, InputDevice.SOURCE_ANY, SW_TABLET_MODE);
+ }
+
+ @Override // Binder call
public void registerTabletModeChangedListener(ITabletModeChangedListener listener) {
- if (!checkCallingPermission(android.Manifest.permission.TABLET_MODE_LISTENER,
+ if (!checkCallingPermission(android.Manifest.permission.TABLET_MODE,
"registerTabletModeChangedListener()")) {
throw new SecurityException("Requires TABLET_MODE_LISTENER permission");
}
@@ -1488,7 +1497,7 @@ public class InputManagerService extends IInputManager.Stub
switchMask);
}
- if ((switchMask & SW_TABLET_MODE) != 0) {
+ if ((switchMask & SW_TABLET_MODE_BIT) != 0) {
SomeArgs args = SomeArgs.obtain();
args.argi1 = (int) (whenNanos & 0xFFFFFFFF);
args.argi2 = (int) (whenNanos >> 32);