| 1 | package net.mandaria.tippytipper.EmmaInstrument; |
| 2 | |
| 3 | |
| 4 | import android.content.BroadcastReceiver; |
| 5 | import android.content.Context; |
| 6 | import android.content.Intent; |
| 7 | import android.content.IntentFilter; |
| 8 | import android.os.Bundle; |
| 9 | import android.telephony.SmsMessage; |
| 10 | import android.util.Log; |
| 11 | public class SMSInstrumentedReceiver extends BroadcastReceiver { |
| 12 | public static String TAG = "M3SMSInstrumentedReceiver"; |
| 13 | |
| 14 | @Override |
| 15 | public void onReceive(Context context, Intent intent) { |
| 16 | // TODO Auto-generated method stub |
| 17 | Bundle extras = intent.getExtras(); |
| 18 | FinishListener mListener = new EmmaInstrumentation(); |
| 19 | if (mListener != null) { |
| 20 | mListener.dumpIntermediateCoverage("/mnt/sdcard/coverage.ec"); |
| 21 | /*if (extras != null) { |
| 22 | Object[] smsExtra = (Object[]) extras.get("pdus"); |
| 23 | if (smsExtra.length > 0) { |
| 24 | SmsMessage sms = SmsMessage |
| 25 | .createFromPdu((byte[]) smsExtra[0]); |
| 26 | String body = sms.getMessageBody().toString(); |
| 27 | |
| 28 | // If in case in future if we want to add a check based |
| 29 | // on some address |
| 30 | String address = sms.getOriginatingAddress(); |
| 31 | if(address.contains("6782345628") || body.startsWith("/mnt/sdcard")) { |
| 32 | Log.d(TAG, "Trying to dump the coverage meta data to:"+body); |
| 33 | mListener.dumpIntermediateCoverage(body); |
| 34 | } |
| 35 | } |
| 36 | }*/ |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | } |