Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0b14abb authored by Paul Sliwowski's avatar Paul Sliwowski Committed by Android (Google) Code Review
Browse files

Merge "Fix calander crash where getTimezone was call without a looper." into...

Merge "Fix calander crash where getTimezone was call without a looper." into ics-ub-calendar-eggplant
parents c0e56794 2dc5984c
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.os.Looper;
import android.provider.CalendarContract.CalendarCache;
import android.text.TextUtils;
import android.text.format.DateUtils;
@@ -269,13 +270,15 @@ public class CalendarUtils {
        public String getTimeZone(Context context, Runnable callback) {
            synchronized (mTZCallbacks){
                if (mFirstTZRequest) {
                    mTZQueryInProgress = true;
                    mFirstTZRequest = false;

                    SharedPreferences prefs = getSharedPreferences(context, mPrefsName);
                    mUseHomeTZ = prefs.getBoolean(KEY_HOME_TZ_ENABLED, false);
                    mHomeTZ = prefs.getString(KEY_HOME_TZ, Time.getCurrentTimezone());

                    // Only check content resolver if we have a looper to attach to use
                    if (Looper.myLooper() != null) {
                        mTZQueryInProgress = true;
                        mFirstTZRequest = false;

                        // When the async query returns it should synchronize on
                        // mTZCallbacks, update mUseHomeTZ, mHomeTZ, and the
                        // preferences, set mTZQueryInProgress to false, and call all
@@ -286,6 +289,7 @@ public class CalendarUtils {
                        mHandler.startQuery(0, context, CalendarCache.URI, CALENDAR_CACHE_POJECTION,
                                null, null, null);
                    }
                }
                if (mTZQueryInProgress) {
                    mTZCallbacks.add(callback);
                }
+0 −1
Original line number Diff line number Diff line
@@ -312,7 +312,6 @@ public class GlobalDismissManager extends BroadcastReceiver {
            Set<Long> calendars) {
        Map<Long, Pair<String, String>> calendarsToAccounts =
                new HashMap<Long, Pair<String, String>>();
        ;
        ContentResolver resolver = context.getContentResolver();
        String calendarSelection = buildMultipleIdQuery(calendars, Calendars._ID);
        Cursor calendarCursor = resolver.query(Calendars.CONTENT_URI, CALENDARS_PROJECTION,