Rename featureId -> attributionTag

Bug: 148792795
Test: TH
Change-Id: Ic56606795e5e68ba76794198faf496eec6d87cd0
Exempt-From-Owner-Approval: API rename
Merged-In: Ic56606795e5e68ba76794198faf496eec6d87cd0
This commit is contained in:
Philip P. Moltmann 2020-03-05 15:06:19 -08:00
parent 2ac52e8ef3
commit 3f6efd8315
4 changed files with 28 additions and 28 deletions

View file

@ -96,11 +96,11 @@ int32_t AppOpsManager::noteOp(int32_t op, int32_t uid, const String16& callingPa
}
int32_t AppOpsManager::noteOp(int32_t op, int32_t uid, const String16& callingPackage,
const std::optional<String16>& featureId, const String16& message) {
const std::optional<String16>& attributionTag, const String16& message) {
sp<IAppOpsService> service = getService();
int32_t mode = service != nullptr
? service->noteOperation(op, uid, callingPackage, featureId, shouldCollectNotes(op),
message)
? service->noteOperation(op, uid, callingPackage, attributionTag,
shouldCollectNotes(op), message)
: AppOpsManager::MODE_IGNORED;
return mode;
@ -113,12 +113,12 @@ int32_t AppOpsManager::startOpNoThrow(int32_t op, int32_t uid, const String16& c
}
int32_t AppOpsManager::startOpNoThrow(int32_t op, int32_t uid, const String16& callingPackage,
bool startIfModeDefault, const std::optional<String16>& featureId,
bool startIfModeDefault, const std::optional<String16>& attributionTag,
const String16& message) {
sp<IAppOpsService> service = getService();
int32_t mode = service != nullptr
? service->startOperation(getClientId(), op, uid, callingPackage,
featureId, startIfModeDefault, shouldCollectNotes(op), message)
attributionTag, startIfModeDefault, shouldCollectNotes(op), message)
: AppOpsManager::MODE_IGNORED;
return mode;
@ -129,10 +129,10 @@ void AppOpsManager::finishOp(int32_t op, int32_t uid, const String16& callingPac
}
void AppOpsManager::finishOp(int32_t op, int32_t uid, const String16& callingPackage,
const std::optional<String16>& callingFeatureId) {
const std::optional<String16>& attributionTag) {
sp<IAppOpsService> service = getService();
if (service != nullptr) {
service->finishOperation(getClientId(), op, uid, callingPackage, callingFeatureId);
service->finishOperation(getClientId(), op, uid, callingPackage, attributionTag);
}
}

View file

@ -49,14 +49,14 @@ public:
}
virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName,
const std::optional<String16>& featureId, bool shouldCollectAsyncNotedOp,
const std::optional<String16>& attributionTag, bool shouldCollectAsyncNotedOp,
const String16& message) {
Parcel data, reply;
data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
data.writeInt32(code);
data.writeInt32(uid);
data.writeString16(packageName);
data.writeString16(featureId);
data.writeString16(attributionTag);
data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0);
data.writeString16(message);
remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply);
@ -66,7 +66,7 @@ public:
}
virtual int32_t startOperation(const sp<IBinder>& token, int32_t code, int32_t uid,
const String16& packageName, const std::optional<String16>& featureId,
const String16& packageName, const std::optional<String16>& attributionTag,
bool startIfModeDefault, bool shouldCollectAsyncNotedOp, const String16& message) {
Parcel data, reply;
data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
@ -74,7 +74,7 @@ public:
data.writeInt32(code);
data.writeInt32(uid);
data.writeString16(packageName);
data.writeString16(featureId);
data.writeString16(attributionTag);
data.writeInt32(startIfModeDefault ? 1 : 0);
data.writeInt32(shouldCollectAsyncNotedOp ? 1 : 0);
data.writeString16(message);
@ -85,14 +85,14 @@ public:
}
virtual void finishOperation(const sp<IBinder>& token, int32_t code, int32_t uid,
const String16& packageName, const std::optional<String16>& featureId) {
const String16& packageName, const std::optional<String16>& attributionTag) {
Parcel data, reply;
data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
data.writeStrongBinder(token);
data.writeInt32(code);
data.writeInt32(uid);
data.writeString16(packageName);
data.writeString16(featureId);
data.writeString16(attributionTag);
remote()->transact(FINISH_OPERATION_TRANSACTION, data, &reply);
}
@ -184,11 +184,11 @@ status_t BnAppOpsService::onTransact(
int32_t code = data.readInt32();
int32_t uid = data.readInt32();
String16 packageName = data.readString16();
std::optional<String16> featureId;
data.readString16(&featureId);
std::optional<String16> attributionTag;
data.readString16(&attributionTag);
bool shouldCollectAsyncNotedOp = data.readInt32() == 1;
String16 message = data.readString16();
int32_t res = noteOperation(code, uid, packageName, featureId,
int32_t res = noteOperation(code, uid, packageName, attributionTag,
shouldCollectAsyncNotedOp, message);
reply->writeNoException();
reply->writeInt32(res);
@ -200,12 +200,12 @@ status_t BnAppOpsService::onTransact(
int32_t code = data.readInt32();
int32_t uid = data.readInt32();
String16 packageName = data.readString16();
std::optional<String16> featureId;
data.readString16(&featureId);
std::optional<String16> attributionTag;
data.readString16(&attributionTag);
bool startIfModeDefault = data.readInt32() == 1;
bool shouldCollectAsyncNotedOp = data.readInt32() == 1;
String16 message = data.readString16();
int32_t res = startOperation(token, code, uid, packageName, featureId,
int32_t res = startOperation(token, code, uid, packageName, attributionTag,
startIfModeDefault, shouldCollectAsyncNotedOp, message);
reply->writeNoException();
reply->writeInt32(res);
@ -217,9 +217,9 @@ status_t BnAppOpsService::onTransact(
int32_t code = data.readInt32();
int32_t uid = data.readInt32();
String16 packageName = data.readString16();
std::optional<String16> featureId;
data.readString16(&featureId);
finishOperation(token, code, uid, packageName, featureId);
std::optional<String16> attributionTag;
data.readString16(&attributionTag);
finishOperation(token, code, uid, packageName, attributionTag);
reply->writeNoException();
return NO_ERROR;
} break;

View file

@ -136,18 +136,18 @@ public:
// const String16&) instead
int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage);
int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage,
const std::optional<String16>& featureId, const String16& message);
const std::optional<String16>& attributionTag, const String16& message);
// @Deprecated, use startOpNoThrow(int32_t, int32_t, const String16&, bool, const String16&,
// const String16&) instead
int32_t startOpNoThrow(int32_t op, int32_t uid, const String16& callingPackage,
bool startIfModeDefault);
int32_t startOpNoThrow(int32_t op, int32_t uid, const String16& callingPackage,
bool startIfModeDefault, const std::optional<String16>& featureId,
bool startIfModeDefault, const std::optional<String16>& attributionTag,
const String16& message);
// @Deprecated, use finishOp(int32_t, int32_t, const String16&, bool, const String16&) instead
void finishOp(int32_t op, int32_t uid, const String16& callingPackage);
void finishOp(int32_t op, int32_t uid, const String16& callingPackage,
const std::optional<String16>& featureId);
const std::optional<String16>& attributionTag);
void startWatchingMode(int32_t op, const String16& packageName,
const sp<IAppOpsCallback>& callback);
void stopWatchingMode(const sp<IAppOpsCallback>& callback);

View file

@ -38,13 +38,13 @@ public:
virtual int32_t checkOperation(int32_t code, int32_t uid, const String16& packageName) = 0;
virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName,
const std::optional<String16>& featureId, bool shouldCollectAsyncNotedOp,
const std::optional<String16>& attributionTag, bool shouldCollectAsyncNotedOp,
const String16& message) = 0;
virtual int32_t startOperation(const sp<IBinder>& token, int32_t code, int32_t uid,
const String16& packageName, const std::optional<String16>& featureId,
const String16& packageName, const std::optional<String16>& attributionTag,
bool startIfModeDefault, bool shouldCollectAsyncNotedOp, const String16& message) = 0;
virtual void finishOperation(const sp<IBinder>& token, int32_t code, int32_t uid,
const String16& packageName, const std::optional<String16>& featureId) = 0;
const String16& packageName, const std::optional<String16>& attributionTag) = 0;
virtual void startWatchingMode(int32_t op, const String16& packageName,
const sp<IAppOpsCallback>& callback) = 0;
virtual void stopWatchingMode(const sp<IAppOpsCallback>& callback) = 0;