ns client quickfix now catch all

This commit is contained in:
AdrianLxM 2017-07-16 16:49:26 +02:00
parent c64c5f5401
commit 0d1ff3d721
12 changed files with 76 additions and 9 deletions

View file

@ -29,9 +29,13 @@ public class BroadcastAckAlarm {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("ACKALARM " + x.size() + " receivers"); log.debug("ACKALARM " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -26,8 +26,13 @@ public class BroadcastAlarm {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try{
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("ALARM " + x.size() + " receivers"); log.debug("ALARM " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -27,8 +27,12 @@ public class BroadcastAnnouncement {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("ANNOUNCEMENT " + x.size() + " receivers"); log.debug("ANNOUNCEMENT " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -27,8 +27,12 @@ public class BroadcastCals {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("CAL " + x.size() + " receivers"); log.debug("CAL " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -26,8 +26,12 @@ public class BroadcastClearAlarm {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("CLEARALARM " + x.size() + " receivers"); log.debug("CLEARALARM " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -26,9 +26,13 @@ public class BroadcastDeviceStatus {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("DEVICESTATUS " + x.size() + " receivers"); log.debug("DEVICESTATUS " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
public static void handleNewDeviceStatus(JSONArray statuses, Context context, boolean isDelta) { public static void handleNewDeviceStatus(JSONArray statuses, Context context, boolean isDelta) {
List<JSONArray> splitted = BroadcastTreatment.splitArray(statuses); List<JSONArray> splitted = BroadcastTreatment.splitArray(statuses);
@ -40,9 +44,13 @@ public class BroadcastDeviceStatus {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("DEVICESTATUS " + part.length() + " records " + x.size() + " receivers"); log.debug("DEVICESTATUS " + part.length() + " records " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }
} }

View file

@ -27,8 +27,12 @@ public class BroadcastMbgs {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("MBG " + x.size() + " receivers"); log.debug("MBG " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -28,9 +28,13 @@ public class BroadcastProfile {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("PROFILE " + x.size() + " receivers"); log.debug("PROFILE " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -28,9 +28,13 @@ public class BroadcastSgvs {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("SGV " + x.size() + " receivers"); log.debug("SGV " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
public static void handleNewSgv(JSONArray sgvs, Context context, boolean isDelta) { public static void handleNewSgv(JSONArray sgvs, Context context, boolean isDelta) {
@ -41,9 +45,13 @@ public class BroadcastSgvs {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("SGV " + x.size() + " receivers"); log.debug("SGV " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -38,8 +38,12 @@ public class BroadcastStatus {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("STATUS: " + x.size() + " receivers"); log.debug("STATUS: " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }

View file

@ -32,9 +32,13 @@ public class BroadcastTreatment {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("TREAT_ADD " + treatment.getEventType() + " " + x.size() + " receivers"); log.debug("TREAT_ADD " + treatment.getEventType() + " " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
public static void handleNewTreatment(JSONArray treatments, Context context, boolean isDelta) { public static void handleNewTreatment(JSONArray treatments, Context context, boolean isDelta) {
@ -50,8 +54,8 @@ public class BroadcastTreatment {
try { try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("TREAT_ADD " + part.length() + " " + x.size() + " receivers"); log.debug("TREAT_ADD " + part.length() + " " + x.size() + " receivers");
} catch (Throwable exception){ } catch (Exception e){
log.debug("TREAT_ADD " + part.length() + " ERROR: no receiver size, CAUSE: " + exception.getMessage()); //for testing
} }
} }
@ -65,11 +69,11 @@ public class BroadcastTreatment {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
try {
log.debug("TREAT_CHANGE " + treatment.getString("_id") + " " + x.size() + " receivers"); log.debug("TREAT_CHANGE " + treatment.getString("_id") + " " + x.size() + " receivers");
} catch (JSONException e) { } catch (Exception e) {
} }
} }
@ -83,9 +87,13 @@ public class BroadcastTreatment {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("TREAT_CHANGE " + part.length() + " " + x.size() + " receivers"); log.debug("TREAT_CHANGE " + part.length() + " " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }
@ -97,11 +105,13 @@ public class BroadcastTreatment {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
try {
log.debug("TREAT_REMOVE " + treatment.getString("_id") + " " + x.size() + " receivers"); log.debug("TREAT_REMOVE " + treatment.getString("_id") + " " + x.size() + " receivers");
} catch (JSONException e) { } catch (Exception e){
//for testing
} }
} }
@ -113,9 +123,13 @@ public class BroadcastTreatment {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("TREAT_REMOVE " + treatments.length() + " treatments " + x.size() + " receivers"); log.debug("TREAT_REMOVE " + treatments.length() + " treatments " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }

View file

@ -26,8 +26,12 @@ public class BroadcastUrgentAlarm {
intent.putExtras(bundle); intent.putExtras(bundle);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
context.sendBroadcast(intent); context.sendBroadcast(intent);
try {
List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0); List<ResolveInfo> x = context.getPackageManager().queryBroadcastReceivers(intent, 0);
log.debug("URGENTALARM " + x.size() + " receivers"); log.debug("URGENTALARM " + x.size() + " receivers");
} catch (Exception e){
//for testing
}
} }
} }