From c132b6d924caba5557b5f26c34f609c60dc966d0 Mon Sep 17 00:00:00 2001 From: Luke Miller Date: Thu, 2 Dec 2010 09:52:20 +0000 Subject: Disabled the notification SMSes. --- .../BlaMail/src/com/blatech/blamail/BlaMail.java | 35 ++++++++-------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'workspace/BlaMail/src/com/blatech') diff --git a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java index 1fe08ca..78a947b 100644 --- a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java +++ b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java @@ -80,32 +80,21 @@ public class BlaMail extends Activity { Boolean serviceDisconnected = true; @Override public void onServiceStateChanged(ServiceState serviceState){ - try { + //try { if(serviceState.getState() == 0 && serviceDisconnected == true){ - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: The phone is registered with an operator."); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: The phone is registered with an operator."); serviceDisconnected = false; } else { serviceDisconnected = true; } - /*switch(serviceState.getState()){ - case 0: //serviceState.STATE_IN_SERVICE - if (serviceDisconnected == true) { - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: The phone is registered with an operator."); - } - serviceDisconnected = false; - break; - case 1: //serviceState.STATE_OUT_OF_SERVICE - serviceDisconnected = true; - break; - }*/ - } catch (AddressException e) { + /*} catch (AddressException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + }*/ } }; @@ -115,7 +104,7 @@ public class BlaMail extends Activity { public void onDataConnectionStateChanged(int state){ Thread t = null; //Thread s = null; - try { + //try { switch (state) { case TelephonyManager.DATA_CONNECTED: if(dataDisconnected == true){ @@ -123,14 +112,14 @@ public class BlaMail extends Activity { if(t != null){ t.destroy(); //not good practice. TODO: fix this! } - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Connected. IP traffic should be available."); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Connected. IP traffic should be available."); t = new Thread(new Monitor()); t.start(); } break; case TelephonyManager.DATA_DISCONNECTED: dataDisconnected = true; - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Disconnected. IP traffic not available."); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Disconnected. IP traffic not available."); if(t != null){ t.destroy(); //not good practice. TODO: fix this! //t.interrupt(); @@ -141,7 +130,7 @@ public class BlaMail extends Activity { case TelephonyManager.DATA_ACTIVITY_DORMANT: if(t != null){ dataDisconnected = true; - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Data connection is active, but physical link is down"); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Data connection is active, but physical link is down"); t.destroy(); //not good practice. TODO: fix this! //t.interrupt(); //s = new Thread(new StopIdle()); @@ -151,7 +140,7 @@ public class BlaMail extends Activity { case TelephonyManager.DATA_SUSPENDED: if(t != null){ dataDisconnected = true; - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Suspended. The connection is up, but IP traffic is temporarily unavailable. For example, in a 2G network, data activity may be suspended when a voice call arrives."); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Suspended. The connection is up, but IP traffic is temporarily unavailable. For example, in a 2G network, data activity may be suspended when a voice call arrives."); t.destroy(); //not good practice. TODO: fix this! //t.interrupt(); //s = new Thread(new StopIdle()); @@ -161,18 +150,18 @@ public class BlaMail extends Activity { default: if(t != null){ dataDisconnected = true; - sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Current state is \"" + state + "\""); + //sendSMS("0000000000000000000", "07927278978", "!blamail Notification from blamail: Current state is \"" + state + "\""); t.destroy(); //not good practice. TODO: fix this! } break; } - } catch (AddressException e) { + /*} catch (AddressException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + }*/ } }; -- cgit v1.2.3