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

Commit 90b78101 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Make formattedPhoneNumber @Nullable

This value could be null, make @Nullable will make sure the generated
SubscriptionInfoDao_Impl will be null safe for formattedPhoneNumber.

Bug: 289155281
Test: m Settings
Test: manual - on Settings Network & internet page
Change-Id: I4e8b1c3d59baaba658d05350b238033775db6aab
parent b7e76d28
Loading
Loading
Loading
Loading
+30 −34
Original line number Original line Diff line number Diff line
@@ -16,27 +16,23 @@


package com.android.settingslib.mobile.dataservice;
package com.android.settingslib.mobile.dataservice;


import static androidx.room.ForeignKey.CASCADE;

import android.text.TextUtils;
import android.text.TextUtils;


import java.util.Objects;

import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Nullable;
import androidx.room.ColumnInfo;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import androidx.room.PrimaryKey;


import java.util.Objects;

@Entity(tableName = DataServiceUtils.SubscriptionInfoData.TABLE_NAME)
@Entity(tableName = DataServiceUtils.SubscriptionInfoData.TABLE_NAME)
public class SubscriptionInfoEntity {
public class SubscriptionInfoEntity {
    public SubscriptionInfoEntity(@NonNull String subId, int simSlotIndex, int carrierId,
    public SubscriptionInfoEntity(@NonNull String subId, int simSlotIndex, int carrierId,
            String displayName, String carrierName, int dataRoaming, String mcc, String mnc,
            String displayName, String carrierName, int dataRoaming, String mcc, String mnc,
            String countryIso, boolean isEmbedded, int cardId, int portIndex,
            String countryIso, boolean isEmbedded, int cardId, int portIndex,
            boolean isOpportunistic, @Nullable String groupUUID, int subscriptionType,
            boolean isOpportunistic, @Nullable String groupUUID, int subscriptionType,
            String uniqueName, boolean isSubscriptionVisible, String formattedPhoneNumber,
            String uniqueName, boolean isSubscriptionVisible, @Nullable String formattedPhoneNumber,
            boolean isFirstRemovableSubscription, boolean isDefaultSubscriptionSelection,
            boolean isFirstRemovableSubscription, boolean isDefaultSubscriptionSelection,
            boolean isValidSubscription, boolean isUsableSubscription,
            boolean isValidSubscription, boolean isUsableSubscription,
            boolean isActiveSubscriptionId, boolean isAvailableSubscription,
            boolean isActiveSubscriptionId, boolean isAvailableSubscription,
@@ -123,6 +119,7 @@ public class SubscriptionInfoEntity {
    public boolean isSubscriptionVisible;
    public boolean isSubscriptionVisible;


    @ColumnInfo(name = DataServiceUtils.SubscriptionInfoData.COLUMN_FORMATTED_PHONE_NUMBER)
    @ColumnInfo(name = DataServiceUtils.SubscriptionInfoData.COLUMN_FORMATTED_PHONE_NUMBER)
    @Nullable
    public String formattedPhoneNumber;
    public String formattedPhoneNumber;


    @ColumnInfo(name = DataServiceUtils.SubscriptionInfoData.COLUMN_IS_FIRST_REMOVABLE_SUBSCRIPTION)
    @ColumnInfo(name = DataServiceUtils.SubscriptionInfoData.COLUMN_IS_FIRST_REMOVABLE_SUBSCRIPTION)
@@ -165,33 +162,32 @@ public class SubscriptionInfoEntity {


    @Override
    @Override
    public int hashCode() {
    public int hashCode() {
        int result = 17;
        return Objects.hash(
        result = 31 * result + subId.hashCode();
                subId,
        result = 31 * result + simSlotIndex;
                simSlotIndex,
        result = 31 * result + carrierId;
                carrierId,
        result = 31 * result + displayName.hashCode();
                displayName,
        result = 31 * result + carrierName.hashCode();
                carrierName,
        result = 31 * result + dataRoaming;
                dataRoaming,
        result = 31 * result + mcc.hashCode();
                mcc,
        result = 31 * result + mnc.hashCode();
                mnc,
        result = 31 * result + countryIso.hashCode();
                countryIso,
        result = 31 * result + Boolean.hashCode(isEmbedded);
                isEmbedded,
        result = 31 * result + cardId;
                cardId,
        result = 31 * result + portIndex;
                portIndex,
        result = 31 * result + Boolean.hashCode(isOpportunistic);
                isOpportunistic,
        result = 31 * result + groupUUID.hashCode();
                groupUUID,
        result = 31 * result + subscriptionType;
                subscriptionType,
        result = 31 * result + uniqueName.hashCode();
                uniqueName,
        result = 31 * result + Boolean.hashCode(isSubscriptionVisible);
                isSubscriptionVisible,
        result = 31 * result + formattedPhoneNumber.hashCode();
                formattedPhoneNumber,
        result = 31 * result + Boolean.hashCode(isFirstRemovableSubscription);
                isFirstRemovableSubscription,
        result = 31 * result + Boolean.hashCode(isDefaultSubscriptionSelection);
                isDefaultSubscriptionSelection,
        result = 31 * result + Boolean.hashCode(isValidSubscription);
                isValidSubscription,
        result = 31 * result + Boolean.hashCode(isUsableSubscription);
                isUsableSubscription,
        result = 31 * result + Boolean.hashCode(isActiveSubscriptionId);
                isActiveSubscriptionId,
        result = 31 * result + Boolean.hashCode(isAvailableSubscription);
                isAvailableSubscription,
        result = 31 * result + Boolean.hashCode(isActiveDataSubscriptionId);
                isActiveDataSubscriptionId);
        return result;
    }
    }


    @Override
    @Override