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

Commit 35fc6af0 authored by Karishma Vakil's avatar Karishma Vakil Committed by Android (Google) Code Review
Browse files

Merge "[DeviceAware] Refactor AppOpsService aidl to use AttributionSourceState...

Merge "[DeviceAware] Refactor AppOpsService aidl to use AttributionSourceState instead of AttributionSource" into main
parents 6fb222fa 4ff9c010
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8632,7 +8632,7 @@ public class AppOpsManager {
                }
            }

            SyncNotedAppOp syncOp = mService.noteProxyOperation(op, attributionSource,
            SyncNotedAppOp syncOp = mService.noteProxyOperation(op, attributionSource.asState(),
                    collectionMode == COLLECT_ASYNC, message,
                    shouldCollectMessage, skipProxyOperation);

@@ -9105,7 +9105,7 @@ public class AppOpsManager {
            }

            SyncNotedAppOp syncOp = mService.startProxyOperation(clientId, op,
                    attributionSource, false, collectionMode == COLLECT_ASYNC, message,
                    attributionSource.asState(), false, collectionMode == COLLECT_ASYNC, message,
                    shouldCollectMessage, skipProxyOperation, proxyAttributionFlags,
                    proxiedAttributionFlags, attributionChainId);

@@ -9223,7 +9223,7 @@ public class AppOpsManager {
    public void finishProxyOp(@NonNull IBinder clientId, @NonNull String op,
            @NonNull AttributionSource attributionSource, boolean skipProxyOperation) {
        try {
            mService.finishProxyOperation(clientId, strOpToOp(op), attributionSource,
            mService.finishProxyOperation(clientId, strOpToOp(op), attributionSource.asState(),
                    skipProxyOperation);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
+5 −5
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.app.AppOpsManager;
import android.app.AsyncNotedAppOp;
import android.app.SyncNotedAppOp;
import android.app.RuntimeAppOpAccessMessage;
import android.content.AttributionSource;
import android.content.AttributionSourceState;
import android.content.pm.ParceledListSlice;
import android.os.Bundle;
import android.os.PackageTagsList;
@@ -57,16 +57,16 @@ interface IAppOpsService {
    // End of methods also called by native code.
    // Any new method exposed to native must be added after the last one, do not reorder

    SyncNotedAppOp noteProxyOperation(int code, in AttributionSource attributionSource,
    SyncNotedAppOp noteProxyOperation(int code, in AttributionSourceState attributionSourceState,
            boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
            boolean skipProxyOperation);
    SyncNotedAppOp startProxyOperation(IBinder clientId, int code,
            in AttributionSource attributionSource, boolean startIfModeDefault,
            in AttributionSourceState attributionSourceState, boolean startIfModeDefault,
            boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
            boolean skipProxyOperation, int proxyAttributionFlags, int proxiedAttributionFlags,
            int attributionChainId);
    void finishProxyOperation(IBinder clientId, int code, in AttributionSource attributionSource,
            boolean skipProxyOperation);
    void finishProxyOperation(IBinder clientId, int code,
            in AttributionSourceState attributionSourceState, boolean skipProxyOperation);

    // Remaining methods are only used in Java.
    int checkPackage(int uid, String packageName);
+9 −5
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ import android.app.RuntimeAppOpAccessMessage;
import android.app.SyncNotedAppOp;
import android.app.admin.DevicePolicyManagerInternal;
import android.content.AttributionSource;
import android.content.AttributionSourceState;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
@@ -2680,9 +2681,10 @@ public class AppOpsService extends IAppOpsService.Stub {
    }

    @Override
    public SyncNotedAppOp noteProxyOperation(int code, AttributionSource attributionSource,
            boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
            boolean skipProxyOperation) {
    public SyncNotedAppOp noteProxyOperation(int code,
            AttributionSourceState attributionSourceState, boolean shouldCollectAsyncNotedOp,
            String message, boolean shouldCollectMessage, boolean skipProxyOperation) {
        AttributionSource attributionSource = new AttributionSource(attributionSourceState);
        return mCheckOpsDelegateDispatcher.noteProxyOperation(code, attributionSource,
                shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation);
    }
@@ -3212,10 +3214,11 @@ public class AppOpsService extends IAppOpsService.Stub {

    @Override
    public SyncNotedAppOp startProxyOperation(@NonNull IBinder clientId, int code,
            @NonNull AttributionSource attributionSource, boolean startIfModeDefault,
            @NonNull AttributionSourceState attributionSourceState, boolean startIfModeDefault,
            boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
            boolean skipProxyOperation, @AttributionFlags int proxyAttributionFlags,
            @AttributionFlags int proxiedAttributionFlags, int attributionChainId) {
        AttributionSource attributionSource = new AttributionSource(attributionSourceState);
        return mCheckOpsDelegateDispatcher.startProxyOperation(clientId, code, attributionSource,
                startIfModeDefault, shouldCollectAsyncNotedOp, message, shouldCollectMessage,
                skipProxyOperation, proxyAttributionFlags, proxiedAttributionFlags,
@@ -3512,7 +3515,8 @@ public class AppOpsService extends IAppOpsService.Stub {

    @Override
    public void finishProxyOperation(@NonNull IBinder clientId, int code,
            @NonNull AttributionSource attributionSource, boolean skipProxyOperation) {
            @NonNull AttributionSourceState attributionSourceState, boolean skipProxyOperation) {
        AttributionSource attributionSource = new AttributionSource(attributionSourceState);
        mCheckOpsDelegateDispatcher.finishProxyOperation(clientId, code, attributionSource,
                skipProxyOperation);
    }