Example #1
0
 public File getFile() {
   if (!Storage.externalStorageAvailable() || this.mSize <= 0) {
     return null;
   }
   File destinationDir = ObbFactory.getParentDirectory(this.mPackageName);
   if (!destinationDir.exists()) {
     destinationDir.mkdirs();
   }
   return new File(destinationDir, this.mFileName);
 }
Example #2
0
 public void syncStateWithStorage() {
   if (this.mState != 5) {
     if (!Storage.externalStorageAvailable()) {
       setState(4);
     } else if (isDownloaded()) {
       setState(3);
     } else {
       setState(4);
     }
   }
 }