Merge "Allow channel count modification on userdebug"

This commit is contained in:
Irfan Sheriff
2010-01-28 20:45:57 -08:00
committed by Android (Google) Code Review

View File

@@ -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,19 +75,24 @@ 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
*/
Preference chanPref = findPreference(KEY_NUM_CHANNELS);
if (chanPref != null) {
getPreferenceScreen().removePreference(chanPref);
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);
}
}
}
@@ -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();
}