Prevent NPE

If two threads call EmailContent.init(), one of them may use
uninitialized EmailContent contstants

Bug: 10355491

Change-Id: Iedcad01345989df62baf755bf4d63c123e307b7c
This commit is contained in:
Paul Westbrook 2013-08-16 20:11:54 -07:00
parent ea69cbe533
commit 5440a40532
1 changed files with 1 additions and 1 deletions

View File

@ -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;