Fixes to native app ops services
Bug: 8181262
Change-Id: I3d3f20453f6c6f2756c988363c5b5453ef309cb6
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp
index d8922c9..282b30f 100644
--- a/libs/binder/IAppOpsService.cpp
+++ b/libs/binder/IAppOpsService.cpp
@@ -45,8 +45,8 @@
data.writeString16(packageName);
remote()->transact(CHECK_OPERATION_TRANSACTION, data, &reply);
// fail on exception
- if (reply.readExceptionCode() != 0) return 0;
- return reply.readInt32() != 0;
+ if (reply.readExceptionCode() != 0) return MODE_ERRORED;
+ return reply.readInt32();
}
virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) {
@@ -57,8 +57,8 @@
data.writeString16(packageName);
remote()->transact(NOTE_OPERATION_TRANSACTION, data, &reply);
// fail on exception
- if (reply.readExceptionCode() != 0) return 0;
- return reply.readInt32() != 0;
+ if (reply.readExceptionCode() != 0) return MODE_ERRORED;
+ return reply.readInt32();
}
virtual int32_t startOperation(int32_t code, int32_t uid, const String16& packageName) {
@@ -69,8 +69,8 @@
data.writeString16(packageName);
remote()->transact(START_OPERATION_TRANSACTION, data, &reply);
// fail on exception
- if (reply.readExceptionCode() != 0) return 0;
- return reply.readInt32() != 0;
+ if (reply.readExceptionCode() != 0) return MODE_ERRORED;
+ return reply.readInt32();
}
virtual void finishOperation(int32_t code, int32_t uid, const String16& packageName) {