summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Greenwalt <rgreenwalt@google.com> 2011-11-16 12:06:53 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-11-16 12:06:53 -0800
commit33fe4a36b7d1ef84b13447f2a765db465ef96e56 (patch)
tree72080a07a055919eb258eac5668c08595b7ff78e
parentfd6b64f6ad040b4d550a5219a2576997e2c0e85d (diff)
parent8f4f814beb03400e9143b7c88307b2fd68abd77c (diff)
Merge "Fix TelephonyManager to grab the best context" into ics-mr1
-rwxr-xr-xtelephony/java/android/telephony/TelephonyManager.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 8ead45ebb953..db78e2e98dea 100755
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -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());
}
}