示例#1
0
 private void logFinalizeProblem(String tag) {
   try {
     FinskyLog.w("Failure %s while finalizing %s", tag, toString());
     FinskyLog.w(" file=%s, size=%d", this.mFileName, Long.valueOf(this.mSize));
     File destinationDir = ObbFactory.getParentDirectory(this.mPackageName);
     FinskyLog.w(" Contents of %s:", destinationDir.getAbsolutePath());
     if (!destinationDir.exists()) {
       FinskyLog.w(" (Does not exist)", new Object[0]);
     } else if (destinationDir.isDirectory()) {
       File[] files = destinationDir.listFiles();
       if (files == null) {
         FinskyLog.w(" (listFiles() returned null)", new Object[0]);
         return;
       }
       for (File existingFile : files) {
         FinskyLog.w(
             "  name=%s size=%d", existingFile.getName(), Long.valueOf(existingFile.length()));
       }
     } else {
       FinskyLog.w(" (Is not a directory)", new Object[0]);
     }
   } catch (Exception e) {
     FinskyLog.wtf(e, "Unexpected exception", new Object[0]);
   }
 }
示例#2
0
 private void startNextDownload()
 {
   if (this.mRunningMap.size() >= this.mMaxConcurrent) {
     return;
   }
   long l = 0L;
   Iterator localIterator = this.mPendingQueue.keySet().iterator();
   while (localIterator.hasNext())
   {
     String str = (String)localIterator.next();
     l = Math.max(((Download)this.mPendingQueue.get(str)).getMaximumSize(), l);
   }
   Context localContext = this.mContext;
   PackageManagerHelper.2 local2 = new PackageManagerHelper.2(new PurgeCacheCallback((byte)0));
   try
   {
     Class[] arrayOfClass = new Class[2];
     arrayOfClass[0] = Long.TYPE;
     arrayOfClass[1] = IPackageDataObserver.class;
     Method localMethod = PackageManager.class.getMethod("freeStorageAndNotify", arrayOfClass);
     PackageManager localPackageManager = localContext.getPackageManager();
     Object[] arrayOfObject = new Object[2];
     arrayOfObject[0] = Long.valueOf(l);
     arrayOfObject[1] = local2;
     localMethod.invoke(localPackageManager, arrayOfObject);
     return;
   }
   catch (NoSuchMethodException localNoSuchMethodException)
   {
     FinskyLog.d("Cannot freeStorageAndNotify on this platform", new Object[0]);
     return;
   }
   catch (SecurityException localSecurityException)
   {
     FinskyLog.wtf(localSecurityException, "Cannot freeStorageAndNotify due to security exception", new Object[0]);
     return;
   }
   catch (IllegalAccessException localIllegalAccessException)
   {
     FinskyLog.wtf(localIllegalAccessException, "Cannot freeStorageAndNotify due to reflection access exception", new Object[0]);
     return;
   }
   catch (InvocationTargetException localInvocationTargetException)
   {
     FinskyLog.wtf(localInvocationTargetException, "Cannot freeStorageAndNotify due to reflection invocation exception", new Object[0]);
   }
 }
示例#3
0
 public final void add(Download paramDownload)
 {
   
   if (paramDownload.getState() != 0)
   {
     Object[] arrayOfObject2 = new Object[3];
     arrayOfObject2[0] = paramDownload;
     arrayOfObject2[1] = paramDownload.getUrl();
     arrayOfObject2[2] = Integer.valueOf(paramDownload.getState());
     FinskyLog.wtf("Added download %s (url=%s) while in state %d", arrayOfObject2);
   }
   String str = paramDownload.getUrl();
   Download localDownload;
   if (this.mRunningMap.containsKey(str)) {
     localDownload = (Download)this.mRunningMap.get(str);
   }
   for (;;)
   {
     if (localDownload != null)
     {
       Object[] arrayOfObject1 = new Object[4];
       arrayOfObject1[0] = paramDownload;
       arrayOfObject1[1] = paramDownload.getUrl();
       arrayOfObject1[2] = localDownload;
       arrayOfObject1[3] = localDownload.getUrl();
       FinskyLog.wtf("Added download %s (url=%s) while existing found %s (url=%s)", arrayOfObject1);
     }
     FinskyLog.d("Download %s added to DownloadQueue", new Object[] { paramDownload });
     this.mPendingQueue.put(paramDownload.getUrl(), paramDownload);
     if (this.mDownloadProgressManager == null) {
       this.mDownloadProgressManager = new DownloadProgressManager(this);
     }
     setDownloadState(paramDownload, 1);
     startNextDownload();
     return;
     if (this.mPendingQueue.containsKey(str)) {
       localDownload = (Download)this.mPendingQueue.get(str);
     } else {
       localDownload = null;
     }
   }
 }
 public void onClick(View paramView) {
   if (!readyForDisplay()) {
     FinskyLog.wtf("Module is not ready to handle click", new Object[0]);
     return;
   }
   this.mNavigationManager.goBrowse(
       ((Data) this.mModuleData).sectionMetadata.browseUrl,
       null,
       ((Data) this.mModuleData).dfeList.getBackendId(),
       this.mDfeToc,
       this);
 }
示例#5
0
 public void run()
 {
   Iterator localIterator = DownloadQueueImpl.this.mListeners.iterator();
   while (localIterator.hasNext())
   {
     DownloadQueueListener localDownloadQueueListener = (DownloadQueueListener)localIterator.next();
     try
     {
       updateListener(localDownloadQueueListener);
     }
     catch (Exception localException)
     {
       FinskyLog.wtf(localException, "Download listener threw an exception during " + this.mType, new Object[0]);
     }
   }
 }
示例#6
0
 public final void setDownloadState(Download paramDownload, int paramInt)
 {
   paramDownload.setState(paramInt);
   switch (paramInt)
   {
   default: 
     Object[] arrayOfObject = new Object[1];
     arrayOfObject[0] = Integer.valueOf(paramInt);
     FinskyLog.wtf("enum %d", arrayOfObject);
   case 0: 
   case 1: 
     return;
   case 2: 
     notifyListeners(4, paramDownload);
     return;
   case 4: 
     notifyListeners(3, paramDownload);
     return;
   case 5: 
     notifyListeners(5, paramDownload);
     return;
   }
   notifyListeners(1, paramDownload);
 }