diff options
author | RoboErik <epastern@google.com> | 2014-08-14 18:42:09 -0700 |
---|---|---|
committer | RoboErik <epastern@google.com> | 2014-08-14 18:42:54 -0700 |
commit | 78c64cdbd82a4d8feb7faf43109b86ab87252dd1 (patch) | |
tree | 501c72368cab17c769900fec88798f3aeb80e1c4 /cmds/media | |
parent | 1d2a1c917f46b6854e91f9867a20abb76ecb794d (diff) | |
download | frameworks_base-78c64cdbd82a4d8feb7faf43109b86ab87252dd1.zip frameworks_base-78c64cdbd82a4d8feb7faf43109b86ab87252dd1.tar.gz frameworks_base-78c64cdbd82a4d8feb7faf43109b86ab87252dd1.tar.bz2 |
Fix crash in legacy apps that register without a looper
Some legacy apps registered their media button receiver in a thread
without a looper. If this happens we need to use the main looper to
prevent a crash.
bug: 16306226
Change-Id: Idf472e649393e2a7ce2a3e1cbb3476003ab17f34
Diffstat (limited to 'cmds/media')
-rw-r--r-- | cmds/media/src/com/android/commands/media/Media.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmds/media/src/com/android/commands/media/Media.java b/cmds/media/src/com/android/commands/media/Media.java index b13b009..b37f896 100644 --- a/cmds/media/src/com/android/commands/media/Media.java +++ b/cmds/media/src/com/android/commands/media/Media.java @@ -225,7 +225,7 @@ public class Media extends BaseCommand { void printUsageMessage() { try { System.out.println("V2Monitoring session " + mController.getTag() - + "... available commands:"); + + "... available commands: play, pause, next, previous"); } catch (RemoteException e) { System.out.println("Error trying to monitor session!"); } @@ -257,6 +257,14 @@ public class Media extends BaseCommand { addNewline = false; } else if ("q".equals(line) || "quit".equals(line)) { break; + } else if ("play".equals(line)) { + mController.play(); + } else if ("pause".equals(line)) { + mController.pause(); + } else if ("next".equals(line)) { + mController.next(); + } else if ("previous".equals(line)) { + mController.previous(); } else { System.out.println("Invalid command: " + line); } |