Snap for 4471243 from 44369ba0a2 to pi-release

Change-Id: I8eb8bc31b3354990fc435ee132a7b2b1eb78244d
This commit is contained in:
android-build-team Robot
2017-11-28 08:32:59 +00:00
129 changed files with 406 additions and 378 deletions

View File

@@ -110,10 +110,11 @@
<com.android.setupwizardlib.view.FillContentLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginVertical="24dp"
android:layout_weight="1"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_marginVertical="24dp">
android:paddingBottom="0dp">
<include layout="@layout/fingerprint_enroll_enrolling_content"
android:layout_width="match_parent"

View File

@@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 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.
-->
<!-- Based off frameworks/base/core/res/res/layout/preference_dropdown_material.xml
except that icon space in this layout is always reserved -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/preference_no_icon_padding_start"
android:visibility="invisible" />
<include layout="@layout/preference_material"/>
</FrameLayout>

View File

@@ -2676,13 +2676,13 @@
<string name="status_imei_sv">IMEI SV</string>
<!-- Do not translate. About phone, status item title -->
<string name="status_iccid">ICCID</string>
<!-- About tablet, status item title. The Mobile Directory Number [CHAR LIMIT=30] -->
<!-- About tablet, status item title. The Mobile Directory Number [CHAR LIMIT=40] -->
<string name="status_number" product="tablet">MDN</string>
<!-- About phone, status item title. The phone number of the current device [CHAR LIMIT=30] -->
<!-- About phone, status item title. The phone number of the current device [CHAR LIMIT=40] -->
<string name="status_number" product="default">Phone number</string>
<!-- About tablet, status item title for multi-sim devices. The Mobile Directory Number [CHAR LIMIT=30] -->
<!-- About tablet, status item title for multi-sim devices. The Mobile Directory Number [CHAR LIMIT=40] -->
<string name="status_number_sim_slot" product="tablet">MDN (sim slot %1$d)</string>
<!-- About phone, status item title for multi-sim devices. The phone number of the current device [CHAR LIMIT=30] -->
<!-- About phone, status item title for multi-sim devices. The phone number of the current device [CHAR LIMIT=40] -->
<string name="status_number_sim_slot" product="default">Phone number (sim slot %1$d)</string>
<!-- About tablet, status item title. The Mobile Directory Number [CHAR LIMIT=30] -->
<string name="status_number_sim_status" product="tablet">MDN on SIM</string>
@@ -4975,7 +4975,7 @@
<string name="process_dex2oat_label">App optimization</string>
<!-- [CHAR_LIMIT=40] Battery saver: Label for feature, title + menu item -->
<string name="battery_saver">Battery saver</string>
<string name="battery_saver">Battery Saver</string>
<!-- [CHAR_LIMIT=40] Battery saver: Title for automatic entry option -->
<string name="battery_saver_turn_on_automatically_title">Turn on automatically</string>
@@ -6583,7 +6583,7 @@
<string name="keywords_imei_info">imei, meid, min, prl version, imei sv</string>
<string name="keywords_sim_status">network, mobile network state, service state, signal strength, mobile network type, roaming, iccid</string>
<string name="keywords_model_and_hardware">serial number, hardware version</string>
<string name="keywords_android_version">android security patch level, baseband version, kernel version, </string>
<string name="keywords_android_version">android security patch level, baseband version, kernel version</string>
<!-- NFC Wi-Fi pairing/setup strings-->

View File

@@ -20,19 +20,19 @@
<resources>
<!-- Fragment style -->
<style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragmentStyle.SettingsBase">
<style name="SettingsPreferenceFragmentStyle" parent="@style/PreferenceFragment.Material">
<item name="android:layout">@layout/preference_list_fragment</item>
</style>
<style name="ApnPreference" parent="Preference.SettingsBase">
<style name="ApnPreference" parent="@style/Preference.Material">
<item name="android:layout">@layout/apn_preference_layout</item>
</style>
<style name="SettingsSeekBarPreference" parent="Preference.SettingsBase">
<style name="SettingsSeekBarPreference" parent="@style/Preference.Material">
<item name="android:layout">@layout/preference_widget_seekbar_settings</item>
</style>
<style name="SyncSwitchPreference" parent="Preference.SettingsBase">
<style name="SyncSwitchPreference" parent="@style/Preference.Material">
<item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item>
</style>

View File

@@ -275,6 +275,16 @@ public final class CredentialStorage extends Activity {
Log.e(TAG, "Failed to install " + key + " as uid " + uid);
return;
}
// The key was prepended USER_PRIVATE_KEY by the CredentialHelper. However,
// KeyChain internally uses the raw alias name and only prepends USER_PRIVATE_KEY
// to the key name when interfacing with KeyStore.
// This is generally a symptom of CredentialStorage and CredentialHelper relying
// on internal implementation details of KeyChain and imitating its functionality
// rather than delegating to KeyChain for the certificate installation.
if (uid == Process.SYSTEM_UID || uid == KeyStore.UID_SELF) {
new MarkKeyAsUserSelectable(
key.replaceFirst("^" + Credentials.USER_PRIVATE_KEY, "")).execute();
}
}
int flags = KeyStore.FLAG_NONE;
@@ -390,6 +400,33 @@ public final class CredentialStorage extends Activity {
}
}
/**
* Background task to mark a given key alias as user-selectable, so that
* it can be selected by users from the Certificate Selection prompt.
*/
private class MarkKeyAsUserSelectable extends AsyncTask<Void, Void, Boolean> {
final String mAlias;
public MarkKeyAsUserSelectable(String alias) {
mAlias = alias;
}
@Override
protected Boolean doInBackground(Void... unused) {
try (KeyChainConnection keyChainConnection = KeyChain.bind(CredentialStorage.this)) {
keyChainConnection.getService().setUserSelectable(mAlias, true);
return true;
} catch (RemoteException e) {
Log.w(TAG, "Failed to mark key " + mAlias + " as user-selectable.");
return false;
} catch (InterruptedException e) {
Log.w(TAG, "Failed to mark key " + mAlias + " as user-selectable.");
Thread.currentThread().interrupt();
return false;
}
}
}
/**
* Check that the caller is either certinstaller or Settings running in a profile of this user.
*/

View File

@@ -16,6 +16,8 @@
package com.android.settings.applications;
import static com.android.settings.widget.EntityHeaderController.ActionType;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.preference.Preference;
@@ -25,8 +27,6 @@ import android.util.Log;
import com.android.settings.widget.EntityHeaderController;
import com.android.settingslib.applications.AppUtils;
import static com.android.settings.widget.EntityHeaderController.ActionType;
public abstract class AppInfoWithHeader extends AppInfoBase {
private boolean mCreated;
@@ -44,7 +44,7 @@ public abstract class AppInfoWithHeader extends AppInfoBase {
final Preference pref = EntityHeaderController
.newInstance(activity, this, null /* header */)
.setRecyclerView(getListView(), getLifecycle())
.setIcon(IconDrawableFactory.newInstance(activity)
.setIcon(IconDrawableFactory.newInstance(getContext())
.getBadgedIcon(mPackageInfo.applicationInfo))
.setLabel(mPackageInfo.applicationInfo.loadLabel(mPm))
.setSummary(mPackageInfo)

View File

@@ -30,7 +30,7 @@ import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
import com.android.settingslib.wrapper.PackageManagerWrapper;
public class BugReportInPowerPreferenceControllerV2 extends
public class BugReportInPowerPreferenceController extends
DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
PreferenceControllerMixin {
@@ -48,7 +48,7 @@ public class BugReportInPowerPreferenceControllerV2 extends
private final UserManager mUserManager;
private SwitchPreference mPreference;
public BugReportInPowerPreferenceControllerV2(Context context) {
public BugReportInPowerPreferenceController(Context context) {
super(context);
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mPackageManager = new PackageManagerWrapper(context.getPackageManager());

View File

@@ -22,14 +22,14 @@ import android.os.UserManager;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
public class BugReportPreferenceControllerV2 extends DeveloperOptionsPreferenceController implements
public class BugReportPreferenceController extends DeveloperOptionsPreferenceController implements
PreferenceControllerMixin {
private static final String KEY_BUGREPORT = "bugreport";
private final UserManager mUserManager;
public BugReportPreferenceControllerV2(Context context) {
public BugReportPreferenceController(Context context) {
super(context);
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);

View File

@@ -29,7 +29,7 @@ import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
public class CameraLaserSensorPreferenceControllerV2 extends
public class CameraLaserSensorPreferenceController extends
DeveloperOptionsPreferenceController implements
Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
@@ -51,7 +51,7 @@ public class CameraLaserSensorPreferenceControllerV2 extends
private SwitchPreference mPreference;
public CameraLaserSensorPreferenceControllerV2(Context context) {
public CameraLaserSensorPreferenceController(Context context) {
super(context);
}

View File

@@ -29,7 +29,7 @@ import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
public class ConnectivityMonitorPreferenceControllerV2 extends
public class ConnectivityMonitorPreferenceController extends
DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
PreferenceControllerMixin {
@@ -55,7 +55,7 @@ public class ConnectivityMonitorPreferenceControllerV2 extends
private SwitchPreference mPreference;
public ConnectivityMonitorPreferenceControllerV2(Context context) {
public ConnectivityMonitorPreferenceController(Context context) {
super(context);
}

View File

@@ -257,15 +257,15 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
@Override
public void onDisableLogPersistDialogConfirmed() {
final LogPersistPreferenceControllerV2 controller = getDevelopmentOptionsController(
LogPersistPreferenceControllerV2.class);
final LogPersistPreferenceController controller = getDevelopmentOptionsController(
LogPersistPreferenceController.class);
controller.onDisableLogPersistDialogConfirmed();
}
@Override
public void onDisableLogPersistDialogRejected() {
final LogPersistPreferenceControllerV2 controller = getDevelopmentOptionsController(
LogPersistPreferenceControllerV2.class);
final LogPersistPreferenceController controller = getDevelopmentOptionsController(
LogPersistPreferenceController.class);
controller.onDisableLogPersistDialogRejected();
}
@@ -371,7 +371,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
BluetoothA2dpConfigStore bluetoothA2dpConfigStore) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new MemoryUsagePreferenceController(context));
controllers.add(new BugReportPreferenceControllerV2(context));
controllers.add(new BugReportPreferenceController(context));
controllers.add(new LocalBackupPasswordPreferenceController(context));
controllers.add(new StayAwakePreferenceController(context, lifecycle));
controllers.add(new HdcpCheckingPreferenceController(context));
@@ -379,23 +379,23 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
controllers.add(new OemUnlockPreferenceController(context, activity, fragment));
controllers.add(new FileEncryptionPreferenceController(context));
controllers.add(new PictureColorModePreferenceController(context, lifecycle));
controllers.add(new WebViewAppPreferenceControllerV2(context));
controllers.add(new WebViewAppPreferenceController(context));
controllers.add(new CoolColorTemperaturePreferenceController(context));
controllers.add(new DisableAutomaticUpdatesPreferenceController(context));
controllers.add(new AdbPreferenceController(context, fragment));
controllers.add(new ClearAdbKeysPreferenceController(context, fragment));
controllers.add(new LocalTerminalPreferenceController(context));
controllers.add(new BugReportInPowerPreferenceControllerV2(context));
controllers.add(new BugReportInPowerPreferenceController(context));
controllers.add(new MockLocationAppPreferenceController(context, fragment));
controllers.add(new DebugViewAttributesPreferenceController(context));
controllers.add(new SelectDebugAppPreferenceController(context, fragment));
controllers.add(new WaitForDebuggerPreferenceController(context));
controllers.add(new EnableGpuDebugLayersPreferenceController(context));
controllers.add(new VerifyAppsOverUsbPreferenceControllerV2(context));
controllers.add(new LogdSizePreferenceControllerV2(context));
controllers.add(new LogPersistPreferenceControllerV2(context, fragment, lifecycle));
controllers.add(new ConnectivityMonitorPreferenceControllerV2(context));
controllers.add(new CameraLaserSensorPreferenceControllerV2(context));
controllers.add(new VerifyAppsOverUsbPreferenceController(context));
controllers.add(new LogdSizePreferenceController(context));
controllers.add(new LogPersistPreferenceController(context, fragment, lifecycle));
controllers.add(new ConnectivityMonitorPreferenceController(context));
controllers.add(new CameraLaserSensorPreferenceController(context));
controllers.add(new WifiDisplayCertificationPreferenceController(context));
controllers.add(new WifiVerboseLoggingPreferenceController(context));
controllers.add(new WifiAggressiveHandoverPreferenceController(context));

View File

@@ -26,14 +26,14 @@ import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.development.AbstractLogpersistPreferenceController;
public class LogPersistPreferenceControllerV2 extends
public class LogPersistPreferenceController extends
AbstractLogpersistPreferenceController implements PreferenceControllerMixin {
private final DevelopmentSettingsDashboardFragment mFragment;
private ListPreference mPreference;
public LogPersistPreferenceControllerV2(Context context,
public LogPersistPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment, Lifecycle lifecycle) {
super(context, lifecycle);

View File

@@ -24,12 +24,12 @@ import android.support.v7.preference.PreferenceScreen;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.AbstractLogdSizePreferenceController;
public class LogdSizePreferenceControllerV2 extends AbstractLogdSizePreferenceController implements
public class LogdSizePreferenceController extends AbstractLogdSizePreferenceController implements
Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
private ListPreference mPreference;
public LogdSizePreferenceControllerV2(Context context) {
public LogdSizePreferenceController(Context context) {
super(context);
}

View File

@@ -38,7 +38,7 @@ import java.util.List;
/**
* Controller to manage the state of "Verify apps over USB" toggle.
*/
public class VerifyAppsOverUsbPreferenceControllerV2 extends
public class VerifyAppsOverUsbPreferenceController extends
DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
AdbOnChangeListener, PreferenceControllerMixin {
private static final String VERIFY_APPS_OVER_USB_KEY = "verify_apps_over_usb";
@@ -70,7 +70,7 @@ public class VerifyAppsOverUsbPreferenceControllerV2 extends
// This field is accessed using reflection in the test, please keep name in sync.
private final PackageManagerWrapper mPackageManager;
public VerifyAppsOverUsbPreferenceControllerV2(Context context) {
public VerifyAppsOverUsbPreferenceController(Context context) {
super(context);
mPackageManager = new PackageManagerWrapper(context.getPackageManager());

View File

@@ -31,7 +31,7 @@ import com.android.settings.webview.WebViewUpdateServiceWrapper;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
import com.android.settingslib.wrapper.PackageManagerWrapper;
public class WebViewAppPreferenceControllerV2 extends
public class WebViewAppPreferenceController extends
DeveloperOptionsPreferenceController implements PreferenceControllerMixin {
private static final String TAG = "WebViewAppPrefCtrl";
@@ -42,7 +42,7 @@ public class WebViewAppPreferenceControllerV2 extends
private Preference mPreference;
public WebViewAppPreferenceControllerV2(Context context) {
public WebViewAppPreferenceController(Context context) {
super(context);
mPackageManager = new PackageManagerWrapper(context.getPackageManager());

View File

@@ -40,7 +40,6 @@ public class EmergencyBroadcastPreferenceController extends AbstractPreferenceCo
private AccountRestrictionHelper mHelper;
private UserManager mUserManager;
private PackageManager mPm;
private boolean mCellBroadcastAppLinkEnabled;
public EmergencyBroadcastPreferenceController(Context context, String prefKey) {
this(context, new AccountRestrictionHelper(context), prefKey);
@@ -54,8 +53,6 @@ public class EmergencyBroadcastPreferenceController extends AbstractPreferenceCo
mHelper = helper;
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mPm = mContext.getPackageManager();
// Enable link to CMAS app settings depending on the value in config.xml.
mCellBroadcastAppLinkEnabled = isCellBroadcastAppLinkEnabled();
}
@Override
@@ -79,12 +76,13 @@ public class EmergencyBroadcastPreferenceController extends AbstractPreferenceCo
@Override
public boolean isAvailable() {
return mUserManager.isAdminUser() && mCellBroadcastAppLinkEnabled
return mUserManager.isAdminUser() && isCellBroadcastAppLinkEnabled()
&& !mHelper.hasBaseUserRestriction(
UserManager.DISALLOW_CONFIG_CELL_BROADCASTS, UserHandle.myUserId());
}
private boolean isCellBroadcastAppLinkEnabled() {
// Enable link to CMAS app settings depending on the value in config.xml.
boolean enabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_cellBroadcastAppLinks);
if (enabled) {

View File

@@ -23,7 +23,7 @@ import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPreferenceController;
/**
* Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceControllerV2}
* Deprecated in favor of {@link com.android.settings.development.WebViewAppPreferenceController}
*/
@Deprecated
public class WebViewAppPreferenceController extends DefaultAppPreferenceController {

View File

@@ -18,4 +18,5 @@
<bool name="config_enableColorTemperature">false</bool>
<bool name="config_show_camera_laser_sensor">false</bool>
<bool name="config_show_connectivity_monitor">false</bool>
<bool name="config_display_recent_apps">false</bool>
</resources>

View File

@@ -20,4 +20,5 @@
<bool name="config_enableColorTemperature">true</bool>
<bool name="config_show_camera_laser_sensor">true</bool>
<bool name="config_show_connectivity_monitor">true</bool>
<bool name="config_display_recent_apps">true</bool>
</resources>

View File

@@ -16,32 +16,35 @@
package com.android.settings.applications;
import android.content.Context;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.os.UserManager;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import com.android.settings.notification.EmergencyBroadcastPreferenceController;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.XmlTestUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import java.util.List;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppAndNotificationDashboardFragmentTest {
@Test
@Config(shadows = {ShadowEmergencyBroadcastPreferenceController.class})
public void testNonIndexableKeys_existInXmlLayout() {
final Context context = spy(RuntimeEnvironment.application);
UserManager manager = mock(UserManager.class);
@@ -56,4 +59,13 @@ public class AppAndNotificationDashboardFragmentTest {
assertThat(keys).containsAllIn(niks);
}
@Implements(EmergencyBroadcastPreferenceController.class)
public static class ShadowEmergencyBroadcastPreferenceController {
@Implementation
public boolean isAvailable() {
return true;
}
}
}

View File

@@ -16,6 +16,13 @@
package com.android.settings.applications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -49,14 +56,8 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.ReflectionHelpers;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowEntityHeaderController.class)
public class AppInfoWithHeaderTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -46,7 +46,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppPermissionsPreferenceControllerTest {
private static final String PERM_LOCATION = "android.permission-group.LOCATION";

View File

@@ -37,7 +37,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public final class AppStateAppOpsBridgeTest {
@Mock private Context mContext;

View File

@@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppStateInstallAppsBridgeTest {
@Test

View File

@@ -45,7 +45,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppStorageSettingsTest {
@Mock

View File

@@ -8,8 +8,10 @@ import static org.mockito.Mockito.when;
import android.content.Context;
import android.support.v7.preference.Preference;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.R;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
import org.junit.Before;
import org.junit.Test;
@@ -18,11 +20,8 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import com.android.settings.R;
import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppStorageSizesControllerTest {
private static final String COMPUTING = "Computing…";
private static final String INVALID_SIZE = "Couldnt compute package size.";
@@ -85,9 +84,9 @@ public class AppStorageSizesControllerTest {
mController.setResult(result);
mController.updateUi(mContext);
assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
assertThat(mCachePreference.getSummary()).isEqualTo("10.00 B");
assertThat(mDataPreference.getSummary()).isEqualTo("90.00 B");
assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
assertThat(mCachePreference.getSummary()).isEqualTo("10 B");
assertThat(mDataPreference.getSummary()).isEqualTo("90 B");
assertThat(mTotalPreference.getSummary()).isEqualTo("101 B");
}
@@ -103,10 +102,10 @@ public class AppStorageSizesControllerTest {
mController.setCacheCleared(true);
mController.updateUi(mContext);
assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
assertThat(mCachePreference.getSummary()).isEqualTo("0.00 B");
assertThat(mDataPreference.getSummary()).isEqualTo("90.00 B");
assertThat(mTotalPreference.getSummary()).isEqualTo("91.00 B");
assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
assertThat(mCachePreference.getSummary()).isEqualTo("0 B");
assertThat(mDataPreference.getSummary()).isEqualTo("90 B");
assertThat(mTotalPreference.getSummary()).isEqualTo("91 B");
}
@Test
@@ -121,9 +120,9 @@ public class AppStorageSizesControllerTest {
mController.setDataCleared(true);
mController.updateUi(mContext);
assertThat(mAppPreference.getSummary()).isEqualTo("1.00 B");
assertThat(mCachePreference.getSummary()).isEqualTo("0.00 B");
assertThat(mDataPreference.getSummary()).isEqualTo("0.00 B");
assertThat(mTotalPreference.getSummary()).isEqualTo("1.00 B");
assertThat(mAppPreference.getSummary()).isEqualTo("1 B");
assertThat(mCachePreference.getSummary()).isEqualTo("0 B");
assertThat(mDataPreference.getSummary()).isEqualTo("0 B");
assertThat(mTotalPreference.getSummary()).isEqualTo("1 B");
}
}

View File

@@ -56,7 +56,7 @@ import static org.mockito.Mockito.when;
* Tests for {@link InstalledAppCounter}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public final class AppWithAdminGrantedPermissionsCounterTest {
private final String APP_1 = "app1";

View File

@@ -55,7 +55,7 @@ import static org.mockito.Mockito.when;
* Tests for {@link AppWithAdminGrantedPermissionsLister}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public final class AppWithAdminGrantedPermissionsListerTest {
private final String APP_1 = "app1";

View File

@@ -55,7 +55,7 @@ import static org.mockito.Mockito.when;
* Tests for {@link ApplicationFeatureProviderImpl}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {ShadowUserManager.class})
public final class ApplicationFeatureProviderImplTest {

View File

@@ -52,7 +52,7 @@ import org.robolectric.util.ReflectionHelpers;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAppSettingsTest {
private Context mContext;

View File

@@ -46,7 +46,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DrawOverlayDetailsTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -27,7 +27,7 @@ import org.robolectric.annotation.Config;
import static junit.framework.Assert.assertTrue;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class EnterpriseDefaultAppsTest {
@Test
public void testNumberOfIntentsCorrelateWithUI() throws Exception {

View File

@@ -44,7 +44,7 @@ import org.robolectric.annotation.Config;
import java.io.IOException;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class FetchPackageStorageAsyncLoaderTest {
private static final String PACKAGE_NAME = "com.test.package";
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -61,7 +61,7 @@ import java.util.Set;
* Tests for {@link InstalledAppCounter}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {ShadowUserManager.class})
public final class InstalledAppCounterTest {

View File

@@ -17,6 +17,7 @@
package com.android.settings.applications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.anyDouble;
import static org.mockito.Matchers.anyInt;
@@ -83,9 +84,9 @@ import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(
manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION,
shadows = InstalledAppDetailsTest.ShadowUtils.class
manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION_O,
shadows = InstalledAppDetailsTest.ShadowUtils.class
)
public final class InstalledAppDetailsTest {
@@ -192,7 +193,7 @@ public final class InstalledAppDetailsTest {
when(stats.getTotalBytes()).thenReturn(1L);
assertThat(InstalledAppDetails.getStorageSummary(context, stats, true))
.isEqualTo("1.00 B used in external storage");
.isEqualTo("1 B used in external storage");
}
@Test
@@ -202,7 +203,7 @@ public final class InstalledAppDetailsTest {
when(stats.getTotalBytes()).thenReturn(1L);
assertThat(InstalledAppDetails.getStorageSummary(context, stats, false))
.isEqualTo("1.00 B used in internal storage");
.isEqualTo("1 B used in internal storage");
}
@Test

View File

@@ -57,7 +57,7 @@ import static org.mockito.Mockito.when;
* Tests for {@link InstalledAppLister}.
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public final class InstalledAppListerTest {
private final String APP_1 = "app1";

View File

@@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class NotificationAppsTest {
@Mock

View File

@@ -39,7 +39,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PictureInPictureDetailsTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -51,7 +51,7 @@ import java.util.ArrayList;
import java.util.Collections;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PictureInPictureSettingsTest {
private static final int PRIMARY_USER_ID = 0;

View File

@@ -38,7 +38,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PremiumSmsAccessTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -16,13 +16,30 @@
package com.android.settings.applications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.Application;
import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.os.UserHandle;
import android.os.UserManager;
import android.support.v7.preference.Preference;
@@ -31,14 +48,13 @@ import android.support.v7.preference.PreferenceScreen;
import android.text.TextUtils;
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.applications.ApplicationsState;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -47,25 +63,9 @@ import org.robolectric.annotation.Config;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.argThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class RecentAppsPreferenceControllerTest {
@Mock
@@ -76,14 +76,18 @@ public class RecentAppsPreferenceControllerTest {
private Preference mSeeAllPref;
@Mock
private PreferenceCategory mDivider;
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Context mMockContext;
@Mock
private UsageStatsManager mUsageStatsManager;
@Mock
private UserManager mUserManager;
@Mock
private ApplicationsState mAppState;
@Mock
private PackageManager mPackageManager;
@Mock
private ApplicationsState.AppEntry mAppEntry;
@Mock
private ApplicationInfo mApplicationInfo;
private Context mContext;
private RecentAppsPreferenceController mController;
@@ -91,12 +95,11 @@ public class RecentAppsPreferenceControllerTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mMockContext.getSystemService(Context.USAGE_STATS_SERVICE))
.thenReturn(mUsageStatsManager);
when(mMockContext.getSystemService(Context.USER_SERVICE))
.thenReturn(mUserManager);
mContext = spy(RuntimeEnvironment.application);
doReturn(mUsageStatsManager).when(mContext).getSystemService(Context.USAGE_STATS_SERVICE);
doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE);
doReturn(mPackageManager).when(mContext).getPackageManager();
mContext = RuntimeEnvironment.application;
mController = new RecentAppsPreferenceController(mContext, mAppState, null);
when(mScreen.findPreference(anyString())).thenReturn(mCategory);
@@ -125,7 +128,7 @@ public class RecentAppsPreferenceControllerTest {
@Test
public void onDisplayAndUpdateState_shouldRefreshUi() {
mController = spy(
new RecentAppsPreferenceController(mMockContext, (Application) null, null));
new RecentAppsPreferenceController(mContext, (Application) null, null));
doNothing().when(mController).refreshUi(mContext);
@@ -136,11 +139,8 @@ public class RecentAppsPreferenceControllerTest {
}
@Test
@Config(qualifiers = "mcc999")
public void display_shouldNotShowRecents_showAppInfoPreference() {
mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
.thenReturn(false);
mController.displayPreference(mScreen);
verify(mCategory, never()).addPreference(any(Preference.class));
@@ -152,8 +152,6 @@ public class RecentAppsPreferenceControllerTest {
@Test
public void display_showRecents() {
when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
.thenReturn(true);
final List<UsageStats> stats = new ArrayList<>();
final UsageStats stat1 = new UsageStats();
final UsageStats stat2 = new UsageStats();
@@ -172,20 +170,17 @@ public class RecentAppsPreferenceControllerTest {
// stat1, stat2 are valid apps. stat3 is invalid.
when(mAppState.getEntry(stat1.mPackageName, UserHandle.myUserId()))
.thenReturn(mock(ApplicationsState.AppEntry.class));
.thenReturn(mAppEntry);
when(mAppState.getEntry(stat2.mPackageName, UserHandle.myUserId()))
.thenReturn(mock(ApplicationsState.AppEntry.class));
.thenReturn(mAppEntry);
when(mAppState.getEntry(stat3.mPackageName, UserHandle.myUserId()))
.thenReturn(null);
when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
.thenReturn(new ResolveInfo());
when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
new ResolveInfo());
when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
.thenReturn(stats);
final Configuration configuration = new Configuration();
configuration.locale = Locale.US;
when(mMockContext.getResources().getConfiguration()).thenReturn(configuration);
mAppEntry.info = mApplicationInfo;
mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
mController.displayPreference(mScreen);
verify(mCategory).setTitle(R.string.recent_app_category_title);
@@ -200,8 +195,6 @@ public class RecentAppsPreferenceControllerTest {
@Test
public void display_hasRecentButNoneDisplayable_showAppInfo() {
when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
.thenReturn(true);
final List<UsageStats> stats = new ArrayList<>();
final UsageStats stat1 = new UsageStats();
final UsageStats stat2 = new UsageStats();
@@ -218,12 +211,11 @@ public class RecentAppsPreferenceControllerTest {
.thenReturn(mock(ApplicationsState.AppEntry.class));
when(mAppState.getEntry(stat2.mPackageName, UserHandle.myUserId()))
.thenReturn(mock(ApplicationsState.AppEntry.class));
when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
.thenReturn(new ResolveInfo());
when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
new ResolveInfo());
when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
.thenReturn(stats);
mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
mController.displayPreference(mScreen);
verify(mCategory, never()).addPreference(any(Preference.class));
@@ -234,8 +226,6 @@ public class RecentAppsPreferenceControllerTest {
@Test
public void display_showRecents_formatSummary() {
when(mMockContext.getResources().getBoolean(R.bool.config_display_recent_apps))
.thenReturn(true);
final List<UsageStats> stats = new ArrayList<>();
final UsageStats stat1 = new UsageStats();
stat1.mLastTimeUsed = System.currentTimeMillis();
@@ -243,17 +233,13 @@ public class RecentAppsPreferenceControllerTest {
stats.add(stat1);
when(mAppState.getEntry(stat1.mPackageName, UserHandle.myUserId()))
.thenReturn(mock(ApplicationsState.AppEntry.class));
when(mMockContext.getPackageManager().resolveActivity(any(Intent.class), anyInt()))
.thenReturn(new ResolveInfo());
.thenReturn(mAppEntry);
when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
new ResolveInfo());
when(mUsageStatsManager.queryUsageStats(anyInt(), anyLong(), anyLong()))
.thenReturn(stats);
.thenReturn(stats);
mAppEntry.info = mApplicationInfo;
final Configuration configuration = new Configuration();
configuration.locale = Locale.US;
when(mMockContext.getResources().getConfiguration()).thenReturn(configuration);
mController = new RecentAppsPreferenceController(mMockContext, mAppState, null);
mController.displayPreference(mScreen);
verify(mCategory).addPreference(argThat(summaryMatches("0 min. ago")));

View File

@@ -36,7 +36,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class SpecialAppAccessPreferenceControllerTest {
private Context mContext;
@Mock

View File

@@ -41,7 +41,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class UsageAccessDetailsTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -36,7 +36,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class VrListenerSettingsTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -36,7 +36,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class WriteSettingsDetailsTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -46,7 +46,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AssistContextPreferenceControllerTest {
@Mock

View File

@@ -51,7 +51,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AssistFlashScreenPreferenceControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -29,7 +29,7 @@ import org.robolectric.annotation.Config;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AssistSettingObserverTest {
private AssistSettingObserver mObserver;

View File

@@ -40,7 +40,7 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAssistPickerTest {
private static ComponentName sTestAssist;

View File

@@ -56,7 +56,7 @@ import java.util.ArrayList;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAssistPreferenceControllerTest {
private static final String TEST_KEY = "test_pref_key";

View File

@@ -29,7 +29,7 @@ import org.robolectric.annotation.Config;
import static com.google.common.truth.Truth.assertThat;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class ManageAssistTest {
private ManageAssist mSettings;

View File

@@ -17,11 +17,17 @@
package com.android.settings.applications.defaultapps;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
@@ -39,7 +45,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAppInfoTest {
@Mock
@@ -50,15 +56,24 @@ public class DefaultAppInfoTest {
private PackageManager mPackageManager;
@Mock
private PackageManagerWrapper mPackageManagerWrapper;
@Mock
private ApplicationInfo mApplicationInfo;
@Mock
private Drawable mIcon;
private Context mContext;
private DefaultAppInfo mInfo;
@Before
public void setUp() {
public void setUp() throws PackageManager.NameNotFoundException {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mContext = spy(RuntimeEnvironment.application);
doReturn(mPackageManager).when(mContext).getPackageManager();
when(mPackageManagerWrapper.getPackageManager()).thenReturn(mPackageManager);
when(mPackageManagerWrapper.getApplicationInfoAsUser(anyString(), anyInt(),
anyInt())).thenReturn(mApplicationInfo);
when(mPackageManager.loadUnbadgedItemIcon(mPackageItemInfo, mApplicationInfo)).thenReturn(
mIcon);
}
@Test

View File

@@ -51,7 +51,7 @@ import java.util.ArrayList;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAppPickerFragmentTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -39,7 +39,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAppPreferenceControllerTest {
private static final String TEST_APP_NAME = "test";

View File

@@ -43,7 +43,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAutofillPickerTest {
private static final String TEST_APP_KEY = "foo.bar/foo.bar.Baz";

View File

@@ -46,7 +46,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultAutofillPreferenceControllerTest {
@Mock

View File

@@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultBrowserPickerTest {
private static final String TEST_APP_KEY = "";

View File

@@ -48,7 +48,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultBrowserPreferenceControllerTest {
@Mock

View File

@@ -41,7 +41,7 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultEmergencyPickerTest {
private static final String TEST_APP_KEY = "test_app";

View File

@@ -59,7 +59,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultHomePickerTest {
private static final String TEST_APP_KEY = "com.android.settings/DefaultEmergencyPickerTest";

View File

@@ -51,7 +51,7 @@ import java.util.Arrays;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultHomePreferenceControllerTest {
@Mock

View File

@@ -42,7 +42,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultPaymentSettingsPreferenceControllerTest {
@Mock

View File

@@ -43,7 +43,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultPhonePickerTest {
private static final String TEST_APP_KEY = "com.android.settings/PickerTest";

View File

@@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DefaultSmsPickerTest {
private static final String TEST_APP_KEY = "com.android.settings/PickerTest";

View File

@@ -35,7 +35,7 @@ import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppFilterItemTest {
@Test

View File

@@ -60,7 +60,7 @@ import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppFilterRegistryTest {
@Test

View File

@@ -37,7 +37,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class ApplicationViewHolderTest {
private Context mContext;

View File

@@ -73,7 +73,7 @@ import java.util.ArrayList;
@RunWith(SettingsRobolectricTestRunner.class)
// TODO: Consider making the shadow class set global using a robolectric.properties file.
@Config(manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION,
sdk = TestConfig.SDK_VERSION_O,
shadows = {
SettingsShadowResources.class,
SettingsShadowTheme.class,

View File

@@ -17,6 +17,7 @@
package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -27,6 +28,7 @@ import android.content.Intent;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
import android.provider.DocumentsContract;
import android.text.format.Formatter;
import android.view.View;
import android.widget.FrameLayout;
@@ -46,7 +48,7 @@ import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class MusicViewHolderControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Fragment mFragment;
@@ -75,7 +77,8 @@ public class MusicViewHolderControllerTest {
public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
mController.setupView(mHolder);
assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
Formatter.formatFileSize(mContext, 0));
}
@Test
@@ -86,7 +89,8 @@ public class MusicViewHolderControllerTest {
mController.queryStats();
mController.setupView(mHolder);
assertThat(mHolder.mSummary.getText().toString()).isEqualTo("1.00 B");
assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
Formatter.formatFileSize(mContext, 1));
}
@Test

View File

@@ -17,6 +17,7 @@
package com.android.settings.applications.manageapplications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -26,6 +27,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
import android.text.format.Formatter;
import android.view.View;
import android.widget.FrameLayout;
@@ -44,11 +46,12 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class PhotosViewHolderControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Fragment mFragment;
@Mock private StorageStatsSource mSource;
@Mock
private StorageStatsSource mSource;
private Context mContext;
private PhotosViewHolderController mController;
@@ -74,7 +77,8 @@ public class PhotosViewHolderControllerTest {
public void storageShouldBeZeroBytesIfQueriedBeforeStorageQueryFinishes() {
mController.setupView(mHolder);
assertThat(mHolder.mSummary.getText().toString()).isEqualTo("0.00 B");
assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
Formatter.formatFileSize(mContext, 0));
}
@Test
@@ -85,7 +89,8 @@ public class PhotosViewHolderControllerTest {
mController.queryStats();
mController.setupView(mHolder);
assertThat(mHolder.mSummary.getText().toString()).isEqualTo("11.00 B");
assertThat(mHolder.mSummary.getText().toString()).isEqualTo(
Formatter.formatFileSize(mContext, 11));
}
@Test

View File

@@ -45,7 +45,7 @@ import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {BackupSettingsActivityPreferenceControllerTest.ShadowBackupManager.class})
public class BackupSettingsActivityPreferenceControllerTest {
private static final String KEY_BACKUP_SETTINGS = "backup_settings";

View File

@@ -58,7 +58,7 @@ import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {BackupSettingsActivityTest.ShadowBackupSettingsHelper.class,
BackupSettingsActivityTest.ShadowUserHandle.class})
public class BackupSettingsActivityTest {

View File

@@ -50,7 +50,7 @@ import com.android.settings.TestConfig;
import com.android.settingslib.drawer.SettingsDrawerActivity;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {BackupSettingsHelperTest.ShadowBackupManagerStub.class})
public class BackupSettingsHelperTest {

View File

@@ -41,7 +41,7 @@ import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = {BackupSettingsPreferenceControllerTest.ShadowBackupSettingsHelper.class})
public class BackupSettingsPreferenceControllerTest {
private static final String BACKUP_SETTINGS = "backup_settings";

View File

@@ -41,7 +41,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AlwaysDiscoverableTest {
@Mock
private LocalBluetoothAdapter mLocalAdapter;

View File

@@ -43,7 +43,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = SettingsShadowBluetoothDevice.class)
public class BluetoothDetailsButtonsControllerTest extends BluetoothDetailsControllerTestBase {
private BluetoothDetailsButtonsController mController;

View File

@@ -28,14 +28,20 @@ import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.core.lifecycle.Lifecycle;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothDetailsControllerTestBase {
protected Context mContext;
protected Lifecycle mLifecycle;

View File

@@ -53,7 +53,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.fakes.RoboMenu;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothDeviceDetailsFragmentTest {
private BluetoothDeviceDetailsFragment mFragment;
private Context mContext;

View File

@@ -40,7 +40,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothDeviceNamePreferenceControllerTest {
private static final String DEVICE_NAME = "Nightshade";
private static final int ORDER = 1;

View File

@@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = SettingsShadowResources.class)
public class BluetoothDevicePreferenceTest {
private static final boolean SHOW_DEVICES_WITHOUT_NAMES = true;

View File

@@ -43,7 +43,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothDeviceRenamePreferenceControllerTest {
private static final String DEVICE_NAME = "Nightshade";

View File

@@ -58,7 +58,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
SettingsShadowResources.class, SettingsShadowResources.SettingsShadowTheme.class
})
public class BluetoothEnablerTest {

View File

@@ -35,7 +35,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothFilesPreferenceControllerTest {
private Context mContext;
private BluetoothFilesPreferenceController mController;

View File

@@ -47,7 +47,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothMasterSwitchPreferenceControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -52,7 +52,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothPairingDetailTest {
@Mock

View File

@@ -53,7 +53,7 @@ import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.FragmentTestUtil;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows=ShadowEventLogWriter.class)
public class BluetoothPairingDialogTest {

View File

@@ -49,7 +49,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothPairingPreferenceControllerTest {
private static final int ORDER = 1;
private Context mContext;

View File

@@ -35,7 +35,7 @@ import org.robolectric.annotation.Config;
import static org.mockito.Mockito.verify;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothSettingsSummaryProviderTest {
private Context mContext;

View File

@@ -50,7 +50,7 @@ import org.robolectric.annotation.Config;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothSettingsTest {
private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx";

View File

@@ -51,7 +51,7 @@ import java.util.HashSet;
import java.util.Set;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BluetoothSummaryUpdaterTest {
private static final String DEVICE_NAME = "Nightshade";
private static final String DEVICE_KEYBOARD_NAME = "Bluetooth Keyboard";

View File

@@ -49,7 +49,7 @@ import org.robolectric.annotation.Config;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DeviceListPreferenceFragmentTest {
private static final String FOOTAGE_MAC_STRING = "Bluetooth mac: xxxx";

View File

@@ -30,7 +30,7 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class DevicePickerFragmentTest {
@Mock
private LocalBluetoothAdapter mLocalAdapter;

View File

@@ -56,7 +56,7 @@ import java.util.ArrayList;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
ShadowEventLogWriter.class
})
public class DeviceProfilesSettingsTest {

View File

@@ -46,7 +46,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowDialog;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class ForgetDeviceDialogFragmentTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -50,7 +50,7 @@ import org.robolectric.shadows.ShadowDialog;
import org.robolectric.util.FragmentTestUtil;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class RemoteDeviceNameDialogFragmentTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = SettingsShadowResources.class)
public class UtilsTest {

View File

@@ -39,7 +39,7 @@ import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowThreadUtils.class)
public class AppDataUsagePreferenceTest {

View File

@@ -57,7 +57,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowEntityHeaderController.class)
public class AppDataUsageTest {

View File

@@ -44,7 +44,7 @@ import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class AppPrefLoaderTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)

View File

@@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O)
public class BillingCycleSettingsTest {
private static final int LIMIT_BYTES = 123;

Some files were not shown because too many files have changed in this diff Show More