DeviceInfo: Wrap prefereces in PreferenceController
Bug: 34774945 Test: make RunSettingsRoboTests Change-Id: I8bf56b436064684f4d2010e6899548249af69fc3
This commit is contained in:
@@ -39,8 +39,10 @@ import com.android.settings.dashboard.DashboardFragment;
|
|||||||
import com.android.settings.dashboard.SummaryLoader;
|
import com.android.settings.dashboard.SummaryLoader;
|
||||||
import com.android.settings.deviceinfo.AdditionalSystemUpdatePreferenceController;
|
import com.android.settings.deviceinfo.AdditionalSystemUpdatePreferenceController;
|
||||||
import com.android.settings.deviceinfo.BuildNumberPreferenceController;
|
import com.android.settings.deviceinfo.BuildNumberPreferenceController;
|
||||||
|
import com.android.settings.deviceinfo.FeedbackPreferenceController;
|
||||||
|
import com.android.settings.deviceinfo.KernelVersionPreferenceController;
|
||||||
import com.android.settings.deviceinfo.ManualPreferenceController;
|
import com.android.settings.deviceinfo.ManualPreferenceController;
|
||||||
import com.android.settings.deviceinfo.SystemUpdatePreferenceController;
|
import com.android.settings.deviceinfo.SafetyLegalPreferenceController;
|
||||||
import com.android.settings.search.BaseSearchIndexProvider;
|
import com.android.settings.search.BaseSearchIndexProvider;
|
||||||
import com.android.settings.search.Indexable;
|
import com.android.settings.search.Indexable;
|
||||||
import com.android.settingslib.DeviceInfoUtils;
|
import com.android.settingslib.DeviceInfoUtils;
|
||||||
@@ -57,9 +59,7 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
private static final String LOG_TAG = "DeviceInfoSettings";
|
private static final String LOG_TAG = "DeviceInfoSettings";
|
||||||
|
|
||||||
private static final String KEY_REGULATORY_INFO = "regulatory_info";
|
private static final String KEY_REGULATORY_INFO = "regulatory_info";
|
||||||
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
|
|
||||||
private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
|
private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
|
||||||
private static final String KEY_KERNEL_VERSION = "kernel_version";
|
|
||||||
private static final String KEY_DEVICE_MODEL = "device_model";
|
private static final String KEY_DEVICE_MODEL = "device_model";
|
||||||
private static final String KEY_SELINUX_STATUS = "selinux_status";
|
private static final String KEY_SELINUX_STATUS = "selinux_status";
|
||||||
private static final String KEY_BASEBAND_VERSION = "baseband_version";
|
private static final String KEY_BASEBAND_VERSION = "baseband_version";
|
||||||
@@ -67,8 +67,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
private static final String KEY_SECURITY_PATCH = "security_patch";
|
private static final String KEY_SECURITY_PATCH = "security_patch";
|
||||||
private static final String KEY_EQUIPMENT_ID = "fcc_equipment_id";
|
private static final String KEY_EQUIPMENT_ID = "fcc_equipment_id";
|
||||||
private static final String PROPERTY_EQUIPMENT_ID = "ro.ril.fccid";
|
private static final String PROPERTY_EQUIPMENT_ID = "ro.ril.fccid";
|
||||||
private static final String KEY_DEVICE_FEEDBACK = "device_feedback";
|
|
||||||
private static final String KEY_SAFETY_LEGAL = "safetylegal";
|
|
||||||
|
|
||||||
|
|
||||||
long[] mHits = new long[3];
|
long[] mHits = new long[3];
|
||||||
@@ -120,7 +118,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband");
|
setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband");
|
||||||
setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + DeviceInfoUtils.getMsvSuffix());
|
setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + DeviceInfoUtils.getMsvSuffix());
|
||||||
setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
|
setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
|
||||||
findPreference(KEY_KERNEL_VERSION).setSummary(DeviceInfoUtils.getFormattedKernelVersion());
|
|
||||||
|
|
||||||
if (!SELinux.isSELinuxEnabled()) {
|
if (!SELinux.isSELinuxEnabled()) {
|
||||||
String status = getResources().getString(R.string.selinux_status_disabled);
|
String status = getResources().getString(R.string.selinux_status_disabled);
|
||||||
@@ -134,10 +131,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_SELINUX_STATUS,
|
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_SELINUX_STATUS,
|
||||||
PROPERTY_SELINUX_STATUS);
|
PROPERTY_SELINUX_STATUS);
|
||||||
|
|
||||||
// Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
|
|
||||||
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_SAFETY_LEGAL,
|
|
||||||
PROPERTY_URL_SAFETYLEGAL);
|
|
||||||
|
|
||||||
// Remove Equipment id preference if FCC ID is not set by RIL
|
// Remove Equipment id preference if FCC ID is not set by RIL
|
||||||
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_EQUIPMENT_ID,
|
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_EQUIPMENT_ID,
|
||||||
PROPERTY_EQUIPMENT_ID);
|
PROPERTY_EQUIPMENT_ID);
|
||||||
@@ -147,11 +140,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
getPreferenceScreen().removePreference(findPreference(KEY_BASEBAND_VERSION));
|
getPreferenceScreen().removePreference(findPreference(KEY_BASEBAND_VERSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dont show feedback option if there is no reporter.
|
|
||||||
if (TextUtils.isEmpty(DeviceInfoUtils.getFeedbackReporterPackage(getActivity()))) {
|
|
||||||
getPreferenceScreen().removePreference(findPreference(KEY_DEVICE_FEEDBACK));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove regulatory labels if no activity present to handle intent.
|
// Remove regulatory labels if no activity present to handle intent.
|
||||||
removePreferenceIfActivityMissing(
|
removePreferenceIfActivityMissing(
|
||||||
KEY_REGULATORY_INFO, Settings.ACTION_SHOW_REGULATORY_INFO);
|
KEY_REGULATORY_INFO, Settings.ACTION_SHOW_REGULATORY_INFO);
|
||||||
@@ -171,9 +159,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(Preference preference) {
|
public boolean onPreferenceTreeClick(Preference preference) {
|
||||||
if (mBuildNumberPreferenceController.handlePreferenceTreeClick(preference)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (preference.getKey().equals(KEY_FIRMWARE_VERSION)) {
|
if (preference.getKey().equals(KEY_FIRMWARE_VERSION)) {
|
||||||
System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1);
|
System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1);
|
||||||
mHits[mHits.length - 1] = SystemClock.uptimeMillis();
|
mHits[mHits.length - 1] = SystemClock.uptimeMillis();
|
||||||
@@ -203,8 +188,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
+ "queryIntentActivities() returns empty");
|
+ "queryIntentActivities() returns empty");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (preference.getKey().equals(KEY_DEVICE_FEEDBACK)) {
|
|
||||||
sendFeedback();
|
|
||||||
}
|
}
|
||||||
return super.onPreferenceTreeClick(preference);
|
return super.onPreferenceTreeClick(preference);
|
||||||
}
|
}
|
||||||
@@ -228,6 +211,8 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
controllers.add(mBuildNumberPreferenceController);
|
controllers.add(mBuildNumberPreferenceController);
|
||||||
controllers.add(new AdditionalSystemUpdatePreferenceController(context));
|
controllers.add(new AdditionalSystemUpdatePreferenceController(context));
|
||||||
controllers.add(new ManualPreferenceController(context));
|
controllers.add(new ManualPreferenceController(context));
|
||||||
|
controllers.add(new FeedbackPreferenceController(this, context));
|
||||||
|
controllers.add(new KernelVersionPreferenceController(context));
|
||||||
return controllers;
|
return controllers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,16 +258,6 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFeedback() {
|
|
||||||
String reporterPackage = DeviceInfoUtils.getFeedbackReporterPackage(getActivity());
|
|
||||||
if (TextUtils.isEmpty(reporterPackage)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
|
|
||||||
intent.setPackage(reporterPackage);
|
|
||||||
startActivityForResult(intent, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class SummaryProvider implements SummaryLoader.SummaryProvider {
|
private static class SummaryProvider implements SummaryLoader.SummaryProvider {
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
@@ -331,9 +306,7 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
if (isPropertyMissing(PROPERTY_SELINUX_STATUS)) {
|
if (isPropertyMissing(PROPERTY_SELINUX_STATUS)) {
|
||||||
keys.add(KEY_SELINUX_STATUS);
|
keys.add(KEY_SELINUX_STATUS);
|
||||||
}
|
}
|
||||||
if (isPropertyMissing(PROPERTY_URL_SAFETYLEGAL)) {
|
new SafetyLegalPreferenceController(context).updateNonIndexableKeys(keys);
|
||||||
keys.add(KEY_SAFETY_LEGAL);
|
|
||||||
}
|
|
||||||
if (isPropertyMissing(PROPERTY_EQUIPMENT_ID)) {
|
if (isPropertyMissing(PROPERTY_EQUIPMENT_ID)) {
|
||||||
keys.add(KEY_EQUIPMENT_ID);
|
keys.add(KEY_EQUIPMENT_ID);
|
||||||
}
|
}
|
||||||
@@ -341,11 +314,8 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
if (Utils.isWifiOnly(context)) {
|
if (Utils.isWifiOnly(context)) {
|
||||||
keys.add((KEY_BASEBAND_VERSION));
|
keys.add((KEY_BASEBAND_VERSION));
|
||||||
}
|
}
|
||||||
// Dont show feedback option if there is no reporter.
|
|
||||||
if (TextUtils.isEmpty(DeviceInfoUtils.getFeedbackReporterPackage(context))) {
|
new FeedbackPreferenceController(null, context)
|
||||||
keys.add(KEY_DEVICE_FEEDBACK);
|
|
||||||
}
|
|
||||||
new SystemUpdatePreferenceController(context, UserManager.get(context))
|
|
||||||
.updateNonIndexableKeys(keys);
|
.updateNonIndexableKeys(keys);
|
||||||
new AdditionalSystemUpdatePreferenceController(context)
|
new AdditionalSystemUpdatePreferenceController(context)
|
||||||
.updateNonIndexableKeys(keys);
|
.updateNonIndexableKeys(keys);
|
||||||
|
@@ -0,0 +1,43 @@
|
|||||||
|
package com.android.settings.deviceinfo;
|
||||||
|
|
||||||
|
import android.app.Fragment;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.support.v7.preference.Preference;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.android.settings.core.PreferenceController;
|
||||||
|
import com.android.settingslib.DeviceInfoUtils;
|
||||||
|
|
||||||
|
public class FeedbackPreferenceController extends PreferenceController {
|
||||||
|
private static final String KEY_DEVICE_FEEDBACK = "device_feedback";
|
||||||
|
private final Fragment mHost;
|
||||||
|
|
||||||
|
public FeedbackPreferenceController(Fragment host, Context context) {
|
||||||
|
super(context);
|
||||||
|
this.mHost = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAvailable() {
|
||||||
|
return !TextUtils.isEmpty(DeviceInfoUtils.getFeedbackReporterPackage(this.mContext));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreferenceKey() {
|
||||||
|
return KEY_DEVICE_FEEDBACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||||
|
if (!TextUtils.equals(preference.getKey(), KEY_DEVICE_FEEDBACK)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!this.isAvailable()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String reporterPackage = DeviceInfoUtils.getFeedbackReporterPackage(this.mContext);
|
||||||
|
Intent intent = new Intent("android.intent.action.BUG_REPORT");
|
||||||
|
intent.setPackage(reporterPackage);
|
||||||
|
this.mHost.startActivityForResult(intent, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,32 @@
|
|||||||
|
package com.android.settings.deviceinfo;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.v7.preference.Preference;
|
||||||
|
|
||||||
|
import com.android.settings.core.PreferenceController;
|
||||||
|
import com.android.settingslib.DeviceInfoUtils;
|
||||||
|
|
||||||
|
public class KernelVersionPreferenceController extends PreferenceController {
|
||||||
|
|
||||||
|
private static final String KEY_KERNEL_VERSION = "kernel_version";
|
||||||
|
|
||||||
|
public KernelVersionPreferenceController(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAvailable() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState(Preference preference) {
|
||||||
|
super.updateState(preference);
|
||||||
|
preference.setSummary(DeviceInfoUtils.getFormattedKernelVersion());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPreferenceKey() {
|
||||||
|
return KEY_KERNEL_VERSION;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
package com.android.settings.deviceinfo;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.SystemProperties;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.android.settings.core.PreferenceController;
|
||||||
|
|
||||||
|
public class SafetyLegalPreferenceController extends PreferenceController {
|
||||||
|
|
||||||
|
private static final String KEY_SAFETY_LEGAL = "safetylegal";
|
||||||
|
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
|
||||||
|
|
||||||
|
|
||||||
|
public SafetyLegalPreferenceController(Context context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAvailable() {
|
||||||
|
return !TextUtils.isEmpty(SystemProperties.get(PROPERTY_URL_SAFETYLEGAL));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPreferenceKey() {
|
||||||
|
return KEY_SAFETY_LEGAL;
|
||||||
|
}
|
||||||
|
}
|
@@ -66,43 +66,4 @@ public class DeviceInfoSettingsTest extends AndroidTestCase {
|
|||||||
public void getPrefXml_shoudlReturnDeviceInfoXml() {
|
public void getPrefXml_shoudlReturnDeviceInfoXml() {
|
||||||
assertThat(mSettings.getPreferenceScreenResId()).isEqualTo(R.xml.device_info_settings);
|
assertThat(mSettings.getPreferenceScreenResId()).isEqualTo(R.xml.device_info_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetFormattedKernelVersion() throws Exception {
|
|
||||||
assertWithMessage("formatKernelVersion can't cope with this device's /proc/version")
|
|
||||||
.that(DeviceInfoUtils.getFormattedKernelVersion())
|
|
||||||
.isNotEqualTo("Unavailable");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFormatKernelVersion() throws Exception {
|
|
||||||
assertThat(DeviceInfoUtils.formatKernelVersion("")).isEqualTo("Unavailable");
|
|
||||||
assertThat(DeviceInfoUtils.formatKernelVersion("Linux version 2.6.38.8-gg784 " +
|
|
||||||
"(root@hpao4.eem.corp.google.com) " +
|
|
||||||
"(gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #2 SMP " +
|
|
||||||
"Fri Feb 24 03:31:23 PST 2012"))
|
|
||||||
.isEqualTo("2.6.38.8-gg784\n" +
|
|
||||||
"root@hpao4.eem.corp.google.com #2\n" +
|
|
||||||
"Fri Feb 24 03:31:23 PST 2012");
|
|
||||||
assertThat(DeviceInfoUtils.formatKernelVersion("Linux version 3.0.31-g6fb96c9 " +
|
|
||||||
"(android-build@vpbs1.mtv.corp.google.com) " +
|
|
||||||
"(gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 " +
|
|
||||||
"SMP PREEMPT Thu Jun 28 11:02:39 PDT 2012"))
|
|
||||||
.isEqualTo("3.0.31-g6fb96c9\n" +
|
|
||||||
"android-build@vpbs1.mtv.corp.google.com #1\n" +
|
|
||||||
"Thu Jun 28 11:02:39 PDT 2012");
|
|
||||||
assertThat(DeviceInfoUtils.formatKernelVersion("Linux version " +
|
|
||||||
"2.6.38.8-a-b-jellybean+ (x@y) " +
|
|
||||||
"(gcc version 4.4.3 (GCC) ) #1 PREEMPT Tue Aug 28 22:10:46 CDT 2012"))
|
|
||||||
.isEqualTo("2.6.38.8-a-b-jellybean+\n" +
|
|
||||||
"x@y #1\n" +
|
|
||||||
"Tue Aug 28 22:10:46 CDT 2012");
|
|
||||||
assertThat(DeviceInfoUtils.formatKernelVersion("Linux version " +
|
|
||||||
"3.18.31-g3ce5faa-dirty (x@y) (Android clang " +
|
|
||||||
"version 3.8.275480 (based on LLVM 3.8.275480)) " +
|
|
||||||
"#5 SMP PREEMPT Fri Oct 28 14:38:13 PDT 2016"))
|
|
||||||
.isEqualTo("3.18.31-g3ce5faa-dirty\n" +
|
|
||||||
"x@y #5\n" +
|
|
||||||
"Fri Oct 28 14:38:13 PDT 2016");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,44 @@
|
|||||||
|
package com.android.settings.deviceinfo;
|
||||||
|
|
||||||
|
import android.app.Fragment;
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.android.settings.SettingsRobolectricTestRunner;
|
||||||
|
import com.android.settings.TestConfig;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Answers;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.MockitoAnnotations;
|
||||||
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static org.mockito.Matchers.anyInt;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||||
|
public class FeedbackPreferenceControllerTest {
|
||||||
|
@Mock
|
||||||
|
private Fragment mFragment;
|
||||||
|
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||||
|
private Context mContext;
|
||||||
|
private FeedbackPreferenceController mController;
|
||||||
|
|
||||||
|
public FeedbackPreferenceControllerTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
MockitoAnnotations.initMocks(this);
|
||||||
|
this.mController = new FeedbackPreferenceController(this.mFragment, this.mContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isAvailable_noReporterPackage_shouldReturnFalse() {
|
||||||
|
when(this.mContext.getResources().getString(anyInt())).thenReturn("");
|
||||||
|
assertThat(Boolean.valueOf(this.mController.isAvailable())).isFalse();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,37 @@
|
|||||||
|
package com.android.settings.deviceinfo;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.android.settings.SettingsRobolectricTestRunner;
|
||||||
|
import com.android.settings.TestConfig;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.MockitoAnnotations;
|
||||||
|
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)
|
||||||
|
public class KernelVersionPreferenceControllerTest {
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private Context mContext;
|
||||||
|
private KernelVersionPreferenceController mController;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
MockitoAnnotations.initMocks(this);
|
||||||
|
mController = new KernelVersionPreferenceController(mContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void alwaysAvailable() {
|
||||||
|
assertThat(mController.isAvailable()).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user