Skip to content

Commit

Permalink
修复小米等机型杀进程导致无法发出请求的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BolexLiu committed May 1, 2018
1 parent f3a5fc6 commit a307883
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions AutoEx-Lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
package="com.bolex.autoEx">

<uses-permission android:name="android.permission.INTERNET" />
<application android:supportsRtl="true">
<service android:name=".HandleService" />
<application android:supportsRtl="true">
<service android:process=":AutoEx" android:name="com.bolex.autoEx.HandleService" />

</application>

Expand Down
2 changes: 1 addition & 1 deletion AutoEx-Lib/src/main/java/com/bolex/autoEx/AutoEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void uncaughtException(final Thread thread, final Throwable ex) {
String errorMsg = getErrorMsg(ex);
Intent intent = new Intent(mApp, HandleService.class);
intent.putExtra(ERROR_MSG,errorMsg);
intent.putExtra(ERROR_MSG,errorMsg);
intent.putExtra(MAX_SIZE,maxSize);
mApp.startService(intent);
mUEH.uncaughtException(thread, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Created by Bolex on 2018/5/2.
*/

class HandleService extends Service implements AutoExConstant {
public class HandleService extends Service implements AutoExConstant {

@Override
public IBinder onBind(Intent intent) {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/bolex/test/Application.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.bolex.test;

import android.content.Intent;

import com.bolex.autoEx.*;
import com.bolex.autoEx.BuildConfig;

Expand All @@ -10,7 +12,7 @@
public class Application extends android.app.Application {
@Override
public void onCreate() {
if (BuildConfig.DEBUG){AutoEx.apply(this);}
AutoEx.apply(this);
super.onCreate();
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/bolex/test/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protected void onCreate(Bundle savedInstanceState) {
// AutoEx.apply(getApplication()); 更加推荐把AutoEx放在Application中初始化
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LinearLayout mainView = (LinearLayout) findViewById(R.id.activity_main);
LinearLayout mainView = (LinearLayout) findViewById(R.id.activity_main);

}
}

0 comments on commit a307883

Please sign in to comment.