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

Commit a2425603 authored by Rajeev Kumar's avatar Rajeev Kumar Committed by Android (Google) Code Review
Browse files

Merge "Stop showing Picture in Picture for Android Go."

parents 8a2e755e ebf850ed
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -19,14 +19,12 @@ import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.support.v7.preference.Preference;

import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;

import java.util.ArrayList;
import java.util.List;

@@ -35,7 +33,8 @@ public class SpecialAccessSettings extends DashboardFragment {
    private static final String TAG = "SpecialAccessSettings";

    private static final String[] DISABLED_FEATURES_LOW_RAM =
            new String[] {"notification_access", "zen_access", "enabled_vr_listeners"};
            new String[]{"notification_access", "zen_access", "enabled_vr_listeners",
                    "picture_in_picture"};

    @Override
    protected String getLogTag() {
+14 −7
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withText;

import static junit.framework.Assert.assertTrue;

import android.app.ActivityManager;
import android.app.Instrumentation;
import android.content.Context;
@@ -32,10 +30,6 @@ import android.provider.Settings;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiSelector;


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,7 +53,7 @@ public class ManagedAccessSettingsLowRamTest {
                com.android.settings.Settings.SpecialAccessSettingsActivity.class));

        String[] managedServiceLabels = new String[] {"Do Not Disturb access",
                "VR helper services", "Notification access"};
                "VR helper services", "Notification access", "Picture-in-picture"};
        for (String label : managedServiceLabels) {
            if (ActivityManager.isLowRamDeviceStatic()) {
                onView(withText(label)).check(doesNotExist());
@@ -111,4 +105,17 @@ public class ManagedAccessSettingsLowRamTest {
        }
    }

    @Test
    public void launchPictureInPictureSetting_onlyWorksIfNotLowRam() {
        final Intent intent = new Intent(Settings.ACTION_PICTURE_IN_PICTURE_SETTINGS);

        mInstrumentation.startActivitySync(intent);

        final String label = "This feature is not available on this device";
        if (ActivityManager.isLowRamDeviceStatic()) {
            onView(withText(label)).check(matches(isDisplayed()));
        } else {
            onView(withText(label)).check(doesNotExist());
        }
    }
}