Skip to content

Commit 0499b3e

Browse files
atneyaAndroid (Google) Code Review
authored andcommitted
Merge "[appops] Migrate IAppOpsCallback to aidl" into main
2 parents 8e94d30 + 5487bc6 commit 0499b3e

8 files changed

Lines changed: 30 additions & 131 deletions

File tree

libs/binder/include/binder/IInterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ constexpr const char* const kManualInterfaces[] = {
263263
"android.utils.IMemory",
264264
"android.utils.IMemoryHeap",
265265
"com.android.car.procfsinspector.IProcfsInspector",
266-
"com.android.internal.app.IAppOpsCallback",
267266
"com.android.internal.app.IAppOpsService",
268267
"com.android.internal.app.IBatteryStats",
269268
"com.android.internal.os.IResultReceiver",

libs/permission/Android.bp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ aidl_interface {
1616
double_loadable: true,
1717
srcs: [
1818
"aidl/android/content/AttributionSourceState.aidl",
19+
"aidl/com/android/internal/app/IAppOpsCallback.aidl",
1920
"aidl/android/permission/IPermissionChecker.aidl",
2021
],
2122
}
@@ -36,7 +37,6 @@ cc_library {
3637
],
3738
srcs: [
3839
"AppOpsManager.cpp",
39-
"IAppOpsCallback.cpp",
4040
"IAppOpsService.cpp",
4141
"android/permission/PermissionChecker.cpp",
4242
],

libs/permission/IAppOpsCallback.cpp

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (C) 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.app;
18+
19+
oneway interface IAppOpsCallback {
20+
void opChanged(int op, int uid, String packageName, String persistentDeviceId);
21+
}

libs/permission/include/binder/AppOpsManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ class AppOpsManager
180180
void finishOp(int32_t op, int32_t uid, const String16& callingPackage,
181181
const std::optional<String16>& attributionTag);
182182
void startWatchingMode(int32_t op, const String16& packageName,
183-
const sp<IAppOpsCallback>& callback);
183+
const sp<com::android::internal::app::IAppOpsCallback>& callback);
184184
void startWatchingMode(int32_t op, const String16& packageName, int32_t flags,
185-
const sp<IAppOpsCallback>& callback);
186-
void stopWatchingMode(const sp<IAppOpsCallback>& callback);
185+
const sp<com::android::internal::app::IAppOpsCallback>& callback);
186+
void stopWatchingMode(const sp<com::android::internal::app::IAppOpsCallback>& callback);
187187
int32_t permissionToOpCode(const String16& permission);
188188
void setCameraAudioRestriction(int32_t mode);
189189

libs/permission/include/binder/IAppOpsCallback.h

Lines changed: 0 additions & 57 deletions
This file was deleted.

libs/permission/include/binder/IAppOpsService.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
#pragma once
1818

19-
#include <binder/IAppOpsCallback.h>
19+
#include <com/android/internal/app/IAppOpsCallback.h>
20+
#include <com/android/internal/app/BnAppOpsCallback.h>
2021
#include <binder/IInterface.h>
2122

2223
#include <optional>
@@ -27,6 +28,8 @@
2728

2829
namespace android {
2930

31+
using IAppOpsCallback = ::com::android::internal::app::IAppOpsCallback;
32+
3033
// ----------------------------------------------------------------------
3134

3235
class IAppOpsService : public IInterface

services/sensorservice/aidl/fuzzer/Android.bp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ cc_fuzz {
2222
"android.hardware.sensors-V1-convert",
2323
"android.hardware.sensors-V3-ndk",
2424
"android.hardware.common-V2-ndk",
25+
"framework-permission-aidl-cpp",
2526
"libsensor",
2627
"libfakeservicemanager",
2728
"libcutils",

0 commit comments

Comments
 (0)