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

Commit 73d6ad09 authored by mrulhania's avatar mrulhania
Browse files

Skip appops pulled atom when SQLite is enabled

Appop access events are now reported via a
pushed atom.

Bug: 377584611
Test: presubmit
Flag: android.permission.flags.enable_all_sqlite_appops_accesses
Change-Id: I52ce0da464ad230383489380211d59981b080c90
parent e74e0c1c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import static android.os.Process.SYSTEM_UID;
import static android.os.Process.getUidForPid;
import static android.os.storage.VolumeInfo.TYPE_PRIVATE;
import static android.os.storage.VolumeInfo.TYPE_PUBLIC;
import static android.permission.flags.Flags.enableAllSqliteAppopsAccesses;
import static android.provider.Settings.Global.NETSTATS_UID_BUCKET_DURATION;
import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;
import static android.util.MathUtils.constrain;
@@ -1035,8 +1036,10 @@ public class StatsPullAtomService extends SystemService {
        registerExternalStorageInfo();
        registerAppsOnExternalStorageInfo();
        registerFaceSettings();
        if (!enableAllSqliteAppopsAccesses()) {
            registerAppOps();
            registerAttributedAppOps();
        }
        registerRuntimeAppOpAccessMessage();
        registerNotificationRemoteViews();
        registerDangerousPermissionState();
@@ -4051,6 +4054,9 @@ public class StatsPullAtomService extends SystemService {
    }

    int pullAppOpsLocked(int atomTag, List<StatsEvent> pulledData) {
        if (enableAllSqliteAppopsAccesses()) {
            return StatsManager.PULL_SKIP;
        }
        final long token = Binder.clearCallingIdentity();
        try {
            AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class);
@@ -4130,6 +4136,9 @@ public class StatsPullAtomService extends SystemService {
    }

    int pullAttributedAppOpsLocked(int atomTag, List<StatsEvent> pulledData) {
        if (enableAllSqliteAppopsAccesses()) {
            return StatsManager.PULL_SKIP;
        }
        final long token = Binder.clearCallingIdentity();
        try {
            AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class);