summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorJinghui Guo <w001091@motorola.com>2009-08-06 14:47:17 -0500
committerWink Saville <wink@google.com>2009-08-07 10:35:11 -0700
commit9e652dcc213b96087ccadc730b1e6b1891cd02ae (patch)
tree24f550148ea636d46f15200a8658bd9217146df8 /telephony
parent44495b71345b196f17552e608ac6b251c67062ff (diff)
downloadframeworks_base-9e652dcc213b96087ccadc730b1e6b1891cd02ae.zip
frameworks_base-9e652dcc213b96087ccadc730b1e6b1891cd02ae.tar.gz
frameworks_base-9e652dcc213b96087ccadc730b1e6b1891cd02ae.tar.bz2
Touch activation screen shown up fix
During the time of OTA activation screen startup, the app needs to get MIN by calling getCdmaMin(). The issue in current code is that OTA app calls getCdmaMin() before framework gets MIN data from lower layer. To fix this issue, framework will be providing the following new APIs to applications for checking if MIN data is ready: 1. isMinInfoReady(): Check if mMin variable in getCdmaMin() has been assigned a non-null value. 2. registerForSubscriptionInfoReady(): Apps uses this API to register for notification. 3. unregisterForSubscriptionInfoReady(): This API is used by apps to unregister notification. Framework will be sending out the notification in the following situations: 1. when mMin is assigned a non-null MIN value; 2. When app calls register API and MIN is ready.
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/Phone.java21
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneBase.java16
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneProxy.java12
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/CDMAPhone.java12
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java37
5 files changed, 98 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java
index 769226e..86ea12b 100644
--- a/telephony/java/com/android/internal/telephony/Phone.java
+++ b/telephony/java/com/android/internal/telephony/Phone.java
@@ -542,6 +542,20 @@ public interface Phone {
void unregisterForCdmaOtaStatusChange(Handler h);
/**
+ * Registration point for subscription info ready
+ * @param h handler to notify
+ * @param what what code of message when delivered
+ * @param obj placed in Message.obj
+ */
+ public void registerForSubscriptionInfoReady(Handler h, int what, Object obj);
+
+ /**
+ * Unregister for notifications for subscription info
+ * @param h Handler to be removed from the registrant list.
+ */
+ public void unregisterForSubscriptionInfoReady(Handler h);
+
+ /**
* Returns SIM record load state. Use
* <code>getSimCard().registerForReady()</code> for change notification.
*
@@ -1366,6 +1380,13 @@ public interface Phone {
String getCdmaMin();
/**
+ * Check if subscription data has been assigned to mMin
+ *
+ * return true if MIN info is ready; false otherwise.
+ */
+ boolean isMinInfoReady();
+
+ /**
* Retrieves PRL Version for CDMA phones
*/
String getCdmaPrlVersion();
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index fbda221..6e2b3f3 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -698,6 +698,12 @@ public abstract class PhoneBase implements Phone {
return null;
}
+ public boolean isMinInfoReady() {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ return false;
+ }
+
public String getCdmaPrlVersion(){
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
@@ -724,6 +730,16 @@ public abstract class PhoneBase implements Phone {
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
}
+ public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
+ public void unregisterForSubscriptionInfoReady(Handler h) {
+ // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
+ Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+ }
+
public boolean isOtaSpNumber(String dialStr) {
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java
index 30d56da..f2568c1 100644
--- a/telephony/java/com/android/internal/telephony/PhoneProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java
@@ -315,6 +315,14 @@ public class PhoneProxy extends Handler implements Phone {
mActivePhone.unregisterForCdmaOtaStatusChange(h);
}
+ public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) {
+ mActivePhone.registerForSubscriptionInfoReady(h, what, obj);
+ }
+
+ public void unregisterForSubscriptionInfoReady(Handler h) {
+ mActivePhone.unregisterForSubscriptionInfoReady(h);
+ }
+
public boolean getIccRecordsLoaded() {
return mActivePhone.getIccRecordsLoaded();
}
@@ -419,6 +427,10 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getCdmaMin();
}
+ public boolean isMinInfoReady() {
+ return mActivePhone.isMinInfoReady();
+ }
+
public String getCdmaPrlVersion() {
return mActivePhone.getCdmaPrlVersion();
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 7b3ff5e..e0fbd81 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -441,6 +441,10 @@ public class CDMAPhone extends PhoneBase {
return mSST.getCdmaMin();
}
+ public boolean isMinInfoReady() {
+ return mSST.isMinInfoReady();
+ }
+
public void getCallWaiting(Message onComplete) {
mCM.queryCallWaiting(CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
}
@@ -556,6 +560,14 @@ public class CDMAPhone extends PhoneBase {
mCM.unregisterForCdmaOtaProvision(h);
}
+ public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) {
+ mSST.registerForSubscriptionInfoReady(h, what, obj);
+ }
+
+ public void unregisterForSubscriptionInfoReady(Handler h) {
+ mSST.unregisterForSubscriptionInfoReady(h);
+ }
+
public void setOnEcbModeExitResponse(Handler h, int what, Object obj) {
mECMExitRespRegistrant = new Registrant (h, what, obj);
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 53f0274..753b5e7 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -93,6 +93,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
private int mRegistrationState = -1;
private RegistrantList cdmaDataConnectionAttachedRegistrants = new RegistrantList();
private RegistrantList cdmaDataConnectionDetachedRegistrants = new RegistrantList();
+ private RegistrantList cdmaForSubscriptionInfoReadyRegistrants = new RegistrantList();
// Sometimes we get the NITZ time before we know what country we are in.
// Keep the time zone information from the NITZ string so we can fix
@@ -125,6 +126,7 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
private int mHomeNetworkId[] = null;
private String mMin;
private String mPrlVersion;
+ private boolean mIsMinInfoReady = false;
private boolean isEriTextLoaded = false;
private boolean isSubscriptionFromRuim = false;
@@ -264,6 +266,25 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
cdmaDataConnectionDetachedRegistrants.remove(h);
}
+ /**
+ * Registration point for subscription info ready
+ * @param h handler to notify
+ * @param what what code of message when delivered
+ * @param obj placed in Message.obj
+ */
+ public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) {
+ Registrant r = new Registrant(h, what, obj);
+ cdmaForSubscriptionInfoReadyRegistrants.add(r);
+
+ if (isMinInfoReady()) {
+ r.notifyRegistrant();
+ }
+ }
+
+ public void unregisterForSubscriptionInfoReady(Handler h) {
+ cdmaForSubscriptionInfoReadyRegistrants.remove(h);
+ }
+
//***** Called from CDMAPhone
public void
getLacAndCid(Message onComplete) {
@@ -426,6 +447,13 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
mMin = cdmaSubscription[3];
mPrlVersion = cdmaSubscription[4];
Log.d(LOG_TAG,"GET_CDMA_SUBSCRIPTION MDN=" + mMdn);
+ //Notify apps subscription info is ready
+ if (cdmaForSubscriptionInfoReadyRegistrants != null) {
+ cdmaForSubscriptionInfoReadyRegistrants.notifyRegistrants();
+ }
+ if (!mIsMinInfoReady) {
+ mIsMinInfoReady = true;
+ }
} else {
Log.w(LOG_TAG,"error parsing cdmaSubscription params num="
+ cdmaSubscription.length);
@@ -1545,4 +1573,13 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
return null;
}
}
+
+ /**
+ * Check if subscription data has been assigned to mMin
+ *
+ * return true if MIN info is ready; false otherwise.
+ */
+ public boolean isMinInfoReady() {
+ return mIsMinInfoReady;
+ }
}