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

Commit b19cc075 authored by eunjeongshin's avatar eunjeongshin
Browse files

Short term fix: Allow native processes for Logcat data access

We allow native processes as a short term solution.

Bug: 218293986
Test: CtsVerifier
Ignore-AOSP-First: pending fix for logcat privacy issue
Change-Id: Ib73305700349f98035a689ffcb4b1fa9e8728eb3
parent 128ef931
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public final class LogcatManagerService extends SystemService {
    private ActivityManagerInternal mActivityManagerInternal;
    private static final int MAX_UID_IMPORTANCE_COUNT_LISTENER = 2;
    private static int sUidImportanceListenerCount = 0;
    private static final int AID_SHELL_UID = 2000;
    private static final int AID_APP_UID = 10000;

    // TODO This allowlist is just a temporary workaround for the tests:
    //      FrameworksServicesTests
@@ -339,8 +339,10 @@ public final class LogcatManagerService extends SystemService {
                    return;
                }

                // If the access request is coming from adb shell, approve the logd access
                if (mUid == AID_SHELL_UID) {
                // If the access request is coming from native apps, approve the logd access
                // TODO: This is needed to make tooling to work. However,
                // we intend to be stricter with respect to native processes in a follow-up CL
                if (mUid < AID_APP_UID) {
                    try {
                        getLogdService().approve(mUid, mGid, mPid, mFd);
                    } catch (RemoteException e) {