Loading services/core/java/com/android/server/TelephonyRegistry.java +17 −6 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.OptionalInt; import java.util.stream.Collectors; /** Loading Loading @@ -248,6 +247,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private final LocalLog mLocalLog = new LocalLog(100); private final LocalLog mListenLog = new LocalLog(100); private PreciseDataConnectionState mPreciseDataConnectionState = new PreciseDataConnectionState(); Loading Loading @@ -305,6 +306,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } mDefaultSubId = newDefaultSubId; mDefaultPhoneId = newDefaultPhoneId; mLocalLog.log("Default subscription updated: mDefaultPhoneId=" + mDefaultPhoneId + ", mDefaultSubId" + mDefaultSubId); } } } Loading Loading @@ -598,10 +601,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { boolean notifyNow, int subId) { int callerUserId = UserHandle.getCallingUserId(); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (VDBG) { log("listen: E pkg=" + callingPackage + " events=0x" + Integer.toHexString(events) String str = "listen: E pkg=" + callingPackage + " events=0x" + Integer.toHexString(events) + " notifyNow=" + notifyNow + " subId=" + subId + " myUserId=" + UserHandle.myUserId() + " callerUserId=" + callerUserId); + UserHandle.myUserId() + " callerUserId=" + callerUserId; mListenLog.log(str); if (VDBG) { log(str); } if (events != PhoneStateListener.LISTEN_NONE) { Loading Loading @@ -1410,8 +1415,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { if (PhoneConstants.APN_TYPE_DEFAULT.equals(apnType) && (mDataConnectionState[phoneId] != state || mDataConnectionNetworkType[phoneId] != networkType)) { String str = "onDataConnectionStateChanged(" + state + ", " + networkType + ")"; String str = "onDataConnectionStateChanged(" + TelephonyManager.dataStateToString(state) + ", " + TelephonyManager.getNetworkTypeName(networkType) + ") subId=" + subId + ", phoneId=" + phoneId; log(str); mLocalLog.log(str); for (Record r : mRecords) { Loading Loading @@ -1926,12 +1933,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mEmergencyNumberList=" + mEmergencyNumberList); pw.println("mCallQuality=" + mCallQuality); pw.println("mCallAttributes=" + mCallAttributes); pw.println("mDefaultPhoneId" + mDefaultPhoneId); pw.println("mDefaultSubId" + mDefaultSubId); pw.decreaseIndent(); pw.println("local logs:"); pw.increaseIndent(); mLocalLog.dump(fd, pw, args); pw.println("listen logs:"); mListenLog.dump(fd, pw, args); pw.decreaseIndent(); pw.println("registrations: count=" + recordCount); pw.increaseIndent(); Loading telephony/java/android/telephony/TelephonyManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -2682,7 +2682,7 @@ public class TelephonyManager { */ /** {@hide} */ @UnsupportedAppUsage public static String getNetworkTypeName(int type) { public static String getNetworkTypeName(@NetworkType int type) { switch (type) { case NETWORK_TYPE_GPRS: return "GPRS"; Loading Loading @@ -4812,6 +4812,22 @@ public class TelephonyManager { } } /** * Convert data state to string * * @return The data state in string format. * @hide */ public static String dataStateToString(@DataState int state) { switch (state) { case DATA_DISCONNECTED: return "DISCONNECTED"; case DATA_CONNECTING: return "CONNECTING"; case DATA_CONNECTED: return "CONNECTED"; case DATA_SUSPENDED: return "SUSPENDED"; } return "UNKNOWN(" + state + ")"; } /** * @hide */ Loading Loading
services/core/java/com/android/server/TelephonyRegistry.java +17 −6 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.OptionalInt; import java.util.stream.Collectors; /** Loading Loading @@ -248,6 +247,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private final LocalLog mLocalLog = new LocalLog(100); private final LocalLog mListenLog = new LocalLog(100); private PreciseDataConnectionState mPreciseDataConnectionState = new PreciseDataConnectionState(); Loading Loading @@ -305,6 +306,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } mDefaultSubId = newDefaultSubId; mDefaultPhoneId = newDefaultPhoneId; mLocalLog.log("Default subscription updated: mDefaultPhoneId=" + mDefaultPhoneId + ", mDefaultSubId" + mDefaultSubId); } } } Loading Loading @@ -598,10 +601,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { boolean notifyNow, int subId) { int callerUserId = UserHandle.getCallingUserId(); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); if (VDBG) { log("listen: E pkg=" + callingPackage + " events=0x" + Integer.toHexString(events) String str = "listen: E pkg=" + callingPackage + " events=0x" + Integer.toHexString(events) + " notifyNow=" + notifyNow + " subId=" + subId + " myUserId=" + UserHandle.myUserId() + " callerUserId=" + callerUserId); + UserHandle.myUserId() + " callerUserId=" + callerUserId; mListenLog.log(str); if (VDBG) { log(str); } if (events != PhoneStateListener.LISTEN_NONE) { Loading Loading @@ -1410,8 +1415,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { if (PhoneConstants.APN_TYPE_DEFAULT.equals(apnType) && (mDataConnectionState[phoneId] != state || mDataConnectionNetworkType[phoneId] != networkType)) { String str = "onDataConnectionStateChanged(" + state + ", " + networkType + ")"; String str = "onDataConnectionStateChanged(" + TelephonyManager.dataStateToString(state) + ", " + TelephonyManager.getNetworkTypeName(networkType) + ") subId=" + subId + ", phoneId=" + phoneId; log(str); mLocalLog.log(str); for (Record r : mRecords) { Loading Loading @@ -1926,12 +1933,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mEmergencyNumberList=" + mEmergencyNumberList); pw.println("mCallQuality=" + mCallQuality); pw.println("mCallAttributes=" + mCallAttributes); pw.println("mDefaultPhoneId" + mDefaultPhoneId); pw.println("mDefaultSubId" + mDefaultSubId); pw.decreaseIndent(); pw.println("local logs:"); pw.increaseIndent(); mLocalLog.dump(fd, pw, args); pw.println("listen logs:"); mListenLog.dump(fd, pw, args); pw.decreaseIndent(); pw.println("registrations: count=" + recordCount); pw.increaseIndent(); Loading
telephony/java/android/telephony/TelephonyManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -2682,7 +2682,7 @@ public class TelephonyManager { */ /** {@hide} */ @UnsupportedAppUsage public static String getNetworkTypeName(int type) { public static String getNetworkTypeName(@NetworkType int type) { switch (type) { case NETWORK_TYPE_GPRS: return "GPRS"; Loading Loading @@ -4812,6 +4812,22 @@ public class TelephonyManager { } } /** * Convert data state to string * * @return The data state in string format. * @hide */ public static String dataStateToString(@DataState int state) { switch (state) { case DATA_DISCONNECTED: return "DISCONNECTED"; case DATA_CONNECTING: return "CONNECTING"; case DATA_CONNECTED: return "CONNECTED"; case DATA_SUSPENDED: return "SUSPENDED"; } return "UNKNOWN(" + state + ")"; } /** * @hide */ Loading