Snap for 11691493 from 1f00d38d2d to 24Q3-release
Change-Id: Id39cdc4cfb530dc6c541cc21dac50ff2a46cf6d1
This commit is contained in:
@@ -62,7 +62,8 @@
|
||||
android:focusable="true"
|
||||
android:longClickable="true"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Body1"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:typeface="monospace" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -387,6 +387,9 @@
|
||||
<!-- Whether Wi-Fi hotspot speed should be shown or not. -->
|
||||
<bool name="config_show_wifi_hotspot_speed">true</bool>
|
||||
|
||||
<!-- Whether or not Internet preference should be shown. -->
|
||||
<bool name="config_show_internet_settings">true</bool>
|
||||
|
||||
<!-- Whether toggle_airplane is available or not. -->
|
||||
<bool name="config_show_toggle_airplane">true</bool>
|
||||
|
||||
|
||||
@@ -11107,6 +11107,9 @@
|
||||
<!-- Title of the warning dialog for enabling the credential provider. [CHAR_LIMIT=NONE] -->
|
||||
<string name="credman_enable_confirmation_message_title">Use %1$s\?</string>
|
||||
|
||||
<!-- Content description for credential manager provider on/off switch. [CHAR_LIMIT=NONE] -->
|
||||
<string name="credman_on_off_switch_content_description">%1$s on/off</string>
|
||||
|
||||
<!-- Positive button text for disabling credential manager. [CHAR_LIMIT=30] -->
|
||||
<string name="credman_confirmation_turn_off_positive_button">Turn off</string>
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
android:title="@string/account_dashboard_title_with_passkeys"
|
||||
settings:keywords="@string/keywords_accounts">
|
||||
|
||||
<com.android.settingslib.widget.TopIntroPreference
|
||||
android:title="@string/credman_main_settings_intro_text" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="default_service_category"
|
||||
android:order="10"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<ListPreference
|
||||
android:key="calls_preference"
|
||||
android:title="@string/calls_preference"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:enabled="false"
|
||||
settings:controller="com.android.settings.network.telephony.CallsDefaultSubscriptionController"
|
||||
settings:allowDividerAbove="true"/>
|
||||
@@ -43,6 +44,7 @@
|
||||
<ListPreference
|
||||
android:key="sms_preference"
|
||||
android:title="@string/sms_preference"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:enabled="false"
|
||||
settings:controller="com.android.settings.network.telephony.SmsDefaultSubscriptionController"/>
|
||||
|
||||
|
||||
@@ -72,8 +72,7 @@ public abstract class AppCounter extends AsyncTask<Void, Void, Integer> {
|
||||
}
|
||||
|
||||
private boolean isArchivingEnabled() {
|
||||
return mFf.archiving() || SystemProperties.getBoolean("pm.archiving.enabled", false)
|
||||
|| Flags.appArchiving();
|
||||
return mFf.archiving() || Flags.appArchiving();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1072,6 +1072,22 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
|
||||
return mChecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(@Nullable CharSequence title) {
|
||||
super.setTitle(title);
|
||||
maybeUpdateContentDescription();
|
||||
}
|
||||
|
||||
private void maybeUpdateContentDescription() {
|
||||
final CharSequence appName = getTitle();
|
||||
|
||||
if (mSwitch != null && !TextUtils.isEmpty(appName)) {
|
||||
mSwitch.setContentDescription(
|
||||
getContext().getString(
|
||||
R.string.credman_on_off_switch_content_description, appName));
|
||||
}
|
||||
}
|
||||
|
||||
public void setPreferenceListener(OnCombiPreferenceClickListener onClickListener) {
|
||||
mOnClickListener = onClickListener;
|
||||
}
|
||||
@@ -1094,6 +1110,9 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
|
||||
|
||||
// Store this for later.
|
||||
mSwitch = switchView;
|
||||
|
||||
// Update the content description.
|
||||
maybeUpdateContentDescription();
|
||||
}
|
||||
|
||||
super.setOnPreferenceClickListener(
|
||||
|
||||
@@ -129,6 +129,7 @@ public class PrimaryProviderPreference extends GearPreference {
|
||||
}
|
||||
});
|
||||
setVisibility(mOpenButton, mOpenButtonVisible);
|
||||
holder.itemView.setClickable(false);
|
||||
|
||||
mChangeButton = (Button) holder.findViewById(R.id.change_button);
|
||||
mChangeButton.setOnClickListener(
|
||||
|
||||
@@ -448,7 +448,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
|
||||
switch (mType) {
|
||||
case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION:
|
||||
case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY:
|
||||
return String.format(Locale.US, "%06d", passkey);
|
||||
return String.format(Locale.getDefault(), "%06d", passkey);
|
||||
|
||||
case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN:
|
||||
return String.format("%04d", passkey);
|
||||
|
||||
@@ -43,6 +43,9 @@ public class EraseEuiccDataDialogFragment extends InstrumentedDialogFragment imp
|
||||
"com.android.settings.network";
|
||||
|
||||
public static void show(ResetDashboardFragment host) {
|
||||
if (host.getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
final EraseEuiccDataDialogFragment dialog = new EraseEuiccDataDialogFragment();
|
||||
dialog.setTargetFragment(host, 0 /* requestCode */);
|
||||
final FragmentManager manager = host.getActivity().getSupportFragmentManager();
|
||||
|
||||
@@ -33,14 +33,25 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.system.ResetDashboardFragment;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settingslib.core.lifecycle.ObservableDialogFragment;
|
||||
|
||||
public class EuiccRacConnectivityDialogFragment extends InstrumentedDialogFragment
|
||||
implements DialogInterface.OnClickListener {
|
||||
public class EuiccRacConnectivityDialogFragment extends ObservableDialogFragment
|
||||
implements DialogInterface.OnClickListener, DialogInterface.OnCancelListener {
|
||||
public static final String TAG = "EuiccRacConnectivityDlg";
|
||||
private static final int METRICS_TAG =
|
||||
SettingsEnums.ACTION_RESET_ESIMS_RAC_CONNECTIVITY_WARNING;
|
||||
private static final int METRICS_CANCEL_VALUE = 0;
|
||||
private static final int METRICS_CONTINUE_VALUE = 1;
|
||||
|
||||
private MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
|
||||
static void show(ResetDashboardFragment host) {
|
||||
if (host.getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
final EuiccRacConnectivityDialogFragment dialog = new EuiccRacConnectivityDialogFragment();
|
||||
dialog.setTargetFragment(host, /* requestCode= */ 0);
|
||||
final FragmentManager manager = host.getActivity().getSupportFragmentManager();
|
||||
@@ -48,8 +59,9 @@ public class EuiccRacConnectivityDialogFragment extends InstrumentedDialogFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return SettingsEnums.RESET_EUICC;
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -62,7 +74,7 @@ public class EuiccRacConnectivityDialogFragment extends InstrumentedDialogFragme
|
||||
new AlertDialog.Builder(getContext())
|
||||
.setOnDismissListener(this)
|
||||
// Return is on the right side
|
||||
.setPositiveButton(R.string.wifi_warning_return_button, null)
|
||||
.setPositiveButton(R.string.wifi_warning_return_button, this)
|
||||
// Continue is on the left side
|
||||
.setNegativeButton(R.string.wifi_warning_continue_button, this);
|
||||
|
||||
@@ -109,7 +121,24 @@ public class EuiccRacConnectivityDialogFragment extends InstrumentedDialogFragme
|
||||
// Positions of the buttons have been switch:
|
||||
// negative button = left button = the button to continue
|
||||
if (which == DialogInterface.BUTTON_NEGATIVE) {
|
||||
logMetrics(METRICS_CONTINUE_VALUE);
|
||||
EraseEuiccDataDialogFragment.show(((ResetDashboardFragment) fragment));
|
||||
} else {
|
||||
logMetrics(METRICS_CANCEL_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(@NonNull DialogInterface dialog) {
|
||||
final Fragment fragment = getTargetFragment();
|
||||
if (!(fragment instanceof ResetDashboardFragment)) {
|
||||
Log.e(TAG, "getTargetFragment return unexpected type");
|
||||
return;
|
||||
}
|
||||
logMetrics(METRICS_CANCEL_VALUE);
|
||||
}
|
||||
|
||||
private void logMetrics(int value) {
|
||||
mMetricsFeatureProvider.action(getActivity(), METRICS_TAG, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class InternetPreferenceController extends AbstractPreferenceController i
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_internet_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.wifi.WifiPickerTrackerHelper;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
/**
|
||||
@@ -117,12 +116,6 @@ public class NetworkMobileProviderController extends BasePreferenceController im
|
||||
mPreferenceCategory.setVisible(available);
|
||||
}
|
||||
|
||||
public void setWifiPickerTrackerHelper(WifiPickerTrackerHelper helper) {
|
||||
if (mSubscriptionsController != null) {
|
||||
mSubscriptionsController.setWifiPickerTrackerHelper(helper);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the preference.
|
||||
*/
|
||||
|
||||
@@ -295,6 +295,12 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
final Context context = getContext();
|
||||
if (context != null && !context.getResources().getBoolean(
|
||||
R.bool.config_show_internet_settings)) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
mAirplaneModeEnabler = new AirplaneModeEnabler(getContext(), this);
|
||||
|
||||
// TODO(b/37429702): Add animations and preference comparator back after initial screen is
|
||||
@@ -477,10 +483,6 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
|
||||
mOpenSsid = intent.getStringExtra(EXTRA_START_CONNECT_SSID);
|
||||
}
|
||||
|
||||
if (mNetworkMobileProviderController != null) {
|
||||
mNetworkMobileProviderController.setWifiPickerTrackerHelper(mWifiPickerTrackerHelper);
|
||||
}
|
||||
|
||||
requireActivity().addMenuProvider(mMenuProvider);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ import com.android.settingslib.mobile.MobileMappings.Config;
|
||||
import com.android.settingslib.mobile.TelephonyIcons;
|
||||
import com.android.settingslib.net.SignalStrengthUtil;
|
||||
import com.android.wifitrackerlib.WifiEntry;
|
||||
import com.android.wifitrackerlib.WifiPickerTracker;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -82,7 +83,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
LifecycleObserver, SubscriptionsChangeListener.SubscriptionsChangeListenerClient,
|
||||
MobileDataEnabledListener.Client, DataConnectivityListener.Client,
|
||||
SignalStrengthListener.Callback, TelephonyDisplayInfoListener.Callback,
|
||||
TelephonyCallback.CarrierNetworkListener {
|
||||
TelephonyCallback.CarrierNetworkListener, WifiPickerTracker.WifiPickerTrackerCallback {
|
||||
private static final String TAG = "SubscriptionsPrefCntrlr";
|
||||
|
||||
private UpdateListener mUpdateListener;
|
||||
@@ -95,7 +96,8 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
private DataConnectivityListener mConnectivityListener;
|
||||
private SignalStrengthListener mSignalStrengthListener;
|
||||
private TelephonyDisplayInfoListener mTelephonyDisplayInfoListener;
|
||||
private WifiPickerTrackerHelper mWifiPickerTrackerHelper;
|
||||
@VisibleForTesting
|
||||
WifiPickerTrackerHelper mWifiPickerTrackerHelper;
|
||||
private final WifiManager mWifiManager;
|
||||
private boolean mCarrierNetworkChangeMode;
|
||||
|
||||
@@ -163,6 +165,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
mSignalStrengthListener = new SignalStrengthListener(context, this);
|
||||
mTelephonyDisplayInfoListener = new TelephonyDisplayInfoListener(context, this);
|
||||
lifecycle.addObserver(this);
|
||||
mWifiPickerTrackerHelper = new WifiPickerTrackerHelper(lifecycle, context, this);
|
||||
mSubsPrefCtrlInjector = createSubsPrefCtrlInjector();
|
||||
mConfig = mSubsPrefCtrlInjector.getConfig(mContext);
|
||||
}
|
||||
@@ -485,8 +488,24 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
update();
|
||||
}
|
||||
|
||||
public void setWifiPickerTrackerHelper(WifiPickerTrackerHelper helper) {
|
||||
mWifiPickerTrackerHelper = helper;
|
||||
@Override
|
||||
public void onNumSavedNetworksChanged() {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNumSavedSubscriptionsChanged() {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWifiStateChanged() {
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWifiEntriesChanged() {
|
||||
update();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
@@ -116,8 +116,6 @@ public abstract class DefaultSubscriptionController extends TelephonyBasePrefere
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
mPreference = screen.findPreference(getPreferenceKey());
|
||||
// Set a summary placeholder to reduce flicker.
|
||||
mPreference.setSummaryProvider(pref -> mContext.getString(R.string.summary_placeholder));
|
||||
updateEntries();
|
||||
}
|
||||
|
||||
|
||||
@@ -179,5 +179,4 @@ private fun AppInfoSettings(packageInfoPresenter: PackageInfoPresenter) {
|
||||
}
|
||||
|
||||
fun isArchivingEnabled(featureFlags: PmFeatureFlags) =
|
||||
featureFlags.archiving() || SystemProperties.getBoolean("pm.archiving.enabled", false)
|
||||
|| Flags.appArchiving()
|
||||
featureFlags.archiving() || Flags.appArchiving()
|
||||
@@ -93,8 +93,7 @@ fun HibernationSwitchPreference(
|
||||
}
|
||||
|
||||
private fun isArchivingEnabled() =
|
||||
PmFlags.archiving() || SystemProperties.getBoolean("pm.archiving.enabled", false)
|
||||
|| Flags.appArchiving()
|
||||
PmFlags.archiving() || Flags.appArchiving()
|
||||
|
||||
private class HibernationSwitchPresenter(context: Context, private val app: ApplicationInfo) {
|
||||
private val appOpsManager = context.appOpsManager
|
||||
|
||||
@@ -26,7 +26,6 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -120,8 +119,6 @@ public class WifiDppQrCodeGeneratorFragment extends WifiDppQrCodeBaseFragment {
|
||||
|
||||
final String password = wifiNetworkConfig.getPreSharedKey();
|
||||
TextView passwordView = view.findViewById(R.id.password);
|
||||
passwordView.setInputType(
|
||||
InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
mSummary.setText(getString(
|
||||
R.string.wifi_dpp_scan_open_network_qr_code_with_another_device,
|
||||
|
||||
@@ -30,19 +30,23 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.android.util.concurrent.PausedExecutorService;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.annotation.LooperMode;
|
||||
import org.robolectric.shadows.ShadowLooper;
|
||||
import org.robolectric.shadows.ShadowPausedAsyncTask;
|
||||
import org.robolectric.shadows.androidx.fragment.FragmentController;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
@Config(shadows = ShadowStorageManager.class)
|
||||
public class PrivateVolumeUnmountTest {
|
||||
|
||||
private PrivateVolumeUnmount mFragment;
|
||||
private PausedExecutorService mExecutorService;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mExecutorService = new PausedExecutorService();
|
||||
ShadowPausedAsyncTask.overrideExecutor(mExecutorService);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(VolumeInfo.EXTRA_VOLUME_ID, "id");
|
||||
mFragment = FragmentController.of(new PrivateVolumeUnmount(), bundle)
|
||||
@@ -65,6 +69,8 @@ public class PrivateVolumeUnmountTest {
|
||||
final Button confirm = mFragment.getView().findViewById(R.id.confirm);
|
||||
|
||||
confirm.performClick();
|
||||
mExecutorService.runAll();
|
||||
ShadowLooper.idleMainLooper();
|
||||
|
||||
assertThat(ShadowStorageManager.isUnmountCalled()).isTrue();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import android.os.UserHandle;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
@@ -46,23 +47,27 @@ import com.android.settings.testutils.ApplicationTestUtils;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.LooperMode;
|
||||
import org.robolectric.shadows.ShadowApplication;
|
||||
import org.robolectric.android.util.concurrent.PausedExecutorService;
|
||||
import org.robolectric.shadows.ShadowLooper;
|
||||
import org.robolectric.shadows.ShadowPausedAsyncTask;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public class EnterpriseSetDefaultAppsListPreferenceControllerTest {
|
||||
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
|
||||
private static final int USER_ID = 0;
|
||||
private static final int APP_UID = 0;
|
||||
|
||||
@@ -82,11 +87,13 @@ public class EnterpriseSetDefaultAppsListPreferenceControllerTest {
|
||||
|
||||
private Context mContext;
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
private PausedExecutorService mExecutorService;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
mExecutorService = new PausedExecutorService();
|
||||
ShadowPausedAsyncTask.overrideExecutor(mExecutorService);
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
when(mFragment.getPreferenceScreen()).thenReturn(mScreen);
|
||||
when(mPrefenceManager.getContext()).thenReturn(mContext);
|
||||
@@ -127,7 +134,8 @@ public class EnterpriseSetDefaultAppsListPreferenceControllerTest {
|
||||
new UserAppInfo(user, appInfo2)));
|
||||
|
||||
new EnterpriseSetDefaultAppsListPreferenceController(mContext, mFragment, mPackageManager);
|
||||
ShadowApplication.runBackgroundTasks();
|
||||
mExecutorService.runAll();
|
||||
ShadowLooper.idleMainLooper();
|
||||
|
||||
ArgumentCaptor<Preference> apps = ArgumentCaptor.forClass(Preference.class);
|
||||
verify(mScreen, times(2)).addPreference(apps.capture());
|
||||
|
||||
@@ -41,19 +41,24 @@ import android.os.RemoteException;
|
||||
import android.os.UserManager;
|
||||
import android.text.format.DateUtils;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
import com.android.settings.fuelgauge.batteryusage.db.AppUsageEventEntity;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.LooperMode;
|
||||
import org.robolectric.android.util.concurrent.PausedExecutorService;
|
||||
import org.robolectric.shadows.ShadowLooper;
|
||||
import org.robolectric.shadows.ShadowPausedAsyncTask;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -65,10 +70,14 @@ import java.util.function.Supplier;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public final class DataProcessManagerTest {
|
||||
@Rule
|
||||
public final MockitoRule mMockitoRule = MockitoJUnit.rule();
|
||||
|
||||
private static final String FAKE_ENTRY_KEY = "fake_entry_key";
|
||||
|
||||
private Context mContext;
|
||||
private DataProcessManager mDataProcessManager;
|
||||
private PausedExecutorService mExecutorService;
|
||||
|
||||
@Mock private UserIdsSeries mUserIdsSeries;
|
||||
@Mock private IUsageStatsManager mUsageStatsManager;
|
||||
@@ -80,9 +89,9 @@ public final class DataProcessManagerTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
mExecutorService = new PausedExecutorService();
|
||||
ShadowPausedAsyncTask.overrideExecutor(mExecutorService);
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
DataProcessor.sTestSystemAppsPackageNames = Set.of();
|
||||
DataProcessor.sUsageStatsManager = mUsageStatsManager;
|
||||
doReturn(mContext).when(mContext).getApplicationContext();
|
||||
@@ -117,7 +126,6 @@ public final class DataProcessManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public void constructor_noLevelData() {
|
||||
final DataProcessManager dataProcessManager =
|
||||
new DataProcessManager(
|
||||
@@ -129,7 +137,6 @@ public final class DataProcessManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public void start_loadEmptyDatabaseAppUsageData() {
|
||||
final MatrixCursor cursor =
|
||||
new MatrixCursor(
|
||||
@@ -142,6 +149,8 @@ public final class DataProcessManagerTest {
|
||||
doReturn(true).when(mUserManager).isUserUnlocked(anyInt());
|
||||
|
||||
mDataProcessManager.start();
|
||||
mExecutorService.runAll();
|
||||
ShadowLooper.idleMainLooper();
|
||||
|
||||
assertThat(mDataProcessManager.getIsCurrentAppUsageLoaded()).isTrue();
|
||||
assertThat(mDataProcessManager.getIsDatabaseAppUsageLoaded()).isTrue();
|
||||
@@ -152,7 +161,6 @@ public final class DataProcessManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public void start_loadExpectedAppUsageData() throws RemoteException {
|
||||
final List<BatteryLevelData.PeriodBatteryLevelData> hourlyBatteryLevelsPerDay =
|
||||
new ArrayList<>();
|
||||
@@ -254,6 +262,8 @@ public final class DataProcessManagerTest {
|
||||
hourlyBatteryLevelsPerDay,
|
||||
/* batteryHistoryMap= */ new HashMap<>());
|
||||
dataProcessManager.start();
|
||||
mExecutorService.runAll();
|
||||
ShadowLooper.idleMainLooper();
|
||||
|
||||
assertThat(dataProcessManager.getIsCurrentAppUsageLoaded()).isTrue();
|
||||
assertThat(dataProcessManager.getIsDatabaseAppUsageLoaded()).isTrue();
|
||||
@@ -301,7 +311,6 @@ public final class DataProcessManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public void start_currentUserLocked_emptyAppUsageList() throws RemoteException {
|
||||
final UsageEvents.Event event =
|
||||
getUsageEvent(UsageEvents.Event.ACTIVITY_RESUMED, /* timestamp= */ 1, "package");
|
||||
@@ -323,6 +332,8 @@ public final class DataProcessManagerTest {
|
||||
DatabaseUtils.sFakeSupplier = () -> cursor;
|
||||
|
||||
mDataProcessManager.start();
|
||||
mExecutorService.runAll();
|
||||
ShadowLooper.idleMainLooper();
|
||||
|
||||
assertThat(mDataProcessManager.getAppUsageEventList()).isEmpty();
|
||||
assertThat(mDataProcessManager.getAppUsagePeriodMap()).isNull();
|
||||
@@ -330,7 +341,6 @@ public final class DataProcessManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@LooperMode(LooperMode.Mode.LEGACY)
|
||||
public void getBatteryLevelData_emptyHistoryMap_returnNull() {
|
||||
assertThat(
|
||||
DataProcessManager.getBatteryLevelData(
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright (C) 2024 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings.network;
|
||||
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.DialogInterface;
|
||||
|
||||
import com.android.settings.system.ResetDashboardFragment;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.shadows.androidx.fragment.FragmentController;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class EuiccRacConnectivityDialogFragmentTest {
|
||||
private static final int CONTINUE_VALUE = 1;
|
||||
private static final int CANCEL_VALUE = 0;
|
||||
|
||||
private EuiccRacConnectivityDialogFragment mRacDialogFragment;
|
||||
private FakeFeatureFactory mFeatureFactory;
|
||||
@Mock private DialogInterface mDialogInterface;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||
mRacDialogFragment = new EuiccRacConnectivityDialogFragment();
|
||||
|
||||
FragmentController.setupFragment(mRacDialogFragment);
|
||||
mRacDialogFragment.setTargetFragment(new ResetDashboardFragment(), /* requestCode= */ 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dialogAction_continue_intentResetESIMS_metricsLogged() {
|
||||
mRacDialogFragment.onClick(mDialogInterface, DialogInterface.BUTTON_NEGATIVE);
|
||||
verify(mFeatureFactory.metricsFeatureProvider)
|
||||
.action(
|
||||
mRacDialogFragment.getActivity(),
|
||||
SettingsEnums.ACTION_RESET_ESIMS_RAC_CONNECTIVITY_WARNING,
|
||||
CONTINUE_VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dialogAction_backCancel_intentResetESIMS_metricsLogged() {
|
||||
mRacDialogFragment.onCancel(mDialogInterface);
|
||||
verify(mFeatureFactory.metricsFeatureProvider)
|
||||
.action(
|
||||
mRacDialogFragment.getActivity(),
|
||||
SettingsEnums.ACTION_RESET_ESIMS_RAC_CONNECTIVITY_WARNING,
|
||||
CANCEL_VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dialogAction_buttonCancel_intentResetESIMS_metricsLogged() {
|
||||
mRacDialogFragment.onCancel(mDialogInterface);
|
||||
verify(mFeatureFactory.metricsFeatureProvider)
|
||||
.action(
|
||||
mRacDialogFragment.getActivity(),
|
||||
SettingsEnums.ACTION_RESET_ESIMS_RAC_CONNECTIVITY_WARNING,
|
||||
CANCEL_VALUE);
|
||||
}
|
||||
}
|
||||
@@ -163,8 +163,7 @@ class HibernationSwitchPreferenceTest {
|
||||
}
|
||||
|
||||
private fun isArchivingEnabled() =
|
||||
PmFlags.archiving() || SystemProperties.getBoolean("pm.archiving.enabled", false)
|
||||
|| Flags.appArchiving()
|
||||
PmFlags.archiving() || Flags.appArchiving()
|
||||
@Test
|
||||
fun `An app targets Q with ops mode default when hibernation targets pre S - not exempted`() {
|
||||
mockOpsMode(MODE_DEFAULT)
|
||||
|
||||
@@ -49,6 +49,7 @@ import androidx.test.annotation.UiThreadTest;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.ResourcesUtils;
|
||||
import com.android.settings.wifi.WifiPickerTrackerHelper;
|
||||
import com.android.settings.wifi.WifiSummaryUpdater;
|
||||
@@ -188,8 +189,9 @@ public class InternetPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_shouldBeTrue() {
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
public void isAvailable_shouldMatchPrefFlag() {
|
||||
assertThat(mController.isAvailable()).isEqualTo(
|
||||
mContext.getResources().getBoolean(R.bool.config_show_internet_settings));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -165,7 +165,7 @@ public class SubscriptionsPreferenceControllerTest {
|
||||
mController = new FakeSubscriptionsPreferenceController(mContext, mLifecycle,
|
||||
mUpdateListener, KEY, 5);
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
|
||||
mController.setWifiPickerTrackerHelper(mWifiPickerTrackerHelper);
|
||||
mController.mWifiPickerTrackerHelper = mWifiPickerTrackerHelper;
|
||||
}
|
||||
|
||||
@After
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.settings.privatespace;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.spy;
|
||||
@@ -27,6 +28,7 @@ import static org.mockito.Mockito.when;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Flags;
|
||||
import android.os.UserManager;
|
||||
import android.platform.test.annotations.RequiresFlagsEnabled;
|
||||
import android.platform.test.flag.junit.CheckFlagsRule;
|
||||
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
|
||||
@@ -91,6 +93,7 @@ public class PrivateSpaceAuthenticationActivityTest {
|
||||
@RequiresFlagsEnabled({Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES})
|
||||
public void whenPrivateProfileDoesNotExist_triggersSetupFlow() {
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
when(mPrivateSpaceMaintainer.doesPrivateSpaceExist()).thenReturn(false);
|
||||
|
||||
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
|
||||
|
||||
@@ -81,6 +81,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void deletePrivateSpace_psExists_deletesPS() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -114,6 +115,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_psDoesNotExist_createsPS() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.deletePrivateSpace();
|
||||
@@ -129,6 +131,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_psExists_returnsFalse() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.deletePrivateSpace();
|
||||
@@ -145,6 +148,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_psDoesNotExist_resetsHidePSSettings() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
Settings.Secure.putInt(
|
||||
@@ -168,6 +172,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PS_SENSITIVE_NOTIFICATIONS_TOGGLE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.deletePrivateSpace();
|
||||
@@ -185,6 +190,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_psExists_doesNotResetHidePSSettings() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -230,6 +236,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void lockPrivateSpace_psExistsAndPrivateProfileRunning_locksCreatedPrivateSpace() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -248,6 +255,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void lockPrivateSpace_psExistsAndPrivateProfileNotRunning_returnsFalse() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -284,6 +292,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_psDoesNotExist_setsUserSetupComplete() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -298,6 +307,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
public void createPrivateSpace_pSExists_doesNotChangeUserSetupSetting() {
|
||||
mSetFlagsRule.enableFlags(
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
privateSpaceMaintainer.createPrivateSpace();
|
||||
@@ -316,6 +326,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_SUPPORT_AUTOLOCK_FOR_PRIVATE_SPACE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
final int autoLockOption = 2;
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
@@ -340,6 +351,7 @@ public class PrivateSpaceMaintainerTest {
|
||||
Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_SUPPORT_AUTOLOCK_FOR_PRIVATE_SPACE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
final int privateSpaceAutLockValue = 1;
|
||||
PrivateSpaceMaintainer privateSpaceMaintainer =
|
||||
PrivateSpaceMaintainer.getInstance(mContext);
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.android.settings.privatespace.PrivateSpaceMaintainer.ErrorDele
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
import static org.mockito.Mockito.doNothing;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.spy;
|
||||
@@ -28,6 +29,7 @@ import static org.mockito.Mockito.verify;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.Flags;
|
||||
import android.os.UserManager;
|
||||
import android.platform.test.flag.junit.SetFlagsRule;
|
||||
|
||||
import androidx.test.annotation.UiThreadTest;
|
||||
@@ -90,6 +92,7 @@ public class PrivateSpaceDeletionProgressFragmentTest {
|
||||
doNothing().when(spyFragment).showSuccessfulDeletionToast();
|
||||
mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
|
||||
mPrivateSpaceMaintainer.createPrivateSpace();
|
||||
spyFragment.deletePrivateSpace();
|
||||
@@ -104,6 +107,7 @@ public class PrivateSpaceDeletionProgressFragmentTest {
|
||||
doNothing().when(spyFragment).showSuccessfulDeletionToast();
|
||||
mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
|
||||
mPrivateSpaceMaintainer.createPrivateSpace();
|
||||
spyFragment.deletePrivateSpace();
|
||||
@@ -128,6 +132,7 @@ public class PrivateSpaceDeletionProgressFragmentTest {
|
||||
doNothing().when(spyFragment).showDeletionInternalErrorToast();
|
||||
mSetFlagsRule.enableFlags(Flags.FLAG_ALLOW_PRIVATE_PROFILE,
|
||||
android.multiuser.Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES);
|
||||
assumeTrue(mContext.getSystemService(UserManager.class).canAddPrivateProfile());
|
||||
|
||||
spyFragment.deletePrivateSpace();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user