Call system service API instead of checking the phenotype flag directly.

Test: atest SettingsUnitTests
Bug: 208625216
Change-Id: Ib551cbaf0f09fe49bd81ef657037401263705521
This commit is contained in:
Jan Tomljanovic
2022-01-17 12:21:59 +00:00
parent e9ca51918c
commit 9d2ec95c61
18 changed files with 202 additions and 245 deletions

View File

@@ -20,7 +20,7 @@ import android.annotation.NonNull;
import android.content.Context;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.safetycenter.SafetyCenterStatus;
import com.android.settings.safetycenter.SafetyCenterStatusHolder;
/** The preference controller for the top level privacy tile. */
public class TopLevelPrivacyEntryPreferenceController extends BasePreferenceController {
@@ -31,7 +31,7 @@ public class TopLevelPrivacyEntryPreferenceController extends BasePreferenceCon
@Override
public int getAvailabilityStatus() {
if (!SafetyCenterStatus.isEnabled()) {
if (!SafetyCenterStatusHolder.get().isEnabled(mContext)) {
return AVAILABLE;
}
return CONDITIONALLY_UNAVAILABLE;