Commit cd63d6ca by pye52

不再检查更新包是否存在,直接进入安装步骤

parent 5e9d3cd1
package com.bgycc.smartcanteen.daemon; package com.bgycc.smartcanteen.daemon;
import android.app.Service; import android.app.Service;
import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
import android.os.IBinder; import android.os.IBinder;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -32,17 +31,6 @@ public class DaemonService extends Service { ...@@ -32,17 +31,6 @@ public class DaemonService extends Service {
path = PathUtils.getExternalStoragePath() + File.separator + UPDATE_APK; path = PathUtils.getExternalStoragePath() + File.separator + UPDATE_APK;
LogUtils.d(TAG, "安装apk地址为空,使用默认地址: " + path); LogUtils.d(TAG, "安装apk地址为空,使用默认地址: " + path);
} }
// 当找不到安装apk时,直接启动主应用
if (!FileUtils.isFileExists(path)) {
LogUtils.w(TAG, "安装失败, 找不到apk,重新启动主应用");
ComponentName componentName = new ComponentName(MAIN_PACKAGE_NAME, MAIN_ACTIVITY_NAME);
Intent startMainActivity = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(componentName);
startActivity(startMainActivity);
stopSelf(START_NOT_STICKY);
return START_NOT_STICKY ;
}
String component = intent.getStringExtra(ARG_COMPONENT); String component = intent.getStringExtra(ARG_COMPONENT);
if (TextUtils.isEmpty(component)) { if (TextUtils.isEmpty(component)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment