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

Commit 371a62d2 authored by Nate Myren's avatar Nate Myren
Browse files

Do not hard code USER_SYSTEM when reading adb allowlist

In practice, it always is, but in tests on HSUM, it causes security
exceptions

Fixes: 438853805
Flag: EXEMPT trivial change
Test: atest FrameworksAppFunctionsTests
Change-Id: Iaa7259175e6282a5fac76b9b189299c28ed1278e
parent 7045f33c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.appfunctions;
import static android.app.appfunctions.AppFunctionManager.ACCESS_REQUEST_STATE_UNREQUESTABLE;
import static android.app.appfunctions.AppFunctionRuntimeMetadata.APP_FUNCTION_RUNTIME_METADATA_DB;
import static android.app.appfunctions.AppFunctionRuntimeMetadata.APP_FUNCTION_RUNTIME_NAMESPACE;
import static android.os.UserHandle.USER_SYSTEM;

import static com.android.server.appfunctions.AppFunctionExecutors.THREAD_POOL_EXECUTOR;
import static com.android.server.appfunctions.CallerValidator.CAN_EXECUTE_APP_FUNCTIONS_ALLOWED_HAS_PERMISSION;
@@ -746,7 +745,8 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub {
    @NonNull
    private List<SignedPackage> readAdbAgentAllowlist() {
        String agents = Settings.Secure.getStringForUser(mContext.getContentResolver(),
                Settings.Secure.APP_FUNCTION_ADDITIONAL_AGENT_ALLOWLIST, USER_SYSTEM);
                Settings.Secure.APP_FUNCTION_ADDITIONAL_AGENT_ALLOWLIST,
                Process.myUserHandle().getIdentifier());
        if (agents == null) {
            return Collections.emptyList();
        }