Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ba25495 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Check caller for sending media key to global priority session" into nyc-dev

parents 32bd448c 09c3df00
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ServiceManager;
@@ -763,6 +764,13 @@ public class MediaSessionService extends SystemService implements Monitor {
                            + "setup is in progress.");
                    return;
                }
                if (isGlobalPriorityActive() && uid != Process.SYSTEM_UID) {
                    // Prevent dispatching key event through reflection while the global priority
                    // session is active.
                    Slog.i(TAG, "Only the system can dispatch media key event "
                            + "to the global priority session.");
                    return;
                }

                synchronized (mLock) {
                    // If we don't have a media button receiver to fall back on