Skip to content

Commit 9b2f930

Browse files
Priyanka AdvaniAndroid (Google) Code Review
authored andcommitted
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
1 parent d5660e3 commit 9b2f930

7 files changed

Lines changed: 3 additions & 91 deletions

File tree

libs/sensorprivacy/Android.bp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ cc_library_shared {
5757
filegroup {
5858
name: "libsensorprivacy_aidl",
5959
srcs: [
60-
"aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl",
6160
"aidl/android/hardware/ISensorPrivacyListener.aidl",
6261
"aidl/android/hardware/ISensorPrivacyManager.aidl",
6362
],

libs/sensorprivacy/SensorPrivacyManager.cpp

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ bool SensorPrivacyManager::isSensorPrivacyEnabled()
108108

109109
bool SensorPrivacyManager::isToggleSensorPrivacyEnabled(int sensor)
110110
{
111-
sp<hardware::ISensorPrivacyManager> service = getService();
111+
sp<hardware::ISensorPrivacyManager> service = getService();
112112
if (service != nullptr) {
113113
bool result;
114114
service->isCombinedToggleSensorPrivacyEnabled(sensor, &result);
@@ -143,39 +143,6 @@ status_t SensorPrivacyManager::isToggleSensorPrivacyEnabled(int toggleType, int
143143
return UNKNOWN_ERROR;
144144
}
145145

146-
int SensorPrivacyManager::getToggleSensorPrivacyState(int toggleType, int sensor)
147-
{
148-
sp<hardware::ISensorPrivacyManager> service = getService();
149-
if (service != nullptr) {
150-
int result;
151-
service->getToggleSensorPrivacyState(toggleType, sensor, &result);
152-
return result;
153-
}
154-
// if the SensorPrivacyManager is not available then assume sensor privacy is disabled
155-
return DISABLED;
156-
}
157-
158-
std::vector<hardware::CameraPrivacyAllowlistEntry>
159-
SensorPrivacyManager::getCameraPrivacyAllowlist(){
160-
sp<hardware::ISensorPrivacyManager> service = getService();
161-
std::vector<hardware::CameraPrivacyAllowlistEntry> result;
162-
if (service != nullptr) {
163-
service->getCameraPrivacyAllowlist(&result);
164-
return result;
165-
}
166-
return result;
167-
}
168-
169-
bool SensorPrivacyManager::isCameraPrivacyEnabled(String16 packageName){
170-
sp<hardware::ISensorPrivacyManager> service = getService();
171-
if (service != nullptr) {
172-
bool result;
173-
service->isCameraPrivacyEnabled(packageName, &result);
174-
return result;
175-
}
176-
return false;
177-
}
178-
179146
status_t SensorPrivacyManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient)
180147
{
181148
sp<hardware::ISensorPrivacyManager> service = getService();

libs/sensorprivacy/aidl/android/hardware/CameraPrivacyAllowlistEntry.aidl

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

libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyListener.aidl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ package android.hardware;
2121
*/
2222
oneway interface ISensorPrivacyListener {
2323
void onSensorPrivacyChanged(int toggleType, int sensor, boolean enabled);
24-
void onSensorPrivacyStateChanged(int toggleType, int sensor, int state);
2524
}

libs/sensorprivacy/aidl/android/hardware/ISensorPrivacyManager.aidl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package android.hardware;
1818

19-
import android.hardware.CameraPrivacyAllowlistEntry;
2019
import android.hardware.ISensorPrivacyListener;
2120

2221
/** @hide */
@@ -42,15 +41,4 @@ interface ISensorPrivacyManager {
4241
void setToggleSensorPrivacy(int userId, int source, int sensor, boolean enable);
4342

4443
void setToggleSensorPrivacyForProfileGroup(int userId, int source, int sensor, boolean enable);
45-
46-
List<CameraPrivacyAllowlistEntry> getCameraPrivacyAllowlist();
47-
48-
int getToggleSensorPrivacyState(int toggleType, int sensor);
49-
50-
void setToggleSensorPrivacyState(int userId, int source, int sensor, int state);
51-
52-
void setToggleSensorPrivacyStateForProfileGroup(int userId, int source, int sensor, int state);
53-
54-
boolean isCameraPrivacyEnabled(String packageName);
55-
5644
}

libs/sensorprivacy/include/sensorprivacy/SensorPrivacyManager.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,12 @@ class SensorPrivacyManager
3232
public:
3333
enum {
3434
TOGGLE_SENSOR_MICROPHONE = 1,
35-
TOGGLE_SENSOR_CAMERA = 2,
36-
TOGGLE_SENSOR_UNKNOWN = -1
35+
TOGGLE_SENSOR_CAMERA = 2
3736
};
3837

3938
enum {
4039
TOGGLE_TYPE_SOFTWARE = 1,
41-
TOGGLE_TYPE_HARDWARE = 2,
42-
TOGGLE_TYPE_UNKNOWN = -1
43-
};
44-
45-
enum {
46-
ENABLED = 1,
47-
DISABLED = 2,
48-
AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS = 3,
49-
AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS = 4,
50-
AUTOMOTIVE_DRIVER_ASSISTANCE_APPS = 5
40+
TOGGLE_TYPE_HARDWARE = 2
5141
};
5242

5343
SensorPrivacyManager();
@@ -61,9 +51,6 @@ class SensorPrivacyManager
6151
bool isToggleSensorPrivacyEnabled(int sensor);
6252
bool isToggleSensorPrivacyEnabled(int toggleType, int sensor);
6353
status_t isToggleSensorPrivacyEnabled(int toggleType, int sensor, bool &result);
64-
int getToggleSensorPrivacyState(int toggleType, int sensor);
65-
std::vector<hardware::CameraPrivacyAllowlistEntry> getCameraPrivacyAllowlist();
66-
bool isCameraPrivacyEnabled(String16 packageName);
6754

6855
status_t linkToDeath(const sp<IBinder::DeathRecipient>& recipient);
6956
status_t unlinkToDeath(const sp<IBinder::DeathRecipient>& recipient);

services/sensorservice/SensorService.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,6 @@ class SensorService :
340340
binder::Status onSensorPrivacyChanged(int toggleType, int sensor,
341341
bool enabled);
342342

343-
// This callback is used for additional automotive-specific states for sensor privacy
344-
// such as AUTO_DRIVER_ASSISTANCE_APPS. The newly defined states will only be valid
345-
// for camera privacy on automotive devices. onSensorPrivacyChanged() will still be
346-
// invoked whenever the enabled status of a toggle changes.
347-
binder::Status onSensorPrivacyStateChanged(int, int, int) {return binder::Status::ok();}
348-
349343
protected:
350344
std::atomic_bool mSensorPrivacyEnabled;
351345
wp<SensorService> mService;

0 commit comments

Comments
 (0)