Merge "Update mic/camera toggles api" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cbc3bc5acd
@@ -371,7 +371,7 @@ public abstract class DevelopmentTiles extends TileService {
|
|||||||
mContext = getApplicationContext();
|
mContext = getApplicationContext();
|
||||||
mSensorPrivacyManager = (SensorPrivacyManager) mContext.getSystemService(
|
mSensorPrivacyManager = (SensorPrivacyManager) mContext.getSystemService(
|
||||||
Context.SENSOR_PRIVACY_SERVICE);
|
Context.SENSOR_PRIVACY_SERVICE);
|
||||||
mIsEnabled = mSensorPrivacyManager.isSensorPrivacyEnabled();
|
mIsEnabled = mSensorPrivacyManager.isAllSensorPrivacyEnabled();
|
||||||
mMetricsFeatureProvider = FeatureFactory.getFactory(
|
mMetricsFeatureProvider = FeatureFactory.getFactory(
|
||||||
mContext).getMetricsFeatureProvider();
|
mContext).getMetricsFeatureProvider();
|
||||||
mKeyguardManager = (KeyguardManager) mContext.getSystemService(
|
mKeyguardManager = (KeyguardManager) mContext.getSystemService(
|
||||||
@@ -392,7 +392,7 @@ public abstract class DevelopmentTiles extends TileService {
|
|||||||
mMetricsFeatureProvider.action(getApplicationContext(), SettingsEnums.QS_SENSOR_PRIVACY,
|
mMetricsFeatureProvider.action(getApplicationContext(), SettingsEnums.QS_SENSOR_PRIVACY,
|
||||||
isEnabled);
|
isEnabled);
|
||||||
mIsEnabled = isEnabled;
|
mIsEnabled = isEnabled;
|
||||||
mSensorPrivacyManager.setSensorPrivacy(isEnabled);
|
mSensorPrivacyManager.setAllSensorPrivacy(isEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ public class AdaptiveSleepCameraStatePreferenceController {
|
|||||||
mPreference.setPositiveButtonText(R.string.allow);
|
mPreference.setPositiveButtonText(R.string.allow);
|
||||||
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
||||||
mPrivacyManager.addSensorPrivacyListener(CAMERA,
|
mPrivacyManager.addSensorPrivacyListener(CAMERA,
|
||||||
enabled -> updateVisibility());
|
(sensor, enabled) -> updateVisibility());
|
||||||
mPreference.setPositiveButtonOnClickListener(p -> {
|
mPreference.setPositiveButtonOnClickListener(p -> {
|
||||||
mPrivacyManager.setSensorPrivacy(CAMERA, false);
|
mPrivacyManager.setSensorPrivacy(CAMERA, false);
|
||||||
});
|
});
|
||||||
|
@@ -111,9 +111,7 @@ public class ScreenTimeoutSettings extends RadioButtonPickerFragment implements
|
|||||||
mPrivacyPreference.setLayoutResource(R.layout.preference_footer);
|
mPrivacyPreference.setLayoutResource(R.layout.preference_footer);
|
||||||
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
||||||
mPrivacyManager.addSensorPrivacyListener(CAMERA,
|
mPrivacyManager.addSensorPrivacyListener(CAMERA,
|
||||||
enabled -> {
|
(sensor, enabled) -> mAdaptiveSleepController.updatePreference());
|
||||||
mAdaptiveSleepController.updatePreference();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -43,7 +43,7 @@ public class SmartAutoRotateCameraStateController extends BasePreferenceControll
|
|||||||
public SmartAutoRotateCameraStateController(Context context, String key) {
|
public SmartAutoRotateCameraStateController(Context context, String key) {
|
||||||
super(context, key);
|
super(context, key);
|
||||||
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
||||||
mPrivacyManager.addSensorPrivacyListener(CAMERA, enabled -> {
|
mPrivacyManager.addSensorPrivacyListener(CAMERA, (sensor, enabled) -> {
|
||||||
mPreference.setVisible(enabled);
|
mPreference.setVisible(enabled);
|
||||||
updateState(mPreference);
|
updateState(mPreference);
|
||||||
});
|
});
|
||||||
|
@@ -52,7 +52,8 @@ public class SmartAutoRotateController extends TogglePreferenceController implem
|
|||||||
super(context, preferenceKey);
|
super(context, preferenceKey);
|
||||||
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
|
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
|
||||||
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
mPrivacyManager = SensorPrivacyManager.getInstance(context);
|
||||||
mPrivacyManager.addSensorPrivacyListener(CAMERA, enabled -> updateState(mPreference));
|
mPrivacyManager
|
||||||
|
.addSensorPrivacyListener(CAMERA, (sensor, enabled) -> updateState(mPreference));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user