Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfcef072 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I7925482b,Ia4ed8863,Ia322a8c9

* changes:
  move gestures package to sdk 26
  Update DoubleTapScreenPrefCtrl to sdk 26
  Update PickupGesturePrefCtrlTest to sdk 26
parents 06747ef9 942dd5e2
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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);
    }

+7 −1
Original line number Diff line number Diff line
@@ -24,6 +24,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;
@@ -90,7 +91,7 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll

    @Override
    public boolean canHandleClicks() {
        return mAmbientConfig.pulseOnPickupCanBeModified(mUserId);
        return pulseOnPickupCanBeModified();
    }

    @Override
@@ -102,4 +103,9 @@ public class PickupGesturePreferenceController extends GesturePreferenceControll
        return new InlineSwitchPayload(SECURE_KEY, ResultPayload.SettingsSource.SECURE,
                ON /* onValue */, intent, isAvailable(), ON /* defaultValue */);
    }

    @VisibleForTesting
    boolean pulseOnPickupCanBeModified() {
        return mAmbientConfig.pulseOnPickupCanBeModified(mUserId);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(
    manifest = TestConfig.MANIFEST_PATH,
    sdk = TestConfig.SDK_VERSION,
    sdk = TestConfig.SDK_VERSION_O,
    shadows = ShadowSecureSettings.class
)
public class AssistGestureSettingsPreferenceControllerTest {
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ import org.robolectric.shadows.ShadowApplication;
import java.util.List;

@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AssistGestureSettingsTest {
    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
    private Context mContext;
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;

@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
        SettingsShadowResources.class
})
public class DoubleTapPowerPreferenceControllerTest {
Loading