Loading media/java/android/media/MediaFocusControl.java +8 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.os.IBinder.DeathRecipient; Loading Loading @@ -750,7 +751,13 @@ public class MediaFocusControl implements OnFinished { synchronized(mRCStack) { if ((mMediaReceiverForCalls != null) && (mIsRinging || (mAudioService.getMode() == AudioSystem.MODE_IN_CALL))) { if (Binder.getCallingUid() != Process.SYSTEM_UID) { // Prevent dispatching key event to the global priority session. Slog.i(TAG, "Only the system can dispatch media key event " + "to the global priority session."); } else { dispatchMediaKeyEventForCalls(keyEvent, needWakeLock); } return; } } Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -4044,6 +4044,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_RECORD: case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK: { ITelephony telephonyService = getTelephonyService(); if (telephonyService != null) { try { if (!telephonyService.isIdle()) { // When phone is ringing or in-call, pass all media keys to it. result &= ~ACTION_PASS_TO_USER; } } catch (RemoteException ex) { Log.w(TAG, "ITelephony threw RemoteException", ex); } } if ((result & ACTION_PASS_TO_USER) == 0) { // Only do this if we would otherwise not pass it to the user. In that // case, the PhoneWindow class will do the same thing, except it will Loading Loading
media/java/android/media/MediaFocusControl.java +8 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.os.IBinder.DeathRecipient; Loading Loading @@ -750,7 +751,13 @@ public class MediaFocusControl implements OnFinished { synchronized(mRCStack) { if ((mMediaReceiverForCalls != null) && (mIsRinging || (mAudioService.getMode() == AudioSystem.MODE_IN_CALL))) { if (Binder.getCallingUid() != Process.SYSTEM_UID) { // Prevent dispatching key event to the global priority session. Slog.i(TAG, "Only the system can dispatch media key event " + "to the global priority session."); } else { dispatchMediaKeyEventForCalls(keyEvent, needWakeLock); } return; } } Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -4044,6 +4044,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_RECORD: case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK: { ITelephony telephonyService = getTelephonyService(); if (telephonyService != null) { try { if (!telephonyService.isIdle()) { // When phone is ringing or in-call, pass all media keys to it. result &= ~ACTION_PASS_TO_USER; } } catch (RemoteException ex) { Log.w(TAG, "ITelephony threw RemoteException", ex); } } if ((result & ACTION_PASS_TO_USER) == 0) { // Only do this if we would otherwise not pass it to the user. In that // case, the PhoneWindow class will do the same thing, except it will Loading