Pingping Lin
Committed by Gerrit Code Review

completer should work as command description, enable delete intent by key

Change-Id: Ibc4574f97f69a4c8e266708c0440baa09ee361f3
......@@ -39,7 +39,7 @@ public class IntentIdCompleter implements Completer {
Iterator<Intent> it = service.getIntents().iterator();
SortedSet<String> strings = delegate.getStrings();
while (it.hasNext()) {
strings.add(it.next().key().toString());
strings.add(it.next().id().toString());
}
// Now let the completer do the work for figuring out what to offer.
......
......@@ -77,13 +77,16 @@ public class IntentRemoveCommand extends AbstractShellCommand {
}
}
final Key key;
if (id.startsWith("0x")) {
id = id.replaceFirst("0x", "");
key = Key.of(new BigInteger(id, 16).longValue(), appId);
} else {
// This line is to use the intent key to delete an intent
key = Key.of(id, appId);
}
Key key = Key.of(new BigInteger(id, 16).longValue(), appId);
Intent intent = intentService.getIntent(key);
if (intent != null) {
IntentListener listener = null;
final CountDownLatch withdrawLatch, purgeLatch;
......