コード例 #1
0
 public void removeStorageObserver(Observer o) {
   Log.i(TAG, "removeStorageObserver: E");
   synchronized (mStorageObservable) {
     if (mStorageObservable.countObservers() == 1) {
       mStorageReceiver.unregister();
     }
     mStorageObservable.deleteObserver(o);
   }
 }
コード例 #2
0
 public void addStorageObserver(Observer o) {
   Log.i(TAG, "addStorageObserver: E");
   synchronized (mStorageObservable) {
     if (mStorageObservable.countObservers() == 0) {
       mStorageReceiver.register(this);
     }
     mStorageObservable.addObserver(o);
   }
 }
コード例 #3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * cn.mabin.lanfileshare.logic.StorageReceiver.OnStorageListener#onUnmounted
  * ()
  */
 @Override
 public void onUnmounted() {
   Log.i(TAG, "onUnmounted: isStorageAvailable = " + isStorageAvailable);
   if (isStorageAvailable) {
     isStorageAvailable = false;
     mStorageObservable.fireFastNotify(false);
   }
 }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * cn.mabin.lanfileshare.logic.StorageReceiver.OnStorageListener#onMounted()
  */
 @Override
 public void onMounted() {
   Log.i(TAG, "onMounted: isStorageAvailable = " + isStorageAvailable);
   if (!isStorageAvailable) {
     isStorageAvailable = true;
     mStorageObservable.fireFastNotify(true);
   }
 }