Merge "Fix TelephonyManager to grab the best context" into ics-mr1
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 8ead45e..db78e2e 100755
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -60,16 +60,16 @@
/** @hide */
public TelephonyManager(Context context) {
- context = context.getApplicationContext();
if (sContext == null) {
- sContext = context;
+ Context appContext = context.getApplicationContext();
+ if (appContext != null) {
+ sContext = appContext;
+ } else {
+ sContext = context;
+ }
sRegistry = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService(
"telephony.registry"));
- } else if (sContext != context) {
- Log.e(TAG, "Hidden constructor called more than once per process!");
- Log.e(TAG, "Original: " + sContext.getPackageName() + ", new: " +
- context.getPackageName());
}
}