|
@@ -71,10 +71,8 @@ public class XCrashUtils {
|
|
|
if (!BuildConfig.DEBUG) {
|
|
|
uploadCrashLog(logPath);
|
|
|
} else {
|
|
|
- AppUtils.relaunchApp(true);
|
|
|
+ AppUpdateHelper.restartApp(app);
|
|
|
}
|
|
|
-
|
|
|
- //restartApp();
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -84,7 +82,7 @@ public class XCrashUtils {
|
|
|
public void onCrash(String logPath, String emergency) {
|
|
|
Log.d(TAG, "log path: " + (logPath != null ? logPath : "(null)") + ", emergency: " + (emergency != null ? emergency : "(null)"));
|
|
|
|
|
|
- if (emergency != null) {
|
|
|
+ /*if (emergency != null) {
|
|
|
debug(logPath, emergency);
|
|
|
|
|
|
// Disk is exhausted, send crash report immediately.
|
|
@@ -100,12 +98,12 @@ public class XCrashUtils {
|
|
|
// TombstoneManager.appendSection(logPath, "expanded_key_3", "expanded_content_row_1\n\nexpanded_content_row_2");
|
|
|
|
|
|
debug(logPath, null);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// Disk is exhausted, send crash report immediately.
|
|
|
//sendThenDeleteCrashLog(logPath, emergency);
|
|
|
|
|
|
- AppUtils.relaunchApp(true);
|
|
|
+ AppUpdateHelper.restartApp(app);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -144,7 +142,7 @@ public class XCrashUtils {
|
|
|
@Override
|
|
|
public void onFail() {
|
|
|
Log.e(TAG,"错误日志文件上传失败!");
|
|
|
- AppUtils.relaunchApp(true);
|
|
|
+ AppUpdateHelper.restartApp(app);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -185,7 +183,7 @@ public class XCrashUtils {
|
|
|
@Override
|
|
|
public void onFailure(Call call, IOException e) {
|
|
|
Log.e(TAG,"错误日志名称上传失败"+e.getMessage());
|
|
|
- AppUtils.relaunchApp(true);
|
|
|
+ AppUpdateHelper.restartApp(app);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -194,7 +192,7 @@ public class XCrashUtils {
|
|
|
TombstoneManager.deleteTombstone(logPath);
|
|
|
//String data = response.body().string();
|
|
|
//Log.d(TAG,"错误日志数据 data "+data);
|
|
|
- AppUtils.relaunchApp(true);
|
|
|
+ AppUpdateHelper.restartApp(app);
|
|
|
}
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
@@ -232,24 +230,4 @@ public class XCrashUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void restartApp() {
|
|
|
- Constants.Companion.setCALL_STATE(Constants.Companion.getCALL_STANDBY());
|
|
|
- DeviceChannel.calling = false;
|
|
|
- CallSession session= SkyEngineKit.Instance().getCurrentSession();
|
|
|
- if(session!=null&&session.getState()!= EnumType.CallState.Idle){
|
|
|
- SkyEngineKit.Instance().endCall();
|
|
|
- }
|
|
|
-
|
|
|
- //重新启动app
|
|
|
- Intent mStartActivity = new Intent(app.getApplicationContext(), RegisterActivity.class);
|
|
|
- mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
- int mPendingIntentId = 123456;
|
|
|
- PendingIntent mPendingIntent = PendingIntent.getActivity(app.getApplicationContext(), mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
|
|
|
- AlarmManager mgr = (AlarmManager) app.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
|
|
|
- mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 2000, mPendingIntent);
|
|
|
-
|
|
|
- android.os.Process.killProcess(android.os.Process.myPid());
|
|
|
- System.exit(0);
|
|
|
- }
|
|
|
-
|
|
|
}
|