summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.org>2013-03-28 20:54:05 +0000
committercodeworkx <codeworkx@cyanogenmod.org>2013-03-28 20:54:05 +0000
commit80fad11cdc879a3aaa8894b8225f7bea63bdb583 (patch)
tree4cdd96de0f46937c23266ca69b3e019b2b546e6d
parenta99f64e2534b621e7d023cca87b84d851daa061d (diff)
downloaddevice_samsung_i9305-80fad11cdc879a3aaa8894b8225f7bea63bdb583.zip
device_samsung_i9305-80fad11cdc879a3aaa8894b8225f7bea63bdb583.tar.gz
device_samsung_i9305-80fad11cdc879a3aaa8894b8225f7bea63bdb583.tar.bz2
i9305: fix dock audio, config cleanup
Change-Id: I03aee53eddfbaa7978c47321e306f490e5d56f33
-rw-r--r--DeviceSettings/res/values-de/strings.xml5
-rw-r--r--DeviceSettings/res/values/strings.xml5
-rw-r--r--DeviceSettings/res/xml/dock_preferences.xml26
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java3
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java75
-rw-r--r--DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java1
-rw-r--r--audio/audio_hw.c14
-rw-r--r--configs/tiny_hw.xml33
-rw-r--r--overlay/packages/apps/Settings/res/values/bools.xml21
-rw-r--r--overlay/packages/apps/Settings/res/values/config.xml21
10 files changed, 176 insertions, 28 deletions
diff --git a/DeviceSettings/res/values-de/strings.xml b/DeviceSettings/res/values-de/strings.xml
index 50c66a6..099267d 100644
--- a/DeviceSettings/res/values-de/strings.xml
+++ b/DeviceSettings/res/values-de/strings.xml
@@ -2,6 +2,11 @@
<resources>
<string name="app_name">Galaxy S III Einstellungen</string>
+ <string name="category_dock_title">Dock</string>
+ <string name="dockaudio_subcat_title">Audio</string>
+ <string name="use_dock_audio_title_head">USB-Dock Audio</string>
+ <string name="use_dock_audio_summary_head">Passive Audio-Ausgabe des USB-Docks verwenden</string>
+
<string name="category_haptic_title">Haptik</string>
<string name="vibrator_subcat_title">Vibrator</string>
<string name="vibrator_intensity_title_head">Vibrator Intensität</string>
diff --git a/DeviceSettings/res/values/strings.xml b/DeviceSettings/res/values/strings.xml
index e842ae4..c32c2d5 100644
--- a/DeviceSettings/res/values/strings.xml
+++ b/DeviceSettings/res/values/strings.xml
@@ -2,6 +2,11 @@
<resources>
<string name="app_name">Galaxy S III Settings</string>
+ <string name="category_dock_title">Dock</string>
+ <string name="dockaudio_subcat_title">Dock Audio</string>
+ <string name="use_dock_audio_title_head">Use Dock USB Audio</string>
+ <string name="use_dock_audio_summary_head">Use the passive audio out on the dock</string>
+
<string name="category_haptic_title">Haptic</string>
<string name="vibrator_subcat_title">Vibrator</string>
<string name="vibrator_intensity_title_head">Vibrator Intensity</string>
diff --git a/DeviceSettings/res/xml/dock_preferences.xml b/DeviceSettings/res/xml/dock_preferences.xml
new file mode 100644
index 0000000..62c962c
--- /dev/null
+++ b/DeviceSettings/res/xml/dock_preferences.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ <PreferenceCategory
+ android:title="@string/dockaudio_subcat_title">
+ <!-- Use Dock Audio -->
+ <CheckBoxPreference
+ android:key="dock_audio"
+ android:title="@string/use_dock_audio_title_head"
+ android:summary="@string/use_dock_audio_summary_head"
+ />
+ </PreferenceCategory>
+</PreferenceScreen>
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java b/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java
index 152e361..6c5fc67 100644
--- a/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/DeviceSettings.java
@@ -44,6 +44,7 @@ public class DeviceSettings extends FragmentActivity {
public static final String KEY_LED_FADE = "led_fade";
public static final String KEY_TOUCHKEY_LIGHT = "touchkey_light";
public static final String KEY_TOUCHKEY_TIMEOUT = "touchkey_timeout";
+ public static final String KEY_USE_DOCK_AUDIO = "dock_audio";
ViewPager mViewPager;
TabsAdapter mTabsAdapter;
@@ -63,6 +64,8 @@ public class DeviceSettings extends FragmentActivity {
bar.setDisplayHomeAsUpEnabled(true);
mTabsAdapter = new TabsAdapter(this, mViewPager);
+ mTabsAdapter.addTab(bar.newTab().setText(R.string.category_dock_title),
+ DockFragmentActivity.class, null);
mTabsAdapter.addTab(bar.newTab().setText(R.string.category_radio_title),
RadioFragmentActivity.class, null);
mTabsAdapter.addTab(bar.newTab().setText(R.string.category_screen_title),
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java b/DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java
new file mode 100644
index 0000000..c57cd63
--- /dev/null
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java
@@ -0,0 +1,75 @@
+/*
+* Copyright (C) 2012 The CyanogenMod Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package com.cyanogenmod.settings.device;
+
+import android.app.ActivityManagerNative;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.preference.PreferenceScreen;
+import android.util.Log;
+
+import com.cyanogenmod.settings.device.R;
+
+public class DockFragmentActivity extends PreferenceFragment {
+
+ private static final String PREF_ENABLED = "1";
+ private static final String TAG = "GalaxyS3Settings_Dock";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addPreferencesFromResource(R.xml.dock_preferences);
+ PreferenceScreen prefSet = getPreferenceScreen();
+
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+
+ String boxValue;
+ String key = preference.getKey();
+
+ Log.w(TAG, "key: " + key);
+
+ if (key.compareTo(DeviceSettings.KEY_USE_DOCK_AUDIO) == 0) {
+ boxValue = (((CheckBoxPreference)preference).isChecked() ? "1" : "0");
+ Intent i = new Intent("com.cyanogenmod.settings.SamsungDock");
+ i.putExtra("data", boxValue);
+ ActivityManagerNative.broadcastStickyIntent(i, null, UserHandle.USER_ALL);
+ }
+
+ return true;
+ }
+
+ public static void restore(Context context) {
+ SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean dockAudio = sharedPrefs.getBoolean(DeviceSettings.KEY_USE_DOCK_AUDIO, false);
+ Intent i = new Intent("com.cyanogenmod.settings.SamsungDock");
+ i.putExtra("data", (dockAudio? "1" : "0"));
+ ActivityManagerNative.broadcastStickyIntent(i, null, UserHandle.USER_ALL);
+ }
+
+}
diff --git a/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java
index dc9ec9c..56b903b 100644
--- a/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java
+++ b/DeviceSettings/src/com/cyanogenmod/settings/device/Startup.java
@@ -24,6 +24,7 @@ public class Startup extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent bootintent) {
+ DockFragmentActivity.restore(context);
HapticFragmentActivity.restore(context);
Hspa.restore(context);
RadioFragmentActivity.restore(context);
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index bdf7599..43fdb8b 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -536,8 +536,9 @@ static void set_incall_device(struct m0_audio_device *adev)
voice_index = 5;
break;
case AUDIO_DEVICE_OUT_SPEAKER:
- case AUDIO_DEVICE_OUT_AUX_DIGITAL:
+ case AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET:
case AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET:
+ case AUDIO_DEVICE_OUT_AUX_DIGITAL:
rx_dev_id = DEVICE_SPEAKER_MONO_RX_ACDB_ID;
tx_dev_id = DEVICE_SPEAKER_TX_ACDB_ID;
voice_index = 7;
@@ -726,6 +727,12 @@ static void select_output_device(struct m0_audio_device *adev)
case AUDIO_DEVICE_OUT_ALL_SCO:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL_SCO", __func__);
break;
+ case AUDIO_DEVICE_OUT_USB_ACCESSORY:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_ACCESSORY", __func__);
+ break;
+ case AUDIO_DEVICE_OUT_USB_DEVICE:
+ ALOGD("%s: AUDIO_DEVICE_OUT_USB_DEVICE", __func__);
+ break;
default:
ALOGD("%s: AUDIO_DEVICE_OUT_ALL", __func__);
break;
@@ -2935,9 +2942,10 @@ static const struct {
{ AUDIO_DEVICE_OUT_SPEAKER, "speaker" },
{ AUDIO_DEVICE_OUT_WIRED_HEADSET | AUDIO_DEVICE_OUT_WIRED_HEADPHONE, "headphone" },
{ AUDIO_DEVICE_OUT_EARPIECE, "earpiece" },
- { AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET, "analog-dock" },
- { AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, "digital-dock" },
+ { AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET, "dock" },
+ { AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET, "dock" },
{ AUDIO_DEVICE_OUT_ALL_SCO, "sco-out" },
+ { AUDIO_DEVICE_OUT_AUX_DIGITAL, "aux-digital" },
{ AUDIO_DEVICE_IN_BUILTIN_MIC, "builtin-mic" },
{ AUDIO_DEVICE_IN_BACK_MIC, "back-mic" },
diff --git a/configs/tiny_hw.xml b/configs/tiny_hw.xml
index 1f3afb4..6cfc499 100644
--- a/configs/tiny_hw.xml
+++ b/configs/tiny_hw.xml
@@ -213,52 +213,35 @@ We are able to have most of our routing static so do that
<ctl name="AIF2DAC2R Mixer AIF1.1 Switch" val="0"/>
</path>
</device>
-<device name="analog-dock">
+<device name="dock">
<path name="on">
<ctl name="LINEOUT2N Switch" val="1"/>
<ctl name="LINEOUT2P Switch" val="1"/>
<ctl name="LINEOUT2N Mixer Left Output Switch" val="1"/>
+ <ctl name="LINEOUT2N Mixer Right Output Switch" val="0"/>
<ctl name="LINEOUT2P Mixer Right Output Switch" val="1"/>
<ctl name="LINE Switch" val="1"/>
- <ctl name="AIF1DAC1 Volume" val="96"/>
- <ctl name="AIF1 Boost Volume" val="0"/>
- <ctl name="DAC1 Volume" val="96"/>
+ <ctl name="LineoutSwitch Mode" val="1"/>
<ctl name="Left Output Mixer DAC Volume" val="7"/>
<ctl name="Right Output Mixer DAC Volume" val="7"/>
- <ctl name="Output Volume" val="55"/>
- <ctl name="Earpiece Volume" val="1"/>
</path>
<path name="off">
+ <ctl name="LineoutSwitch Mode" val="0"/>
<ctl name="LINEOUT2N Switch" val="0"/>
<ctl name="LINEOUT2P Switch" val="0"/>
<ctl name="LINE Switch" val="0"/>
- <ctl name="AIF1DAC1 Volume" val="96"/>
- <ctl name="AIF1 Boost Volume" val="0"/>
- <ctl name="DAC1 Volume" val="96"/>
- <ctl name="Left Output Mixer DAC Volume" val="7"/>
- <ctl name="Right Output Mixer DAC Volume" val="7"/>
- <ctl name="Output Volume" val="57"/>
- <ctl name="LINEOUT2 Volume" val="1"/>
</path>
</device>
-<device name="digital-dock">
+<device name="aux-digital">
<path name="on">
<ctl name="LINEOUT1N Switch" val="1"/>
<ctl name="LINEOUT1P Switch" val="1"/>
<ctl name="HDMI Switch" val="1"/>
- <ctl name="AIF1DAC1 Volume" val="96"/>
</path>
<path name="off">
- <ctl name="LINEOUT1N Switch" val="1"/>
- <ctl name="LINEOUT1P Switch" val="1"/>
- <ctl name="HDMI Switch" val="1"/>
- <ctl name="AIF1DAC1 Volume" val="96"/>
- <ctl name="AIF1 Boost Volume" val="0"/>
- <ctl name="DAC1 Volume" val="96"/>
- <ctl name="SPKL DAC1 Volume" val="1"/>
- <ctl name="SPKR DAC1 Volume" val="1"/>
- <ctl name="Speaker Mixer Volume" val="0"/>
- <ctl name="Speaker Boost Volume" val="0"/>
+ <ctl name="LINEOUT1N Switch" val="0"/>
+ <ctl name="LINEOUT1P Switch" val="0"/>
+ <ctl name="HDMI Switch" val="0"/>
</path>
</device>
<device name="builtin-mic">
diff --git a/overlay/packages/apps/Settings/res/values/bools.xml b/overlay/packages/apps/Settings/res/values/bools.xml
new file mode 100644
index 0000000..88338eb
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values/bools.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 The CyanogenMod Project <http://www.cyanogenmod.org>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources xmlns:xliff="urnasis:names:tc:xliff:document:1.2 ">
+ <!-- Whether or not the dock settings are to be displayed for this device when docked -->
+ <bool name="has_dock_settings">true</bool>
+</resources>
diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml
new file mode 100644
index 0000000..89a117f
--- /dev/null
+++ b/overlay/packages/apps/Settings/res/values/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2012 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources xmlns:xliff="urnasis:names:tc:xliff:document:1.2 ">
+ <!-- Volume Rocker Wake -->
+ <bool name="config_show_volumeRockerWake">true</bool>
+</resources>