Loading src/java/com/android/internal/telephony/gsm/GSMPhone.java +42 −0 Original line number Diff line number Diff line Loading @@ -19,8 +19,12 @@ package com.android.internal.telephony.gsm; import android.app.NotificationManager; import android.content.BroadcastReceiver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.database.SQLException; import android.net.Uri; Loading Loading @@ -76,6 +80,7 @@ import com.android.internal.telephony.PhoneProxy; import com.android.internal.telephony.PhoneSubInfo; import com.android.internal.telephony.SubscriptionController; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.TelephonyProperties; import com.android.internal.telephony.UUSInfo; import com.android.internal.telephony.imsphone.ImsPhone; Loading Loading @@ -121,6 +126,9 @@ public class GSMPhone extends PhoneBase { // Event constant for checking if Call Forwarding is enabled private static final int CHECK_CALLFORWARDING_STATUS = 75; private static final int CALL_FORWARD_NOTIFICATION = 4; private static final int NOTIFICATION_ID_OFFSET = 50; // Instance Variables GsmCallTracker mCT; GsmServiceStateTracker mSST; Loading @@ -128,6 +136,7 @@ public class GSMPhone extends PhoneBase { protected SimPhoneBookInterfaceManager mSimPhoneBookIntManager; PhoneSubInfo mSubInfo; NotificationManager mNotificationManager; Registrant mPostDialHandler; /** List of Registrants to receive Supplementary Service Notifications. */ Loading Loading @@ -155,6 +164,28 @@ public class GSMPhone extends PhoneBase { } } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT. equals(intent.getAction())) { long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUB_ID); int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, PhoneConstants.PHONE_ID1); int status = intent.getIntExtra(TelephonyIntents.EXTRA_RESULT, PhoneConstants.FAILURE); int state = intent.getIntExtra(TelephonyIntents.EXTRA_NEW_SUB_STATE, SubscriptionManager.INACTIVE); log("Received ACTION_SUBSCRIPTION_SET_UICC_RESULT on subId: " + subId + "phoneId " + phoneId + " status: " + status); if ((status == PhoneConstants.SUCCESS) && (state == SubscriptionManager.INACTIVE)) { resetSubSpecifics(); } } }}; // Constructors public Loading Loading @@ -216,6 +247,11 @@ public class GSMPhone extends PhoneBase { mSubInfo = new PhoneSubInfo(this); } mNotificationManager = (NotificationManager) mContext .getSystemService(Context.NOTIFICATION_SERVICE); IntentFilter filter = new IntentFilter(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); context.registerReceiver(mReceiver, filter); mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null); mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); mCi.registerForOn(this, EVENT_RADIO_ON, null); Loading Loading @@ -2112,6 +2148,12 @@ public class GSMPhone extends PhoneBase { } public void resetSubSpecifics() { log("resetSubSpecifics"); if (getCallForwardingIndicator()) { int notificationId = CALL_FORWARD_NOTIFICATION + (getPhoneId() * NOTIFICATION_ID_OFFSET); mNotificationManager.cancel(notificationId); } } /** gets the voice mail count from preferences */ Loading Loading
src/java/com/android/internal/telephony/gsm/GSMPhone.java +42 −0 Original line number Diff line number Diff line Loading @@ -19,8 +19,12 @@ package com.android.internal.telephony.gsm; import android.app.NotificationManager; import android.content.BroadcastReceiver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.database.SQLException; import android.net.Uri; Loading Loading @@ -76,6 +80,7 @@ import com.android.internal.telephony.PhoneProxy; import com.android.internal.telephony.PhoneSubInfo; import com.android.internal.telephony.SubscriptionController; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.TelephonyProperties; import com.android.internal.telephony.UUSInfo; import com.android.internal.telephony.imsphone.ImsPhone; Loading Loading @@ -121,6 +126,9 @@ public class GSMPhone extends PhoneBase { // Event constant for checking if Call Forwarding is enabled private static final int CHECK_CALLFORWARDING_STATUS = 75; private static final int CALL_FORWARD_NOTIFICATION = 4; private static final int NOTIFICATION_ID_OFFSET = 50; // Instance Variables GsmCallTracker mCT; GsmServiceStateTracker mSST; Loading @@ -128,6 +136,7 @@ public class GSMPhone extends PhoneBase { protected SimPhoneBookInterfaceManager mSimPhoneBookIntManager; PhoneSubInfo mSubInfo; NotificationManager mNotificationManager; Registrant mPostDialHandler; /** List of Registrants to receive Supplementary Service Notifications. */ Loading Loading @@ -155,6 +164,28 @@ public class GSMPhone extends PhoneBase { } } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT. equals(intent.getAction())) { long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUB_ID); int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, PhoneConstants.PHONE_ID1); int status = intent.getIntExtra(TelephonyIntents.EXTRA_RESULT, PhoneConstants.FAILURE); int state = intent.getIntExtra(TelephonyIntents.EXTRA_NEW_SUB_STATE, SubscriptionManager.INACTIVE); log("Received ACTION_SUBSCRIPTION_SET_UICC_RESULT on subId: " + subId + "phoneId " + phoneId + " status: " + status); if ((status == PhoneConstants.SUCCESS) && (state == SubscriptionManager.INACTIVE)) { resetSubSpecifics(); } } }}; // Constructors public Loading Loading @@ -216,6 +247,11 @@ public class GSMPhone extends PhoneBase { mSubInfo = new PhoneSubInfo(this); } mNotificationManager = (NotificationManager) mContext .getSystemService(Context.NOTIFICATION_SERVICE); IntentFilter filter = new IntentFilter(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); context.registerReceiver(mReceiver, filter); mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null); mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); mCi.registerForOn(this, EVENT_RADIO_ON, null); Loading Loading @@ -2112,6 +2148,12 @@ public class GSMPhone extends PhoneBase { } public void resetSubSpecifics() { log("resetSubSpecifics"); if (getCallForwardingIndicator()) { int notificationId = CALL_FORWARD_NOTIFICATION + (getPhoneId() * NOTIFICATION_ID_OFFSET); mNotificationManager.cancel(notificationId); } } /** gets the voice mail count from preferences */ Loading