Merge "NPE in in AppGlobals#getIntCoreSetting" into honeycomb-mr1

This commit is contained in:
Svetoslav Ganov
2011-03-03 14:25:13 -08:00
committed by Android (Google) Code Review

View File

@@ -55,6 +55,11 @@ public class AppGlobals {
* @return The core settings.
*/
public static int getIntCoreSetting(String key, int defaultValue) {
return ActivityThread.currentActivityThread().getIntCoreSetting(key, defaultValue);
ActivityThread currentActivityThread = ActivityThread.currentActivityThread();
if (currentActivityThread != null) {
return currentActivityThread.getIntCoreSetting(key, defaultValue);
} else {
return defaultValue;
}
}
}