Merging from ub-launcher3-rvc-dev @ build 6557059
Bug:150504032 Test: manual, presubmit on the source branch x20/teams/android-launcher/merge/ub-launcher3-rvc-dev_rvc-dev_6557059.html Change-Id: I280025d9e58626fe725fe24ca60c28e89d0cee74
This commit is contained in:
@@ -127,6 +127,32 @@ public class GridBackupTable {
|
||||
return mRestoredHotseatSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new table and populates with copy of Favorites.TABLE_NAME
|
||||
*/
|
||||
public void createCustomBackupTable(String tableName) {
|
||||
long profileId = UserCache.INSTANCE.get(mContext).getSerialNumberForUser(
|
||||
Process.myUserHandle());
|
||||
copyTable(mDb, Favorites.TABLE_NAME, tableName, profileId);
|
||||
encodeDBProperties(0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Restores the contents of a custom table to Favorites.TABLE_NAME
|
||||
*/
|
||||
|
||||
public void restoreFromCustomBackupTable(String tableName, boolean dropAfterUse) {
|
||||
if (!tableExists(mDb, tableName)) {
|
||||
return;
|
||||
}
|
||||
long userSerial = UserCache.INSTANCE.get(mContext).getSerialNumberForUser(
|
||||
Process.myUserHandle());
|
||||
copyTable(mDb, tableName, Favorites.TABLE_NAME, userSerial);
|
||||
if (dropAfterUse) {
|
||||
dropTable(mDb, tableName);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Copy valid grid entries from one table to another.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user