Skip to content

Commit 33fe4a3

Browse files
Robert GreenwaltAndroid (Google) Code Review
authored andcommitted
Merge "Fix TelephonyManager to grab the best context" into ics-mr1
2 parents fd6b64f + 8f4f814 commit 33fe4a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

telephony/java/android/telephony/TelephonyManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ public class TelephonyManager {
6060

6161
/** @hide */
6262
public TelephonyManager(Context context) {
63-
context = context.getApplicationContext();
6463
if (sContext == null) {
65-
sContext = context;
64+
Context appContext = context.getApplicationContext();
65+
if (appContext != null) {
66+
sContext = appContext;
67+
} else {
68+
sContext = context;
69+
}
6670

6771
sRegistry = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService(
6872
"telephony.registry"));
69-
} else if (sContext != context) {
70-
Log.e(TAG, "Hidden constructor called more than once per process!");
71-
Log.e(TAG, "Original: " + sContext.getPackageName() + ", new: " +
72-
context.getPackageName());
7373
}
7474
}
7575

0 commit comments

Comments
 (0)