[Android] SidebarAdapter: dead code removal
Edward Wang
git at videolan.org
Fri May 31 01:54:11 CEST 2013
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu May 30 19:53:36 2013 -0400| [6aa4fdeec2d9030b9d1e9afee60037974f3b6a31] | committer: Edward Wang
SidebarAdapter: dead code removal
Rendered obsolete by bc4a6aa42f500e86d75001fa35f89aa52162083c
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=6aa4fdeec2d9030b9d1e9afee60037974f3b6a31
---
.../src/org/videolan/vlc/gui/SidebarAdapter.java | 40 --------------------
1 file changed, 40 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java b/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
index f2a2231..9befdd9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/SidebarAdapter.java
@@ -64,7 +64,6 @@ public class SidebarAdapter extends BaseAdapter {
private LayoutInflater mInflater;
static final List<SidebarEntry> entries;
private HashMap<String, Fragment> mFragments;
- private HashMap<String, Boolean> mFragmentAdded;
private Semaphore mSemaphore;
static {
@@ -82,7 +81,6 @@ public class SidebarAdapter extends BaseAdapter {
public SidebarAdapter() {
mInflater = LayoutInflater.from(VLCApplication.getAppContext());
mFragments = new HashMap<String, Fragment>(entries.size());
- mFragmentAdded = new HashMap<String, Boolean>(entries.size());
mSemaphore = new Semaphore(1, true);
}
@@ -140,47 +138,10 @@ public class SidebarAdapter extends BaseAdapter {
}
f.setRetainInstance(true);
mFragments.put(id, f);
- mFragmentAdded.put(id, false);
return f;
}
/**
- * Has the fragment already been added?
- * Note: lock must be held prior to entering this function!
- *
- * @return true if already added
- */
- public boolean isFragmentAdded(String id) {
- return mFragmentAdded.get(id);
- }
-
- /**
- * Flags the fragment as added.
- *
- * @param id ID of the fragment
- */
- public void setFragmentAdded(String id) {
- mFragmentAdded.put(id, true);
- }
-
- /**
- * Locks the semaphore before manipulating the added flag, since only one
- * add operation is permitted.
- *
- * Remember to unlockSemaphore() when done.
- */
- public void lockSemaphore() {
- mSemaphore.acquireUninterruptibly();
- }
-
- /**
- * Release the semaphore when done.
- */
- public void unlockSemaphore() {
- mSemaphore.release();
- }
-
- /**
* When Android has automatically recreated a fragment from the bundle state,
* use this function to 'restore' the recreated fragment into this sidebar
* adapter to prevent it from trying to create the same fragment again.
@@ -194,7 +155,6 @@ public class SidebarAdapter extends BaseAdapter {
return;
}
mFragments.put(id, f);
- mFragmentAdded.put(id, true);
// if Android added it, it's been implicitly added already...
}
}
More information about the Android
mailing list