Removes logic to disable gesture nav when default home app changes

Bug: 137197916
Test: Manual test with setting a 3P launcher as default
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SystemNavigationGestureSettingsTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SystemNavigationPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=RadioButtonPreferenceWithExtraWidgetTest
Change-Id: Id397cfa1c2439222aa21a7b7fe5f69818bf1fe97
This commit is contained in:
Mehdi Alizadeh
2019-07-18 15:27:05 -07:00
parent 5fc6db2cf7
commit 1aaf41b2dc
4 changed files with 3 additions and 153 deletions

View File

@@ -24,7 +24,6 @@ import static com.android.settings.gestures.SystemNavigationPreferenceController
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import android.content.ComponentName;
@@ -181,46 +180,4 @@ public class SystemNavigationPreferenceControllerTest {
assertThat(TextUtils.equals(mController.getSummary(), mContext.getText(
com.android.settings.R.string.swipe_up_to_switch_apps_title))).isTrue();
}
@Test
public void testIsGestureNavSupportedByDefaultLauncher_noDefaultLauncher() {
when(mMockPackageManager.getHomeActivities(any())).thenReturn(null);
assertThat(SystemNavigationPreferenceController
.isGestureNavSupportedByDefaultLauncher(mMockContext)).isTrue();
}
@Test
public void testIsGestureNavSupportedByDefaultLauncher_supported() {
when(mMockPackageManager.getHomeActivities(any())).thenReturn(
ComponentName.unflattenFromString(TEST_RECENTS_COMPONENT_NAME));
assertThat(SystemNavigationPreferenceController
.isGestureNavSupportedByDefaultLauncher(mMockContext)).isTrue();
}
@Test
public void testIsGestureNavSupportedByDefaultLauncher_notSupported() {
when(mMockPackageManager.getHomeActivities(any())).thenReturn(
new ComponentName("unsupported", "launcher"));
assertThat(SystemNavigationPreferenceController
.isGestureNavSupportedByDefaultLauncher(mMockContext)).isFalse();
}
@Test
public void testGetDefaultHomeAppName_noDefaultLauncher() {
when(mMockPackageManager.getHomeActivities(any())).thenReturn(null);
assertThat(SystemNavigationPreferenceController
.getDefaultHomeAppName(mMockContext)).isEqualTo("");
}
@Test
public void testGetDefaultHomeAppName_defaultLauncherExists() throws Exception {
when(mMockPackageManager.getHomeActivities(any())).thenReturn(
new ComponentName("supported", "launcher"));
ApplicationInfo info = new ApplicationInfo();
when(mMockPackageManager.getApplicationInfo("supported", 0)).thenReturn(info);
when(mMockPackageManager.getApplicationLabel(info)).thenReturn("Test Home App");
assertThat(SystemNavigationPreferenceController
.getDefaultHomeAppName(mMockContext)).isEqualTo("Test Home App");
}
}