Merge "Fingerprint swipe settings and suggestions should not show if hardware unavailable" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
af63fc249e
@@ -1222,6 +1222,11 @@ public final class Utils extends com.android.settingslib.Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hasFingerprintHardware(Context context) {
|
||||||
|
FingerprintManager fingerprintManager = getFingerprintManagerOrNull(context);
|
||||||
|
return fingerprintManager != null && fingerprintManager.isHardwareDetected();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches an intent which may optionally have a user id defined.
|
* Launches an intent which may optionally have a user id defined.
|
||||||
* @param fragment Fragment to use to launch the activity.
|
* @param fragment Fragment to use to launch the activity.
|
||||||
|
@@ -65,12 +65,14 @@ public class SuggestionsChecks {
|
|||||||
} else if (className.equals(WifiCallingSuggestionActivity.class.getName())) {
|
} else if (className.equals(WifiCallingSuggestionActivity.class.getName())) {
|
||||||
return isWifiCallingUnavailableOrEnabled();
|
return isWifiCallingUnavailableOrEnabled();
|
||||||
} else if (className.equals(FingerprintSuggestionActivity.class.getName())) {
|
} else if (className.equals(FingerprintSuggestionActivity.class.getName())) {
|
||||||
return isNotSingleFingerprintEnrolled() || !isFingerprintEnabled();
|
return !Utils.hasFingerprintHardware(mContext) || !isFingerprintEnabled()
|
||||||
|
|| isNotSingleFingerprintEnrolled();
|
||||||
} else if (className.equals(ScreenLockSuggestionActivity.class.getName())) {
|
} else if (className.equals(ScreenLockSuggestionActivity.class.getName())) {
|
||||||
return isDeviceSecured();
|
return isDeviceSecured();
|
||||||
} else if (className.equals(FingerprintEnrollSuggestionActivity.class.getName())) {
|
} else if (className.equals(FingerprintEnrollSuggestionActivity.class.getName())) {
|
||||||
FingerprintManager manager = Utils.getFingerprintManagerOrNull(mContext);
|
final FingerprintManager manager = Utils.getFingerprintManagerOrNull(mContext);
|
||||||
if (manager == null || !isFingerprintEnabled()) {
|
if (manager == null || !isFingerprintEnabled()
|
||||||
|
|| !Utils.hasFingerprintHardware(mContext)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return manager.hasEnrolledFingerprints();
|
return manager.hasEnrolledFingerprints();
|
||||||
|
@@ -23,7 +23,7 @@ import android.provider.Settings;
|
|||||||
import android.support.v7.preference.Preference;
|
import android.support.v7.preference.Preference;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.search.DatabaseIndexingUtils;
|
import com.android.settings.search.DatabaseIndexingUtils;
|
||||||
import com.android.settings.search.InlineSwitchPayload;
|
import com.android.settings.search.InlineSwitchPayload;
|
||||||
import com.android.settings.search.ResultPayload;
|
import com.android.settings.search.ResultPayload;
|
||||||
@@ -50,7 +50,7 @@ public class SwipeToNotificationPreferenceController extends GesturePreferenceCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGestureAvailable(Context context) {
|
private static boolean isGestureAvailable(Context context) {
|
||||||
return context.getResources()
|
return Utils.hasFingerprintHardware(context) && context.getResources()
|
||||||
.getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys);
|
.getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,12 +16,15 @@
|
|||||||
|
|
||||||
package com.android.settings.dashboard.suggestions;
|
package com.android.settings.dashboard.suggestions;
|
||||||
|
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
import android.provider.Settings.Secure;
|
import android.provider.Settings.Secure;
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto;
|
import com.android.internal.logging.nano.MetricsProto;
|
||||||
@@ -59,6 +62,7 @@ import java.util.List;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Matchers.anyBoolean;
|
import static org.mockito.Matchers.anyBoolean;
|
||||||
|
import static org.mockito.Matchers.anyInt;
|
||||||
import static org.mockito.Matchers.anyString;
|
import static org.mockito.Matchers.anyString;
|
||||||
import static org.mockito.Matchers.eq;
|
import static org.mockito.Matchers.eq;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
@@ -84,6 +88,12 @@ public class SuggestionFeatureProviderImplTest {
|
|||||||
private Tile mSuggestion;
|
private Tile mSuggestion;
|
||||||
@Mock
|
@Mock
|
||||||
private ActivityManager mActivityManager;
|
private ActivityManager mActivityManager;
|
||||||
|
@Mock
|
||||||
|
private PackageManager mPackageManager;
|
||||||
|
@Mock
|
||||||
|
private FingerprintManager mFingerprintManager;
|
||||||
|
@Mock
|
||||||
|
private SharedPreferences mSharedPreferences;
|
||||||
|
|
||||||
private FakeFeatureFactory mFactory;
|
private FakeFeatureFactory mFactory;
|
||||||
private SuggestionFeatureProviderImpl mProvider;
|
private SuggestionFeatureProviderImpl mProvider;
|
||||||
@@ -93,9 +103,14 @@ public class SuggestionFeatureProviderImplTest {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
FakeFeatureFactory.setupForTest(mContext);
|
FakeFeatureFactory.setupForTest(mContext);
|
||||||
mFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
|
mFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
|
||||||
|
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
||||||
|
// Explicit casting to object due to MockitoCast bug
|
||||||
|
when((Object) mContext.getSystemService(FingerprintManager.class))
|
||||||
|
.thenReturn(mFingerprintManager);
|
||||||
when(mContext.getApplicationContext()).thenReturn(RuntimeEnvironment.application);
|
when(mContext.getApplicationContext()).thenReturn(RuntimeEnvironment.application);
|
||||||
when(mContext.getSystemService(Context.ACTIVITY_SERVICE)).thenReturn(mActivityManager);
|
when(mContext.getSystemService(Context.ACTIVITY_SERVICE)).thenReturn(mActivityManager);
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
|
|
||||||
mSuggestion.intent = new Intent().setClassName("pkg", "cls");
|
mSuggestion.intent = new Intent().setClassName("pkg", "cls");
|
||||||
mSuggestion.category = "category";
|
mSuggestion.category = "category";
|
||||||
|
|
||||||
@@ -210,39 +225,56 @@ public class SuggestionFeatureProviderImplTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(shadows = SettingsShadowResources.class)
|
public void isSuggestionCompleted_swipeToNotification_trueWhenNotHardwareNotAvailable() {
|
||||||
public void isSuggestionCompleted_swipeToNotification_trueWhenNotAvailable() {
|
stubFingerprintSupported(true);
|
||||||
SettingsShadowResources.overrideResource(
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
|
||||||
com.android.internal.R.bool.config_supportSystemNavigationKeys, false);
|
when(mContext.getResources().
|
||||||
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
|
.thenReturn(true);
|
||||||
|
|
||||||
assertThat(mProvider.isSuggestionCompleted(RuntimeEnvironment.application,
|
assertThat(mProvider.isSuggestionCompleted(mContext,
|
||||||
new ComponentName(RuntimeEnvironment.application,
|
new ComponentName(mContext, SwipeToNotificationSuggestionActivity.class))).isTrue();
|
||||||
SwipeToNotificationSuggestionActivity.class))).isTrue();
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isSuggestionCompleted_swipeToNotification_trueWhenNotAvailable() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
|
when(mContext.getResources().
|
||||||
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
|
.thenReturn(false);
|
||||||
|
|
||||||
|
assertThat(mProvider.isSuggestionCompleted(mContext,
|
||||||
|
new ComponentName(mContext, SwipeToNotificationSuggestionActivity.class))).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(shadows = SettingsShadowResources.class)
|
|
||||||
public void isSuggestionCompleted_swipeToNotification_falseWhenNotVisited() {
|
public void isSuggestionCompleted_swipeToNotification_falseWhenNotVisited() {
|
||||||
SettingsShadowResources.overrideResource(
|
stubFingerprintSupported(true);
|
||||||
com.android.internal.R.bool.config_supportSystemNavigationKeys, true);
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
|
when(mContext.getResources().
|
||||||
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
|
.thenReturn(true);
|
||||||
// No stored value in shared preferences if not visited yet.
|
// No stored value in shared preferences if not visited yet.
|
||||||
|
|
||||||
assertThat(mProvider.isSuggestionCompleted(RuntimeEnvironment.application,
|
assertThat(mProvider.isSuggestionCompleted(mContext,
|
||||||
new ComponentName(RuntimeEnvironment.application,
|
new ComponentName(mContext,
|
||||||
SwipeToNotificationSuggestionActivity.class))).isFalse();
|
SwipeToNotificationSuggestionActivity.class))).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Config(shadows = SettingsShadowResources.class)
|
|
||||||
public void isSuggestionCompleted_swipeToNotification_trueWhenVisited() {
|
public void isSuggestionCompleted_swipeToNotification_trueWhenVisited() {
|
||||||
SettingsShadowResources.overrideResource(
|
stubFingerprintSupported(true);
|
||||||
com.android.internal.R.bool.config_supportSystemNavigationKeys, true);
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
mProvider.getSharedPrefs(RuntimeEnvironment.application).edit().putBoolean(
|
when(mContext.getResources().
|
||||||
SwipeToNotificationSettings.PREF_KEY_SUGGESTION_COMPLETE, true).commit();
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
|
.thenReturn(true);
|
||||||
|
when(mContext.getSharedPreferences(anyString(), anyInt())).thenReturn(mSharedPreferences);
|
||||||
|
when(mSharedPreferences.getBoolean(
|
||||||
|
SwipeToNotificationSettings.PREF_KEY_SUGGESTION_COMPLETE, false)).thenReturn(true);
|
||||||
|
|
||||||
assertThat(mProvider.isSuggestionCompleted(RuntimeEnvironment.application,
|
assertThat(mProvider.isSuggestionCompleted(mContext,
|
||||||
new ComponentName(RuntimeEnvironment.application,
|
new ComponentName(mContext, SwipeToNotificationSuggestionActivity.class))).isTrue();
|
||||||
SwipeToNotificationSuggestionActivity.class))).isTrue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -360,6 +392,11 @@ public class SuggestionFeatureProviderImplTest {
|
|||||||
PackageManager.DONT_KILL_APP);
|
PackageManager.DONT_KILL_APP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stubFingerprintSupported(boolean enabled) {
|
||||||
|
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
|
||||||
|
.thenReturn(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void filterExclusiveSuggestions_shouldOnlyKeepFirst3() {
|
public void filterExclusiveSuggestions_shouldOnlyKeepFirst3() {
|
||||||
final List<Tile> suggestions = new ArrayList<>();
|
final List<Tile> suggestions = new ArrayList<>();
|
||||||
|
@@ -78,6 +78,7 @@ public class SuggestionsChecksTest {
|
|||||||
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded() {
|
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded() {
|
||||||
stubFingerprintSupported(true);
|
stubFingerprintSupported(true);
|
||||||
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(true);
|
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
Tile tile = createFingerprintTile();
|
Tile tile = createFingerprintTile();
|
||||||
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
|
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
|
||||||
}
|
}
|
||||||
@@ -86,10 +87,20 @@ public class SuggestionsChecksTest {
|
|||||||
public void testFingerprintEnrollmentIntroductionIsNotCompleteWhenNoFingerprintAdded() {
|
public void testFingerprintEnrollmentIntroductionIsNotCompleteWhenNoFingerprintAdded() {
|
||||||
stubFingerprintSupported(true);
|
stubFingerprintSupported(true);
|
||||||
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
|
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
Tile tile = createFingerprintTile();
|
Tile tile = createFingerprintTile();
|
||||||
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isFalse();
|
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFingerprintEnrollmentIntroductionIsCompleteWhenHardwareNotDetected() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
|
||||||
|
Tile tile = createFingerprintTile();
|
||||||
|
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintNotSupported() {
|
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintNotSupported() {
|
||||||
stubFingerprintSupported(false);
|
stubFingerprintSupported(false);
|
||||||
@@ -101,6 +112,7 @@ public class SuggestionsChecksTest {
|
|||||||
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintDisabled() {
|
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintDisabled() {
|
||||||
stubFingerprintSupported(true);
|
stubFingerprintSupported(true);
|
||||||
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
|
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(), anyInt()))
|
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(), anyInt()))
|
||||||
.thenReturn(DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT);
|
.thenReturn(DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT);
|
||||||
|
|
||||||
|
@@ -18,7 +18,9 @@ package com.android.settings.gestures;
|
|||||||
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
import com.android.settings.search.InlinePayload;
|
import com.android.settings.search.InlinePayload;
|
||||||
@@ -52,6 +54,10 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
|
|
||||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
@Mock
|
||||||
|
private PackageManager mPackageManager;
|
||||||
|
@Mock
|
||||||
|
private FingerprintManager mFingerprintManager;
|
||||||
|
|
||||||
private SwipeToNotificationPreferenceController mController;
|
private SwipeToNotificationPreferenceController mController;
|
||||||
private static final String KEY_SWIPE_DOWN = "gesture_swipe_down_fingerprint";
|
private static final String KEY_SWIPE_DOWN = "gesture_swipe_down_fingerprint";
|
||||||
@@ -60,10 +66,27 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
public void setUp() {
|
public void setUp() {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
mController = new SwipeToNotificationPreferenceController(mContext, null, KEY_SWIPE_DOWN);
|
mController = new SwipeToNotificationPreferenceController(mContext, null, KEY_SWIPE_DOWN);
|
||||||
|
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
||||||
|
// Explicit casting to object due to MockitoCast bug
|
||||||
|
when((Object) mContext.getSystemService(FingerprintManager.class))
|
||||||
|
.thenReturn(mFingerprintManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isAvailable_hardwareNotAvailable_shouldReturnFalse() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
|
||||||
|
when(mContext.getResources().
|
||||||
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
|
.thenReturn(true);
|
||||||
|
|
||||||
|
assertThat(mController.isAvailable()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isAvailable_configIsTrue_shouldReturnTrue() {
|
public void isAvailable_configIsTrue_shouldReturnTrue() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
when(mContext.getResources().
|
when(mContext.getResources().
|
||||||
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
@@ -73,6 +96,8 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isAvailable_configIsFalse_shouldReturnFalse() {
|
public void isAvailable_configIsFalse_shouldReturnFalse() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
when(mContext.getResources().
|
when(mContext.getResources().
|
||||||
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys))
|
||||||
.thenReturn(false);
|
.thenReturn(false);
|
||||||
@@ -82,6 +107,8 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSwitchEnabled_configIsSet_shouldReturnTrue() {
|
public void testSwitchEnabled_configIsSet_shouldReturnTrue() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
// Set the setting to be enabled.
|
// Set the setting to be enabled.
|
||||||
final Context context = ShadowApplication.getInstance().getApplicationContext();
|
final Context context = ShadowApplication.getInstance().getApplicationContext();
|
||||||
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 1);
|
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 1);
|
||||||
@@ -92,6 +119,8 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSwitchEnabled_configIsNotSet_shouldReturnFalse() {
|
public void testSwitchEnabled_configIsNotSet_shouldReturnFalse() {
|
||||||
|
stubFingerprintSupported(true);
|
||||||
|
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||||
// Set the setting to be disabled.
|
// Set the setting to be disabled.
|
||||||
final Context context = ShadowApplication.getInstance().getApplicationContext();
|
final Context context = ShadowApplication.getInstance().getApplicationContext();
|
||||||
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 0);
|
Settings.System.putInt(context.getContentResolver(), SYSTEM_NAVIGATION_KEYS_ENABLED, 0);
|
||||||
@@ -139,4 +168,9 @@ public class SwipeToNotificationPreferenceControllerTest {
|
|||||||
|
|
||||||
assertThat(newValue).isEqualTo(currentValue);
|
assertThat(newValue).isEqualTo(currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void stubFingerprintSupported(boolean enabled) {
|
||||||
|
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
|
||||||
|
.thenReturn(enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user