Update wallet setting availability
For devices that don't support wallet, don't even show the setting in a disabled state, which can cause confusion and lead the user to believe they can enable it somehow. Fixes: 251089510 Test: WalletPrivacyPreferenceControllerTest Change-Id: I5d60957f24712bb4d75e72fa5f64cab35b6d6a5f
This commit is contained in:
@@ -141,11 +141,29 @@ public class WalletPrivacyPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_noService_returnsDisabled() {
|
||||
public void getAvailabilityStatus_noServiceAndIsSecure_returnsUnsupported() {
|
||||
when(mClient.isWalletServiceAvailable()).thenReturn(false);
|
||||
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.UNSUPPORTED_ON_DEVICE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_hasServiceButNotSecure_returnsDisabled() {
|
||||
when(mClient.isWalletServiceAvailable()).thenReturn(true);
|
||||
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(false);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.DISABLED_DEPENDENT_SETTING);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_hasServiceAndIsSecure_returnsAvailable() {
|
||||
when(mClient.isWalletServiceAvailable()).thenReturn(true);
|
||||
when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
|
||||
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(
|
||||
BasePreferenceController.AVAILABLE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user