Update category to intent action
Test: settings unit tests Bug: 254339351 Change-Id: I6c4bfb474408cd9ab95ae3fbd80a89760a4b7844
This commit is contained in:
@@ -38,9 +38,7 @@ public class MoreSettingsPreferenceController extends BasePreferenceController {
|
|||||||
|
|
||||||
PackageManager mPm;
|
PackageManager mPm;
|
||||||
String mPackage;
|
String mPackage;
|
||||||
int mUserId;
|
Intent mIntent = new Intent(NotificationListenerService.ACTION_SETTINGS_HOME);
|
||||||
Intent mIntent = new Intent(Intent.ACTION_MAIN)
|
|
||||||
.addCategory(NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
|
|
||||||
|
|
||||||
public MoreSettingsPreferenceController(Context context) {
|
public MoreSettingsPreferenceController(Context context) {
|
||||||
super(context, KEY_MORE_SETTINGS);
|
super(context, KEY_MORE_SETTINGS);
|
||||||
|
@@ -22,7 +22,6 @@ import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_U
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@@ -73,9 +72,8 @@ public class MoreSettingsPreferenceControllerTest {
|
|||||||
|
|
||||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||||
assertThat(captor.getValue().getPackage()).isEqualTo(mPkg);
|
assertThat(captor.getValue().getPackage()).isEqualTo(mPkg);
|
||||||
assertThat(captor.getValue().getAction()).isEqualTo(Intent.ACTION_MAIN);
|
assertThat(captor.getValue().getAction()).contains(
|
||||||
assertThat(captor.getValue().getCategories()).contains(
|
NotificationListenerService.ACTION_SETTINGS_HOME);
|
||||||
NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -92,8 +90,7 @@ public class MoreSettingsPreferenceControllerTest {
|
|||||||
mController.updateState(preference);
|
mController.updateState(preference);
|
||||||
|
|
||||||
assertThat(preference.getIntent().getPackage()).isEqualTo(mPkg);
|
assertThat(preference.getIntent().getPackage()).isEqualTo(mPkg);
|
||||||
assertThat(preference.getIntent().getAction()).isEqualTo(Intent.ACTION_MAIN);
|
assertThat(preference.getIntent().getAction()).isEqualTo(
|
||||||
assertThat(preference.getIntent().getCategories()).contains(
|
NotificationListenerService.ACTION_SETTINGS_HOME);
|
||||||
NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user