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

Commit 1d548591 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Update category to intent action

Test: settings unit tests
Bug: 254339351
Change-Id: I6c4bfb474408cd9ab95ae3fbd80a89760a4b7844
parent 5702ae9f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -38,9 +38,7 @@ public class MoreSettingsPreferenceController extends BasePreferenceController {

    PackageManager mPm;
    String mPackage;
    int mUserId;
    Intent mIntent = new Intent(Intent.ACTION_MAIN)
            .addCategory(NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
    Intent mIntent = new Intent(NotificationListenerService.ACTION_SETTINGS_HOME);

    public MoreSettingsPreferenceController(Context context) {
        super(context, KEY_MORE_SETTINGS);
+4 −7
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_U
import static com.google.common.truth.Truth.assertThat;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@@ -73,9 +72,8 @@ public class MoreSettingsPreferenceControllerTest {

        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
        assertThat(captor.getValue().getPackage()).isEqualTo(mPkg);
        assertThat(captor.getValue().getAction()).isEqualTo(Intent.ACTION_MAIN);
        assertThat(captor.getValue().getCategories()).contains(
                NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
        assertThat(captor.getValue().getAction()).contains(
                NotificationListenerService.ACTION_SETTINGS_HOME);
    }

    @Test
@@ -92,8 +90,7 @@ public class MoreSettingsPreferenceControllerTest {
        mController.updateState(preference);

        assertThat(preference.getIntent().getPackage()).isEqualTo(mPkg);
        assertThat(preference.getIntent().getAction()).isEqualTo(Intent.ACTION_MAIN);
        assertThat(preference.getIntent().getCategories()).contains(
                NotificationListenerService.INTENT_CATEGORY_SETTINGS_HOME);
        assertThat(preference.getIntent().getAction()).isEqualTo(
                NotificationListenerService.ACTION_SETTINGS_HOME);
    }
}