am 33fe4a36: Merge "Fix TelephonyManager to grab the best context" into ics-mr1

* commit '33fe4a36b7d1ef84b13447f2a765db465ef96e56':
  Fix TelephonyManager to grab the best context
This commit is contained in:
Robert Greenwalt
2011-11-16 12:46:23 -08:00
committed by Android Git Automerger

View File

@@ -60,16 +60,16 @@ public class TelephonyManager {
/** @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());
}
}