summaryrefslogtreecommitdiff
path: root/libs/binder/IAppOpsService.cpp
diff options
context:
space:
mode:
author Svetoslav <svetoslavganov@google.com> 2015-04-29 16:50:41 -0700
committer Svetoslav <svetoslavganov@google.com> 2015-05-01 13:51:45 -0700
commitb412f6e203b38f8047f760261a5e3dc6d0722f08 (patch)
treef4e06f90090581c0efcff50602145ff11d0ea753 /libs/binder/IAppOpsService.cpp
parent61a3c8dec90acebef15ef56cae14efea69279f69 (diff)
Add body sensors app op - framework native
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
Diffstat (limited to 'libs/binder/IAppOpsService.cpp')
-rw-r--r--libs/binder/IAppOpsService.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/binder/IAppOpsService.cpp b/libs/binder/IAppOpsService.cpp
index 86abdc0117..9558376dbf 100644
--- a/libs/binder/IAppOpsService.cpp
+++ b/libs/binder/IAppOpsService.cpp
@@ -111,6 +111,17 @@ public:
if (reply.readExceptionCode() != 0) return NULL;
return reply.readStrongBinder();
}
+
+
+ virtual int32_t permissionToOpCode(const String16& permission) {
+ Parcel data, reply;
+ data.writeInterfaceToken(IAppOpsService::getInterfaceDescriptor());
+ data.writeString16(permission);
+ remote()->transact(PERMISSION_TO_OP_CODE_TRANSACTION, data, &reply);
+ // fail on exception
+ if (reply.readExceptionCode() != 0) return -1;
+ return reply.readInt32();
+ }
};
IMPLEMENT_META_INTERFACE(AppOpsService, "com.android.internal.app.IAppOpsService");
@@ -187,6 +198,14 @@ status_t BnAppOpsService::onTransact(
reply->writeStrongBinder(token);
return NO_ERROR;
} break;
+ case PERMISSION_TO_OP_CODE_TRANSACTION: {
+ CHECK_INTERFACE(IAppOpsService, data, reply);
+ String16 permission = data.readString16();
+ const int32_t opCode = permissionToOpCode(permission);
+ reply->writeNoException();
+ reply->writeInt32(opCode);
+ return NO_ERROR;
+ } break;
default:
return BBinder::onTransact(code, data, reply, flags);
}