コード例 #1
0
 @Override
 public void onLoadPatchListenerReceiveFail(
     final File patchFile, int errorCode, final boolean isUpgrade) {
   super.onLoadPatchListenerReceiveFail(patchFile, errorCode, isUpgrade);
   switch (errorCode) {
     case ShareConstants.ERROR_PATCH_NOTEXIST:
       Toast.makeText(context, "patch file is not exist", Toast.LENGTH_LONG).show();
       break;
     case ShareConstants.ERROR_PATCH_RUNNING:
       // try later
       // only retry for upgrade patch
       if (isUpgrade) {
         handler.postDelayed(
             new Runnable() {
               @Override
               public void run() {
                 TinkerInstaller.onReceiveUpgradePatch(context, patchFile.getAbsolutePath());
               }
             },
             60 * 1000);
       }
       break;
     case Utils.ERROR_PATCH_ROM_SPACE:
       Toast.makeText(context, "rom space is not enough", Toast.LENGTH_LONG).show();
       break;
   }
   SampleTinkerReport.onTryApplyFail(errorCode);
 }
コード例 #2
0
 @Override
 public void onLoadResult(File patchDirectory, int loadCode, long cost) {
   super.onLoadResult(patchDirectory, loadCode, cost);
   switch (loadCode) {
     case ShareConstants.ERROR_LOAD_OK:
       SampleTinkerReport.onLoaded(cost);
       break;
   }
   Looper.getMainLooper()
       .myQueue()
       .addIdleHandler(
           new MessageQueue.IdleHandler() {
             @Override
             public boolean queueIdle() {
               UpgradePatchRetry.getInstance(context).onPatchRetryLoad();
               return false;
             }
           });
 }
コード例 #3
0
 @Override
 public void onLoadFileMd5Mismatch(File file, int fileType) {
   super.onLoadFileMd5Mismatch(file, fileType);
   SampleTinkerReport.onLoadFileMisMatch(fileType);
 }
コード例 #4
0
 @Override
 public void onLoadException(Throwable e, int errorCode) {
   super.onLoadException(e, errorCode);
   SampleTinkerReport.onLoadException(e, errorCode);
 }
コード例 #5
0
 @Override
 public void onLoadPatchInfoCorrupted(String oldVersion, String newVersion, File patchInfoFile) {
   super.onLoadPatchInfoCorrupted(oldVersion, newVersion, patchInfoFile);
   SampleTinkerReport.onLoadInfoCorrupted();
 }
コード例 #6
0
 @Override
 public void onLoadPackageCheckFail(File patchFile, int errorCode) {
   super.onLoadPackageCheckFail(patchFile, errorCode);
   SampleTinkerReport.onLoadPackageCheckFail(errorCode);
 }
コード例 #7
0
 @Override
 public void onLoadFileNotFound(File file, int fileType, boolean isDirectory) {
   super.onLoadFileNotFound(file, fileType, isDirectory);
   SampleTinkerReport.onLoadFileNotFound(fileType);
 }