本文整理汇总了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;
}
}
示例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);
}
}