Use Build.IS_DEBUGGABLE
Change-Id: I8d4a2e83b8cdcf86cafb622013868f117d0701ef
diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java
index d0364da..40e1db8 100644
--- a/src/java/com/android/internal/telephony/PhoneBase.java
+++ b/src/java/com/android/internal/telephony/PhoneBase.java
@@ -22,6 +22,7 @@
import android.net.LinkProperties;
import android.net.wifi.WifiManager;
import android.os.AsyncResult;
+import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -65,7 +66,6 @@
public abstract class PhoneBase extends Handler implements Phone {
private static final String LOG_TAG = "PhoneBase";
- protected static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
// Key used to read and write the saved network selection numeric value
public static final String NETWORK_SELECTION_KEY = "network_selection_key";
@@ -255,7 +255,7 @@
mActionDetached = this.getClass().getPackage().getName() + ".action_detached";
mActionAttached = this.getClass().getPackage().getName() + ".action_attached";
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
mTelephonyTester = new TelephonyTester(this);
}
diff --git a/src/java/com/android/internal/telephony/TelephonyTester.java b/src/java/com/android/internal/telephony/TelephonyTester.java
index eafd248..386866d 100644
--- a/src/java/com/android/internal/telephony/TelephonyTester.java
+++ b/src/java/com/android/internal/telephony/TelephonyTester.java
@@ -20,8 +20,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.os.Handler;
-import android.os.SystemProperties;
+import android.os.Build;
import android.telephony.Rlog;
import com.android.internal.telephony.PhoneBase;
@@ -35,7 +34,6 @@
public class TelephonyTester {
private static final String LOG_TAG = "TelephonyTester";
private static final boolean DBG = true;
- private static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
private PhoneBase mPhone;
@@ -61,7 +59,7 @@
TelephonyTester(PhoneBase phone) {
mPhone = phone;
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
IntentFilter filter = new IntentFilter();
filter.addAction(mPhone.getActionDetached());
diff --git a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
index 4ac0220..4e6ac01 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
@@ -34,6 +34,7 @@
import android.net.LinkProperties;
import android.net.ProxyProperties;
import android.os.AsyncResult;
+import android.os.Build;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
@@ -70,7 +71,6 @@
public final class DataConnection extends StateMachine {
private static final boolean DBG = true;
private static final boolean VDBG = true;
- private static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
/** Retry configuration: A doubling of retry times from 5secs to 30minutes */
private static final String DEFAULT_DATA_RETRY_CONFIG = "default_randomization=2000,"
@@ -329,7 +329,7 @@
private String getRetryConfig(boolean forDefault) {
int nt = mPhone.getServiceState().getNetworkType();
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
String config = SystemProperties.get("test.data_retry_config");
if (! TextUtils.isEmpty(config)) {
return config;
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcController.java b/src/java/com/android/internal/telephony/dataconnection/DcController.java
index cbb9edc..605135d 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcController.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcController.java
@@ -20,9 +20,9 @@
import android.net.NetworkUtils;
import android.net.LinkProperties.CompareResult;
import android.os.AsyncResult;
+import android.os.Build;
import android.os.Handler;
import android.os.Message;
-import android.os.SystemProperties;
import android.telephony.Rlog;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.PhoneConstants;
@@ -43,7 +43,6 @@
class DcController extends StateMachine {
private static final boolean DBG = true;
private static final boolean VDBG = false;
- protected static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
private PhoneBase mPhone;
private DcTrackerBase mDct;
@@ -127,7 +126,7 @@
DataConnection.EVENT_RIL_CONNECTED, null);
mPhone.mCi.registerForDataNetworkStateChanged(getHandler(),
DataConnection.EVENT_DATA_STATE_CHANGED, null);
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
mDcTesterDeactivateAll =
new DcTesterDeactivateAll(mPhone, DcController.this, getHandler());
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java b/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
index be5d300..78a641d 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
@@ -23,7 +23,6 @@
import android.content.IntentFilter;
import android.os.AsyncResult;
import android.os.SystemClock;
-import android.os.SystemProperties;
import android.telephony.Rlog;
import android.text.TextUtils;
@@ -36,7 +35,6 @@
public class DcRetryAlarmController {
private String mLogTag = "DcRac";
private static final boolean DBG = true;
- protected static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
private PhoneBase mPhone;
private DataConnection mDc;
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java b/src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java
index 87f9d93..f61644c 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTesterDeactivateAll.java
@@ -20,8 +20,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.os.Build;
import android.os.Handler;
-import android.os.SystemProperties;
import android.telephony.Rlog;
import com.android.internal.telephony.PhoneBase;
@@ -34,7 +34,6 @@
public class DcTesterDeactivateAll {
private static final String LOG_TAG = "DcTesterDeacativeAll";
private static final boolean DBG = true;
- private static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
private PhoneBase mPhone;
private DcController mDcc;
@@ -70,7 +69,7 @@
mPhone = phone;
mDcc = dcc;
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
IntentFilter filter = new IntentFilter();
filter.addAction(sActionDcTesterDeactivateAll);
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTesterFailBringUpAll.java b/src/java/com/android/internal/telephony/dataconnection/DcTesterFailBringUpAll.java
index 0c86e1c..63c68d6 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTesterFailBringUpAll.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTesterFailBringUpAll.java
@@ -20,8 +20,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.os.Build;
import android.os.Handler;
-import android.os.SystemProperties;
import android.telephony.Rlog;
import com.android.internal.telephony.PhoneBase;
@@ -35,19 +35,11 @@
* Also you can add a suggested retry time if desired:
* --ei suggested_retry_time 5000
*
- * There is also a per DC command implemented in {@link DcRetryAlarmController#mFailBringUp} the intent is
- * the same as above except the action has a "DC-x" before the action_fail_bringup so for
- * DC-1 the action action is:
- * adb shell am broadcast \
- * -a com.android.internal.telephony.dataconnection.DC-1.action_fail_bringup \
- * --ei counter 2 --ei fail_cause -3
- *
* The fail_cause is one of {@link DcFailCause}
*/
public class DcTesterFailBringUpAll {
private static final String LOG_TAG = "DcTesterFailBrinupAll";
private static final boolean DBG = true;
- private static final boolean DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0) == 1;
private PhoneBase mPhone;
@@ -84,7 +76,7 @@
DcTesterFailBringUpAll(PhoneBase phone, Handler handler) {
mPhone = phone;
- if (DEBUGGABLE) {
+ if (Build.IS_DEBUGGABLE) {
IntentFilter filter = new IntentFilter();
filter.addAction(mActionFailBringUp);