am eac9f30c: am 4940789b: am c403a340: Merge "Doze: Route volume keys to music only while pulsing." into lmp-dev
* commit 'eac9f30c94fbfd0ca2db51c1e8f73c3605153062': Doze: Route volume keys to music only while pulsing.
This commit is contained in:
@@ -2135,6 +2135,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
return onKeyguard && (isMethodInsecure || mDozing || mScreenOnComingFromTouch);
|
return onKeyguard && (isMethodInsecure || mDozing || mScreenOnComingFromTouch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDozing() {
|
||||||
|
return mDozing;
|
||||||
|
}
|
||||||
|
|
||||||
@Override // NotificationData.Environment
|
@Override // NotificationData.Environment
|
||||||
public String getCurrentMediaNotificationKey() {
|
public String getCurrentMediaNotificationKey() {
|
||||||
return mMediaNotificationKey;
|
return mMediaNotificationKey;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import android.graphics.Paint;
|
|||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.PorterDuffXfermode;
|
import android.graphics.PorterDuffXfermode;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
|
import android.media.session.MediaSessionLegacyHelper;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -133,11 +134,14 @@ public class StatusBarWindowView extends FrameLayout {
|
|||||||
if (!down) {
|
if (!down) {
|
||||||
return mService.onSpacePressed();
|
return mService.onSpacePressed();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
||||||
case KeyEvent.KEYCODE_VOLUME_UP:
|
case KeyEvent.KEYCODE_VOLUME_UP:
|
||||||
if (down) {
|
if (mService.isDozing()) {
|
||||||
mService.wakeUpIfDozing(event.getEventTime(), false);
|
MediaSessionLegacyHelper.getHelper(mContext).sendVolumeKeyEvent(event, true);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (mService.interceptMediaKey(event)) {
|
if (mService.interceptMediaKey(event)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user