Update DoubleTapScreenPrefCtrl to sdk 26
Test: make RunSettingsRoboTests -j40 Change-Id: Ia4ed886381e2758b7b1523648833fc57ca58a5b3
This commit is contained in:
@@ -22,6 +22,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.internal.hardware.AmbientDisplayConfiguration;
|
||||
import com.android.settings.R;
|
||||
@@ -55,8 +56,13 @@ public class DoubleTapScreenPreferenceController extends GesturePreferenceContro
|
||||
}
|
||||
|
||||
public static boolean isSuggestionComplete(Context context, SharedPreferences prefs) {
|
||||
AmbientDisplayConfiguration ambientConfig = new AmbientDisplayConfiguration(context);
|
||||
return !ambientConfig.pulseOnDoubleTapAvailable()
|
||||
return isSuggestionComplete(new AmbientDisplayConfiguration(context), prefs);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
static boolean isSuggestionComplete(AmbientDisplayConfiguration config,
|
||||
SharedPreferences prefs) {
|
||||
return !config.pulseOnDoubleTapAvailable()
|
||||
|| prefs.getBoolean(DoubleTapScreenSettings.PREF_KEY_SUGGESTION_COMPLETE, false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user