diff options
author | Wu-cheng Li <wuchengli@google.com> | 2012-08-22 19:15:35 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2012-08-27 17:47:53 +0800 |
commit | ec3c73a3c4b7f7b841f707a1b965222c0e86195e (patch) | |
tree | b2cd8148b6a8e8a34830311c9dc98df4925c0bff /src/com/android/gallery3d/data/LocalAlbumSet.java | |
parent | da3df03ed46ac5ce19beba0618dfa3932dad05bc (diff) | |
download | android_packages_apps_Snap-ec3c73a3c4b7f7b841f707a1b965222c0e86195e.tar.gz android_packages_apps_Snap-ec3c73a3c4b7f7b841f707a1b965222c0e86195e.tar.bz2 android_packages_apps_Snap-ec3c73a3c4b7f7b841f707a1b965222c0e86195e.zip |
Add secure album support for lock screen camera.
Secure album only shows the media items added by
the camera.
bug:5955016
Change-Id: Id26abec4dfcc036cf9de682398fed25eed73d1a5
Diffstat (limited to 'src/com/android/gallery3d/data/LocalAlbumSet.java')
-rw-r--r-- | src/com/android/gallery3d/data/LocalAlbumSet.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/com/android/gallery3d/data/LocalAlbumSet.java b/src/com/android/gallery3d/data/LocalAlbumSet.java index 579a71e9b..5d01c064a 100644 --- a/src/com/android/gallery3d/data/LocalAlbumSet.java +++ b/src/com/android/gallery3d/data/LocalAlbumSet.java @@ -43,14 +43,13 @@ public class LocalAlbumSet extends MediaSet private static final String TAG = "LocalAlbumSet"; - private static final Uri mWatchUriImage = Images.Media.EXTERNAL_CONTENT_URI; - private static final Uri mWatchUriVideo = Video.Media.EXTERNAL_CONTENT_URI; + private static final Uri[] mWatchUris = + {Images.Media.EXTERNAL_CONTENT_URI, Video.Media.EXTERNAL_CONTENT_URI}; private final GalleryApp mApplication; private final int mType; private ArrayList<MediaSet> mAlbums = new ArrayList<MediaSet>(); - private final ChangeNotifier mNotifierImage; - private final ChangeNotifier mNotifierVideo; + private final ChangeNotifier mNotifier; private final String mName; private final Handler mHandler; private boolean mIsLoading; @@ -63,8 +62,7 @@ public class LocalAlbumSet extends MediaSet mApplication = application; mHandler = new Handler(application.getMainLooper()); mType = getTypeFromPath(path); - mNotifierImage = new ChangeNotifier(this, mWatchUriImage, application); - mNotifierVideo = new ChangeNotifier(this, mWatchUriVideo, application); + mNotifier = new ChangeNotifier(this, mWatchUris, application); mName = application.getResources().getString( R.string.set_label_local_albums); } @@ -165,8 +163,7 @@ public class LocalAlbumSet extends MediaSet // 1. Prevent calling reload() concurrently. // 2. Prevent calling onFutureDone() and reload() concurrently public synchronized long reload() { - // "|" is used instead of "||" because we want to clear both flags. - if (mNotifierImage.isDirty() | mNotifierVideo.isDirty()) { + if (mNotifier.isDirty()) { if (mLoadTask != null) mLoadTask.cancel(); mIsLoading = true; mLoadTask = mApplication.getThreadPool().submit(new AlbumsLoader(), this); @@ -198,8 +195,7 @@ public class LocalAlbumSet extends MediaSet // For debug only. Fake there is a ContentObserver.onChange() event. void fakeChange() { - mNotifierImage.fakeChange(); - mNotifierVideo.fakeChange(); + mNotifier.fakeChange(); } // Circular shift the array range from a[i] to a[j] (inclusive). That is, |