예제 #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);
 }