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

Commit 5f0edba5 authored by Maurice Lam's avatar Maurice Lam
Browse files

Add intent action to support page

Test: cd tests/robotests && mma
Bug: 62348910
Change-Id: I65b8290bc5bf47803349de92b2560099e7dda402
(cherry picked from commit 1bf5454f)
parent f9283247
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.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());
    }
}