Loading services/core/java/com/android/server/media/MediaKeyDispatcher.java +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.PendingIntent; import android.content.Context; import android.media.session.ISessionManager; import android.media.session.MediaSession; import android.os.Binder; Loading Loading @@ -61,7 +60,7 @@ public abstract class MediaKeyDispatcher { private Map<Integer, Integer> mOverriddenKeyEvents; public MediaKeyDispatcher(Context context) { public MediaKeyDispatcher() { // Constructor used for reflection mOverriddenKeyEvents = new HashMap<>(); mOverriddenKeyEvents.put(KeyEvent.KEYCODE_MEDIA_PLAY, 0); Loading services/core/java/com/android/server/media/MediaSessionService.java +11 −13 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * System implementation of MediaSessionManager Loading Loading @@ -151,6 +152,7 @@ public class MediaSessionService extends SystemService implements Monitor { private SessionPolicyProvider mCustomSessionPolicyProvider; private MediaKeyDispatcher mCustomMediaKeyDispatcher; private Map<Integer, Integer> mOverriddenKeyEventsMap; public MediaSessionService(Context context) { super(context); Loading Loading @@ -769,6 +771,7 @@ public class MediaSessionService extends SystemService implements Monitor { private void instantiateCustomDispatcher(String nameFromTesting) { synchronized (mLock) { mCustomMediaKeyDispatcher = null; mOverriddenKeyEventsMap = null; String customDispatcherClassName = (nameFromTesting == null) ? mContext.getResources().getString(R.string.config_customMediaKeyDispatcher) Loading @@ -776,10 +779,9 @@ public class MediaSessionService extends SystemService implements Monitor { try { if (!TextUtils.isEmpty(customDispatcherClassName)) { Class customDispatcherClass = Class.forName(customDispatcherClassName); Constructor constructor = customDispatcherClass.getDeclaredConstructor(Context.class); mCustomMediaKeyDispatcher = (MediaKeyDispatcher) constructor.newInstance(mContext); Constructor constructor = customDispatcherClass.getDeclaredConstructor(); mCustomMediaKeyDispatcher = (MediaKeyDispatcher) constructor.newInstance(); mOverriddenKeyEventsMap = mCustomMediaKeyDispatcher.getOverriddenKeyEvents(); } } catch (ClassNotFoundException | InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { Loading @@ -799,10 +801,9 @@ public class MediaSessionService extends SystemService implements Monitor { try { if (!TextUtils.isEmpty(customProviderClassName)) { Class customProviderClass = Class.forName(customProviderClassName); Constructor constructor = customProviderClass.getDeclaredConstructor(Context.class); Constructor constructor = customProviderClass.getDeclaredConstructor(); mCustomSessionPolicyProvider = (SessionPolicyProvider) constructor.newInstance(mContext); (SessionPolicyProvider) constructor.newInstance(); } } catch (ClassNotFoundException | InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { Loading Loading @@ -2397,12 +2398,9 @@ public class MediaSessionService extends SystemService implements Monitor { return; } int overriddenKeyEvents = 0; if (mCustomMediaKeyDispatcher == null && mCustomMediaKeyDispatcher.getOverriddenKeyEvents() != null) { overriddenKeyEvents = mCustomMediaKeyDispatcher.getOverriddenKeyEvents() int overriddenKeyEvents = (mCustomMediaKeyDispatcher == null) ? 0 : mCustomMediaKeyDispatcher.getOverriddenKeyEvents() .get(keyEvent.getKeyCode()); } cancelTrackingIfNeeded(packageName, pid, uid, asSystemService, keyEvent, needWakeLock, opPackageName, stream, musicOnly, overriddenKeyEvents); if (!needTracking(keyEvent, overriddenKeyEvents)) { Loading services/core/java/com/android/server/media/SessionPolicyProvider.java +1 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.media; import android.annotation.IntDef; import android.annotation.NonNull; import android.content.Context; import android.media.session.MediaSession; import java.lang.annotation.Retention; Loading Loading @@ -55,7 +54,7 @@ public abstract class SessionPolicyProvider { */ static final int SESSION_POLICY_IGNORE_BUTTON_SESSION = 1 << 1; public SessionPolicyProvider(Context context) { public SessionPolicyProvider() { // Constructor used for reflection } Loading Loading
services/core/java/com/android/server/media/MediaKeyDispatcher.java +1 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.PendingIntent; import android.content.Context; import android.media.session.ISessionManager; import android.media.session.MediaSession; import android.os.Binder; Loading Loading @@ -61,7 +60,7 @@ public abstract class MediaKeyDispatcher { private Map<Integer, Integer> mOverriddenKeyEvents; public MediaKeyDispatcher(Context context) { public MediaKeyDispatcher() { // Constructor used for reflection mOverriddenKeyEvents = new HashMap<>(); mOverriddenKeyEvents.put(KeyEvent.KEYCODE_MEDIA_PLAY, 0); Loading
services/core/java/com/android/server/media/MediaSessionService.java +11 −13 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * System implementation of MediaSessionManager Loading Loading @@ -151,6 +152,7 @@ public class MediaSessionService extends SystemService implements Monitor { private SessionPolicyProvider mCustomSessionPolicyProvider; private MediaKeyDispatcher mCustomMediaKeyDispatcher; private Map<Integer, Integer> mOverriddenKeyEventsMap; public MediaSessionService(Context context) { super(context); Loading Loading @@ -769,6 +771,7 @@ public class MediaSessionService extends SystemService implements Monitor { private void instantiateCustomDispatcher(String nameFromTesting) { synchronized (mLock) { mCustomMediaKeyDispatcher = null; mOverriddenKeyEventsMap = null; String customDispatcherClassName = (nameFromTesting == null) ? mContext.getResources().getString(R.string.config_customMediaKeyDispatcher) Loading @@ -776,10 +779,9 @@ public class MediaSessionService extends SystemService implements Monitor { try { if (!TextUtils.isEmpty(customDispatcherClassName)) { Class customDispatcherClass = Class.forName(customDispatcherClassName); Constructor constructor = customDispatcherClass.getDeclaredConstructor(Context.class); mCustomMediaKeyDispatcher = (MediaKeyDispatcher) constructor.newInstance(mContext); Constructor constructor = customDispatcherClass.getDeclaredConstructor(); mCustomMediaKeyDispatcher = (MediaKeyDispatcher) constructor.newInstance(); mOverriddenKeyEventsMap = mCustomMediaKeyDispatcher.getOverriddenKeyEvents(); } } catch (ClassNotFoundException | InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { Loading @@ -799,10 +801,9 @@ public class MediaSessionService extends SystemService implements Monitor { try { if (!TextUtils.isEmpty(customProviderClassName)) { Class customProviderClass = Class.forName(customProviderClassName); Constructor constructor = customProviderClass.getDeclaredConstructor(Context.class); Constructor constructor = customProviderClass.getDeclaredConstructor(); mCustomSessionPolicyProvider = (SessionPolicyProvider) constructor.newInstance(mContext); (SessionPolicyProvider) constructor.newInstance(); } } catch (ClassNotFoundException | InstantiationException | InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { Loading Loading @@ -2397,12 +2398,9 @@ public class MediaSessionService extends SystemService implements Monitor { return; } int overriddenKeyEvents = 0; if (mCustomMediaKeyDispatcher == null && mCustomMediaKeyDispatcher.getOverriddenKeyEvents() != null) { overriddenKeyEvents = mCustomMediaKeyDispatcher.getOverriddenKeyEvents() int overriddenKeyEvents = (mCustomMediaKeyDispatcher == null) ? 0 : mCustomMediaKeyDispatcher.getOverriddenKeyEvents() .get(keyEvent.getKeyCode()); } cancelTrackingIfNeeded(packageName, pid, uid, asSystemService, keyEvent, needWakeLock, opPackageName, stream, musicOnly, overriddenKeyEvents); if (!needTracking(keyEvent, overriddenKeyEvents)) { Loading
services/core/java/com/android/server/media/SessionPolicyProvider.java +1 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.media; import android.annotation.IntDef; import android.annotation.NonNull; import android.content.Context; import android.media.session.MediaSession; import java.lang.annotation.Retention; Loading Loading @@ -55,7 +54,7 @@ public abstract class SessionPolicyProvider { */ static final int SESSION_POLICY_IGNORE_BUTTON_SESSION = 1 << 1; public SessionPolicyProvider(Context context) { public SessionPolicyProvider() { // Constructor used for reflection } Loading