Make LauncherModel.deleteItemFromDatabase write to disk async.

Fixes a bunch of StrictMode violations and removes TODOs.

Change-Id: I886bd071d4a8336c228d29c517a8ffc5223c0623
This commit is contained in:
Brad Fitzpatrick
2010-09-14 12:15:32 -07:00
parent 319226a894
commit 73013bf94f
3 changed files with 15 additions and 9 deletions
+6 -2
View File
@@ -269,8 +269,12 @@ public class LauncherModel extends BroadcastReceiver {
*/
static void deleteItemFromDatabase(Context context, ItemInfo item) {
final ContentResolver cr = context.getContentResolver();
cr.delete(LauncherSettings.Favorites.getContentUri(item.id, false), null, null);
final Uri uriToDelete = LauncherSettings.Favorites.getContentUri(item.id, false);
new Thread("deleteItemFromDatabase") {
public void run() {
cr.delete(uriToDelete, null, null);
}
}.start();
}
/**