/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.phonemetra.turbo.launcher;

public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
    private static final String TAG = "LauncherAppState";
    private static final String SHARED_PREFERENCES_KEY = "com.phonemetra.turbo.launcher.prefs";
    
    private final AppFilter mAppFilter;
    private final BuildInfo mBuildInfo;
    private LauncherModel mModel;
    private IconCache mIconCache;
    private WidgetPreviewLoader.CacheDb mWidgetPreviewCacheDb;
    private boolean mIsScreenLarge;
    private float mScreenDensity;
    private int mLongPressTimeout = 300;
    private boolean mWallpaperChangedSinceLastCheck;
    
    private static WeakReference<LauncherProvider> sLauncherProvider;
    private static Context sContext;
    
    private static LauncherAppState INSTANCE;
    
    private DynamicGrid mDynamicGrid;
    
    public static LauncherAppState getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new LauncherAppState();
        }
        return INSTANCE;
    }

@@ -1627,12 +1627,1277 @@
 ANCE;%0A    %7D%0A
+    %0A    public static LauncherAppState getInstanceNoCreate() %7B%0A        return INSTANCE;%0A    %7D%0A    %0A    public Context getContext() %7B%0A        return sContext;%0A    %7D%0A    %0A    public static void setApplicationContext(Context context) %7B%0A        sContext = context.getApplicationContext();%0A    %7D%0A    %0A    private LauncherAppState() %7B%0A        if (sContext == null) %7B%0A            throw new IllegalStateException(%22LauncherAppState inited before app context set%22);%0A        %7D%0A        %0A        mIsScreenLarge = isScreenLarge(sContext.getResources());%0A        mScreenDensity = sContext.getResources().getDisplayMetrics().density;%0A        %0A        recreateWidgetPreviewDb();%0A        mIconCache = new IconCache(sContext);%0A        %0A        mAppFilter = AppFilter.loadByName(sContext.getString(R.string.app_filter_class));%0A        mBuildInfo = BuildInfo.loadByName(sContext.getString(R.string.build_info_class));%0A        mModel = new LauncherModel(this, mIconCache, mAppFilter);%0A        %0A        // Register intent receivers%0A        %0A        // Register for changes to the favorites%0A        ContentResolver resolver = sContext.getContentResolver();%0A        resolver.registerContentObserver(LauncherSettings.Favorites.CONTENT_URI, true,%0A        mFavoritesObserver);%0A        %0A    %7D%0A

Update LauncherAppState.java