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

Commit 128fd39a authored by Maurice Lam's avatar Maurice Lam Committed by Android (Google) Code Review
Browse files

Merge "Add intent action to support page" into oc-dr1-dev

parents 9f1e9117 5f0edba5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3038,6 +3038,10 @@
            <intent-filter android:priority="-2">
                <action android:name="com.android.settings.action.SETTINGS"/>
            </intent-filter>
            <intent-filter>
                <action android:name="com.android.settings.action.SUPPORT_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data android:name="com.android.settings.category"
                       android:value="com.android.settings.category.ia.homepage"/>
            <meta-data android:name="com.android.settings.summary"
+17 −2
Original line number Diff line number Diff line
@@ -17,8 +17,12 @@
package com.android.settings.support;


import static com.google.common.truth.Truth.assertThat;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
@@ -33,8 +37,6 @@ import org.robolectric.annotation.Config;

import java.util.List;

import static com.google.common.truth.Truth.assertThat;

@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class SupportDashboardActivityTest {
@@ -62,4 +64,17 @@ public class SupportDashboardActivityTest {
        assertThat(value.intentTargetClass).isEqualTo(SupportDashboardActivity.class.getName());
        assertThat(value.intentAction).isEqualTo(Intent.ACTION_MAIN);
    }

    @Test
    public void shouldHandleIntentAction() {
        RuntimeEnvironment.getRobolectricPackageManager().setQueryIntentImplicitly(true);
        // Intent action used by setup wizard to start support settings
        Intent intent = new Intent("com.android.settings.action.SUPPORT_SETTINGS");
        ResolveInfo resolveInfo = RuntimeEnvironment.getPackageManager().resolveActivity(
                intent,
                PackageManager.MATCH_DEFAULT_ONLY);
        assertThat(resolveInfo).isNotNull();
        assertThat(resolveInfo.activityInfo.targetActivity)
                .isEqualTo(SupportDashboardActivity.class.getName());
    }
}