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

Commit 5a07caa8 authored by Shai Barack's avatar Shai Barack
Browse files

Use UserHandle.isCore() instead of Process.myUid() <...

Use UserHandle.isCore() instead of Process.myUid() < Process.FIRST_APPLICATION_UID to determine if the process is a system process.

This is more robust and will work even if the process is running in a multi-user context.

Change-Id: Idf1d0db3236085702bafb6d48758dd209d06e4f5
Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
parent b142103e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.NonNull;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Process;
import android.os.UserHandle;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
import android.ravenwood.annotation.RavenwoodRedirect;
import android.ravenwood.annotation.RavenwoodRedirectionClass;
@@ -112,7 +113,7 @@ public final class MessageQueue {

    MessageQueue(boolean quitAllowed) {
        if (!sUseConcurrentInitialized) {
            sUseConcurrent = Process.myUid() < Process.FIRST_APPLICATION_UID;
            sUseConcurrent = UserHandle.isCore(Process.myUid());
            sUseConcurrentInitialized = true;
        }
        mQuitAllowed = quitAllowed;