当前位置: 首页>>代码示例>>Java>>正文


Java ManagedProfileHeuristic.processAllUsers方法代码示例

本文整理汇总了Java中com.android.launcher3.util.ManagedProfileHeuristic.processAllUsers方法的典型用法代码示例。如果您正苦于以下问题:Java ManagedProfileHeuristic.processAllUsers方法的具体用法?Java ManagedProfileHeuristic.processAllUsers怎么用?Java ManagedProfileHeuristic.processAllUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.launcher3.util.ManagedProfileHeuristic的用法示例。


在下文中一共展示了ManagedProfileHeuristic.processAllUsers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEmptyDbCreated

import com.android.launcher3.util.ManagedProfileHeuristic; //导入方法依赖的package包/类
/**
 * Overriden in tests.
 */
protected void onEmptyDbCreated() {
    // Database was just created, so wipe any previous widgets
    if (mWidgetHostResetHandler != null) {
        new AppWidgetHost(mContext, Launcher.APPWIDGET_HOST_ID).deleteHost();
        mWidgetHostResetHandler.sendMessage(Message.obtain(
                mWidgetHostResetHandler,
                ChangeListenerWrapper.MSG_APP_WIDGET_HOST_RESET,
                mContext
        ));
    }

    // Set the flag for empty DB
    Utilities.getPrefs(mContext).edit().putBoolean(EMPTY_DATABASE_CREATED, true).commit();

    // When a new DB is created, remove all previously stored managed profile information.
    ManagedProfileHeuristic.processAllUsers(Collections.<UserHandleCompat>emptyList(),
            mContext);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:22,代码来源:LauncherProvider.java

示例2: onCreate

import com.android.launcher3.util.ManagedProfileHeuristic; //导入方法依赖的package包/类
@Override
public void onCreate(SQLiteDatabase db) {
    if (LOGD) Log.d(TAG, "creating new launcher database");

    mMaxItemId = 1;
    mMaxScreenId = 0;
    mNewDbCreated = true;

    UserManagerCompat userManager = UserManagerCompat.getInstance(mContext);
    long userSerialNumber = userManager.getSerialNumberForUser(
            UserHandleCompat.myUserHandle());

    db.execSQL("CREATE TABLE favorites (" +
            "_id INTEGER PRIMARY KEY," +
            "title TEXT," +
            "intent TEXT," +
            "container INTEGER," +
            "screen INTEGER," +
            "cellX INTEGER," +
            "cellY INTEGER," +
            "spanX INTEGER," +
            "spanY INTEGER," +
            "itemType INTEGER," +
            "appWidgetId INTEGER NOT NULL DEFAULT -1," +
            "isShortcut INTEGER," +
            "iconType INTEGER," +
            "iconPackage TEXT," +
            "iconResource TEXT," +
            "icon BLOB," +
            "uri TEXT," +
            "displayMode INTEGER," +
            "appWidgetProvider TEXT," +
            "modified INTEGER NOT NULL DEFAULT 0," +
            "restored INTEGER NOT NULL DEFAULT 0," +
            "profileId INTEGER DEFAULT " + userSerialNumber + "," +
            "hidden INTEGER DEFAULT 0" + "," +
            "rank INTEGER NOT NULL DEFAULT 0," +
            "options INTEGER NOT NULL DEFAULT 0," +
            "subType INTEGER DEFAULT 0" +
            ");");
    addWorkspacesTable(db);

    // Database was just created, so wipe any previous widgets
    if (mAppWidgetHost != null) {
        try {
            mAppWidgetHost.deleteHost();
            /**
             * Send notification that we've deleted the {@link AppWidgetHost},
             * probably as part of the initial database creation. The receiver may
             * want to re-call {@link AppWidgetHost#startListening()} to ensure
             * callbacks are correctly set.
             */
            new MainThreadExecutor().execute(new Runnable() {

                @Override
                public void run() {
                    if (mListener != null) {
                        mListener.onAppWidgetHostReset();
                    }
                }
            });
        } catch (NullPointerException ex) {
            // nothing to do here. Why did this pass the null check? I don't know. but this fixes it.
            // (avoids: Caused by: java.lang.NullPointerException: Attempt to invoke interface method
            // 'void com.android.internal.appwidget.IAppWidgetService.deleteHost(java.lang.String, int)'
            // on a null object reference
        }
    }

    // Fresh and clean launcher DB.
    mMaxItemId = initializeMaxItemId(db);
    setFlagEmptyDbCreated();

    // When a new DB is created, remove all previously stored managed profile information.
    ManagedProfileHeuristic.processAllUsers(Collections.<UserHandleCompat>emptyList(),
            mContext);
}
 
开发者ID:talentlo,项目名称:Trebuchet,代码行数:78,代码来源:LauncherProvider.java


注:本文中的com.android.launcher3.util.ManagedProfileHeuristic.processAllUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。