/** * Initializes the databases and notifies any callers waiting on waitForInit. * * @param context the Context to use for opening the database * @param databaseFile Name of the file to be initialized. */ private synchronized void initOnBackgroundThread(Context context, String databaseFile) { if (mInitialized) { return; } initDatabase(context, databaseFile); // Thread done, notify. mInitialized = true; notifyAll(); }