summaryrefslogtreecommitdiff
path: root/core/java/android/app/AsyncNotedAppOp.java
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2019-12-20 11:21:02 -0800
committerPhilip P. Moltmann <moltmann@google.com>2020-01-03 12:37:23 -0800
commitda554e4de0ac8de3acaa176d299612818b9e7e1d (patch)
treea575e8a8e679ba016949511981c723518a03a101 /core/java/android/app/AsyncNotedAppOp.java
parenta574814474efbc4e181e11dc85dce0457eb37393 (diff)
Collect AsyncNotedAppOp in same call as noteOp
This reduces the overhead of collecting noted app-ops to the same amount of binder calls as if we would not have the feature Before (conceptionally): --------------------------------- mode = service.noteOp() if (mode == allowed && shouldCollectAsyncOp) { fixup(message) service.noteAsyncOp() } ---------------------------------- After (conceptionally): ---------------------------------- if (shouldCollectAsyncOp) { fixup(message) } mode = service.noteOp(shouldCollectAsyncOp, message) ---------------------------------- Bug: 136505050 Test: atest CtsAppOpsTestCases Change-Id: If1b535a7c4b0f431f251c5d06cdf496c34920e23
Diffstat (limited to 'core/java/android/app/AsyncNotedAppOp.java')
-rw-r--r--core/java/android/app/AsyncNotedAppOp.java42
1 files changed, 10 insertions, 32 deletions
diff --git a/core/java/android/app/AsyncNotedAppOp.java b/core/java/android/app/AsyncNotedAppOp.java
index 0e1f92177e9d..c3ef3adb6037 100644
--- a/core/java/android/app/AsyncNotedAppOp.java
+++ b/core/java/android/app/AsyncNotedAppOp.java
@@ -45,12 +45,6 @@ public final class AsyncNotedAppOp implements Parcelable {
/** Uid that noted the op */
private final @IntRange(from = 0) int mNotingUid;
- /**
- * Package that noted the op. {@code null} if the package name that noted the op could be not
- * be determined (e.g. when the op is noted from native code).
- */
- private final @Nullable String mNotingPackageName;
-
/** {@link android.content.Context#createFeatureContext Feature} in the app */
private final @Nullable String mFeatureId;
@@ -69,7 +63,7 @@ public final class AsyncNotedAppOp implements Parcelable {
- // Code below generated by codegen v1.0.9.
+ // Code below generated by codegen v1.0.14.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -89,9 +83,6 @@ public final class AsyncNotedAppOp implements Parcelable {
* Op that was noted
* @param notingUid
* Uid that noted the op
- * @param notingPackageName
- * Package that noted the op. {@code null} if the package name that noted the op could be not
- * be determined (e.g. when the op is noted from native code).
* @param featureId
* {@link android.content.Context#createFeatureContext Feature} in the app
* @param message
@@ -104,7 +95,6 @@ public final class AsyncNotedAppOp implements Parcelable {
public AsyncNotedAppOp(
@IntRange(from = 0, to = AppOpsManager._NUM_OP - 1) int opCode,
@IntRange(from = 0) int notingUid,
- @Nullable String notingPackageName,
@Nullable String featureId,
@NonNull String message,
@IntRange(from = 0) long time) {
@@ -117,7 +107,6 @@ public final class AsyncNotedAppOp implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
IntRange.class, null, mNotingUid,
"from", 0);
- this.mNotingPackageName = notingPackageName;
this.mFeatureId = featureId;
this.mMessage = message;
com.android.internal.util.AnnotationValidations.validate(
@@ -139,15 +128,6 @@ public final class AsyncNotedAppOp implements Parcelable {
}
/**
- * Package that noted the op. {@code null} if the package name that noted the op could be not
- * be determined (e.g. when the op is noted from native code).
- */
- @DataClass.Generated.Member
- public @Nullable String getNotingPackageName() {
- return mNotingPackageName;
- }
-
- /**
* {@link android.content.Context#createFeatureContext Feature} in the app
*/
@DataClass.Generated.Member
@@ -186,7 +166,6 @@ public final class AsyncNotedAppOp implements Parcelable {
return true
&& mOpCode == that.mOpCode
&& mNotingUid == that.mNotingUid
- && java.util.Objects.equals(mNotingPackageName, that.mNotingPackageName)
&& java.util.Objects.equals(mFeatureId, that.mFeatureId)
&& java.util.Objects.equals(mMessage, that.mMessage)
&& mTime == that.mTime;
@@ -201,7 +180,6 @@ public final class AsyncNotedAppOp implements Parcelable {
int _hash = 1;
_hash = 31 * _hash + mOpCode;
_hash = 31 * _hash + mNotingUid;
- _hash = 31 * _hash + java.util.Objects.hashCode(mNotingPackageName);
_hash = 31 * _hash + java.util.Objects.hashCode(mFeatureId);
_hash = 31 * _hash + java.util.Objects.hashCode(mMessage);
_hash = 31 * _hash + Long.hashCode(mTime);
@@ -215,12 +193,10 @@ public final class AsyncNotedAppOp implements Parcelable {
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
- if (mNotingPackageName != null) flg |= 0x4;
- if (mFeatureId != null) flg |= 0x8;
+ if (mFeatureId != null) flg |= 0x4;
dest.writeByte(flg);
dest.writeInt(mOpCode);
dest.writeInt(mNotingUid);
- if (mNotingPackageName != null) dest.writeString(mNotingPackageName);
if (mFeatureId != null) dest.writeString(mFeatureId);
dest.writeString(mMessage);
dest.writeLong(mTime);
@@ -240,8 +216,7 @@ public final class AsyncNotedAppOp implements Parcelable {
byte flg = in.readByte();
int opCode = in.readInt();
int notingUid = in.readInt();
- String notingPackageName = (flg & 0x4) == 0 ? null : in.readString();
- String featureId = (flg & 0x8) == 0 ? null : in.readString();
+ String featureId = (flg & 0x4) == 0 ? null : in.readString();
String message = in.readString();
long time = in.readLong();
@@ -254,7 +229,6 @@ public final class AsyncNotedAppOp implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
IntRange.class, null, mNotingUid,
"from", 0);
- this.mNotingPackageName = notingPackageName;
this.mFeatureId = featureId;
this.mMessage = message;
com.android.internal.util.AnnotationValidations.validate(
@@ -282,11 +256,15 @@ public final class AsyncNotedAppOp implements Parcelable {
};
@DataClass.Generated(
- time = 1571327470155L,
- codegenVersion = "1.0.9",
+ time = 1576864422226L,
+ codegenVersion = "1.0.14",
sourceFile = "frameworks/base/core/java/android/app/AsyncNotedAppOp.java",
- inputSignatures = "private final @android.annotation.IntRange(from=0L, to=92L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mNotingPackageName\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
+ inputSignatures = "private final @android.annotation.IntRange(from=0L, to=92L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
@Deprecated
private void __metadata() {}
+
+ //@formatter:on
+ // End of generated code
+
}