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

Commit cec65e94 authored by Peter Visontay's avatar Peter Visontay
Browse files

Fix the app ops settings tests by adding FLAG_ACTIVITY_NEW_TASK to Intents.

Test: make -j32 SettingsUnitTests && adb install -r out/target/product/marlin/data/app/SettingsUnitTests/SettingsUnitTests.apk && adb shell am instrument -w -e class com.android.settings.applications.ExternalSourcesSettingsTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Change-Id: I187d68e6b214d975df0fe2a3d5dc88cadec35fa3
parent 06af7c8d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@
 */
package com.android.settings.applications;

import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
@@ -95,7 +98,9 @@ abstract public class AppOpsSettingsTest {
     * Creates an intent for showing the permission settings for all apps.
     */
    private Intent createManageAllAppsIntent() {
        return new Intent(mActivityAction);
        final Intent intent = new Intent(mActivityAction);
        intent.addFlags(FLAG_ACTIVITY_CLEAR_TASK | FLAG_ACTIVITY_NEW_TASK);
        return intent;
    }

    /**