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

Commit 6624db48 authored by Wenhao Wang's avatar Wenhao Wang Committed by Android (Google) Code Review
Browse files

Merge "LogcatManagerService: Allow instrumentation tests"

parents 9395860f 6448d247
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -329,6 +329,20 @@ public final class LogcatManagerService extends SystemService {

            if (mStart) {

                ActivityManagerInternal ami = LocalServices.getService(
                        ActivityManagerInternal.class);
                boolean isCallerInstrumented = ami.isUidCurrentlyInstrumented(mUid);

                // The instrumented apks only run for testing, so we don't check user permission.
                if (isCallerInstrumented) {
                    try {
                        getLogdService().approve(mUid, mGid, mPid, mFd);
                    } catch (RemoteException e) {
                        e.printStackTrace();
                    }
                    return;
                }

                // TODO Temporarily approve all the requests to unblock testing failures.
                try {
                    getLogdService().approve(mUid, mGid, mPid, mFd);