Loading core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,29 @@ public class EuiccProfileInfoTest { assertEquals(p.hashCode(), copied.hashCode()); } @Test public void testBuilder_BasedOnAnotherProfileWithEmptyAccessRules() { EuiccProfileInfo p = new EuiccProfileInfo.Builder("21430000000000006587") .setNickname("profile nickname") .setProfileName("profile name") .setServiceProviderName("service provider") .setCarrierIdentifier( new CarrierIdentifier( new byte[] {0x23, 0x45, 0x67}, "123", "45")) .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED) .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL) .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE) .setUiccAccessRule(null) .build(); EuiccProfileInfo copied = new EuiccProfileInfo.Builder(p).build(); assertEquals(null, copied.getUiccAccessRules()); } @Test public void testEqualsHashCode() { EuiccProfileInfo p = Loading telephony/java/android/service/euicc/EuiccProfileInfo.java +4 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.text.TextUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; Loading Loading @@ -231,7 +232,9 @@ public final class EuiccProfileInfo implements Parcelable { mState = baseProfile.mState; mCarrierIdentifier = baseProfile.mCarrierIdentifier; mPolicyRules = baseProfile.mPolicyRules; mAccessRules = Arrays.asList(baseProfile.mAccessRules); mAccessRules = baseProfile.mAccessRules == null ? Collections.emptyList() : Arrays.asList(baseProfile.mAccessRules); } /** Builds the profile instance. */ Loading Loading
core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java +23 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,29 @@ public class EuiccProfileInfoTest { assertEquals(p.hashCode(), copied.hashCode()); } @Test public void testBuilder_BasedOnAnotherProfileWithEmptyAccessRules() { EuiccProfileInfo p = new EuiccProfileInfo.Builder("21430000000000006587") .setNickname("profile nickname") .setProfileName("profile name") .setServiceProviderName("service provider") .setCarrierIdentifier( new CarrierIdentifier( new byte[] {0x23, 0x45, 0x67}, "123", "45")) .setState(EuiccProfileInfo.PROFILE_STATE_ENABLED) .setProfileClass(EuiccProfileInfo.PROFILE_CLASS_OPERATIONAL) .setPolicyRules(EuiccProfileInfo.POLICY_RULE_DO_NOT_DELETE) .setUiccAccessRule(null) .build(); EuiccProfileInfo copied = new EuiccProfileInfo.Builder(p).build(); assertEquals(null, copied.getUiccAccessRules()); } @Test public void testEqualsHashCode() { EuiccProfileInfo p = Loading
telephony/java/android/service/euicc/EuiccProfileInfo.java +4 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.text.TextUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; Loading Loading @@ -231,7 +232,9 @@ public final class EuiccProfileInfo implements Parcelable { mState = baseProfile.mState; mCarrierIdentifier = baseProfile.mCarrierIdentifier; mPolicyRules = baseProfile.mPolicyRules; mAccessRules = Arrays.asList(baseProfile.mAccessRules); mAccessRules = baseProfile.mAccessRules == null ? Collections.emptyList() : Arrays.asList(baseProfile.mAccessRules); } /** Builds the profile instance. */ Loading