@Test public void testAddMultipleUris() { assertTrue(mCompatPinnedList.addPin(Uri.parse("content: mSpecs)); assertTrue(mCompatPinnedList.addPin(Uri.parse("content: mSpecs)); }
public synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs) { Set<String> pins = getPins(uri); boolean wasNotPinned = pins.isEmpty(); pins.add(pkg); setPins(uri, pins); if (wasNotPinned) { setSpecs(uri, new ArraySet<>(specs)); } else { setSpecs(uri, mergeSpecs(getSpecs(uri), specs)); } return wasNotPinned; }
CompatPinnedList { public synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs) { Set<String> pins = getPins(uri); boolean wasNotPinned = pins.isEmpty(); pins.add(pkg); setPins(uri, pins); if (wasNotPinned) { setSpecs(uri, new ArraySet<>(specs)); } else { setSpecs(uri, mergeSpecs(getSpecs(uri), specs)); } return wasNotPinned; } }
CompatPinnedList { public synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs) { Set<String> pins = getPins(uri); boolean wasNotPinned = pins.isEmpty(); pins.add(pkg); setPins(uri, pins); if (wasNotPinned) { setSpecs(uri, new ArraySet<>(specs)); } else { setSpecs(uri, mergeSpecs(getSpecs(uri), specs)); } return wasNotPinned; } CompatPinnedList(Context context, String prefsName); }
CompatPinnedList { public synchronized boolean addPin(Uri uri, String pkg, Set<SliceSpec> specs) { Set<String> pins = getPins(uri); boolean wasNotPinned = pins.isEmpty(); pins.add(pkg); setPins(uri, pins); if (wasNotPinned) { setSpecs(uri, new ArraySet<>(specs)); } else { setSpecs(uri, mergeSpecs(getSpecs(uri), specs)); } return wasNotPinned; } 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 addPin(Uri uri, String pkg, Set<SliceSpec> specs) { Set<String> pins = getPins(uri); boolean wasNotPinned = pins.isEmpty(); pins.add(pkg); setPins(uri, pins); if (wasNotPinned) { setSpecs(uri, new ArraySet<>(specs)); } else { setSpecs(uri, mergeSpecs(getSpecs(uri), specs)); } return wasNotPinned; } 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);  }