Skip to content

Commit

Permalink
Settings part: Add Sprint Tools (CDMATools) into settings. (Part 1 of 3)
Browse files Browse the repository at this point in the history
  -devices can set this in overlay. (Not for all CDMA devices)

For more information see this thread:  http://forum.xda-developers.com/showthread.php?t=1774503

Patchset 2: get rid of TABS
Patchset 3: attempting to make it look clean
Patchset 4: last attempt tonight to clean it...
Patchset 5: rename

Change-Id: I121f61cd16d4064a1ded85428ac4857c653e6582
  • Loading branch information
qnhoang81 authored and Gerrit Code Review committed Feb 23, 2013
1 parent 5d41445 commit 8b77563
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
Binary file added res/drawable-hdpi/ic_sprint_tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_sprint_tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_sprint_tools.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions res/values/bools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@

<!-- Whether to show a preference item for regulatory information in About phone -->
<bool name="config_show_regulatory_info">false</bool>

<!-- Add option to add CDMA tools -->
<bool name="is_sprint_device">false</bool>
</resources>
3 changes: 3 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4487,4 +4487,7 @@

<!-- Hostname setting -->
<string name="device_hostname">Device hostname</string>

<!-- Sprint Tools -->
<string name="sprint_tools_title">Sprint Tools</string>
</resources>
9 changes: 9 additions & 0 deletions res/xml/settings_headers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@
android:targetClass="com.cyanogenmod.settings.device.DeviceSettings" />
</header>

<header android:id="@+id/sprint_tools"
android:title="@string/sprint_tools_title"
android:icon="@drawable/ic_sprint_tools">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="org.teameos.settings.device"
android:targetClass="org.teameos.settings.device.DeviceSettings" />
</header>

<!-- DEVICE -->
<header android:id="@+id/device_section"
android:title="@string/header_category_device" />
Expand Down
12 changes: 10 additions & 2 deletions src/com/android/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ public class Settings extends PreferenceActivity
R.id.rom_control,
R.id.themes,
R.id.performance,
R.id.advanced_settings
R.id.advanced_settings,
R.id.sprint_tools
};

private SharedPreferences mDevelopmentPreferences;
Expand Down Expand Up @@ -436,7 +437,10 @@ private void updateHeaderList(List<Header> target) {
} else if (id == R.id.advanced_settings) {
if (!needsAdvancedSettings())
target.remove(header);
} else if (id == R.id.wifi_settings) {
} else if (id == R.id.sprint_tools) {
if (!isSprintDevice())
target.remove(header);
} else if (id == R.id.wifi_settings) {
// Remove WiFi Settings if WiFi service is not available.
if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
target.remove(i);
Expand Down Expand Up @@ -556,6 +560,10 @@ private boolean needsAdvancedSettings() {
return getResources().getBoolean(R.bool.has_advanced_settings);
}

private boolean isSprintDevice() {
return getResources().getBoolean(R.bool.is_sprint_device);
}

private void getMetaData() {
try {
ActivityInfo ai = getPackageManager().getActivityInfo(getComponentName(),
Expand Down

0 comments on commit 8b77563

Please sign in to comment.