summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-05-13 23:06:35 +0200
committerJorim Jaggi <jjaggi@google.com>2014-05-14 14:32:50 +0200
commitdf993513fbfe0e952175c1c5384458deaa1ff01a (patch)
treebc8533aedce67b14f4ab83106d4e5a79c93dce23 /packages/SystemUI/src
parent5fd4d05aae4b8b0dc1d1b21a206e218f47b0ea3a (diff)
downloadframeworks_base-df993513fbfe0e952175c1c5384458deaa1ff01a.zip
frameworks_base-df993513fbfe0e952175c1c5384458deaa1ff01a.tar.gz
frameworks_base-df993513fbfe0e952175c1c5384458deaa1ff01a.tar.bz2
Handle media key events correctly on Keyguard.
Bug: 14490267 Change-Id: Ib8f8ee3ee7f1fbec70f1dd8b6fb04cd7c242bdce
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java3
4 files changed, 20 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index 1ffb4ee..d8e1766 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.phone;
import android.content.Context;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -160,4 +161,9 @@ public class KeyguardBouncer {
return false;
}
}
+
+ public boolean interceptMediaKey(KeyEvent event) {
+ ensureView();
+ return mKeyguardView.interceptMediaKey(event);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 922ac05..23b0594 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -68,6 +68,7 @@ import android.util.EventLog;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@@ -2767,6 +2768,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
}
+ public boolean interceptMediaKey(KeyEvent event) {
+ return mState == StatusBarState.KEYGUARD
+ && mStatusBarKeyguardViewManager.interceptMediaKey(event);
+ }
+
public boolean onMenuPressed() {
return mState == StatusBarState.KEYGUARD && mStatusBarKeyguardViewManager.onMenuPressed();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index b624c96..2ae21ac 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Slog;
+import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -227,4 +228,8 @@ public class StatusBarKeyguardViewManager {
public boolean onMenuPressed() {
return mBouncer.onMenuPressed();
}
+
+ public boolean interceptMediaKey(KeyEvent event) {
+ return mBouncer.interceptMediaKey(event);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index e802d18..b51626d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -103,6 +103,9 @@ public class StatusBarWindowView extends FrameLayout {
return mService.onMenuPressed();
}
}
+ if (mService.interceptMediaKey(event)) {
+ return true;
+ }
return super.dispatchKeyEvent(event);
}