diff options
author | Tim Kilbourn <tkilbourn@google.com> | 2014-05-29 16:08:10 -0700 |
---|---|---|
committer | Tim Kilbourn <tkilbourn@google.com> | 2014-05-30 09:58:13 -0700 |
commit | d7c0c2ee45dd5367ac7863517de2e385fbd424f3 (patch) | |
tree | 72903cfad31ec357253735b15f92fce2cd1d4063 /policy | |
parent | c05cb5ffb33ad59236cad29c920aea0a70c1178f (diff) | |
download | frameworks_base-d7c0c2ee45dd5367ac7863517de2e385fbd424f3.zip frameworks_base-d7c0c2ee45dd5367ac7863517de2e385fbd424f3.tar.gz frameworks_base-d7c0c2ee45dd5367ac7863517de2e385fbd424f3.tar.bz2 |
Add global key mappings to dump output.
Example:
mKeyMapping={
KEYCODE_FOO=com.example/com.example.KeyReceiver
}
Change-Id: I03ed8327cebf245ff1e3e5f2aaef3cdec1b94d98
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/GlobalKeyManager.java | 18 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/GlobalKeyManager.java b/policy/src/com/android/internal/policy/impl/GlobalKeyManager.java index 3cf7e82..8c8209f 100644 --- a/policy/src/com/android/internal/policy/impl/GlobalKeyManager.java +++ b/policy/src/com/android/internal/policy/impl/GlobalKeyManager.java @@ -30,6 +30,7 @@ import com.android.internal.util.XmlUtils; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; +import java.io.PrintWriter; /** * Stores a mapping of global keys. @@ -123,4 +124,21 @@ final class GlobalKeyManager { } } } + + public void dump(String prefix, PrintWriter pw) { + final int numKeys = mKeyMapping.size(); + if (numKeys == 0) { + pw.print(prefix); pw.println("mKeyMapping.size=0"); + return; + } + pw.print(prefix); pw.println("mKeyMapping={"); + for (int i = 0; i < numKeys; ++i) { + pw.print(" "); + pw.print(prefix); + pw.print(KeyEvent.keyCodeToString(mKeyMapping.keyAt(i))); + pw.print("="); + pw.println(mKeyMapping.valueAt(i).flattenToString()); + } + pw.print(prefix); pw.println("}"); + } } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 8e68dfc..1aca89a 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -5623,6 +5623,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pw.print(prefix); pw.print("mDemoHdmiRotation="); pw.print(mDemoHdmiRotation); pw.print(" mDemoHdmiRotationLock="); pw.println(mDemoHdmiRotationLock); pw.print(prefix); pw.print("mUndockedHdmiRotation="); pw.println(mUndockedHdmiRotation); + mGlobalKeyManager.dump(prefix, pw); mStatusBarController.dump(pw, prefix); mNavigationBarController.dump(pw, prefix); PolicyControl.dump(prefix, pw); |