Ejemplo n.º 1
0
 private BitmapFactory.Options snifBitmapOptions() {
   ParcelFileDescriptor input = getPFD();
   if (input == null) return null;
   try {
     BitmapFactory.Options options = new BitmapFactory.Options();
     options.inJustDecodeBounds = true;
     BitmapManager.instance().decodeFileDescriptor(input.getFileDescriptor(), options);
     return options;
   } finally {
     Util.closeSilently(input);
   }
 }
 @Override
 public void setUp() {
   mContext = getContext();
   mBitmapManager = BitmapManager.instance();
   mImageList =
       ImageManager.makeImageList(
           mContext.getContentResolver(),
           ImageManager.DataLocation.ALL,
           ImageManager.INCLUDE_IMAGES,
           ImageManager.SORT_DESCENDING,
           null);
   mImage = mImageList.getImageAt(0);
 }
Ejemplo n.º 3
0
 public void stop() {
     synchronized (mQueue) {
         mDone = true;
         mQueue.notifyAll();
     }
     if (mDecodeThread != null) {
         try {
             Thread t = mDecodeThread;
             BitmapManager.instance().cancelThreadDecoding(t);
             MediaStore.Images.Thumbnails.cancelThumbnailRequest(mCr, -1);
             t.join();
             mDecodeThread = null;
         } catch (InterruptedException ex) {
             // so now what?
         }
     }
 }
 public void testSingleton() {
   BitmapManager manager = BitmapManager.instance();
   assertNotNull(manager);
   assertNotNull(mBitmapManager);
   assertSame(manager, mBitmapManager);
 }
Ejemplo n.º 5
0
  @Override
  protected void onPause() {

    super.onPause();
    BitmapManager.instance().cancelThreadDecoding(mDecodingThreads);
  }