Allow channel count modification on userdebug
Bug: 2378844 Change-Id: I62bca602c3fe1fefdc4a4517573b2c3db9d53a1f
This commit is contained in:
@@ -34,6 +34,7 @@ import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
public class AdvancedSettings extends PreferenceActivity
|
||||
implements Preference.OnPreferenceChangeListener {
|
||||
@@ -57,6 +58,9 @@ public class AdvancedSettings extends PreferenceActivity
|
||||
private static final int MENU_ITEM_SAVE = Menu.FIRST;
|
||||
private static final int MENU_ITEM_CANCEL = Menu.FIRST + 1;
|
||||
|
||||
//Tracks ro.debuggable (1 on userdebug builds)
|
||||
private static int DEBUGGABLE;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -71,21 +75,26 @@ public class AdvancedSettings extends PreferenceActivity
|
||||
preference.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
// /*
|
||||
// * Fix the Run-time IllegalStateException that ListPreference requires an entries
|
||||
// * array and an entryValues array, this exception occurs when user open/close the
|
||||
// * slider in the Regulatory domain dialog.
|
||||
// */
|
||||
// initNumChannelsPreference();
|
||||
DEBUGGABLE = SystemProperties.getInt("ro.debuggable", 0);
|
||||
|
||||
/**
|
||||
* Remove user control of regulatory domain
|
||||
* channel count settings
|
||||
* channel count settings in non userdebug builds
|
||||
*/
|
||||
if (DEBUGGABLE == 1) {
|
||||
/*
|
||||
* Fix the Run-time IllegalStateException that ListPreference requires an entries
|
||||
* array and an entryValues array, this exception occurs when user open/close the
|
||||
* slider in the Regulatory domain dialog.
|
||||
*/
|
||||
initNumChannelsPreference();
|
||||
} else {
|
||||
Preference chanPref = findPreference(KEY_NUM_CHANNELS);
|
||||
if (chanPref != null) {
|
||||
getPreferenceScreen().removePreference(chanPref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
@@ -94,9 +103,11 @@ public class AdvancedSettings extends PreferenceActivity
|
||||
updateUi();
|
||||
/**
|
||||
* Remove user control of regulatory domain
|
||||
* channel count settings
|
||||
* channel count settings in non userdebug builds
|
||||
*/
|
||||
//initNumChannelsPreference();
|
||||
if (DEBUGGABLE == 1) {
|
||||
initNumChannelsPreference();
|
||||
}
|
||||
initSleepPolicyPreference();
|
||||
refreshMacAddress();
|
||||
}
|
||||
|
Reference in New Issue
Block a user