summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt28
-rw-r--r--core/java/android/telephony/PhoneStateListener.java10
-rw-r--r--core/java/android/telephony/TelephonyRegistryManager.java6
-rw-r--r--core/java/com/android/internal/telephony/IPhoneStateListener.aidl4
-rw-r--r--core/java/com/android/internal/telephony/ITelephonyRegistry.aidl4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java69
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java10
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java2
-rw-r--r--services/core/java/com/android/server/TelephonyRegistry.java34
-rw-r--r--telephony/java/android/telephony/Annotation.java10
-rw-r--r--telephony/java/android/telephony/TelephonyDisplayInfo.aidl (renamed from telephony/java/android/telephony/DisplayInfo.aidl)2
-rw-r--r--telephony/java/android/telephony/TelephonyDisplayInfo.java (renamed from telephony/java/android/telephony/DisplayInfo.java)25
12 files changed, 109 insertions, 95 deletions
diff --git a/api/current.txt b/api/current.txt
index 2d86ace263c2..4d63293a5157 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -45247,19 +45247,6 @@ package android.telephony {
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.ClosedSubscriberGroupInfo> CREATOR;
}
- public final class DisplayInfo implements android.os.Parcelable {
- method public int describeContents();
- method public int getNetworkType();
- method public int getOverrideNetworkType();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DisplayInfo> CREATOR;
- field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
- field public static final int OVERRIDE_NETWORK_TYPE_LTE_CA = 1; // 0x1
- field public static final int OVERRIDE_NETWORK_TYPE_NONE = 0; // 0x0
- field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA = 3; // 0x3
- field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE = 4; // 0x4
- }
-
public class IccOpenLogicalChannelResponse implements android.os.Parcelable {
method public int describeContents();
method public int getChannel();
@@ -45486,7 +45473,7 @@ package android.telephony {
method public void onDataActivity(int);
method public void onDataConnectionStateChanged(int);
method public void onDataConnectionStateChanged(int, int);
- method @RequiresPermission("android.permission.READ_PHONE_STATE") public void onDisplayInfoChanged(@NonNull android.telephony.DisplayInfo);
+ method @RequiresPermission("android.permission.READ_PHONE_STATE") public void onDisplayInfoChanged(@NonNull android.telephony.TelephonyDisplayInfo);
method @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public void onImsCallDisconnectCauseChanged(@NonNull android.telephony.ims.ImsReasonInfo);
method public void onMessageWaitingIndicatorChanged(boolean);
method @RequiresPermission("android.permission.MODIFY_PHONE_STATE") public void onPreciseDataConnectionStateChanged(@NonNull android.telephony.PreciseDataConnectionState);
@@ -45902,6 +45889,19 @@ package android.telephony {
method public android.telephony.SubscriptionPlan.Builder setTitle(@Nullable CharSequence);
}
+ public final class TelephonyDisplayInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getNetworkType();
+ method public int getOverrideNetworkType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.TelephonyDisplayInfo> CREATOR;
+ field public static final int OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO = 2; // 0x2
+ field public static final int OVERRIDE_NETWORK_TYPE_LTE_CA = 1; // 0x1
+ field public static final int OVERRIDE_NETWORK_TYPE_NONE = 0; // 0x0
+ field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA = 3; // 0x3
+ field public static final int OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE = 4; // 0x4
+ }
+
public class TelephonyManager {
method public boolean canChangeDtmfToneLength();
method @Nullable public android.telephony.TelephonyManager createForPhoneAccountHandle(android.telecom.PhoneAccountHandle);
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java
index fc4b09073400..b92731e6d6d4 100644
--- a/core/java/android/telephony/PhoneStateListener.java
+++ b/core/java/android/telephony/PhoneStateListener.java
@@ -893,16 +893,16 @@ public class PhoneStateListener {
/**
* Callback invoked when the display info has changed on the registered subscription.
- * <p> The {@link DisplayInfo} contains status information shown to the user based on
+ * <p> The {@link TelephonyDisplayInfo} contains status information shown to the user based on
* carrier policy.
*
* Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE} or that the calling
* app has carrier privileges (see {@link TelephonyManager#hasCarrierPrivileges}).
*
- * @param displayInfo The display information.
+ * @param telephonyDisplayInfo The display information.
*/
@RequiresPermission((android.Manifest.permission.READ_PHONE_STATE))
- public void onDisplayInfoChanged(@NonNull DisplayInfo displayInfo) {
+ public void onDisplayInfoChanged(@NonNull TelephonyDisplayInfo telephonyDisplayInfo) {
// default implementation empty
}
@@ -1285,13 +1285,13 @@ public class PhoneStateListener {
() -> psl.onUserMobileDataStateChanged(enabled)));
}
- public void onDisplayInfoChanged(DisplayInfo displayInfo) {
+ public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
if (psl == null) return;
Binder.withCleanCallingIdentity(
() -> mExecutor.execute(
- () -> psl.onDisplayInfoChanged(displayInfo)));
+ () -> psl.onDisplayInfoChanged(telephonyDisplayInfo)));
}
public void onOemHookRawEvent(byte[] rawData) {
diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java
index e3620426049f..5924421decce 100644
--- a/core/java/android/telephony/TelephonyRegistryManager.java
+++ b/core/java/android/telephony/TelephonyRegistryManager.java
@@ -500,12 +500,12 @@ public class TelephonyRegistryManager {
* derived from {@code subscriptionId} except when {@code subscriptionId} is invalid, such as
* when the device is in emergency-only mode.
* @param subscriptionId Subscription id for which display network info has changed.
- * @param displayInfo The display info.
+ * @param telephonyDisplayInfo The display info.
*/
public void notifyDisplayInfoChanged(int slotIndex, int subscriptionId,
- @NonNull DisplayInfo displayInfo) {
+ @NonNull TelephonyDisplayInfo telephonyDisplayInfo) {
try {
- sRegistry.notifyDisplayInfoChanged(slotIndex, subscriptionId, displayInfo);
+ sRegistry.notifyDisplayInfoChanged(slotIndex, subscriptionId, telephonyDisplayInfo);
} catch (RemoteException ex) {
// system process is dead
}
diff --git a/core/java/com/android/internal/telephony/IPhoneStateListener.aidl b/core/java/com/android/internal/telephony/IPhoneStateListener.aidl
index 3d5dfbbb871a..b2c5a998e254 100644
--- a/core/java/com/android/internal/telephony/IPhoneStateListener.aidl
+++ b/core/java/com/android/internal/telephony/IPhoneStateListener.aidl
@@ -21,7 +21,7 @@ import android.telephony.CallAttributes;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
import android.telephony.DataConnectionRealTimeInfo;
-import android.telephony.DisplayInfo;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.PhoneCapability;
import android.telephony.PreciseCallState;
import android.telephony.PreciseDataConnectionState;
@@ -55,7 +55,7 @@ oneway interface IPhoneStateListener {
void onOemHookRawEvent(in byte[] rawData);
void onCarrierNetworkChange(in boolean active);
void onUserMobileDataStateChanged(in boolean enabled);
- void onDisplayInfoChanged(in DisplayInfo displayInfo);
+ void onDisplayInfoChanged(in TelephonyDisplayInfo telephonyDisplayInfo);
void onPhoneCapabilityChanged(in PhoneCapability capability);
void onActiveDataSubIdChanged(in int subId);
void onRadioPowerStateChanged(in int state);
diff --git a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index 866715551a41..6957ec6b6a1e 100644
--- a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -23,7 +23,7 @@ import android.telephony.BarringInfo;
import android.telephony.CallQuality;
import android.telephony.CellIdentity;
import android.telephony.CellInfo;
-import android.telephony.DisplayInfo;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.PhoneCapability;
import android.telephony.PhysicalChannelConfig;
@@ -89,7 +89,7 @@ interface ITelephonyRegistry {
void notifyOpportunisticSubscriptionInfoChanged();
void notifyCarrierNetworkChange(in boolean active);
void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
- void notifyDisplayInfoChanged(int slotIndex, int subId, in DisplayInfo displayInfo);
+ void notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo);
void notifyPhoneCapabilityChanged(in PhoneCapability capability);
void notifyActiveDataSubIdChanged(int activeDataSubId);
void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index eeb623f857de..17481bf601e1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -25,12 +25,12 @@ import android.provider.Settings.Global;
import android.telephony.Annotation;
import android.telephony.CellSignalStrength;
import android.telephony.CellSignalStrengthCdma;
-import android.telephony.DisplayInfo;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.text.TextUtils;
@@ -75,8 +75,9 @@ public class MobileSignalController extends SignalController<
// this could potentially become part of MobileState for simplification/complication
// of code.
private int mDataState = TelephonyManager.DATA_DISCONNECTED;
- private DisplayInfo mDisplayInfo = new DisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
+ private TelephonyDisplayInfo mTelephonyDisplayInfo =
+ new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
private ServiceState mServiceState;
private SignalStrength mSignalStrength;
private MobileIconGroup mDefaultIcons;
@@ -245,41 +246,52 @@ public class MobileSignalController extends SignalController<
mNetworkToIconLookup.put(toIconKey(TelephonyManager.NETWORK_TYPE_HSPAP), hPlusGroup);
if (mConfig.show4gForLte) {
- mNetworkToIconLookup.put(toIconKey(TelephonyManager.NETWORK_TYPE_LTE),
+ mNetworkToIconLookup.put(toIconKey(
+ TelephonyManager.NETWORK_TYPE_LTE),
TelephonyIcons.FOUR_G);
if (mConfig.hideLtePlus) {
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA), TelephonyIcons.FOUR_G);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA),
+ TelephonyIcons.FOUR_G);
} else {
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA), TelephonyIcons.FOUR_G_PLUS);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA),
+ TelephonyIcons.FOUR_G_PLUS);
}
} else {
- mNetworkToIconLookup.put(toIconKey(TelephonyManager.NETWORK_TYPE_LTE),
+ mNetworkToIconLookup.put(toIconKey(
+ TelephonyManager.NETWORK_TYPE_LTE),
TelephonyIcons.LTE);
if (mConfig.hideLtePlus) {
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA), TelephonyIcons.LTE);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA),
+ TelephonyIcons.LTE);
} else {
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA), TelephonyIcons.LTE_PLUS);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA),
+ TelephonyIcons.LTE_PLUS);
}
}
- mNetworkToIconLookup.put(toIconKey(TelephonyManager.NETWORK_TYPE_IWLAN),
+ mNetworkToIconLookup.put(toIconKey(
+ TelephonyManager.NETWORK_TYPE_IWLAN),
TelephonyIcons.WFC);
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO), TelephonyIcons.LTE_CA_5G_E);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO),
+ TelephonyIcons.LTE_CA_5G_E);
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA), TelephonyIcons.NR_5G);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA),
+ TelephonyIcons.NR_5G);
mNetworkToIconLookup.put(toDisplayIconKey(
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE), TelephonyIcons.NR_5G_PLUS);
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE),
+ TelephonyIcons.NR_5G_PLUS);
}
private String getIconKey() {
- if (mDisplayInfo.getOverrideNetworkType() == DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
- return toIconKey(mDisplayInfo.getNetworkType());
+ if (mTelephonyDisplayInfo.getOverrideNetworkType()
+ == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
+ return toIconKey(mTelephonyDisplayInfo.getNetworkType());
} else {
- return toDisplayIconKey(mDisplayInfo.getOverrideNetworkType());
+ return toDisplayIconKey(mTelephonyDisplayInfo.getOverrideNetworkType());
}
}
@@ -289,13 +301,13 @@ public class MobileSignalController extends SignalController<
private String toDisplayIconKey(@Annotation.OverrideNetworkType int displayNetworkType) {
switch (displayNetworkType) {
- case DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA";
- case DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA_Plus";
- case DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
return "5G";
- case DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
return "5G_Plus";
default:
return "unsupported";
@@ -507,14 +519,14 @@ public class MobileSignalController extends SignalController<
/**
* Updates the current state based on mServiceState, mSignalStrength, mDataState,
- * mDisplayInfo, and mSimState. It should be called any time one of these is updated.
+ * mTelephonyDisplayInfo, and mSimState. It should be called any time one of these is updated.
* This will call listeners if necessary.
*/
private final void updateTelephony() {
if (DEBUG) {
Log.d(mTag, "updateTelephonySignalStrength: hasService=" +
Utils.isInService(mServiceState) + " ss=" + mSignalStrength
- + " displayInfo=" + mDisplayInfo);
+ + " displayInfo=" + mTelephonyDisplayInfo);
}
checkDefaultData();
mCurrentState.connected = Utils.isInService(mServiceState) && mSignalStrength != null;
@@ -600,7 +612,7 @@ public class MobileSignalController extends SignalController<
pw.println(" mSubscription=" + mSubscriptionInfo + ",");
pw.println(" mServiceState=" + mServiceState + ",");
pw.println(" mSignalStrength=" + mSignalStrength + ",");
- pw.println(" mDisplayInfo=" + mDisplayInfo + ",");
+ pw.println(" mTelephonyDisplayInfo=" + mTelephonyDisplayInfo + ",");
pw.println(" mDataState=" + mDataState + ",");
pw.println(" mInflateSignalStrengths=" + mInflateSignalStrengths + ",");
pw.println(" isDataDisabled=" + isDataDisabled() + ",");
@@ -639,8 +651,9 @@ public class MobileSignalController extends SignalController<
+ " type=" + networkType);
}
mDataState = state;
- if (networkType != mDisplayInfo.getNetworkType()) {
- mDisplayInfo = new DisplayInfo(networkType, DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
+ if (networkType != mTelephonyDisplayInfo.getNetworkType()) {
+ mTelephonyDisplayInfo = new TelephonyDisplayInfo(networkType,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
}
updateTelephony();
}
@@ -670,11 +683,11 @@ public class MobileSignalController extends SignalController<
}
@Override
- public void onDisplayInfoChanged(DisplayInfo displayInfo) {
+ public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
if (DEBUG) {
- Log.d(mTag, "onDisplayInfoChanged: displayInfo=" + displayInfo);
+ Log.d(mTag, "onDisplayInfoChanged: telephonyDisplayInfo=" + telephonyDisplayInfo);
}
- mDisplayInfo = displayInfo;
+ mTelephonyDisplayInfo = telephonyDisplayInfo;
updateTelephony();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 698185fe5154..3c3f2fad066d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -42,13 +42,13 @@ import android.net.wifi.WifiManager;
import android.os.Handler;
import android.provider.Settings;
import android.provider.Settings.Global;
-import android.telephony.DisplayInfo;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.testing.TestableLooper;
import android.testing.TestableResources;
@@ -94,7 +94,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
protected PhoneStateListener mPhoneStateListener;
protected SignalStrength mSignalStrength;
protected ServiceState mServiceState;
- protected DisplayInfo mDisplayInfo;
+ protected TelephonyDisplayInfo mTelephonyDisplayInfo;
protected ConnectivityManager mMockCm;
protected WifiManager mMockWm;
protected SubscriptionManager mMockSm;
@@ -145,7 +145,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
mSignalStrength = mock(SignalStrength.class);
mServiceState = mock(ServiceState.class);
- mDisplayInfo = mock(DisplayInfo.class);
+ mTelephonyDisplayInfo = mock(TelephonyDisplayInfo.class);
mConfig = new Config();
mConfig.hspaDataDistinguishable = true;
@@ -319,7 +319,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
protected void updateServiceState() {
Log.d(TAG, "Sending Service State: " + mServiceState);
mPhoneStateListener.onServiceStateChanged(mServiceState);
- mPhoneStateListener.onDisplayInfoChanged(mDisplayInfo);
+ mPhoneStateListener.onDisplayInfoChanged(mTelephonyDisplayInfo);
}
public void updateCallState(int state) {
@@ -335,7 +335,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
.build();
when(mServiceState.getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN))
.thenReturn(fakeRegInfo);
- when(mDisplayInfo.getNetworkType()).thenReturn(dataNetType);
+ when(mTelephonyDisplayInfo.getNetworkType()).thenReturn(dataNetType);
mPhoneStateListener.onDataConnectionStateChanged(dataState, dataNetType);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
index bac1b8ca240c..242d85cdb6b9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java
@@ -235,7 +235,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest {
.build();
when(mServiceState.getNetworkRegistrationInfo(DOMAIN_PS, TRANSPORT_TYPE_WWAN))
.thenReturn(fakeRegInfo);
- when(mDisplayInfo.getNetworkType()).thenReturn(TelephonyManager.NETWORK_TYPE_HSPA);
+ when(mTelephonyDisplayInfo.getNetworkType()).thenReturn(TelephonyManager.NETWORK_TYPE_HSPA);
updateServiceState();
verifyDataIndicators(TelephonyIcons.ICON_H);
}
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 59b2247b5428..d012bd7c91ad 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -63,7 +63,6 @@ import android.telephony.CellSignalStrengthTdscdma;
import android.telephony.CellSignalStrengthWcdma;
import android.telephony.DataFailCause;
import android.telephony.DisconnectCause;
-import android.telephony.DisplayInfo;
import android.telephony.LocationAccessPolicy;
import android.telephony.PhoneCapability;
import android.telephony.PhoneStateListener;
@@ -75,6 +74,7 @@ import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.telephony.emergency.EmergencyNumber;
@@ -239,7 +239,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
private boolean[] mUserMobileDataState;
- private DisplayInfo[] mDisplayInfos;
+ private TelephonyDisplayInfo[] mTelephonyDisplayInfos;
private SignalStrength[] mSignalStrength;
@@ -479,7 +479,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
mCallAttributes = copyOf(mCallAttributes, mNumPhones);
mOutgoingCallEmergencyNumber = copyOf(mOutgoingCallEmergencyNumber, mNumPhones);
mOutgoingSmsEmergencyNumber = copyOf(mOutgoingSmsEmergencyNumber, mNumPhones);
- mDisplayInfos = copyOf(mDisplayInfos, mNumPhones);
+ mTelephonyDisplayInfos = copyOf(mTelephonyDisplayInfos, mNumPhones);
// ds -> ss switch.
if (mNumPhones < oldNumPhones) {
@@ -518,8 +518,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
mForegroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
mBackgroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
mPreciseDataConnectionStates.add(new HashMap<String, PreciseDataConnectionState>());
- mDisplayInfos[i] = null;
mBarringInfo.add(i, new BarringInfo());
+ mTelephonyDisplayInfos[i] = null;
}
}
@@ -578,8 +578,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
mEmergencyNumberList = new HashMap<>();
mOutgoingCallEmergencyNumber = new EmergencyNumber[numPhones];
mOutgoingSmsEmergencyNumber = new EmergencyNumber[numPhones];
- mDisplayInfos = new DisplayInfo[numPhones];
mBarringInfo = new ArrayList<>();
+ mTelephonyDisplayInfos = new TelephonyDisplayInfo[numPhones];
for (int i = 0; i < numPhones; i++) {
mCallState[i] = TelephonyManager.CALL_STATE_IDLE;
mDataActivity[i] = TelephonyManager.DATA_ACTIVITY_NONE;
@@ -607,8 +607,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
mForegroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
mBackgroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
mPreciseDataConnectionStates.add(new HashMap<String, PreciseDataConnectionState>());
- mDisplayInfos[i] = null;
mBarringInfo.add(i, new BarringInfo());
+ mTelephonyDisplayInfos[i] = null;
}
mAppOps = mContext.getSystemService(AppOpsManager.class);
@@ -1025,8 +1025,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
}
if ((events & PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED) != 0) {
try {
- if (mDisplayInfos[phoneId] != null) {
- r.callback.onDisplayInfoChanged(mDisplayInfos[phoneId]);
+ if (mTelephonyDisplayInfos[phoneId] != null) {
+ r.callback.onDisplayInfoChanged(mTelephonyDisplayInfos[phoneId]);
}
} catch (RemoteException ex) {
remove(r.binder);
@@ -1586,28 +1586,28 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
*
* @param phoneId Phone id
* @param subId Subscription id
- * @param displayInfo Display network info
+ * @param telephonyDisplayInfo Display network info
*
- * @see PhoneStateListener#onDisplayInfoChanged(DisplayInfo)
+ * @see PhoneStateListener#onDisplayInfoChanged(TelephonyDisplayInfo)
*/
public void notifyDisplayInfoChanged(int phoneId, int subId,
- @NonNull DisplayInfo displayInfo) {
+ @NonNull TelephonyDisplayInfo telephonyDisplayInfo) {
if (!checkNotifyPermission("notifyDisplayInfoChanged()")) {
return;
}
if (VDBG) {
log("notifyDisplayInfoChanged: PhoneId=" + phoneId
- + " subId=" + subId + " displayInfo=" + displayInfo);
+ + " subId=" + subId + " telephonyDisplayInfo=" + telephonyDisplayInfo);
}
synchronized (mRecords) {
if (validatePhoneId(phoneId)) {
- mDisplayInfos[phoneId] = displayInfo;
+ mTelephonyDisplayInfos[phoneId] = telephonyDisplayInfo;
for (Record r : mRecords) {
if (r.matchPhoneStateListenerEvent(
PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED)
&& idMatch(r.subId, subId, phoneId)) {
try {
- r.callback.onDisplayInfoChanged(displayInfo);
+ r.callback.onDisplayInfoChanged(telephonyDisplayInfo);
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
}
@@ -2829,10 +2829,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
try {
if (VDBG) {
log("checkPossibleMissNotify: onDisplayInfoChanged phoneId="
- + phoneId + " dpi=" + mDisplayInfos[phoneId]);
+ + phoneId + " dpi=" + mTelephonyDisplayInfos[phoneId]);
}
- if (mDisplayInfos[phoneId] != null) {
- r.callback.onDisplayInfoChanged(mDisplayInfos[phoneId]);
+ if (mTelephonyDisplayInfos[phoneId] != null) {
+ r.callback.onDisplayInfoChanged(mTelephonyDisplayInfos[phoneId]);
}
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
diff --git a/telephony/java/android/telephony/Annotation.java b/telephony/java/android/telephony/Annotation.java
index ccda88f717c3..f0ed1a3fe070 100644
--- a/telephony/java/android/telephony/Annotation.java
+++ b/telephony/java/android/telephony/Annotation.java
@@ -628,10 +628,10 @@ public class Annotation {
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = "OVERRIDE_NETWORK_TYPE_", value = {
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NONE,
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA,
- DisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO,
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA,
- DisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE})
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE})
public @interface OverrideNetworkType {}
}
diff --git a/telephony/java/android/telephony/DisplayInfo.aidl b/telephony/java/android/telephony/TelephonyDisplayInfo.aidl
index 861b0fe04848..ab41f93efb14 100644
--- a/telephony/java/android/telephony/DisplayInfo.aidl
+++ b/telephony/java/android/telephony/TelephonyDisplayInfo.aidl
@@ -15,4 +15,4 @@
*/
package android.telephony;
-parcelable DisplayInfo;
+parcelable TelephonyDisplayInfo;
diff --git a/telephony/java/android/telephony/DisplayInfo.java b/telephony/java/android/telephony/TelephonyDisplayInfo.java
index d54bcf931c33..2c4d5ae3b82b 100644
--- a/telephony/java/android/telephony/DisplayInfo.java
+++ b/telephony/java/android/telephony/TelephonyDisplayInfo.java
@@ -25,12 +25,12 @@ import android.telephony.Annotation.OverrideNetworkType;
import java.util.Objects;
/**
- * DisplayInfo contains telephony-related information used for display purposes only. This
+ * TelephonyDisplayInfo contains telephony-related information used for display purposes only. This
* information is provided in accordance with carrier policy and branding preferences; it is not
* necessarily a precise or accurate representation of the current state and should be treated
* accordingly.
*/
-public final class DisplayInfo implements Parcelable {
+public final class TelephonyDisplayInfo implements Parcelable {
/**
* No override. {@link #getNetworkType()} should be used for display network
* type.
@@ -81,13 +81,14 @@ public final class DisplayInfo implements Parcelable {
*
* @hide
*/
- public DisplayInfo(@NetworkType int networkType, @OverrideNetworkType int overrideNetworkType) {
+ public TelephonyDisplayInfo(@NetworkType int networkType,
+ @OverrideNetworkType int overrideNetworkType) {
mNetworkType = networkType;
mOverrideNetworkType = overrideNetworkType;
}
/** @hide */
- public DisplayInfo(Parcel p) {
+ public TelephonyDisplayInfo(Parcel p) {
mNetworkType = p.readInt();
mOverrideNetworkType = p.readInt();
}
@@ -121,16 +122,16 @@ public final class DisplayInfo implements Parcelable {
dest.writeInt(mOverrideNetworkType);
}
- public static final @NonNull Parcelable.Creator<DisplayInfo> CREATOR =
- new Parcelable.Creator<DisplayInfo>() {
+ public static final @NonNull Parcelable.Creator<TelephonyDisplayInfo> CREATOR =
+ new Parcelable.Creator<TelephonyDisplayInfo>() {
@Override
- public DisplayInfo createFromParcel(Parcel source) {
- return new DisplayInfo(source);
+ public TelephonyDisplayInfo createFromParcel(Parcel source) {
+ return new TelephonyDisplayInfo(source);
}
@Override
- public DisplayInfo[] newArray(int size) {
- return new DisplayInfo[size];
+ public TelephonyDisplayInfo[] newArray(int size) {
+ return new TelephonyDisplayInfo[size];
}
};
@@ -143,7 +144,7 @@ public final class DisplayInfo implements Parcelable {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- DisplayInfo that = (DisplayInfo) o;
+ TelephonyDisplayInfo that = (TelephonyDisplayInfo) o;
return mNetworkType == that.mNetworkType
&& mOverrideNetworkType == that.mOverrideNetworkType;
}
@@ -166,7 +167,7 @@ public final class DisplayInfo implements Parcelable {
@Override
public String toString() {
- return "DisplayInfo {network=" + TelephonyManager.getNetworkTypeName(mNetworkType)
+ return "TelephonyDisplayInfo {network=" + TelephonyManager.getNetworkTypeName(mNetworkType)
+ ", override=" + overrideNetworkTypeToString(mOverrideNetworkType);
}
}