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


Java Utilities.isPropertyEnabled方法代码示例

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


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

示例1: UserEventDispatcher

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public UserEventDispatcher() {
    if (ProviderConfig.IS_DOGFOOD_BUILD) {
        mIsVerbose = Utilities.isPropertyEnabled(TAG);
    } else {
        mIsVerbose = false;
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:UserEventDispatcher.java

示例2: sanitizeDB

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Makes the following changes in the provider DB.
 *   1. Removes all entries belonging to a managed profile as managed profiles
 *      cannot be restored.
 *   2. Marks all entries as restored. The flags are updated during first load or as
 *      the restored apps get installed.
 *   3. If the user serial for primary profile is different than that of the previous device,
 *      update the entries to the new profile id.
 */
private void sanitizeDB(DatabaseHelper helper, SQLiteDatabase db) throws Exception {
    long oldProfileId = getDefaultProfileId(db);
    // Delete all entries which do not belong to the main user
    int itemsDeleted = db.delete(
            Favorites.TABLE_NAME, "profileId != ?", new String[]{Long.toString(oldProfileId)});
    if (itemsDeleted > 0) {
        FileLog.d(TAG, itemsDeleted + " items belonging to a managed profile, were deleted");
    }

    // Mark all items as restored.
    boolean keepAllIcons = Utilities.isPropertyEnabled(KEEP_ALL_ICONS);
    ContentValues values = new ContentValues();
    values.put(Favorites.RESTORED, ShortcutInfo.FLAG_RESTORED_ICON
            | (keepAllIcons ? ShortcutInfo.FLAG_RESTORE_STARTED : 0));
    db.update(Favorites.TABLE_NAME, values, null, null);

    // Mark widgets with appropriate restore flag
    values.put(Favorites.RESTORED,  LauncherAppWidgetInfo.FLAG_ID_NOT_VALID |
            LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY |
            LauncherAppWidgetInfo.FLAG_UI_NOT_READY |
            (keepAllIcons ? LauncherAppWidgetInfo.FLAG_RESTORE_STARTED : 0));
    db.update(Favorites.TABLE_NAME, values, "itemType = ?",
            new String[]{Integer.toString(Favorites.ITEM_TYPE_APPWIDGET)});

    long myProfileId = helper.getDefaultUserSerial();
    if (Utilities.longCompare(oldProfileId, myProfileId) != 0) {
        FileLog.d(TAG, "Changing primary user id from " + oldProfileId + " to " + myProfileId);
        migrateProfileId(db, myProfileId);
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:40,代码来源:RestoreDbTask.java


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