diff options
49 files changed, 216 insertions, 833 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 131db7320f3f..0eba9d75fdfc 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -31427,6 +31427,7 @@ package android.os { method public int dataSize(); method public void enforceInterface(@NonNull String); method public boolean hasFileDescriptors(); + method public boolean hasFileDescriptors(int, int); method public byte[] marshall(); method @NonNull public static android.os.Parcel obtain(); method @NonNull public static android.os.Parcel obtain(@NonNull android.os.IBinder); diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 4a732e544722..13f7cfb94124 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -2128,6 +2128,7 @@ package android.bluetooth { field @NonNull public static final android.os.ParcelUuid AVRCP_TARGET; field @NonNull public static final android.os.ParcelUuid BASE_UUID; field @NonNull public static final android.os.ParcelUuid BNEP; + field @NonNull public static final android.os.ParcelUuid CAP; field @NonNull public static final android.os.ParcelUuid COORDINATED_SET; field @NonNull public static final android.os.ParcelUuid DIP; field @NonNull public static final android.os.ParcelUuid GENERIC_MEDIA_CONTROL; diff --git a/core/java/android/app/time/OWNERS b/core/java/android/app/time/OWNERS index 8f8089717e3b..ef357e5a3b6a 100644 --- a/core/java/android/app/time/OWNERS +++ b/core/java/android/app/time/OWNERS @@ -1,3 +1,4 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# The app-facing APIs related to both time and time zone detection. +include /services/core/java/com/android/server/timedetector/OWNERS +include /services/core/java/com/android/server/timezonedetector/OWNERS diff --git a/core/java/android/app/timedetector/OWNERS b/core/java/android/app/timedetector/OWNERS index 941eed8de631..e9dbe4a0007d 100644 --- a/core/java/android/app/timedetector/OWNERS +++ b/core/java/android/app/timedetector/OWNERS @@ -1,4 +1,3 @@ # Bug component: 847766 -mingaleev@google.com -narayan@google.com -nfuller@google.com +# Internal APIs related to time detection. SDK APIs are in android.app.time. +include /services/core/java/com/android/server/timedetector/OWNERS diff --git a/core/java/android/app/timezone/OWNERS b/core/java/android/app/timezone/OWNERS index 8f8089717e3b..04d78f23517f 100644 --- a/core/java/android/app/timezone/OWNERS +++ b/core/java/android/app/timezone/OWNERS @@ -1,3 +1,4 @@ -# Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Bug component: 24949 +# Internal APIs related to APK-based time zone rule updates. +# Deprecated, deletion tracked by b/148144561 +include /services/core/java/com/android/server/timezone/OWNERS diff --git a/core/java/android/app/timezonedetector/OWNERS b/core/java/android/app/timezonedetector/OWNERS index 8f8089717e3b..fa03f1e835fd 100644 --- a/core/java/android/app/timezonedetector/OWNERS +++ b/core/java/android/app/timezonedetector/OWNERS @@ -1,3 +1,3 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Internal APIs related to time zone detection. SDK APIs are in android.app.time. +include /services/core/java/com/android/server/timezonedetector/OWNERS diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java index 325a77107255..858819e15abc 100644 --- a/core/java/android/bluetooth/BluetoothUuid.java +++ b/core/java/android/bluetooth/BluetoothUuid.java @@ -188,6 +188,11 @@ public final class BluetoothUuid { /** @hide */ @NonNull @SystemApi + public static final ParcelUuid CAP = + ParcelUuid.fromString("EEEEEEEE-EEEE-EEEE-EEEE-EEEEEEEEEEEE"); + /** @hide */ + @NonNull + @SystemApi public static final ParcelUuid BASE_UUID = ParcelUuid.fromString("00000000-0000-1000-8000-00805F9B34FB"); diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 44d51db80f86..fa578be0c984 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -384,6 +384,8 @@ public final class Parcel { long thisNativePtr, long otherNativePtr, int offset, int length); @CriticalNative private static native boolean nativeHasFileDescriptors(long nativePtr); + private static native boolean nativeHasFileDescriptorsInRange( + long nativePtr, int offset, int length); private static native void nativeWriteInterfaceToken(long nativePtr, String interfaceName); private static native void nativeEnforceInterface(long nativePtr, String interfaceName); @@ -717,11 +719,26 @@ public final class Parcel { /** * Report whether the parcel contains any marshalled file descriptors. */ - public final boolean hasFileDescriptors() { + public boolean hasFileDescriptors() { return nativeHasFileDescriptors(mNativePtr); } /** + * Report whether the parcel contains any marshalled file descriptors in the range defined by + * {@code offset} and {@code length}. + * + * @param offset The offset from which the range starts. Should be between 0 and + * {@link #dataSize()}. + * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code + * offset}. + * @return whether there are file descriptors or not. + * @throws IllegalArgumentException if the parameters are out of the permitted ranges. + */ + public boolean hasFileDescriptors(int offset, int length) { + return nativeHasFileDescriptorsInRange(mNativePtr, offset, length); + } + + /** * Check if the object used in {@link #readValue(ClassLoader)} / {@link #writeValue(Object)} * has file descriptors. * @@ -3536,15 +3553,26 @@ public final class Parcel { int start = dataPosition(); int type = readInt(); if (isLengthPrefixed(type)) { - int length = readInt(); - setDataPosition(MathUtils.addOrThrow(dataPosition(), length)); - return new LazyValue(this, start, length, type, loader); + int objectLength = readInt(); + int end = MathUtils.addOrThrow(dataPosition(), objectLength); + int valueLength = end - start; + setDataPosition(end); + return new LazyValue(this, start, valueLength, type, loader); } else { return readValue(type, loader, /* clazz */ null); } } + private static final class LazyValue implements Supplier<Object> { + /** + * | 4B | 4B | + * mSource = Parcel{... | type | length | object | ...} + * a b c d + * length = d - c + * mPosition = a + * mLength = d - a + */ private final int mPosition; private final int mLength; private final int mType; @@ -3592,7 +3620,7 @@ public final class Parcel { public void writeToParcel(Parcel out) { Parcel source = mSource; if (source != null) { - out.appendFrom(source, mPosition, mLength + 8); + out.appendFrom(source, mPosition, mLength); } else { out.writeValue(mObject); } @@ -3601,7 +3629,7 @@ public final class Parcel { public boolean hasFileDescriptors() { Parcel source = mSource; return (source != null) - ? getValueParcel(source).hasFileDescriptors() + ? source.hasFileDescriptors(mPosition, mLength) : Parcel.hasFileDescriptors(mObject); } @@ -3662,10 +3690,7 @@ public final class Parcel { Parcel parcel = mValueParcel; if (parcel == null) { parcel = Parcel.obtain(); - // mLength is the length of object representation, excluding the type and length. - // mPosition is the position of the entire value container, right before the type. - // So, we add 4 bytes for the type + 4 bytes for the length written. - parcel.appendFrom(source, mPosition, mLength + 8); + parcel.appendFrom(source, mPosition, mLength); mValueParcel = parcel; } return parcel; diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index 51f19ebee987..b4acb67d2979 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -706,6 +706,25 @@ public class CallLog { /** * Contains the recent calls. + * <p> + * Note: If you want to query the call log and limit the results to a single value, you should + * append the {@link #LIMIT_PARAM_KEY} parameter to the content URI. For example: + * <pre> + * {@code + * getContentResolver().query( + * Calls.CONTENT_URI.buildUpon().appendQueryParameter(LIMIT_PARAM_KEY, "1") + * .build(), + * null, null, null, null); + * } + * </pre> + * <p> + * The call log provider enforces strict SQL grammar, so you CANNOT append "LIMIT" to the SQL + * query as below: + * <pre> + * {@code + * getContentResolver().query(Calls.CONTENT_URI, null, "LIMIT 1", null, null); + * } + * </pre> */ public static class Calls implements BaseColumns { /** diff --git a/core/java/android/service/timezone/OWNERS b/core/java/android/service/timezone/OWNERS index 28aff188dbd8..b5144d17a14c 100644 --- a/core/java/android/service/timezone/OWNERS +++ b/core/java/android/service/timezone/OWNERS @@ -1,3 +1,3 @@ # Bug component: 847766 -nfuller@google.com -include /core/java/android/app/timedetector/OWNERS +# System APIs for system server time zone detection plugins. +include /services/core/java/com/android/server/timezonedetector/OWNERS diff --git a/core/java/android/timezone/OWNERS b/core/java/android/timezone/OWNERS index 8f8089717e3b..8b5e15635a73 100644 --- a/core/java/android/timezone/OWNERS +++ b/core/java/android/timezone/OWNERS @@ -1,3 +1,5 @@ -# Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Bug component: 24949 +# APIs originally intended to provide a stable API surface to access time zone rules data for use by +# unbundled components like a telephony mainline module and the ART module. Not exposed, potentially +# deletable if callers do not unbundle. +include platform/libcore:/OWNERS diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp index 42ff39535567..8fee610180ca 100644 --- a/core/jni/android_os_Parcel.cpp +++ b/core/jni/android_os_Parcel.cpp @@ -635,6 +635,22 @@ static jboolean android_os_Parcel_hasFileDescriptors(jlong nativePtr) return ret; } +static jboolean android_os_Parcel_hasFileDescriptorsInRange(JNIEnv* env, jclass clazz, + jlong nativePtr, jint offset, + jint length) { + Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr); + if (parcel != NULL) { + bool result; + status_t err = parcel->hasFileDescriptorsInRange(offset, length, result); + if (err != NO_ERROR) { + signalExceptionForError(env, clazz, err); + return JNI_FALSE; + } + return result ? JNI_TRUE : JNI_FALSE; + } + return JNI_FALSE; +} + // String tries to allocate itself on the stack, within a known size, but will // make a heap allocation if not. template <size_t StackReserve> @@ -828,6 +844,7 @@ static const JNINativeMethod gParcelMethods[] = { {"nativeAppendFrom", "(JJII)V", (void*)android_os_Parcel_appendFrom}, // @CriticalNative {"nativeHasFileDescriptors", "(J)Z", (void*)android_os_Parcel_hasFileDescriptors}, + {"nativeHasFileDescriptorsInRange", "(JII)Z", (void*)android_os_Parcel_hasFileDescriptorsInRange}, {"nativeWriteInterfaceToken", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeInterfaceToken}, {"nativeEnforceInterface", "(JLjava/lang/String;)V", (void*)android_os_Parcel_enforceInterface}, diff --git a/core/tests/coretests/src/android/app/time/OWNERS b/core/tests/coretests/src/android/app/time/OWNERS index 8f8089717e3b..292cb72f2dbe 100644 --- a/core/tests/coretests/src/android/app/time/OWNERS +++ b/core/tests/coretests/src/android/app/time/OWNERS @@ -1,3 +1,2 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +include /core/java/android/app/time/OWNERS diff --git a/core/tests/coretests/src/android/app/timedetector/OWNERS b/core/tests/coretests/src/android/app/timedetector/OWNERS index 8f8089717e3b..c6124734bc5c 100644 --- a/core/tests/coretests/src/android/app/timedetector/OWNERS +++ b/core/tests/coretests/src/android/app/timedetector/OWNERS @@ -1,3 +1,2 @@ # Bug component: 847766 -mingaleev@google.com include /core/java/android/app/timedetector/OWNERS diff --git a/core/tests/coretests/src/android/app/timezone/OWNERS b/core/tests/coretests/src/android/app/timezone/OWNERS index 8f8089717e3b..381ecf1abda5 100644 --- a/core/tests/coretests/src/android/app/timezone/OWNERS +++ b/core/tests/coretests/src/android/app/timezone/OWNERS @@ -1,3 +1,2 @@ -# Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Bug component: 24949 +include /core/java/android/app/timezone/OWNERS diff --git a/core/tests/coretests/src/android/app/timezonedetector/OWNERS b/core/tests/coretests/src/android/app/timezonedetector/OWNERS index 8f8089717e3b..2e9c3246e4fc 100644 --- a/core/tests/coretests/src/android/app/timezonedetector/OWNERS +++ b/core/tests/coretests/src/android/app/timezonedetector/OWNERS @@ -1,3 +1,2 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +include /core/java/android/app/timezonedetector/OWNERS diff --git a/core/tests/coretests/src/android/service/timezone/OWNERS b/core/tests/coretests/src/android/service/timezone/OWNERS new file mode 100644 index 000000000000..811638805996 --- /dev/null +++ b/core/tests/coretests/src/android/service/timezone/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 847766 +include /core/java/android/service/timezone/OWNERS diff --git a/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java b/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java index 46bda06d0e04..27d4ea71dfc0 100644 --- a/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java +++ b/packages/services/PacProcessor/src/com/android/pacprocessor/PacService.java @@ -21,6 +21,7 @@ import android.os.Binder; import android.os.IBinder; import android.os.Process; import android.os.RemoteException; +import android.os.UserManager; import android.util.Log; import android.webkit.PacProcessor; @@ -33,16 +34,44 @@ import java.net.URL; public class PacService extends Service { private static final String TAG = "PacService"; - private Object mLock = new Object(); + private final Object mLock = new Object(); + // Webkit PacProcessor cannot be instantiated before the user is unlocked, so this field is + // initialized lazily. @GuardedBy("mLock") - private final PacProcessor mPacProcessor = PacProcessor.getInstance(); + private PacProcessor mPacProcessor; + + // Stores PAC script when setPacFile is called before mPacProcessor is available. In case the + // script was already fed to the PacProcessor, it should be null. + @GuardedBy("mLock") + private String mPendingScript; private ProxyServiceStub mStub = new ProxyServiceStub(); @Override public void onCreate() { super.onCreate(); + + synchronized (mLock) { + checkPacProcessorLocked(); + } + } + + /** + * Initializes PacProcessor if it hasn't been initialized yet and if the system user is + * unlocked, e.g. after the user has entered their PIN after a reboot. + * Returns whether PacProcessor is available. + */ + private boolean checkPacProcessorLocked() { + if (mPacProcessor != null) { + return true; + } + UserManager um = getSystemService(UserManager.class); + if (um.isUserUnlocked()) { + mPacProcessor = PacProcessor.getInstance(); + return true; + } + return false; } @Override @@ -74,7 +103,20 @@ public class PacService extends Service { } synchronized (mLock) { - return mPacProcessor.findProxyForUrl(url); + if (checkPacProcessorLocked()) { + // Apply pending script in case it was set before processor was ready. + if (mPendingScript != null) { + if (!mPacProcessor.setProxyScript(mPendingScript)) { + Log.e(TAG, "Unable to parse proxy script."); + } + mPendingScript = null; + } + return mPacProcessor.findProxyForUrl(url); + } else { + Log.e(TAG, "PacProcessor isn't ready during early boot," + + " request will be direct"); + return null; + } } } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid URL was passed"); @@ -88,8 +130,13 @@ public class PacService extends Service { throw new SecurityException(); } synchronized (mLock) { - if (!mPacProcessor.setProxyScript(script)) { - Log.e(TAG, "Unable to parse proxy script."); + if (checkPacProcessorLocked()) { + if (!mPacProcessor.setProxyScript(script)) { + Log.e(TAG, "Unable to parse proxy script."); + } + } else { + Log.d(TAG, "PAC processor isn't ready, saving script for later."); + mPendingScript = script; } } } diff --git a/services/core/java/com/android/server/timedetector/OWNERS b/services/core/java/com/android/server/timedetector/OWNERS index 8f8089717e3b..67fc9d66d69d 100644 --- a/services/core/java/com/android/server/timedetector/OWNERS +++ b/services/core/java/com/android/server/timedetector/OWNERS @@ -1,3 +1,3 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# This code is maintained by the same OWNERS as timezonedetector. +include /services/core/java/com/android/server/timezonedetector/OWNERS diff --git a/services/core/java/com/android/server/timezone/OWNERS b/services/core/java/com/android/server/timezone/OWNERS index 8f8089717e3b..2d365747473a 100644 --- a/services/core/java/com/android/server/timezone/OWNERS +++ b/services/core/java/com/android/server/timezone/OWNERS @@ -1,3 +1,2 @@ -# Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Bug component: 24949 +include platform/libcore:/OWNERS diff --git a/services/core/java/com/android/server/timezonedetector/OWNERS b/services/core/java/com/android/server/timezonedetector/OWNERS index 8f8089717e3b..029324246c91 100644 --- a/services/core/java/com/android/server/timezonedetector/OWNERS +++ b/services/core/java/com/android/server/timezonedetector/OWNERS @@ -1,3 +1,7 @@ # Bug component: 847766 +# This is the main list for platform time / time zone detection maintainers, for this dir and +# ultimately referenced by other OWNERS files for components maintained by the same team. +nfuller@google.com +jmorace@google.com mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +narayan@google.com diff --git a/services/tests/servicestests/src/com/android/server/timedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS index 8f8089717e3b..a0f46e172da6 100644 --- a/services/tests/servicestests/src/com/android/server/timedetector/OWNERS +++ b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS @@ -1,3 +1,2 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +include /services/core/java/com/android/server/timedetector/OWNERS diff --git a/services/tests/servicestests/src/com/android/server/timezone/OWNERS b/services/tests/servicestests/src/com/android/server/timezone/OWNERS index 8f8089717e3b..61652604ee9f 100644 --- a/services/tests/servicestests/src/com/android/server/timezone/OWNERS +++ b/services/tests/servicestests/src/com/android/server/timezone/OWNERS @@ -1,3 +1,2 @@ -# Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +# Bug component: 24949 +include /services/core/java/com/android/server/timezone/OWNERS diff --git a/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS index 8f8089717e3b..a6ff1ba8a8cb 100644 --- a/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS +++ b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS @@ -1,3 +1,2 @@ # Bug component: 847766 -mingaleev@google.com -include /core/java/android/app/timedetector/OWNERS +include /services/core/java/com/android/server/timezonedetector/OWNERS diff --git a/telephony/java/android/telephony/BarringInfo.java b/telephony/java/android/telephony/BarringInfo.java index e9698adc0356..0aa4b5805cd6 100644 --- a/telephony/java/android/telephony/BarringInfo.java +++ b/telephony/java/android/telephony/BarringInfo.java @@ -28,7 +28,6 @@ import android.util.SparseArray; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.List; import java.util.Objects; /** @@ -269,42 +268,6 @@ public final class BarringInfo implements Parcelable { mBarringServiceInfos = barringServiceInfos; } - /** @hide */ - public static BarringInfo create( - @NonNull android.hardware.radio.V1_5.CellIdentity halBarringCellId, - @NonNull List<android.hardware.radio.V1_5.BarringInfo> halBarringInfos) { - CellIdentity ci = CellIdentity.create(halBarringCellId); - SparseArray<BarringServiceInfo> serviceInfos = new SparseArray<>(); - - for (android.hardware.radio.V1_5.BarringInfo halBarringInfo : halBarringInfos) { - if (halBarringInfo.barringType - == android.hardware.radio.V1_5.BarringInfo.BarringType.CONDITIONAL) { - if (halBarringInfo.barringTypeSpecificInfo.getDiscriminator() - != android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo - .hidl_discriminator.conditional) { - // this is an error case where the barring info is conditional but the - // conditional barring fields weren't included - continue; - } - android.hardware.radio.V1_5.BarringInfo.BarringTypeSpecificInfo - .Conditional conditionalInfo = - halBarringInfo.barringTypeSpecificInfo.conditional(); - serviceInfos.put( - halBarringInfo.serviceType, new BarringServiceInfo( - halBarringInfo.barringType, // will always be CONDITIONAL here - conditionalInfo.isBarred, - conditionalInfo.factor, - conditionalInfo.timeSeconds)); - } else { - // Barring type is either NONE or UNCONDITIONAL - serviceInfos.put( - halBarringInfo.serviceType, new BarringServiceInfo( - halBarringInfo.barringType, false, 0, 0)); - } - } - return new BarringInfo(ci, serviceInfos); - } - /** * Get the BarringServiceInfo for a specified service. * diff --git a/telephony/java/android/telephony/CellConfigLte.java b/telephony/java/android/telephony/CellConfigLte.java index 4b57d71d84ba..3e4e244a3dc6 100644 --- a/telephony/java/android/telephony/CellConfigLte.java +++ b/telephony/java/android/telephony/CellConfigLte.java @@ -34,11 +34,6 @@ public class CellConfigLte implements Parcelable { } /** @hide */ - public CellConfigLte(android.hardware.radio.V1_4.CellConfigLte cellConfig) { - mIsEndcAvailable = cellConfig.isEndcAvailable; - } - - /** @hide */ public CellConfigLte(boolean isEndcAvailable) { mIsEndcAvailable = isEndcAvailable; } diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java index 15147da925b8..06cfd6718664 100644 --- a/telephony/java/android/telephony/CellIdentity.java +++ b/telephony/java/android/telephony/CellIdentity.java @@ -20,7 +20,6 @@ import android.annotation.CallSuper; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; -import android.hardware.radio.V1_0.CellInfoType; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -359,104 +358,4 @@ public abstract class CellIdentity implements Parcelable { return true; } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_0.CellIdentity cellIdentity) { - if (cellIdentity == null) return null; - switch(cellIdentity.cellInfoType) { - case CellInfoType.GSM: { - if (cellIdentity.cellIdentityGsm.size() == 1) { - return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); - } - break; - } - case CellInfoType.WCDMA: { - if (cellIdentity.cellIdentityWcdma.size() == 1) { - return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); - } - break; - } - case CellInfoType.TD_SCDMA: { - if (cellIdentity.cellIdentityTdscdma.size() == 1) { - return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); - } - break; - } - case CellInfoType.LTE: { - if (cellIdentity.cellIdentityLte.size() == 1) { - return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); - } - break; - } - case CellInfoType.CDMA: { - if (cellIdentity.cellIdentityCdma.size() == 1) { - return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); - } - break; - } - case CellInfoType.NONE: break; - default: break; - } - return null; - } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_2.CellIdentity cellIdentity) { - if (cellIdentity == null) return null; - switch(cellIdentity.cellInfoType) { - case CellInfoType.GSM: { - if (cellIdentity.cellIdentityGsm.size() == 1) { - return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); - } - break; - } - case CellInfoType.WCDMA: { - if (cellIdentity.cellIdentityWcdma.size() == 1) { - return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); - } - break; - } - case CellInfoType.TD_SCDMA: { - if (cellIdentity.cellIdentityTdscdma.size() == 1) { - return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); - } - break; - } - case CellInfoType.LTE: { - if (cellIdentity.cellIdentityLte.size() == 1) { - return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); - } - break; - } - case CellInfoType.CDMA: { - if (cellIdentity.cellIdentityCdma.size() == 1) { - return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); - } - break; - } - case CellInfoType.NONE: break; - default: break; - } - return null; - } - - /** @hide */ - public static CellIdentity create(android.hardware.radio.V1_5.CellIdentity ci) { - if (ci == null) return null; - switch (ci.getDiscriminator()) { - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.gsm: - return new CellIdentityGsm(ci.gsm()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.cdma: - return new CellIdentityCdma(ci.cdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.lte: - return new CellIdentityLte(ci.lte()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.wcdma: - return new CellIdentityWcdma(ci.wcdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.tdscdma: - return new CellIdentityTdscdma(ci.tdscdma()); - case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.nr: - return new CellIdentityNr(ci.nr()); - default: return null; - } - } } diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java index 58a01e9d01af..ba3a192074bc 100644 --- a/telephony/java/android/telephony/CellIdentityCdma.java +++ b/telephony/java/android/telephony/CellIdentityCdma.java @@ -112,17 +112,6 @@ public final class CellIdentityCdma extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityCdma(@NonNull android.hardware.radio.V1_0.CellIdentityCdma cid) { - this(cid.networkId, cid.systemId, cid.baseStationId, cid.longitude, cid.latitude, "", ""); - } - - /** @hide */ - public CellIdentityCdma(@NonNull android.hardware.radio.V1_2.CellIdentityCdma cid) { - this(cid.base.networkId, cid.base.systemId, cid.base.baseStationId, cid.base.longitude, - cid.base.latitude, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort); - } - private CellIdentityCdma(@NonNull CellIdentityCdma cid) { this(cid.mNetworkId, cid.mSystemId, cid.mBasestationId, cid.mLongitude, cid.mLatitude, cid.mAlphaLong, cid.mAlphaShort); diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java index a3bec339794b..2516a79546f8 100644 --- a/telephony/java/android/telephony/CellIdentityGsm.java +++ b/telephony/java/android/telephony/CellIdentityGsm.java @@ -101,30 +101,6 @@ public final class CellIdentityGsm extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityGsm(@NonNull android.hardware.radio.V1_0.CellIdentityGsm cid) { - this(cid.lac, cid.cid, cid.arfcn, - cid.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.bsic, - cid.mcc, cid.mnc, "", "", new ArraySet<>()); - } - - /** @hide */ - public CellIdentityGsm(@NonNull android.hardware.radio.V1_2.CellIdentityGsm cid) { - this(cid.base.lac, cid.base.cid, cid.base.arfcn, - cid.base.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.base.bsic, cid.base.mcc, - cid.base.mnc, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort, - new ArraySet<>()); - } - - /** @hide */ - public CellIdentityGsm(@NonNull android.hardware.radio.V1_5.CellIdentityGsm cid) { - this(cid.base.base.lac, cid.base.base.cid, cid.base.base.arfcn, - cid.base.base.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE - : cid.base.base.bsic, cid.base.base.mcc, - cid.base.base.mnc, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns); - } - private CellIdentityGsm(@NonNull CellIdentityGsm cid) { this(cid.mLac, cid.mCid, cid.mArfcn, cid.mBsic, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns); diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java index bd92d00a0321..4db00cf258e5 100644 --- a/telephony/java/android/telephony/CellIdentityLte.java +++ b/telephony/java/android/telephony/CellIdentityLte.java @@ -136,31 +136,6 @@ public final class CellIdentityLte extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityLte(@NonNull android.hardware.radio.V1_0.CellIdentityLte cid) { - this(cid.ci, cid.pci, cid.tac, cid.earfcn, new int[] {}, - CellInfo.UNAVAILABLE, cid.mcc, cid.mnc, "", "", new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityLte(@NonNull android.hardware.radio.V1_2.CellIdentityLte cid) { - this(cid.base.ci, cid.base.pci, cid.base.tac, cid.base.earfcn, new int[] {}, - cid.bandwidth, cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong, - cid.operatorNames.alphaShort, new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityLte(@NonNull android.hardware.radio.V1_5.CellIdentityLte cid) { - this(cid.base.base.ci, cid.base.base.pci, cid.base.base.tac, cid.base.base.earfcn, - cid.bands.stream().mapToInt(Integer::intValue).toArray(), cid.base.bandwidth, - cid.base.base.mcc, cid.base.base.mnc, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - private CellIdentityLte(@NonNull CellIdentityLte cid) { this(cid.mCi, cid.mPci, cid.mTac, cid.mEarfcn, cid.mBands, cid.mBandwidth, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo); diff --git a/telephony/java/android/telephony/CellIdentityNr.java b/telephony/java/android/telephony/CellIdentityNr.java index 4f5052151af5..6aeb482fb236 100644 --- a/telephony/java/android/telephony/CellIdentityNr.java +++ b/telephony/java/android/telephony/CellIdentityNr.java @@ -65,7 +65,6 @@ public final class CellIdentityNr extends CellIdentity { } /** - * * @param pci Physical Cell Id in range [0, 1007]. * @param tac 24-bit Tracking Area Code. * @param nrArfcn NR Absolute Radio Frequency Channel Number, in range [0, 3279165]. @@ -100,21 +99,6 @@ public final class CellIdentityNr extends CellIdentity { } /** @hide */ - public CellIdentityNr(@NonNull android.hardware.radio.V1_4.CellIdentityNr cid) { - this(cid.pci, cid.tac, cid.nrarfcn, new int[] {}, cid.mcc, cid.mnc, cid.nci, - cid.operatorNames.alphaLong, cid.operatorNames.alphaShort, - new ArraySet<>()); - } - - /** @hide */ - public CellIdentityNr(@NonNull android.hardware.radio.V1_5.CellIdentityNr cid) { - this(cid.base.pci, cid.base.tac, cid.base.nrarfcn, - cid.bands.stream().mapToInt(Integer::intValue).toArray(), cid.base.mcc, - cid.base.mnc, cid.base.nci, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns); - } - - /** @hide */ @Override public @NonNull CellIdentityNr sanitizeLocationInfo() { return new CellIdentityNr(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, mNrArfcn, diff --git a/telephony/java/android/telephony/CellIdentityTdscdma.java b/telephony/java/android/telephony/CellIdentityTdscdma.java index ec07d5494849..13d93737f751 100644 --- a/telephony/java/android/telephony/CellIdentityTdscdma.java +++ b/telephony/java/android/telephony/CellIdentityTdscdma.java @@ -113,31 +113,6 @@ public final class CellIdentityTdscdma extends CellIdentity { } /** @hide */ - public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_0.CellIdentityTdscdma cid) { - this(cid.mcc, cid.mnc, cid.lac, cid.cid, cid.cpid, CellInfo.UNAVAILABLE, "", "", - Collections.emptyList(), null); - } - - /** @hide */ - public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_2.CellIdentityTdscdma cid) { - this(cid.base.mcc, cid.base.mnc, cid.base.lac, cid.base.cid, cid.base.cpid, - cid.uarfcn, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort, - Collections.emptyList(), null); - } - - /** @hide */ - public CellIdentityTdscdma(@NonNull android.hardware.radio.V1_5.CellIdentityTdscdma cid) { - this(cid.base.base.mcc, cid.base.base.mnc, cid.base.base.lac, cid.base.base.cid, - cid.base.base.cpid, cid.base.uarfcn, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, - cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - - /** @hide */ @Override public @NonNull CellIdentityTdscdma sanitizeLocationInfo() { return new CellIdentityTdscdma(mMccStr, mMncStr, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, diff --git a/telephony/java/android/telephony/CellIdentityWcdma.java b/telephony/java/android/telephony/CellIdentityWcdma.java index b04a51d238c1..9b463da14f16 100644 --- a/telephony/java/android/telephony/CellIdentityWcdma.java +++ b/telephony/java/android/telephony/CellIdentityWcdma.java @@ -107,30 +107,6 @@ public final class CellIdentityWcdma extends CellIdentity { updateGlobalCellId(); } - /** @hide */ - public CellIdentityWcdma(@NonNull android.hardware.radio.V1_0.CellIdentityWcdma cid) { - this(cid.lac, cid.cid, cid.psc, cid.uarfcn, cid.mcc, cid.mnc, "", "", - new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityWcdma(@NonNull android.hardware.radio.V1_2.CellIdentityWcdma cid) { - this(cid.base.lac, cid.base.cid, cid.base.psc, cid.base.uarfcn, - cid.base.mcc, cid.base.mnc, cid.operatorNames.alphaLong, - cid.operatorNames.alphaShort, new ArraySet<>(), null); - } - - /** @hide */ - public CellIdentityWcdma(@NonNull android.hardware.radio.V1_5.CellIdentityWcdma cid) { - this(cid.base.base.lac, cid.base.base.cid, cid.base.base.psc, cid.base.base.uarfcn, - cid.base.base.mcc, cid.base.base.mnc, cid.base.operatorNames.alphaLong, - cid.base.operatorNames.alphaShort, cid.additionalPlmns, - cid.optionalCsgInfo.getDiscriminator() - == android.hardware.radio.V1_5.OptionalCsgInfo.hidl_discriminator.csgInfo - ? new ClosedSubscriberGroupInfo(cid.optionalCsgInfo.csgInfo()) - : null); - } - private CellIdentityWcdma(@NonNull CellIdentityWcdma cid) { this(cid.mLac, cid.mCid, cid.mPsc, cid.mUarfcn, cid.mMccStr, cid.mMncStr, cid.mAlphaLong, cid.mAlphaShort, cid.mAdditionalPlmns, cid.mCsgInfo); diff --git a/telephony/java/android/telephony/CellInfo.java b/telephony/java/android/telephony/CellInfo.java index 189a4b898886..2b2df24bb268 100644 --- a/telephony/java/android/telephony/CellInfo.java +++ b/telephony/java/android/telephony/CellInfo.java @@ -20,7 +20,6 @@ import android.annotation.ElapsedRealtimeLong; import android.annotation.IntDef; import android.annotation.NonNull; import android.compat.annotation.UnsupportedAppUsage; -import android.hardware.radio.V1_4.CellInfo.Info; import android.os.Parcel; import android.os.Parcelable; @@ -150,6 +149,13 @@ public abstract class CellInfo implements Parcelable { private long mTimeStamp; /** @hide */ + protected CellInfo(int cellConnectionStatus, boolean registered, long timestamp) { + mCellConnectionStatus = cellConnectionStatus; + mRegistered = registered; + mTimeStamp = timestamp; + } + + /** @hide */ protected CellInfo() { this.mRegistered = false; this.mTimeStamp = Long.MAX_VALUE; @@ -321,131 +327,4 @@ public abstract class CellInfo implements Parcelable { return new CellInfo[size]; } }; - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_0.CellInfo ci) { - this.mRegistered = ci.registered; - this.mTimeStamp = ci.timeStamp; - this.mCellConnectionStatus = CONNECTION_UNKNOWN; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_2.CellInfo ci) { - this.mRegistered = ci.registered; - this.mTimeStamp = ci.timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - this.mRegistered = ci.isRegistered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - this.mRegistered = ci.registered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - protected CellInfo(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - this.mRegistered = ci.registered; - this.mTimeStamp = timeStamp; - this.mCellConnectionStatus = ci.connectionStatus; - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_0.CellInfo ci) { - if (ci == null) return null; - switch(ci.cellInfoType) { - case android.hardware.radio.V1_0.CellInfoType.GSM: return new CellInfoGsm(ci); - case android.hardware.radio.V1_0.CellInfoType.CDMA: return new CellInfoCdma(ci); - case android.hardware.radio.V1_0.CellInfoType.LTE: return new CellInfoLte(ci); - case android.hardware.radio.V1_0.CellInfoType.WCDMA: return new CellInfoWcdma(ci); - case android.hardware.radio.V1_0.CellInfoType.TD_SCDMA: return new CellInfoTdscdma(ci); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_2.CellInfo ci) { - if (ci == null) return null; - switch(ci.cellInfoType) { - case android.hardware.radio.V1_0.CellInfoType.GSM: return new CellInfoGsm(ci); - case android.hardware.radio.V1_0.CellInfoType.CDMA: return new CellInfoCdma(ci); - case android.hardware.radio.V1_0.CellInfoType.LTE: return new CellInfoLte(ci); - case android.hardware.radio.V1_0.CellInfoType.WCDMA: return new CellInfoWcdma(ci); - case android.hardware.radio.V1_0.CellInfoType.TD_SCDMA: return new CellInfoTdscdma(ci); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.info.getDiscriminator()) { - case Info.hidl_discriminator.gsm: return new CellInfoGsm(ci, timeStamp); - case Info.hidl_discriminator.cdma: return new CellInfoCdma(ci, timeStamp); - case Info.hidl_discriminator.lte: return new CellInfoLte(ci, timeStamp); - case Info.hidl_discriminator.wcdma: return new CellInfoWcdma(ci, timeStamp); - case Info.hidl_discriminator.tdscdma: return new CellInfoTdscdma(ci, timeStamp); - case Info.hidl_discriminator.nr: return new CellInfoNr(ci, timeStamp); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.ratSpecificInfo.getDiscriminator()) { - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.gsm: - return new CellInfoGsm(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.cdma: - return new CellInfoCdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.lte: - return new CellInfoLte(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.wcdma: - return new CellInfoWcdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.tdscdma: - return new CellInfoTdscdma(ci, timeStamp); - case android.hardware.radio.V1_5.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.nr: - return new CellInfoNr(ci, timeStamp); - default: return null; - } - } - - /** @hide */ - public static CellInfo create(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - if (ci == null) return null; - switch (ci.ratSpecificInfo.getDiscriminator()) { - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.gsm: - return new CellInfoGsm(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.cdma: - return new CellInfoCdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.lte: - return new CellInfoLte(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.wcdma: - return new CellInfoWcdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.tdscdma: - return new CellInfoTdscdma(ci, timeStamp); - case android.hardware.radio.V1_6.CellInfo - .CellInfoRatSpecificInfo.hidl_discriminator.nr: - return new CellInfoNr(ci, timeStamp); - default: return null; - } - } } diff --git a/telephony/java/android/telephony/CellInfoCdma.java b/telephony/java/android/telephony/CellInfoCdma.java index dbb30d29eb87..aa8cff52bcaf 100644 --- a/telephony/java/android/telephony/CellInfoCdma.java +++ b/telephony/java/android/telephony/CellInfoCdma.java @@ -52,48 +52,11 @@ public final class CellInfoCdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoCdma cic = ci.cdma.get(0); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.cdma.get(0); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.info.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.ratSpecificInfo.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); - } - - /** @hide */ - public CellInfoCdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoCdma cic = ci.ratSpecificInfo.cdma(); - mCellIdentityCdma = new CellIdentityCdma(cic.cellIdentityCdma); - mCellSignalStrengthCdma = - new CellSignalStrengthCdma(cic.signalStrengthCdma, cic.signalStrengthEvdo); + public CellInfoCdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityCdma cellIdentityCdma, CellSignalStrengthCdma cellSignalStrengthCdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityCdma = cellIdentityCdma; + mCellSignalStrengthCdma = cellSignalStrengthCdma; } /** diff --git a/telephony/java/android/telephony/CellInfoGsm.java b/telephony/java/android/telephony/CellInfoGsm.java index e1d996e87fcf..76e825bf426c 100644 --- a/telephony/java/android/telephony/CellInfoGsm.java +++ b/telephony/java/android/telephony/CellInfoGsm.java @@ -51,43 +51,11 @@ public final class CellInfoGsm extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoGsm cig = ci.gsm.get(0); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoGsm cig = ci.gsm.get(0); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoGsm cig = ci.info.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoGsm cig = ci.ratSpecificInfo.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); - } - - /** @hide */ - public CellInfoGsm(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoGsm cig = ci.ratSpecificInfo.gsm(); - mCellIdentityGsm = new CellIdentityGsm(cig.cellIdentityGsm); - mCellSignalStrengthGsm = new CellSignalStrengthGsm(cig.signalStrengthGsm); + public CellInfoGsm(int cellConnectionStatus, boolean registered, long timeStamp, + CellIdentityGsm cellIdentityGsm, CellSignalStrengthGsm cellSignalStrengthGsm) { + super(cellConnectionStatus, registered, timeStamp); + mCellIdentityGsm = cellIdentityGsm; + mCellSignalStrengthGsm = cellSignalStrengthGsm; } /** diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java index 39b320afdac9..2d176d52c05c 100644 --- a/telephony/java/android/telephony/CellInfoLte.java +++ b/telephony/java/android/telephony/CellInfoLte.java @@ -56,48 +56,13 @@ public final class CellInfoLte extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoLte(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoLte cil = ci.lte.get(0); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoLte cil = ci.lte.get(0); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_4.CellInfoLte cil = ci.info.lte(); - mCellIdentityLte = new CellIdentityLte(cil.base.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.base.signalStrengthLte); - mCellConfig = new CellConfigLte(cil.cellConfig); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoLte cil = ci.ratSpecificInfo.lte(); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); - } - - /** @hide */ - public CellInfoLte(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_6.CellInfoLte cil = ci.ratSpecificInfo.lte(); - mCellIdentityLte = new CellIdentityLte(cil.cellIdentityLte); - mCellSignalStrengthLte = new CellSignalStrengthLte(cil.signalStrengthLte); - mCellConfig = new CellConfigLte(); + public CellInfoLte(int connectionStatus, boolean registered, long timeStamp, + CellIdentityLte cellIdentityLte, CellSignalStrengthLte cellSignalStrengthLte, + CellConfigLte cellConfig) { + super(connectionStatus, registered, timeStamp); + mCellIdentityLte = cellIdentityLte; + mCellSignalStrengthLte = cellSignalStrengthLte; + mCellConfig = cellConfig; } /** diff --git a/telephony/java/android/telephony/CellInfoNr.java b/telephony/java/android/telephony/CellInfoNr.java index 12e6a38bfdc0..37fac24ab5e7 100644 --- a/telephony/java/android/telephony/CellInfoNr.java +++ b/telephony/java/android/telephony/CellInfoNr.java @@ -53,27 +53,11 @@ public final class CellInfoNr extends CellInfo { } /** @hide */ - public CellInfoNr(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_4.CellInfoNr cil = ci.info.nr(); - mCellIdentity = new CellIdentityNr(cil.cellidentity); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrength); - } - - /** @hide */ - public CellInfoNr(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoNr cil = ci.ratSpecificInfo.nr(); - mCellIdentity = new CellIdentityNr(cil.cellIdentityNr); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrengthNr); - } - - /** @hide */ - public CellInfoNr(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_6.CellInfoNr cil = ci.ratSpecificInfo.nr(); - mCellIdentity = new CellIdentityNr(cil.cellIdentityNr); - mCellSignalStrength = new CellSignalStrengthNr(cil.signalStrengthNr); + public CellInfoNr(int connectionStatus, boolean registered, long timeStamp, + CellIdentityNr cellIdentityNr, CellSignalStrengthNr cellSignalStrengthNr) { + super(connectionStatus, registered, timeStamp); + mCellIdentity = cellIdentityNr; + mCellSignalStrength = cellSignalStrengthNr; } /** diff --git a/telephony/java/android/telephony/CellInfoTdscdma.java b/telephony/java/android/telephony/CellInfoTdscdma.java index 994b317a47fd..d8db4295f374 100644 --- a/telephony/java/android/telephony/CellInfoTdscdma.java +++ b/telephony/java/android/telephony/CellInfoTdscdma.java @@ -54,43 +54,12 @@ public final class CellInfoTdscdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoTdscdma cit = ci.tdscdma.get(0); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoTdscdma cit = ci.tdscdma.get(0); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoTdscdma cit = ci.info.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoTdscdma cit = ci.ratSpecificInfo.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); - } - - /** @hide */ - public CellInfoTdscdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoTdscdma cit = ci.ratSpecificInfo.tdscdma(); - mCellIdentityTdscdma = new CellIdentityTdscdma(cit.cellIdentityTdscdma); - mCellSignalStrengthTdscdma = new CellSignalStrengthTdscdma(cit.signalStrengthTdscdma); + public CellInfoTdscdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityTdscdma cellIdentityTdscdma, + CellSignalStrengthTdscdma cellSignalStrengthTdscdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityTdscdma = cellIdentityTdscdma; + mCellSignalStrengthTdscdma = cellSignalStrengthTdscdma; } /** diff --git a/telephony/java/android/telephony/CellInfoWcdma.java b/telephony/java/android/telephony/CellInfoWcdma.java index 62ac0b8ae04e..dc8e1fed1392 100644 --- a/telephony/java/android/telephony/CellInfoWcdma.java +++ b/telephony/java/android/telephony/CellInfoWcdma.java @@ -49,43 +49,11 @@ public final class CellInfoWcdma extends CellInfo implements Parcelable { } /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_0.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_0.CellInfoWcdma ciw = ci.wcdma.get(0); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_2.CellInfo ci) { - super(ci); - final android.hardware.radio.V1_2.CellInfoWcdma ciw = ci.wcdma.get(0); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_4.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_2.CellInfoWcdma ciw = ci.info.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_5.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoWcdma ciw = ci.ratSpecificInfo.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); - } - - /** @hide */ - public CellInfoWcdma(android.hardware.radio.V1_6.CellInfo ci, long timeStamp) { - super(ci, timeStamp); - final android.hardware.radio.V1_5.CellInfoWcdma ciw = ci.ratSpecificInfo.wcdma(); - mCellIdentityWcdma = new CellIdentityWcdma(ciw.cellIdentityWcdma); - mCellSignalStrengthWcdma = new CellSignalStrengthWcdma(ciw.signalStrengthWcdma); + public CellInfoWcdma(int connectionStatus, boolean registered, long timeStamp, + CellIdentityWcdma cellIdentityWcdma, CellSignalStrengthWcdma cellSignalStrengthWcdma) { + super(connectionStatus, registered, timeStamp); + mCellIdentityWcdma = cellIdentityWcdma; + mCellSignalStrengthWcdma = cellSignalStrengthWcdma; } /** diff --git a/telephony/java/android/telephony/CellSignalStrength.java b/telephony/java/android/telephony/CellSignalStrength.java index e0896570d3ed..9727ab7d23e2 100644 --- a/telephony/java/android/telephony/CellSignalStrength.java +++ b/telephony/java/android/telephony/CellSignalStrength.java @@ -108,7 +108,7 @@ public abstract class CellSignalStrength { // Range for RSSI in ASU (0-31, 99) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getRssiDbmFromAsu(int asu) { + public static final int getRssiDbmFromAsu(int asu) { if (asu > 31 || asu < 0) return CellInfo.UNAVAILABLE; return -113 + (2 * asu); } @@ -122,7 +122,7 @@ public abstract class CellSignalStrength { // Range for RSCP in ASU (0-96, 255) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getRscpDbmFromAsu(int asu) { + public static final int getRscpDbmFromAsu(int asu) { if (asu > 96 || asu < 0) return CellInfo.UNAVAILABLE; return asu - 120; } @@ -136,7 +136,7 @@ public abstract class CellSignalStrength { // Range for SNR in ASU (0-49, 255) as defined in TS 27.007 8.69 /** @hide */ - protected static final int getEcNoDbFromAsu(int asu) { + public static final int getEcNoDbFromAsu(int asu) { if (asu > 49 || asu < 0) return CellInfo.UNAVAILABLE; return -24 + (asu / 2); } diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java index d00049c1ebe5..5298e67bdf80 100644 --- a/telephony/java/android/telephony/CellSignalStrengthCdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java @@ -78,13 +78,6 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements } /** @hide */ - public CellSignalStrengthCdma(android.hardware.radio.V1_0.CdmaSignalStrength cdma, - android.hardware.radio.V1_0.EvdoSignalStrength evdo) { - // Convert from HAL values as part of construction. - this(-cdma.dbm, -cdma.ecio, -evdo.dbm, -evdo.ecio, evdo.signalNoiseRatio); - } - - /** @hide */ public CellSignalStrengthCdma(CellSignalStrengthCdma s) { copyFrom(s); } diff --git a/telephony/java/android/telephony/CellSignalStrengthGsm.java b/telephony/java/android/telephony/CellSignalStrengthGsm.java index 51e1ebc63cf2..7b780843061b 100644 --- a/telephony/java/android/telephony/CellSignalStrengthGsm.java +++ b/telephony/java/android/telephony/CellSignalStrengthGsm.java @@ -67,16 +67,6 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P } /** @hide */ - public CellSignalStrengthGsm(android.hardware.radio.V1_0.GsmSignalStrength gsm) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(gsm.signalStrength), gsm.bitErrorRate, gsm.timingAdvance); - - if (mRssi == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ public CellSignalStrengthGsm(CellSignalStrengthGsm s) { copyFrom(s); } diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java index 9211482fc067..e8633dd4b7bd 100644 --- a/telephony/java/android/telephony/CellSignalStrengthLte.java +++ b/telephony/java/android/telephony/CellSignalStrengthLte.java @@ -166,25 +166,6 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P } /** @hide */ - public CellSignalStrengthLte(android.hardware.radio.V1_0.LteSignalStrength lte) { - // Convert from HAL values as part of construction. - this(convertRssiAsuToDBm(lte.signalStrength), - lte.rsrp != CellInfo.UNAVAILABLE ? -lte.rsrp : lte.rsrp, - lte.rsrq != CellInfo.UNAVAILABLE ? -lte.rsrq : lte.rsrq, - convertRssnrUnitFromTenDbToDB(lte.rssnr), lte.cqi, lte.timingAdvance); - } - - /** @hide */ - public CellSignalStrengthLte(android.hardware.radio.V1_6.LteSignalStrength lte) { - // Convert from HAL values as part of construction. - this(convertRssiAsuToDBm(lte.base.signalStrength), - lte.base.rsrp != CellInfo.UNAVAILABLE ? -lte.base.rsrp : lte.base.rsrp, - lte.base.rsrq != CellInfo.UNAVAILABLE ? -lte.base.rsrq : lte.base.rsrq, - convertRssnrUnitFromTenDbToDB(lte.base.rssnr), lte.cqiTableIndex, lte.base.cqi, - lte.base.timingAdvance); - } - - /** @hide */ public CellSignalStrengthLte(CellSignalStrengthLte s) { copyFrom(s); } @@ -617,11 +598,13 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P Rlog.w(LOG_TAG, s); } - private static int convertRssnrUnitFromTenDbToDB(int rssnr) { + /** @hide */ + public static int convertRssnrUnitFromTenDbToDB(int rssnr) { return rssnr / 10; } - private static int convertRssiAsuToDBm(int rssiAsu) { + /** @hide */ + public static int convertRssiAsuToDBm(int rssiAsu) { if (rssiAsu == SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN) { return CellInfo.UNAVAILABLE; } diff --git a/telephony/java/android/telephony/CellSignalStrengthNr.java b/telephony/java/android/telephony/CellSignalStrengthNr.java index 6ada32e1a86d..cd22abddd3a7 100644 --- a/telephony/java/android/telephony/CellSignalStrengthNr.java +++ b/telephony/java/android/telephony/CellSignalStrengthNr.java @@ -202,29 +202,12 @@ public final class CellSignalStrengthNr extends CellSignalStrength implements Pa } /** - * @hide - * @param ss signal strength from modem. - */ - public CellSignalStrengthNr(android.hardware.radio.V1_4.NrSignalStrength ss) { - this(flip(ss.csiRsrp), flip(ss.csiRsrq), ss.csiSinr, flip(ss.ssRsrp), flip(ss.ssRsrq), - ss.ssSinr); - } - - /** - * @hide - * @param ss signal strength from modem. - */ - public CellSignalStrengthNr(android.hardware.radio.V1_6.NrSignalStrength ss) { - this(flip(ss.base.csiRsrp), flip(ss.base.csiRsrq), ss.base.csiSinr, ss.csiCqiTableIndex, - ss.csiCqiReport, flip(ss.base.ssRsrp), flip(ss.base.ssRsrq), ss.base.ssSinr); - } - - /** * Flip sign cell strength value when taking in the value from hal * @param val cell strength value * @return flipped value + * @hide */ - private static int flip(int val) { + public static int flip(int val) { return val != CellInfo.UNAVAILABLE ? -val : val; } diff --git a/telephony/java/android/telephony/CellSignalStrengthTdscdma.java b/telephony/java/android/telephony/CellSignalStrengthTdscdma.java index e96f200280b6..8a7c70ec5ea9 100644 --- a/telephony/java/android/telephony/CellSignalStrengthTdscdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthTdscdma.java @@ -75,28 +75,6 @@ public final class CellSignalStrengthTdscdma extends CellSignalStrength implemen } /** @hide */ - public CellSignalStrengthTdscdma(android.hardware.radio.V1_0.TdScdmaSignalStrength tdscdma) { - // Convert from HAL values as part of construction. - this(CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE, - tdscdma.rscp != CellInfo.UNAVAILABLE ? -tdscdma.rscp : tdscdma.rscp); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ - public CellSignalStrengthTdscdma(android.hardware.radio.V1_2.TdscdmaSignalStrength tdscdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(tdscdma.signalStrength), - tdscdma.bitErrorRate, getRscpDbmFromAsu(tdscdma.rscp)); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ public CellSignalStrengthTdscdma(CellSignalStrengthTdscdma s) { copyFrom(s); } diff --git a/telephony/java/android/telephony/CellSignalStrengthWcdma.java b/telephony/java/android/telephony/CellSignalStrengthWcdma.java index 8b14b7490679..f30440d95158 100644 --- a/telephony/java/android/telephony/CellSignalStrengthWcdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthWcdma.java @@ -95,30 +95,6 @@ public final class CellSignalStrengthWcdma extends CellSignalStrength implements } /** @hide */ - public CellSignalStrengthWcdma(android.hardware.radio.V1_0.WcdmaSignalStrength wcdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(wcdma.signalStrength), wcdma.bitErrorRate, - CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ - public CellSignalStrengthWcdma(android.hardware.radio.V1_2.WcdmaSignalStrength wcdma) { - // Convert from HAL values as part of construction. - this(getRssiDbmFromAsu(wcdma.base.signalStrength), - wcdma.base.bitErrorRate, - getRscpDbmFromAsu(wcdma.rscp), - getEcNoDbFromAsu(wcdma.ecno)); - - if (mRssi == CellInfo.UNAVAILABLE && mRscp == CellInfo.UNAVAILABLE) { - setDefaultValues(); - } - } - - /** @hide */ public CellSignalStrengthWcdma(CellSignalStrengthWcdma s) { copyFrom(s); } diff --git a/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java b/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java index e9262725d232..bf418ab38648 100644 --- a/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java +++ b/telephony/java/android/telephony/ClosedSubscriberGroupInfo.java @@ -44,12 +44,6 @@ public final class ClosedSubscriberGroupInfo implements Parcelable { mCsgIdentity = csgIdentity; } - /** @hide */ - public ClosedSubscriberGroupInfo( - @NonNull android.hardware.radio.V1_5.ClosedSubscriberGroupInfo csgInfo) { - this(csgInfo.csgIndication, csgInfo.homeNodebName, csgInfo.csgIdentity); - } - /** * Indicates whether the cell is restricted to only CSG members. * diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index b317c5557108..b7bc46736e18 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -144,64 +144,6 @@ public class SignalStrength implements Parcelable { mTimestampMillis = SystemClock.elapsedRealtime(); } - /** - * Constructor for Radio HAL V1.0 - * - * @hide - */ - public SignalStrength(android.hardware.radio.V1_0.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gw), - new CellSignalStrengthWcdma(), - new CellSignalStrengthTdscdma(signalStrength.tdScdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr()); - } - - /** - * Constructor for Radio HAL V1.2 - * - * @hide - */ - public SignalStrength(android.hardware.radio.V1_2.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdScdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr()); - } - - /** - * Constructor for Radio HAL V1.4. - * - * @param signalStrength signal strength reported from modem. - * @hide - */ - public SignalStrength(android.hardware.radio.V1_4.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdscdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr(signalStrength.nr)); - } - - /** - * Constructor for Radio HAL V1.6. - * - * @param signalStrength signal strength reported from modem. - * @hide - */ - public SignalStrength(android.hardware.radio.V1_6.SignalStrength signalStrength) { - this(new CellSignalStrengthCdma(signalStrength.cdma, signalStrength.evdo), - new CellSignalStrengthGsm(signalStrength.gsm), - new CellSignalStrengthWcdma(signalStrength.wcdma), - new CellSignalStrengthTdscdma(signalStrength.tdscdma), - new CellSignalStrengthLte(signalStrength.lte), - new CellSignalStrengthNr(signalStrength.nr)); - } - private CellSignalStrength getPrimary() { // This behavior is intended to replicate the legacy behavior of getLevel() by prioritizing // newer faster RATs for default/for display purposes. |