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

Commit d8e61555 authored by guangl's avatar guangl Committed by Gerrit - the friendly Code Review server
Browse files

Settings: Fix settings force close in monkey test.

No Activity found to handle Intent
{act=android.intent.action.MANAGE_PERMISSIONS}

Check whether activity exists befor start activity.

Change-Id: Ie373d760cbd22a3b24b4b735b3a5fbe290fc25c4
CRs-Fixed: 1069238
parent d452c75e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -63,7 +63,10 @@ public class AdvancedAppSettings extends SettingsPreferenceFragment implements
        addPreferencesFromResource(R.xml.advanced_apps);

        Preference permissions = getPreferenceScreen().findPreference(KEY_APP_PERM);
        permissions.setIntent(new Intent(Intent.ACTION_MANAGE_PERMISSIONS));
        final Intent intent = new Intent(Intent.ACTION_MANAGE_PERMISSIONS);
        if (!getPackageManager().queryIntentActivities(intent, 0).isEmpty()) {
            permissions.setIntent(intent);
        }

        ApplicationsState applicationsState = ApplicationsState.getInstance(
                getActivity().getApplication());