MTK屏蔽谷歌服务报错对话框KK
frameworks/base/services/java/com/android/server/am/ActivityManagerService.java
@@ -1211,8 +1211,17 @@ public final class ActivityManagerService extends ActivityManagerNative
if (mShowDialogs && !mSleeping && !mShuttingDown) {
Dialog d = new AppErrorDialog(mContext,
ActivityManagerService.this, res, proc);
+ if(d != null){
+ if(proc != null && (proc.info.packageName.equals("com.google.android.gms"))){
+ d = null;
+ }
+ }
+ if(d != null){ // modify by sqx s
d.show();
proc.crashDialog = d;
+ } // modify by sqx s
} else {
// The device is asleep, so just pretend that the user
// saw a crash dialog and hit "force quit".
@@ -1246,8 +1255,17 @@ public final class ActivityManagerService extends ActivityManagerNative
Dialog d = new AppNotRespondingDialog(ActivityManagerService.this,
mContext, proc, (ActivityRecord)data.get("activity"),
msg.arg1 != 0);
+ if(d != null){
+ if(proc != null && (proc.info.packageName.equals("com.google.android.gms"))){
+ d = null;
+ }
+ }
+ if(null != d) { // modify by sqx s
d.show();
proc.anrDialog = d;
+ }
} else {
// Just kill the app if there is no dialog to be shown.
killAppAtUsersRequest(proc, null);
@@ -14315,11 +14333,11 @@ public final class ActivityManagerService extends ActivityManagerNative
intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
/// M: ALPS00601880, Fix Settings and RemoteView ANR, Avoid send broadcast to FG queue. @{
- if (intent.getCategories() != null) {
+ /*if (intent.getCategories() != null) {
if (intent.getCategories().contains("android.intent.category.ALTERNATIVE")) {
intent.setFlags(intent.getFlags()&~(Intent.FLAG_RECEIVER_FOREGROUND));
}
- }
+ }*/
/// @}
if (FeatureOption.MTK_LCA_RAM_OPTIMIZE) {