Loading res/values/cm_arrays.xml +2 −2 Original line number Diff line number Diff line Loading @@ -345,14 +345,14 @@ </string-array> <string-array name="entries_location_widget" translatable="false"> <!-- Off is always preset --> <item>@string/cm_location_mode_off</item> <item>@string/cm_location_mode_battery_saving</item> <item>@string/cm_location_mode_device_only</item> <item>@string/cm_location_mode_high_accuracy</item> </string-array> <string-array name="values_location_widget" translatable="false"> <!-- Off is always preset --> <item>0</item> <item>1</item> <item>2</item> <item>3</item> Loading res/values/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,8 @@ <string name="cm_sound_mode_sound">Sound</string> <string name="cm_sound_mode_soundVibrate">Sound & Vibrate</string> <string name="pref_location_mode_title">Location modes</string> <string name="pref_location_mode_summary">Uncheck all for default(old) 2&2 mode</string> <string name="cm_location_mode_off">Location off</string> <string name="cm_location_mode_battery_saving">Battery saving</string> <string name="cm_location_mode_device_only">Device only</string> <string name="cm_location_mode_high_accuracy">High accuracy</string> Loading res/xml/quick_settings_panel.xml +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ android:key="pref_location_mode" android:dialogTitle="@string/pref_location_mode_title" android:title="@string/pref_location_mode_title" android:summary="@string/pref_location_mode_summary" android:entries="@array/entries_location_widget" android:entryValues="@array/values_location_widget" /> Loading src/com/android/settings/quicksettings/QuickSettings.java +3 −3 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class QuickSettings extends SettingsPreferenceFragment implements String[] modes = getResources().getStringArray(R.array.values_location_widget); int count = modes.length; for (int i = 0; i < count; i++) { int mask = (int) Math.pow(2, i + 1); // Off is always preset int mask = (int) Math.pow(2, i); if ((currentLocatorMode & mask) == mask) { currentModes.add(modes[i]); } Loading Loading @@ -210,12 +210,12 @@ public class QuickSettings extends SettingsPreferenceFragment implements updateSummary(value, mRingMode, R.string.pref_ring_mode_summary); return true; } else if (preference == mLocationMode) { int currentLocatorMode = 1; // Off is always preset int currentLocatorMode = 0; String[] currentModes = ((Set<String>) newValue).toArray(new String[]{}); int count = currentModes.length; for (int i = 0; i < count; i++) { int index = mLocationMode.findIndexOfValue(currentModes[i]); currentLocatorMode |= (int) Math.pow(2, index + 1); // Off is always preset currentLocatorMode |= (int) Math.pow(2, index); } Settings.System.putIntForUser(resolver, Settings.System.EXPANDED_LOCATION_MODE, currentLocatorMode, UserHandle.USER_CURRENT); Loading Loading
res/values/cm_arrays.xml +2 −2 Original line number Diff line number Diff line Loading @@ -345,14 +345,14 @@ </string-array> <string-array name="entries_location_widget" translatable="false"> <!-- Off is always preset --> <item>@string/cm_location_mode_off</item> <item>@string/cm_location_mode_battery_saving</item> <item>@string/cm_location_mode_device_only</item> <item>@string/cm_location_mode_high_accuracy</item> </string-array> <string-array name="values_location_widget" translatable="false"> <!-- Off is always preset --> <item>0</item> <item>1</item> <item>2</item> <item>3</item> Loading
res/values/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,8 @@ <string name="cm_sound_mode_sound">Sound</string> <string name="cm_sound_mode_soundVibrate">Sound & Vibrate</string> <string name="pref_location_mode_title">Location modes</string> <string name="pref_location_mode_summary">Uncheck all for default(old) 2&2 mode</string> <string name="cm_location_mode_off">Location off</string> <string name="cm_location_mode_battery_saving">Battery saving</string> <string name="cm_location_mode_device_only">Device only</string> <string name="cm_location_mode_high_accuracy">High accuracy</string> Loading
res/xml/quick_settings_panel.xml +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ android:key="pref_location_mode" android:dialogTitle="@string/pref_location_mode_title" android:title="@string/pref_location_mode_title" android:summary="@string/pref_location_mode_summary" android:entries="@array/entries_location_widget" android:entryValues="@array/values_location_widget" /> Loading
src/com/android/settings/quicksettings/QuickSettings.java +3 −3 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class QuickSettings extends SettingsPreferenceFragment implements String[] modes = getResources().getStringArray(R.array.values_location_widget); int count = modes.length; for (int i = 0; i < count; i++) { int mask = (int) Math.pow(2, i + 1); // Off is always preset int mask = (int) Math.pow(2, i); if ((currentLocatorMode & mask) == mask) { currentModes.add(modes[i]); } Loading Loading @@ -210,12 +210,12 @@ public class QuickSettings extends SettingsPreferenceFragment implements updateSummary(value, mRingMode, R.string.pref_ring_mode_summary); return true; } else if (preference == mLocationMode) { int currentLocatorMode = 1; // Off is always preset int currentLocatorMode = 0; String[] currentModes = ((Set<String>) newValue).toArray(new String[]{}); int count = currentModes.length; for (int i = 0; i < count; i++) { int index = mLocationMode.findIndexOfValue(currentModes[i]); currentLocatorMode |= (int) Math.pow(2, index + 1); // Off is always preset currentLocatorMode |= (int) Math.pow(2, index); } Settings.System.putIntForUser(resolver, Settings.System.EXPANDED_LOCATION_MODE, currentLocatorMode, UserHandle.USER_CURRENT); Loading