Revert "Implement camera privacy allowlist."
Revert submission 25847276-camera_privacy_allowlist
Reason for revert: Culprit for b/324646239.
Reverted changes: /q/submissionid:25847276-camera_privacy_allowlist
Change-Id: Ia989dab3482ff42626ab197461c150a392839622
diff --git a/libs/sensorprivacy/Android.bp b/libs/sensorprivacy/Android.bp
index 1e7e707..00514c4 100644
--- a/libs/sensorprivacy/Android.bp
+++ b/libs/sensorprivacy/Android.bp
@@ -57,7 +57,6 @@
filegroup {
name: "libsensorprivacy_aidl",
srcs: [
- "aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl",
"aidl/android/hardware/ISensorPrivacyListener.aidl",
"aidl/android/hardware/ISensorPrivacyManager.aidl",
],
diff --git a/libs/sensorprivacy/SensorPrivacyManager.cpp b/libs/sensorprivacy/SensorPrivacyManager.cpp
index fe93786..57c74ee 100644
--- a/libs/sensorprivacy/SensorPrivacyManager.cpp
+++ b/libs/sensorprivacy/SensorPrivacyManager.cpp
@@ -108,7 +108,7 @@
bool SensorPrivacyManager::isToggleSensorPrivacyEnabled(int sensor)
{
- sp<hardware::ISensorPrivacyManager> service = getService();
+ sp<hardware::ISensorPrivacyManager> service = getService();
if (service != nullptr) {
bool result;
service->isCombinedToggleSensorPrivacyEnabled(sensor, &result);
@@ -143,39 +143,6 @@
return UNKNOWN_ERROR;
}
-int SensorPrivacyManager::getToggleSensorPrivacyState(int toggleType, int sensor)
-{
- sp<hardware::ISensorPrivacyManager> service = getService();
- if (service != nullptr) {
- int result;
- service->getToggleSensorPrivacyState(toggleType, sensor, &result);
- return result;
- }
- // if the SensorPrivacyManager is not available then assume sensor privacy is disabled
- return DISABLED;
-}
-
-std::vector<hardware::CameraPrivacyAllowlistEntry>
- SensorPrivacyManager::getCameraPrivacyAllowlist(){
- sp<hardware::ISensorPrivacyManager> service = getService();
- std::vector<hardware::CameraPrivacyAllowlistEntry> result;
- if (service != nullptr) {
- service->getCameraPrivacyAllowlist(&result);
- return result;
- }
- return result;
-}
-
-bool SensorPrivacyManager::isCameraPrivacyEnabled(String16 packageName){
- sp<hardware::ISensorPrivacyManager> service = getService();
- if (service != nullptr) {
- bool result;
- service->isCameraPrivacyEnabled(packageName, &result);
- return result;
- }
- return false;
-}
-
status_t SensorPrivacyManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient)
{
sp<hardware::ISensorPrivacyManager> service = getService();
diff --git a/libs/sensorprivacy/aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl b/libs/sensorprivacy/aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl
deleted file mode 100644
index 03e1537..0000000
--- a/libs/sensorprivacy/aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Copyright (c) 2024, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware;
-
-parcelable CameraPrivacyAllowlistEntry {
- String packageName;
- boolean isMandatory;
-}
diff --git a/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl b/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl
index 694af00..eccd54c 100644
--- a/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl
+++ b/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl
@@ -21,5 +21,4 @@
*/
oneway interface ISensorPrivacyListener {
void onSensorPrivacyChanged(int toggleType, int sensor, boolean enabled);
- void onSensorPrivacyStateChanged(int toggleType, int sensor, int state);
}
diff --git a/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl b/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl
index b6bd39e..49a1e1e 100644
--- a/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl
+++ b/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl
@@ -16,7 +16,6 @@
package android.hardware;
-import android.hardware.CameraPrivacyAllowlistEntry;
import android.hardware.ISensorPrivacyListener;
/** @hide */
@@ -42,15 +41,4 @@
void setToggleSensorPrivacy(int userId, int source, int sensor, boolean enable);
void setToggleSensorPrivacyForProfileGroup(int userId, int source, int sensor, boolean enable);
-
- List<CameraPrivacyAllowlistEntry> getCameraPrivacyAllowlist();
-
- int getToggleSensorPrivacyState(int toggleType, int sensor);
-
- void setToggleSensorPrivacyState(int userId, int source, int sensor, int state);
-
- void setToggleSensorPrivacyStateForProfileGroup(int userId, int source, int sensor, int state);
-
- boolean isCameraPrivacyEnabled(String packageName);
-
}
diff --git a/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h b/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h
index 9e97e16..fc5fdf7 100644
--- a/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h
+++ b/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h
@@ -32,22 +32,12 @@
public:
enum {
TOGGLE_SENSOR_MICROPHONE = 1,
- TOGGLE_SENSOR_CAMERA = 2,
- TOGGLE_SENSOR_UNKNOWN = -1
+ TOGGLE_SENSOR_CAMERA = 2
};
enum {
TOGGLE_TYPE_SOFTWARE = 1,
- TOGGLE_TYPE_HARDWARE = 2,
- TOGGLE_TYPE_UNKNOWN = -1
- };
-
- enum {
- ENABLED = 1,
- DISABLED = 2,
- AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS = 3,
- AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS = 4,
- AUTOMOTIVE_DRIVER_ASSISTANCE_APPS = 5
+ TOGGLE_TYPE_HARDWARE = 2
};
SensorPrivacyManager();
@@ -61,9 +51,6 @@
bool isToggleSensorPrivacyEnabled(int sensor);
bool isToggleSensorPrivacyEnabled(int toggleType, int sensor);
status_t isToggleSensorPrivacyEnabled(int toggleType, int sensor, bool &result);
- int getToggleSensorPrivacyState(int toggleType, int sensor);
- std::vector<hardware::CameraPrivacyAllowlistEntry> getCameraPrivacyAllowlist();
- bool isCameraPrivacyEnabled(String16 packageName);
status_t linkToDeath(const sp<IBinder::DeathRecipient>& recipient);
status_t unlinkToDeath(const sp<IBinder::DeathRecipient>& recipient);