From b838a7528769c7ee8e73be797abb629e13ef70c0 Mon Sep 17 00:00:00 2001 From: arunvoddu Date: Tue, 25 Jan 2022 14:59:28 +0000 Subject: [PATCH] Added carrier_id support to the carrier_key table in CarrierInformation DB Bug: b/191919168 Test: Buid, aTest verification Passed Change-Id: Ib51d6eb5231ceb65fffa8e83706c47ce17afd640 Merged-In: Ib51d6eb5231ceb65fffa8e83706c47ce17afd640 --- core/java/android/provider/Telephony.java | 24 ++++--------------- .../android/telephony/ImsiEncryptionInfo.java | 18 ++++++++++---- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java index 0d5ef34c6f763..5b59b2120e19e 100644 --- a/core/java/android/provider/Telephony.java +++ b/core/java/android/provider/Telephony.java @@ -1424,25 +1424,6 @@ public final class Telephony { */ public static final String KEY_TYPE = "key_type"; - /** - * MVNO type: - * {@code SPN (Service Provider Name), IMSI, GID (Group Identifier Level 1)}. - *

Type: TEXT

- */ - public static final String MVNO_TYPE = "mvno_type"; - - /** - * MVNO data. - * Use the following examples. - * - *

Type: TEXT

- */ - public static final String MVNO_MATCH_DATA = "mvno_match_data"; - /** * The carrier public key that is used for the IMSI encryption. *

Type: TEXT

@@ -1469,6 +1450,11 @@ public final class Telephony { */ public static final String LAST_MODIFIED = "last_modified"; + /** + * Carrier ID of the operetor. + *

Type: TEXT

+ */ + public static final String CARRIER_ID = "carrier_id"; /** * The {@code content://} style URL for this table. */ diff --git a/telephony/java/android/telephony/ImsiEncryptionInfo.java b/telephony/java/android/telephony/ImsiEncryptionInfo.java index 4978692d3964d..82333a46914b6 100644 --- a/telephony/java/android/telephony/ImsiEncryptionInfo.java +++ b/telephony/java/android/telephony/ImsiEncryptionInfo.java @@ -46,16 +46,17 @@ public final class ImsiEncryptionInfo implements Parcelable { private final int keyType; //Date-Time in UTC when the key will expire. private final Date expirationTime; + private final int carrierId; /** @hide */ public ImsiEncryptionInfo(String mcc, String mnc, int keyType, String keyIdentifier, - byte[] key, Date expirationTime) { - this(mcc, mnc, keyType, keyIdentifier, makeKeyObject(key), expirationTime); + byte[] key, Date expirationTime, int carrierId) { + this(mcc, mnc, keyType, keyIdentifier, makeKeyObject(key), expirationTime, carrierId); } /** @hide */ public ImsiEncryptionInfo(String mcc, String mnc, int keyType, String keyIdentifier, - PublicKey publicKey, Date expirationTime) { + PublicKey publicKey, Date expirationTime, int carrierId) { // todo need to validate that ImsiEncryptionInfo is being created with the correct params. // Including validating that the public key is in "X.509" format. This will be done in // a subsequent CL. @@ -65,6 +66,7 @@ public final class ImsiEncryptionInfo implements Parcelable { this.publicKey = publicKey; this.keyIdentifier = keyIdentifier; this.expirationTime = expirationTime; + this.carrierId = carrierId; } /** @hide */ @@ -78,6 +80,7 @@ public final class ImsiEncryptionInfo implements Parcelable { keyIdentifier = in.readString(); keyType = in.readInt(); expirationTime = new Date(in.readLong()); + carrierId = in.readInt(); } /** @hide */ @@ -90,6 +93,11 @@ public final class ImsiEncryptionInfo implements Parcelable { return this.mcc; } + /** @hide */ + public int getCarrierId() { + return carrierId; + } + /** * Returns key identifier, a string that helps the authentication server to locate the * private key to decrypt the permanent identity, or {@code null} when uavailable. @@ -157,6 +165,7 @@ public final class ImsiEncryptionInfo implements Parcelable { dest.writeString(keyIdentifier); dest.writeInt(keyType); dest.writeLong(expirationTime.getTime()); + dest.writeInt(carrierId); } @Override @@ -164,10 +173,11 @@ public final class ImsiEncryptionInfo implements Parcelable { return "[ImsiEncryptionInfo " + "mcc=" + mcc + " mnc=" + mnc - + " publicKey=" + publicKey + + ", publicKey=" + publicKey + ", keyIdentifier=" + keyIdentifier + ", keyType=" + keyType + ", expirationTime=" + expirationTime + + ", carrier_id=" + carrierId + "]"; } }