summaryrefslogtreecommitdiffstats
path: root/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java')
-rw-r--r--src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
index 94d71790..ac5b1d89 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
@@ -49,6 +49,7 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
startConfigService(context);
} else if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(action)) {
boolean airplaneModeOn = intent.getBooleanExtra("state", false);
+ if (DBG) log("airplaneModeOn: " + airplaneModeOn);
if (!airplaneModeOn) {
startConfigService(context);
}
@@ -62,7 +63,7 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
intent.setClass(context, CellBroadcastAlertService.class);
context.startService(intent);
} else {
- Log.e(TAG, "ignoring unprivileged action received " + action);
+ loge("ignoring unprivileged action received " + action);
}
} else if (Telephony.Sms.Intents.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION
.equals(action)) {
@@ -72,10 +73,10 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
if (programDataList != null) {
handleCdmaSmsCbProgramData(context, programDataList);
} else {
- Log.e(TAG, "SCPD intent received with no program_data_list");
+ loge("SCPD intent received with no program_data_list");
}
} else {
- Log.e(TAG, "ignoring unprivileged action received " + action);
+ loge("ignoring unprivileged action received " + action);
}
} else {
Log.w(TAG, "onReceive() unexpected action " + action);
@@ -113,7 +114,7 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
break;
default:
- Log.e(TAG, "Ignoring unknown SCPD operation " + programData.getOperation());
+ loge("Ignoring unknown SCPD operation " + programData.getOperation());
}
}
}
@@ -155,19 +156,15 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
* @param context the broadcast receiver context
*/
static void startConfigService(Context context) {
- if (phoneIsCdma()) {
- if (DBG) log("CDMA phone detected; doing nothing");
- } else {
- Intent serviceIntent = new Intent(CellBroadcastConfigService.ACTION_ENABLE_CHANNELS,
- null, context, CellBroadcastConfigService.class);
- context.startService(serviceIntent);
- }
+ Intent serviceIntent = new Intent(CellBroadcastConfigService.ACTION_ENABLE_CHANNELS,
+ null, context, CellBroadcastConfigService.class);
+ context.startService(serviceIntent);
}
/**
* @return true if the phone is a CDMA phone type
*/
- private static boolean phoneIsCdma() {
+ static boolean phoneIsCdma() {
boolean isCdma = false;
try {
ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
@@ -183,4 +180,8 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
private static void log(String msg) {
Log.d(TAG, msg);
}
+
+ private static void loge(String msg) {
+ Log.e(TAG, msg);
+ }
}