From 5440a405325c118ecab7ab4f124955ab3c92c245 Mon Sep 17 00:00:00 2001 From: Paul Westbrook Date: Fri, 16 Aug 2013 20:11:54 -0700 Subject: [PATCH] Prevent NPE If two threads call EmailContent.init(), one of them may use uninitialized EmailContent contstants Bug: 10355491 Change-Id: Iedcad01345989df62baf755bf4d63c123e307b7c --- .../src/com/android/emailcommon/provider/EmailContent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emailcommon/src/com/android/emailcommon/provider/EmailContent.java b/emailcommon/src/com/android/emailcommon/provider/EmailContent.java index 284bf2bb6..0d8525b1f 100755 --- a/emailcommon/src/com/android/emailcommon/provider/EmailContent.java +++ b/emailcommon/src/com/android/emailcommon/provider/EmailContent.java @@ -129,7 +129,7 @@ public abstract class EmailContent { public static Uri ACCOUNT_CHECK_URI; public static String PROVIDER_PERMISSION; - public static void init(Context context) { + public static synchronized void init(Context context) { if (AUTHORITY == null) { PACKAGE_NAME = context.getPackageName(); EMAIL_PACKAGE_NAME = PACKAGE_NAME;