Merge "Remove the option of resetting Euicc data." am: 604c7a7cfa am: fbf2d0bc55

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1804237

Change-Id: Iaf54828eaec9c24a83aaddec90d775dafab6dd34
This commit is contained in:
Treehugger Robot
2021-09-09 10:46:10 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
package com.android.settings.network;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import androidx.preference.Preference;
@@ -50,6 +51,8 @@ public class EraseEuiccDataController extends BasePreferenceController {
@Override
public int getAvailabilityStatus() {
return AVAILABLE_UNSEARCHABLE;
return mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_TELEPHONY_EUICC) ? AVAILABLE_UNSEARCHABLE
: UNSUPPORTED_ON_DEVICE;
}
}

View File

@@ -26,6 +26,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.android.settings.core.BasePreferenceController;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,6 +43,7 @@ public class EraseEuiccDataControllerTest {
mController = new EraseEuiccDataController(context, ERASE_EUICC_DATA_PREFERENCE_KEY);
}
@Ignore("Will not work on devices without FEATURE_TELEPHONY_EUICC")
@Test
public void getAvailabilityStatus_returnAVAILABLE_UNSEARCHABLE() {
assertThat(mController.getAvailabilityStatus())