diff options
author | 2024-02-10 01:28:37 +0000 | |
---|---|---|
committer | 2024-02-10 01:29:03 +0000 | |
commit | 9b2f9306c20d22cf131cc7d9d0eee30579e0d77c (patch) | |
tree | fd280f746a26bafbab5dce2ed8ca0c3df7f3c88a | |
parent | d5660e3ce79a054834411dced896de31ce7475b1 (diff) |
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
7 files changed, 3 insertions, 91 deletions
diff --git a/libs/sensorprivacy/Android.bp b/libs/sensorprivacy/Android.bp index 1e7e70775a..00514c4417 100644 --- a/libs/sensorprivacy/Android.bp +++ b/libs/sensorprivacy/Android.bp @@ -57,7 +57,6 @@ cc_library_shared { 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 fe9378616d..57c74ee565 100644 --- a/libs/sensorprivacy/SensorPrivacyManager.cpp +++ b/libs/sensorprivacy/SensorPrivacyManager.cpp @@ -108,7 +108,7 @@ bool SensorPrivacyManager::isSensorPrivacyEnabled() 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 @@ status_t SensorPrivacyManager::isToggleSensorPrivacyEnabled(int toggleType, int 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 03e153704b..0000000000 --- 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 694af00a87..eccd54c3eb 100644 --- a/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl +++ b/libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl @@ -21,5 +21,4 @@ package android.hardware; */ 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 b6bd39e557..49a1e1ea05 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 @@ interface ISensorPrivacyManager { 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 9e97e166be..fc5fdf7900 100644 --- a/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h +++ b/libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h @@ -32,22 +32,12 @@ class SensorPrivacyManager 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 @@ public: 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); diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h index 118d9281fc..ad10e7a7bd 100644 --- a/services/sensorservice/SensorService.h +++ b/services/sensorservice/SensorService.h @@ -340,12 +340,6 @@ private: binder::Status onSensorPrivacyChanged(int toggleType, int sensor, bool enabled); - // This callback is used for additional automotive-specific states for sensor privacy - // such as AUTO_DRIVER_ASSISTANCE_APPS. The newly defined states will only be valid - // for camera privacy on automotive devices. onSensorPrivacyChanged() will still be - // invoked whenever the enabled status of a toggle changes. - binder::Status onSensorPrivacyStateChanged(int, int, int) {return binder::Status::ok();} - protected: std::atomic_bool mSensorPrivacyEnabled; wp<SensorService> mService; |