Merge "check for long and short component names." into ub-now-nova

This commit is contained in:
Chris Wren
2014-05-12 20:46:38 +00:00
committed by Android (Google) Code Review
+4 -2
View File
@@ -853,10 +853,12 @@ public class LauncherModel extends BroadcastReceiver
return false; return false;
} }
String componentName = component.flattenToString(); String componentName = component.flattenToString();
String shortName = component.flattenToShortString();
long serialNumber = UserManagerCompat.getInstance(context) long serialNumber = UserManagerCompat.getInstance(context)
.getSerialNumberForUser(user); .getSerialNumberForUser(user);
final String where = "intent glob \"*component=" + componentName + "*\" and restored = 1" final String where = "(intent glob \"*component=" + componentName + "*\" or " +
+ " and profileId = " + serialNumber; "intent glob \"*component=" + shortName + "*\")" +
"and restored = 1 and profileId = " + serialNumber;
Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI, Cursor c = cr.query(LauncherSettings.Favorites.CONTENT_URI,
new String[]{"intent", "restored", "profileId"}, where, null, null); new String[]{"intent", "restored", "profileId"}, where, null, null);
boolean result = false; boolean result = false;