Loading telephony/common/com/android/internal/telephony/util/TelephonyUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.os.RemoteException; import android.os.SystemProperties; import java.io.PrintWriter; import java.util.Collections; import java.util.List; import java.util.function.Supplier; /** Loading Loading @@ -59,6 +61,11 @@ public final class TelephonyUtils { return str == null ? "" : str; } /** Returns an empty list if the input is {@code null}. */ public static @NonNull <T> List<T> emptyIfNull(@Nullable List<T> cur) { return cur == null ? Collections.emptyList() : cur; } /** Throws a {@link RuntimeException} that wrapps the {@link RemoteException}. */ public static RuntimeException rethrowAsRuntimeException(RemoteException remoteException) { throw new RuntimeException(remoteException); Loading telephony/java/android/telephony/PhoneCapability.java +8 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.AccessNetworkConstants.RadioAccessNetworkType; import android.telephony.TelephonyManager.NetworkTypeBitMask; import com.android.internal.util.CollectionUtils; import com.android.internal.telephony.util.TelephonyUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -181,13 +181,13 @@ public final class PhoneCapability implements Parcelable { this.mEutranUeCategoryUl = eutranUeCategoryUl; this.mPsDataConnectionLingerTimeMillis = psDataConnectionLingerTimeMillis; this.mSupportedRats = supportedRats; this.mGeranBands = CollectionUtils.emptyIfNull(geranBands); this.mUtranBands = CollectionUtils.emptyIfNull(utranBands); this.mEutranBands = CollectionUtils.emptyIfNull(eutranBands); this.mNgranBands = CollectionUtils.emptyIfNull(ngranBands); this.mLogicalModemUuids = CollectionUtils.emptyIfNull(logicalModemUuids); this.mSimSlotCapabilities = CollectionUtils.emptyIfNull(simSlotCapabilities); this.mConcurrentFeaturesSupport = CollectionUtils.emptyIfNull(concurrentFeaturesSupport); this.mGeranBands = TelephonyUtils.emptyIfNull(geranBands); this.mUtranBands = TelephonyUtils.emptyIfNull(utranBands); this.mEutranBands = TelephonyUtils.emptyIfNull(eutranBands); this.mNgranBands = TelephonyUtils.emptyIfNull(ngranBands); this.mLogicalModemUuids = TelephonyUtils.emptyIfNull(logicalModemUuids); this.mSimSlotCapabilities = TelephonyUtils.emptyIfNull(simSlotCapabilities); this.mConcurrentFeaturesSupport = TelephonyUtils.emptyIfNull(concurrentFeaturesSupport); } private PhoneCapability(Parcel in) { Loading Loading
telephony/common/com/android/internal/telephony/util/TelephonyUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.os.RemoteException; import android.os.SystemProperties; import java.io.PrintWriter; import java.util.Collections; import java.util.List; import java.util.function.Supplier; /** Loading Loading @@ -59,6 +61,11 @@ public final class TelephonyUtils { return str == null ? "" : str; } /** Returns an empty list if the input is {@code null}. */ public static @NonNull <T> List<T> emptyIfNull(@Nullable List<T> cur) { return cur == null ? Collections.emptyList() : cur; } /** Throws a {@link RuntimeException} that wrapps the {@link RemoteException}. */ public static RuntimeException rethrowAsRuntimeException(RemoteException remoteException) { throw new RuntimeException(remoteException); Loading
telephony/java/android/telephony/PhoneCapability.java +8 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import android.telephony.AccessNetworkConstants.AccessNetworkType; import android.telephony.AccessNetworkConstants.RadioAccessNetworkType; import android.telephony.TelephonyManager.NetworkTypeBitMask; import com.android.internal.util.CollectionUtils; import com.android.internal.telephony.util.TelephonyUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -181,13 +181,13 @@ public final class PhoneCapability implements Parcelable { this.mEutranUeCategoryUl = eutranUeCategoryUl; this.mPsDataConnectionLingerTimeMillis = psDataConnectionLingerTimeMillis; this.mSupportedRats = supportedRats; this.mGeranBands = CollectionUtils.emptyIfNull(geranBands); this.mUtranBands = CollectionUtils.emptyIfNull(utranBands); this.mEutranBands = CollectionUtils.emptyIfNull(eutranBands); this.mNgranBands = CollectionUtils.emptyIfNull(ngranBands); this.mLogicalModemUuids = CollectionUtils.emptyIfNull(logicalModemUuids); this.mSimSlotCapabilities = CollectionUtils.emptyIfNull(simSlotCapabilities); this.mConcurrentFeaturesSupport = CollectionUtils.emptyIfNull(concurrentFeaturesSupport); this.mGeranBands = TelephonyUtils.emptyIfNull(geranBands); this.mUtranBands = TelephonyUtils.emptyIfNull(utranBands); this.mEutranBands = TelephonyUtils.emptyIfNull(eutranBands); this.mNgranBands = TelephonyUtils.emptyIfNull(ngranBands); this.mLogicalModemUuids = TelephonyUtils.emptyIfNull(logicalModemUuids); this.mSimSlotCapabilities = TelephonyUtils.emptyIfNull(simSlotCapabilities); this.mConcurrentFeaturesSupport = TelephonyUtils.emptyIfNull(concurrentFeaturesSupport); } private PhoneCapability(Parcel in) { Loading