Merge "Moves Swipe Up overlay from Settings app to android.internal" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9a93a1dbe9
@@ -131,7 +131,4 @@
|
||||
<!-- List of a11y components on the device allowed to be enabled by Settings Slices -->
|
||||
<string-array name="config_settings_slices_accessibility_components" translatable="false"/>
|
||||
|
||||
<!-- Whether or not swipe up gesture's opt-in setting is available on this device -->
|
||||
<bool name="config_swipe_up_gesture_setting_available">false</bool>
|
||||
|
||||
</resources>
|
||||
|
@@ -24,7 +24,7 @@ import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.internal.R;
|
||||
|
||||
public class SwipeUpPreferenceController extends GesturePreferenceController {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class SwipeUpPreferenceController extends GesturePreferenceController {
|
||||
}
|
||||
|
||||
final ComponentName recentsComponentName = ComponentName.unflattenFromString(
|
||||
context.getString(com.android.internal.R.string.config_recentsComponentName));
|
||||
context.getString(R.string.config_recentsComponentName));
|
||||
final Intent quickStepIntent = new Intent(ACTION_QUICKSTEP)
|
||||
.setPackage(recentsComponentName.getPackageName());
|
||||
if (context.getPackageManager().resolveService(quickStepIntent,
|
||||
@@ -81,7 +81,7 @@ public class SwipeUpPreferenceController extends GesturePreferenceController {
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
final int defaultValue = mContext.getResources()
|
||||
.getBoolean(com.android.internal.R.bool.config_swipe_up_gesture_default) ? ON : OFF;
|
||||
.getBoolean(R.bool.config_swipe_up_gesture_default) ? ON : OFF;
|
||||
final int swipeUpEnabled = Settings.Secure.getInt(mContext.getContentResolver(),
|
||||
Settings.Secure.SWIPE_UP_TO_SWITCH_APPS_ENABLED, defaultValue);
|
||||
return swipeUpEnabled != OFF;
|
||||
|
@@ -27,7 +27,7 @@ import android.content.pm.ResolveInfo;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.internal.R;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.testutils.shadow.SettingsShadowResources;
|
||||
|
||||
@@ -57,8 +57,7 @@ public class SwipeUpPreferenceControllerTest {
|
||||
public void setUp() {
|
||||
SettingsShadowResources.overrideResource(R.bool.config_swipe_up_gesture_setting_available,
|
||||
true);
|
||||
SettingsShadowResources.overrideResource(
|
||||
com.android.internal.R.bool.config_swipe_up_gesture_default, true);
|
||||
SettingsShadowResources.overrideResource(R.bool.config_swipe_up_gesture_default, true);
|
||||
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mPackageManager = Shadows.shadowOf(mContext.getPackageManager());
|
||||
@@ -107,8 +106,7 @@ public class SwipeUpPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void testIsChecked_defaultIsFalse_shouldReturnFalse() {
|
||||
SettingsShadowResources.overrideResource(
|
||||
com.android.internal.R.bool.config_swipe_up_gesture_default, false);
|
||||
SettingsShadowResources.overrideResource(R.bool.config_swipe_up_gesture_default, false);
|
||||
assertThat(mController.isChecked()).isFalse();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user