Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd31dc6c authored by Malcolm Chen's avatar Malcolm Chen
Browse files

Define a telephony database column for uicc applications enabled or not.

Bug: 141018421
Test: unittest
Change-Id: I5d4f1ec1bc3832c471fd43f3024cd79383d8d3d6
parent b8109e77
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -9499,6 +9499,7 @@ package android.telephony {
  }
  }
  public class SubscriptionInfo implements android.os.Parcelable {
  public class SubscriptionInfo implements android.os.Parcelable {
    method public boolean areUiccApplicationsEnabled();
    method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
    method @Nullable public java.util.List<android.telephony.UiccAccessRule> getAccessRules();
    method public int getProfileClass();
    method public int getProfileClass();
    method public boolean isGroupDisabled();
    method public boolean isGroupDisabled();
+29 −8
Original line number Original line Diff line number Diff line
@@ -208,6 +208,12 @@ public class SubscriptionInfo implements Parcelable {
     */
     */
    private int mSubscriptionType;
    private int mSubscriptionType;


    /**
     * Whether uicc applications are configured to enable or disable.
     * By default it's true.
     */
    private boolean mAreUiccApplicationsEnabled = true;

    /**
    /**
     * @hide
     * @hide
     */
     */
@@ -219,7 +225,7 @@ public class SubscriptionInfo implements Parcelable {
                roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1,
                roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1,
                false, null, false, TelephonyManager.UNKNOWN_CARRIER_ID,
                false, null, false, TelephonyManager.UNKNOWN_CARRIER_ID,
                SubscriptionManager.PROFILE_CLASS_DEFAULT,
                SubscriptionManager.PROFILE_CLASS_DEFAULT,
                SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null);
                SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null, true);
    }
    }


    /**
    /**
@@ -233,7 +239,7 @@ public class SubscriptionInfo implements Parcelable {
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
        this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number,
                roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1,
                roaming, icon, mcc, mnc, countryIso, isEmbedded, nativeAccessRules, cardString, -1,
                isOpportunistic, groupUUID, false, carrierId, profileClass,
                isOpportunistic, groupUUID, false, carrierId, profileClass,
                SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null);
                SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM, null, null, true);
    }
    }


    /**
    /**
@@ -245,7 +251,8 @@ public class SubscriptionInfo implements Parcelable {
            @Nullable UiccAccessRule[] nativeAccessRules, String cardString, int cardId,
            @Nullable UiccAccessRule[] nativeAccessRules, String cardString, int cardId,
            boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled,
            boolean isOpportunistic, @Nullable String groupUUID, boolean isGroupDisabled,
            int carrierId, int profileClass, int subType, @Nullable String groupOwner,
            int carrierId, int profileClass, int subType, @Nullable String groupOwner,
            @Nullable UiccAccessRule[] carrierConfigAccessRules) {
            @Nullable UiccAccessRule[] carrierConfigAccessRules,
            boolean areUiccApplicationsEnabled) {
        this.mId = id;
        this.mId = id;
        this.mIccId = iccId;
        this.mIccId = iccId;
        this.mSimSlotIndex = simSlotIndex;
        this.mSimSlotIndex = simSlotIndex;
@@ -271,6 +278,7 @@ public class SubscriptionInfo implements Parcelable {
        this.mSubscriptionType = subType;
        this.mSubscriptionType = subType;
        this.mGroupOwner = groupOwner;
        this.mGroupOwner = groupOwner;
        this.mCarrierConfigAccessRules = carrierConfigAccessRules;
        this.mCarrierConfigAccessRules = carrierConfigAccessRules;
        this.mAreUiccApplicationsEnabled = areUiccApplicationsEnabled;
    }
    }


    /**
    /**
@@ -659,6 +667,15 @@ public class SubscriptionInfo implements Parcelable {
        return mIsGroupDisabled;
        return mIsGroupDisabled;
    }
    }


    /**
     * Return whether uicc applications are set to be enabled or disabled.
     * @hide
     */
    @SystemApi
    public boolean areUiccApplicationsEnabled() {
        return mAreUiccApplicationsEnabled;
    }

    public static final @android.annotation.NonNull Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
    public static final @android.annotation.NonNull Parcelable.Creator<SubscriptionInfo> CREATOR = new Parcelable.Creator<SubscriptionInfo>() {
        @Override
        @Override
        public SubscriptionInfo createFromParcel(Parcel source) {
        public SubscriptionInfo createFromParcel(Parcel source) {
@@ -690,12 +707,13 @@ public class SubscriptionInfo implements Parcelable {
            String groupOwner = source.readString();
            String groupOwner = source.readString();
            UiccAccessRule[] carrierConfigAccessRules = source.createTypedArray(
            UiccAccessRule[] carrierConfigAccessRules = source.createTypedArray(
                UiccAccessRule.CREATOR);
                UiccAccessRule.CREATOR);
            boolean areUiccApplicationsEnabled = source.readBoolean();


            SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName,
            SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName,
                    carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc,
                    carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc,
                    countryIso, isEmbedded, nativeAccessRules, cardString, cardId, isOpportunistic,
                    countryIso, isEmbedded, nativeAccessRules, cardString, cardId, isOpportunistic,
                    groupUUID, isGroupDisabled, carrierid, profileClass, subType, groupOwner,
                    groupUUID, isGroupDisabled, carrierid, profileClass, subType, groupOwner,
                    carrierConfigAccessRules);
                    carrierConfigAccessRules, areUiccApplicationsEnabled);
            info.setAssociatedPlmns(ehplmns, hplmns);
            info.setAssociatedPlmns(ehplmns, hplmns);
            return info;
            return info;
        }
        }
@@ -735,6 +753,7 @@ public class SubscriptionInfo implements Parcelable {
        dest.writeStringArray(mHplmns);
        dest.writeStringArray(mHplmns);
        dest.writeString(mGroupOwner);
        dest.writeString(mGroupOwner);
        dest.writeTypedArray(mCarrierConfigAccessRules, flags);
        dest.writeTypedArray(mCarrierConfigAccessRules, flags);
        dest.writeBoolean(mAreUiccApplicationsEnabled);
    }
    }


    @Override
    @Override
@@ -776,15 +795,16 @@ public class SubscriptionInfo implements Parcelable {
                + " hplmns=" + Arrays.toString(mHplmns)
                + " hplmns=" + Arrays.toString(mHplmns)
                + " subscriptionType=" + mSubscriptionType
                + " subscriptionType=" + mSubscriptionType
                + " mGroupOwner=" + mGroupOwner
                + " mGroupOwner=" + mGroupOwner
                + " carrierConfigAccessRules=" + mCarrierConfigAccessRules + "}";
                + " carrierConfigAccessRules=" + mCarrierConfigAccessRules
                + " mAreUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled + "}";
    }
    }


    @Override
    @Override
    public int hashCode() {
    public int hashCode() {
        return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
        return Objects.hash(mId, mSimSlotIndex, mNameSource, mIconTint, mDataRoaming, mIsEmbedded,
                mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc,
                mIsOpportunistic, mGroupUUID, mIccId, mNumber, mMcc, mMnc, mCountryIso, mCardString,
                mCountryIso, mCardString, mCardId, mDisplayName, mCarrierName, mNativeAccessRules,
                mCardId, mDisplayName, mCarrierName, mNativeAccessRules, mIsGroupDisabled,
                mIsGroupDisabled, mCarrierId, mProfileClass, mGroupOwner);
                mCarrierId, mProfileClass, mGroupOwner, mAreUiccApplicationsEnabled);
    }
    }


    @Override
    @Override
@@ -807,6 +827,7 @@ public class SubscriptionInfo implements Parcelable {
                && mIsEmbedded == toCompare.mIsEmbedded
                && mIsEmbedded == toCompare.mIsEmbedded
                && mIsOpportunistic == toCompare.mIsOpportunistic
                && mIsOpportunistic == toCompare.mIsOpportunistic
                && mIsGroupDisabled == toCompare.mIsGroupDisabled
                && mIsGroupDisabled == toCompare.mIsGroupDisabled
                && mAreUiccApplicationsEnabled == toCompare.mAreUiccApplicationsEnabled
                && mCarrierId == toCompare.mCarrierId
                && mCarrierId == toCompare.mCarrierId
                && Objects.equals(mGroupUUID, toCompare.mGroupUUID)
                && Objects.equals(mGroupUUID, toCompare.mGroupUUID)
                && Objects.equals(mIccId, toCompare.mIccId)
                && Objects.equals(mIccId, toCompare.mIccId)
+6 −0
Original line number Original line Diff line number Diff line
@@ -834,6 +834,12 @@ public class SubscriptionManager {
    //TODO: add @SystemApi
    //TODO: add @SystemApi
    public static final String IMSI = "imsi";
    public static final String IMSI = "imsi";


    /**
     * Whether uicc applications is set to be enabled or disabled. By default it's enabled.
     * @hide
     */
    public static final String UICC_APPLICATIONS_ENABLED = "uicc_applications_enabled";

    /**
    /**
     * Broadcast Action: The user has changed one of the default subs related to
     * Broadcast Action: The user has changed one of the default subs related to
     * data, phone calls, or sms</p>
     * data, phone calls, or sms</p>