Send Microphone Disabled Setting Regardless Of Current State

Fix sending an update on a(n) (obsolete) boolean, and always send
it out.

Bug: 174691697
Test: Run PtsChreTestRunner#micDisableSettingsTest
Change-Id: Ied34dbb8c08cbfd9dc055b0048694188c1ebf452
This commit is contained in:
karthik bharadwaj
2021-02-17 13:59:56 -08:00
parent 32906bfbbd
commit fd461d239e

View File

@@ -119,9 +119,6 @@ public class ContextHubService extends IContextHubService.Stub {
// True if WiFi is available for the Context Hub
private boolean mIsWifiAvailable = false;
// True if audio is disabled for the ContextHub
private boolean mIsAudioDisabled = false;
// Lock object for sendWifiSettingUpdate()
private final Object mSendWifiSettingUpdateLock = new Object();
@@ -1035,10 +1032,8 @@ public class ContextHubService extends IContextHubService.Stub {
SensorPrivacyManager manager = SensorPrivacyManager.getInstance(mContext);
boolean disabled = manager.isIndividualSensorPrivacyEnabled(
SensorPrivacyManager.INDIVIDUAL_SENSOR_MICROPHONE);
if (mIsAudioDisabled != disabled) {
mIsAudioDisabled = disabled;
mContextHubWrapper.onMicrophoneDisableSettingChanged(disabled);
}
Log.d(TAG, "Mic Disabled Setting: " + disabled);
mContextHubWrapper.onMicrophoneDisableSettingChanged(disabled);
}