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

Commit 3a2a6e4f authored by Stanislav Zholnin's avatar Stanislav Zholnin
Browse files

Add AppOpEnum field to represent op_id in RuntimeAppOpAccess atom.

Deprecate string field for Appop id.

Test: ./out/host/linux-x86/bin/statsd_testdrive 10069
Bug: 143519689
Change-Id: I62b245e09a6c6f2dcf769b0e6942057eb94293fe
parent bd24ca3d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -8697,13 +8697,12 @@ message RuntimeAppOpAccess {
    // Name of the package accessing app op
    optional string package_name = 2;

    // operation string id per OPSTR_ constants in AppOpsManager.java
    optional string op = 3;
    // deprecated - set to empty string
    optional string op_deprecated = 3 [deprecated = true];

    // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
    // API.
    // Attributions must be provided through manifest using <attribution> tag available in R and
    // above.
    // API. Attributions must be provided through manifest using <attribution> tag available in R
    // and above.
    optional string attribution_tag = 4;

    // message related to app op access, limited to 600 chars by API
@@ -8718,6 +8717,9 @@ message RuntimeAppOpAccess {

    // sampling strategy used to collect this message
    optional SamplingStrategy sampling_strategy = 6;

    // operation id
    optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
}

/*
+2 −1
Original line number Diff line number Diff line
@@ -3016,7 +3016,7 @@ public class StatsPullAtomService extends SystemService {
            e.setAtomId(atomTag);
            e.writeInt(message.getUid());
            e.writeString(message.getPackageName());
            e.writeString(message.getOp());
            e.writeString("");
            if (message.getAttributionTag() == null) {
                e.writeString("");
            } else {
@@ -3024,6 +3024,7 @@ public class StatsPullAtomService extends SystemService {
            }
            e.writeString(message.getMessage());
            e.writeInt(message.getSamplingStrategy());
            e.writeInt(AppOpsManager.strOpToOp(message.getOp()));

            pulledData.add(e.build());
        } catch (Throwable t) {