@Test public void testRemovePin() { mCompatPinnedList.addPin(Uri.parse("content: mCompatPinnedList.addPin(Uri.parse("content: assertFalse(mCompatPinnedList.removePin(Uri.parse("content: "my_pkg")); assertTrue(mCompatPinnedList.removePin(Uri.parse("content: "my_pkg2")); }
public synchronized boolean removePin(Uri uri, String pkg) { Set<String> pins = getPins(uri); if (pins.isEmpty() || !pins.contains(pkg)) { return false; } pins.remove(pkg); setPins(uri, pins); return pins.size() == 0; }
CompatPinnedList { public synchronized boolean removePin(Uri uri, String pkg) { Set<String> pins = getPins(uri); if (pins.isEmpty() || !pins.contains(pkg)) { return false; } pins.remove(pkg); setPins(uri, pins); return pins.size() == 0; } }
CompatPinnedList { public synchronized boolean removePin(Uri uri, String pkg) { Set<String> pins = getPins(uri); if (pins.isEmpty() || !pins.contains(pkg)) { return false; } pins.remove(pkg); setPins(uri, pins); return pins.size() == 0; } CompatPinnedList(Context context, String prefsName); }
CompatPinnedList { public synchronized boolean removePin(Uri uri, String pkg) { Set<String> pins = getPins(uri); if (pins.isEmpty() || !pins.contains(pkg)) { return false; } pins.remove(pkg); setPins(uri, pins); return pins.size() == 0; } CompatPinnedList(Context context, String prefsName); List<Uri> getPinnedSlices(); synchronized ArraySet<SliceSpec> getSpecs(Uri uri); synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs); synchronized boolean removePin(Uri uri, String pkg); }
CompatPinnedList { public synchronized boolean removePin(Uri uri, String pkg) { Set<String> pins = getPins(uri); if (pins.isEmpty() || !pins.contains(pkg)) { return false; } pins.remove(pkg); setPins(uri, pins); return pins.size() == 0; } CompatPinnedList(Context context, String prefsName); List<Uri> getPinnedSlices(); synchronized ArraySet<SliceSpec> getSpecs(Uri uri); synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs); synchronized boolean removePin(Uri uri, String pkg);  }