Loading services/core/java/com/android/server/TelephonyRegistry.java +10 −6 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { @Override public String toString() { return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId + " events=" + Integer.toHexString(events) + "}"; } } Loading Loading @@ -208,11 +208,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { String action = intent.getAction(); Slog.d(TAG, "mBroadcastReceiver: action=" + action); if (Intent.ACTION_USER_SWITCHED.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0), 0)); int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0); if (DBG) Slog.d(TAG, "onReceive: userHandle=" + userHandle); mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0)); } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) { mDefaultSubId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.getDefaultSubId()); if (DBG) Slog.d(TAG, "onReceive: mDefaultSubId=" + mDefaultSubId); mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0)); } } Loading Loading @@ -340,18 +342,19 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { // the received subId value update the isLegacyApp field if ((r.subId <= 0) || (r.subId == SubscriptionManager.INVALID_SUB_ID)) { r.subId = mDefaultSubId; r.isLegacyApp = true; // FIXME: is this needed ?? r.isLegacyApp = true; // r.subId is to be update when default changes. } if (r.subId == SubscriptionManager.DEFAULT_SUB_ID) { r.subId = mDefaultSubId; r.isLegacyApp = true; // r.subId is to be update when default changes. if (DBG) Slog.i(TAG, "listen: DEFAULT_SUB_ID"); } mRecords.add(r); if (DBG) Slog.i(TAG, "listen: add new record=" + r); if (DBG) Slog.i(TAG, "listen: add new record"); } int phoneId = SubscriptionManager.getPhoneId(subId); int send = events & (events ^ r.events); r.events = events; if (DBG) Slog.i(TAG, "listen: set events record=" + r); if (notifyNow && validatePhoneId(phoneId)) { if ((events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) { try { Loading Loading @@ -1063,6 +1066,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println(" mDataConnectionLinkProperties=" + mDataConnectionLinkProperties); pw.println(" mDataConnectionNetworkCapabilities=" + mDataConnectionNetworkCapabilities); pw.println(" mDefaultSubId=" + mDefaultSubId); pw.println(" mCellLocation=" + mCellLocation); pw.println(" mCellInfo=" + mCellInfo); pw.println(" mDcRtInfo=" + mDcRtInfo); Loading telephony/java/android/telephony/SubInfoRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,11 @@ public class SubInfoRecord implements Parcelable { return 0; } public String toString() { return "{mSubId=" + mSubId + ", mIccId=" + mIccId + " mSlotId=" + mSlotId + " mDisplayName=" + mDisplayName + " mNameSource=" + mNameSource + " mColor=" + mColor + " mNumber=" + mNumber + " mDispalyNumberFormat=" + mDispalyNumberFormat + " mDataRoaming=" + mDataRoaming + " mSimIconRes=" + mSimIconRes + "}"; } } telephony/java/android/telephony/SubscriptionManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -697,12 +697,16 @@ public class SubscriptionManager implements BaseColumns { public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) { long [] subId = SubscriptionManager.getSubId(phoneId); if ((subId != null) && (subId.length >= 1)) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId[0]); putPhoneIdAndSubIdExtra(intent, phoneId, subId[0]); } else { logd("putPhoneIdAndSubIdExtra: no valid subs"); } } public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, long subId) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); } } Loading
services/core/java/com/android/server/TelephonyRegistry.java +10 −6 Original line number Diff line number Diff line Loading @@ -89,7 +89,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { @Override public String toString() { return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId + " events=" + Integer.toHexString(events) + "}"; } } Loading Loading @@ -208,11 +208,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { String action = intent.getAction(); Slog.d(TAG, "mBroadcastReceiver: action=" + action); if (Intent.ACTION_USER_SWITCHED.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0), 0)); int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0); if (DBG) Slog.d(TAG, "onReceive: userHandle=" + userHandle); mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHED, userHandle, 0)); } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) { mDefaultSubId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.getDefaultSubId()); if (DBG) Slog.d(TAG, "onReceive: mDefaultSubId=" + mDefaultSubId); mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0)); } } Loading Loading @@ -340,18 +342,19 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { // the received subId value update the isLegacyApp field if ((r.subId <= 0) || (r.subId == SubscriptionManager.INVALID_SUB_ID)) { r.subId = mDefaultSubId; r.isLegacyApp = true; // FIXME: is this needed ?? r.isLegacyApp = true; // r.subId is to be update when default changes. } if (r.subId == SubscriptionManager.DEFAULT_SUB_ID) { r.subId = mDefaultSubId; r.isLegacyApp = true; // r.subId is to be update when default changes. if (DBG) Slog.i(TAG, "listen: DEFAULT_SUB_ID"); } mRecords.add(r); if (DBG) Slog.i(TAG, "listen: add new record=" + r); if (DBG) Slog.i(TAG, "listen: add new record"); } int phoneId = SubscriptionManager.getPhoneId(subId); int send = events & (events ^ r.events); r.events = events; if (DBG) Slog.i(TAG, "listen: set events record=" + r); if (notifyNow && validatePhoneId(phoneId)) { if ((events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) { try { Loading Loading @@ -1063,6 +1066,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println(" mDataConnectionLinkProperties=" + mDataConnectionLinkProperties); pw.println(" mDataConnectionNetworkCapabilities=" + mDataConnectionNetworkCapabilities); pw.println(" mDefaultSubId=" + mDefaultSubId); pw.println(" mCellLocation=" + mCellLocation); pw.println(" mCellInfo=" + mCellInfo); pw.println(" mDcRtInfo=" + mDcRtInfo); Loading
telephony/java/android/telephony/SubInfoRecord.java +7 −0 Original line number Diff line number Diff line Loading @@ -105,4 +105,11 @@ public class SubInfoRecord implements Parcelable { return 0; } public String toString() { return "{mSubId=" + mSubId + ", mIccId=" + mIccId + " mSlotId=" + mSlotId + " mDisplayName=" + mDisplayName + " mNameSource=" + mNameSource + " mColor=" + mColor + " mNumber=" + mNumber + " mDispalyNumberFormat=" + mDispalyNumberFormat + " mDataRoaming=" + mDataRoaming + " mSimIconRes=" + mSimIconRes + "}"; } }
telephony/java/android/telephony/SubscriptionManager.java +7 −3 Original line number Diff line number Diff line Loading @@ -697,12 +697,16 @@ public class SubscriptionManager implements BaseColumns { public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId) { long [] subId = SubscriptionManager.getSubId(phoneId); if ((subId != null) && (subId.length >= 1)) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId[0]); putPhoneIdAndSubIdExtra(intent, phoneId, subId[0]); } else { logd("putPhoneIdAndSubIdExtra: no valid subs"); } } public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, long subId) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); //FIXME: RENAME TO PHONE_ID_KEY ?? intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); } }