diff options
author | Simon Shields <keepcalm444@gmail.com> | 2016-03-18 23:13:27 +1100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-08-25 23:39:12 +0200 |
commit | 325722855f24fbc017a46d969adaf35c237fe805 (patch) | |
tree | 729b5c6bde12bd4c9f94b288a207e1943ff58e51 | |
parent | 4b1fd8093a30653119a41ecb25a18f8b4ff3350b (diff) | |
download | device_samsung_smdk4412-common-325722855f24fbc017a46d969adaf35c237fe805.zip device_samsung_smdk4412-common-325722855f24fbc017a46d969adaf35c237fe805.tar.gz device_samsung_smdk4412-common-325722855f24fbc017a46d969adaf35c237fe805.tar.bz2 |
smdk4412-common: commonize AdvancedDisplay [3/3]replicant-6.0-alpha-0005
Change-Id: Ie66ca09bccc5e651365c1fe0004ba81eaed823ba
36 files changed, 0 insertions, 1806 deletions
diff --git a/AdvancedDisplay/Android.mk b/AdvancedDisplay/Android.mk deleted file mode 100644 index f848efe..0000000 --- a/AdvancedDisplay/Android.mk +++ /dev/null @@ -1,15 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13 - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := AdvancedDisplay -LOCAL_CERTIFICATE := platform - -include $(BUILD_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/AdvancedDisplay/AndroidManifest.xml b/AdvancedDisplay/AndroidManifest.xml deleted file mode 100644 index bd470fa..0000000 --- a/AdvancedDisplay/AndroidManifest.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.cyanogenmod.settings.device" - android:sharedUserId="android.uid.system" > - - <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> - <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> - - <application android:label="@string/app_name"> - <activity - android:name="com.cyanogenmod.settings.device.DisplaySettings" - android:launchMode="singleTop" - android:icon="@drawable/ic_launcher_cmdevicesettings" - android:hardwareAccelerated="true" - android:configChanges="orientation|keyboardHidden|screenSize" - android:label="@string/app_name" - android:excludeFromRecents="true" > - <intent-filter> - <action android:name="com.cyanogenmod.action.LAUNCH_DEVICE_SETTINGS" /> - <action android:name="android.intent.action.MAIN" /> - </intent-filter> - </activity> - - <receiver android:name=".Startup"> - <intent-filter android:priority="100"> - <action android:name="android.intent.action.BOOT_COMPLETED" /> - </intent-filter> - </receiver> - - <activity android:name=".ScreenFragmentActivity" /> - - </application> -</manifest> diff --git a/AdvancedDisplay/res/drawable/ic_launcher_cmdevicesettings.png b/AdvancedDisplay/res/drawable/ic_launcher_cmdevicesettings.png Binary files differdeleted file mode 100755 index 9bfdd78..0000000 --- a/AdvancedDisplay/res/drawable/ic_launcher_cmdevicesettings.png +++ /dev/null diff --git a/AdvancedDisplay/res/layout/seek_bar_preference.xml b/AdvancedDisplay/res/layout/seek_bar_preference.xml deleted file mode 100644 index 38d9a1e..0000000 --- a/AdvancedDisplay/res/layout/seek_bar_preference.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@android:id/widget_frame" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingLeft="8dp" - android:paddingTop="5dp" - android:paddingRight="10dp" - android:paddingBottom="5dp" - > - - <TextView android:id="@android:id/title" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView android:id="@android:id/summary" - android:layout_alignParentLeft="true" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_below="@android:id/title" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="?android:attr/textColorSecondary" /> - - <RelativeLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_below="@android:id/summary" > - - <TextView android:id="@+id/seekBarPrefUnitsRight" - android:layout_centerInParent="true" - android:layout_alignParentRight="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceSmall" /> - - <TextView android:id="@+id/seekBarPrefValue" - android:layout_centerInParent="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toLeftOf="@id/seekBarPrefUnitsRight" - android:gravity="right" - android:textAppearance="?android:attr/textAppearanceSmall" /> - - <TextView android:id="@+id/seekBarPrefUnitsLeft" - android:layout_centerInParent="true" - android:layout_toLeftOf="@id/seekBarPrefValue" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceSmall" /> - - <LinearLayout android:id="@+id/seekBarPrefBarContainer" - android:layout_centerInParent="true" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_toLeftOf="@id/seekBarPrefUnitsLeft" /> - </RelativeLayout> -</RelativeLayout> diff --git a/AdvancedDisplay/res/layout/top.xml b/AdvancedDisplay/res/layout/top.xml deleted file mode 100755 index 744b568..0000000 --- a/AdvancedDisplay/res/layout/top.xml +++ /dev/null @@ -1,5 +0,0 @@ -<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/viewPager" - android:layout_width="match_parent" - android:layout_height="match_parent" /> - diff --git a/AdvancedDisplay/res/values-de/arrays.xml b/AdvancedDisplay/res/values-de/arrays.xml deleted file mode 100644 index d3faa6a..0000000 --- a/AdvancedDisplay/res/values-de/arrays.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (Standard)</item> - <item>UI</item> - <item>Video</item> - <item>Video warm</item> - <item>Video kalt</item> - <item>Kamera</item> - <item>Navigation</item> - <item>Gallerie</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Dynamisch (Standard)</item> - <item>Standard</item> - <item>Natürlich</item> - <item>Film</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Normal</item> - <item>Invertiert</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-de/strings.xml b/AdvancedDisplay/res/values-de/strings.xml deleted file mode 100644 index 419f05c..0000000 --- a/AdvancedDisplay/res/values-de/strings.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="defaults_button">Zurücksetzen</string> - - <string name="category_screen_title">Display</string> - <string name="screen_colors_title">Farben</string> - <string name="mdnie_scenario_title_head">Szenario</string> - <string name="mdnie_scenario_summary_head">Wähle das mDNIe Szenario</string> - <string name="mdnie_mode_title_head">Modus</string> - <string name="mdnie_mode_summary_head">Wähle den mDNIe Modus</string> - <string name="mdnie_negative_title_head">Negativ Modus</string> - <string name="mdnie_negative_summary_head">Invertiere Farben</string> - -</resources> diff --git a/AdvancedDisplay/res/values-es/arrays.xml b/AdvancedDisplay/res/values-es/arrays.xml deleted file mode 100644 index 94c10b9..0000000 --- a/AdvancedDisplay/res/values-es/arrays.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (por defecto)</item> - <item>UI</item> - <item>Vídeo</item> - <item>Vídeo cálido</item> - <item>Vídeo frío</item> - <item>Camara</item> - <item>Navegación</item> - <item>Galería</item> - <item>VT</item> - </string-array> - <string-array name="mdnie_mode_entries"> - <item>Estándar (por defecto)</item> - <item>Dinámico</item> - <item>Natural</item> - <item>Película</item> - </string-array> - <string-array name="mdnie_negative_entries"> - <item>Normal</item> - <item>Invertido</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-es/strings.xml b/AdvancedDisplay/res/values-es/strings.xml deleted file mode 100644 index e7c1594..0000000 --- a/AdvancedDisplay/res/values-es/strings.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="defaults_button">Restablecer</string> - <string name="category_screen_title">Pantalla</string> - <string name="screen_colors_title">Colores</string> - <string name="mdnie_scenario_title_head">Escenario</string> - <string name="mdnie_scenario_summary_head">Establecer escenario mDNIe</string> - <string name="mdnie_mode_title_head">Modo</string> - <string name="mdnie_mode_summary_head">Establecer modo mDNIe</string> - <string name="mdnie_negative_title_head">Modo Negativo</string> - <string name="mdnie_negative_summary_head">Habilitar/deshabilitar colores invertidos</string> -</resources> diff --git a/AdvancedDisplay/res/values-fr/arrays.xml b/AdvancedDisplay/res/values-fr/arrays.xml deleted file mode 100644 index 6983df7..0000000 --- a/AdvancedDisplay/res/values-fr/arrays.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (Défaut)</item> - <item>UI</item> - <item>Vidéo</item> - <item>Vidéo chaude</item> - <item>Vidéo froide</item> - <item>Caméra</item> - <item>Navigation</item> - <item>Galerie</item> - <item>VT</item> - </string-array> - <string-array name="mdnie_mode_entries"> - <item>Dynamique (Défaut)</item> - <item>Standard</item> - <item>Naturel</item> - <item>Vidéo</item> - </string-array> - <string-array name="mdnie_negative_entries"> - <item>Normal</item> - <item>Inversé</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-fr/strings.xml b/AdvancedDisplay/res/values-fr/strings.xml deleted file mode 100644 index 4e5e67c..0000000 --- a/AdvancedDisplay/res/values-fr/strings.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="defaults_button">Réinitialiser</string> - <string name="category_screen_title">Écran</string> - <string name="screen_colors_title">Couleurs</string> - <string name="mdnie_scenario_title_head">Scénario</string> - <string name="mdnie_scenario_summary_head">Définir le scénario mDNIe</string> - <string name="mdnie_mode_title_head">Mode</string> - <string name="mdnie_mode_summary_head">Définir le mode mDNIe</string> - <string name="mdnie_negative_title_head">Mode négatif</string> - <string name="mdnie_negative_summary_head">Activer/désactiver les couleurs inversées</string> -</resources> diff --git a/AdvancedDisplay/res/values-hu/arrays.xml b/AdvancedDisplay/res/values-hu/arrays.xml deleted file mode 100644 index dae3a4c..0000000 --- a/AdvancedDisplay/res/values-hu/arrays.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (Alapbeállítás)</item> - <item>Felhasználói felület</item> - <item>Videó</item> - <item>Videó (Meleg árnyalat)</item> - <item>Videó (Hideg árnyalat)</item> - <item>Kamera</item> - <item>Navigáció</item> - <item>Galéria</item> - <item>VT</item> - </string-array> - <string-array name="mdnie_mode_entries"> - <item>Dinamikus (Alapbeállítás)</item> - <item>Hagyományos</item> - <item>Természetes</item> - <item>Film</item> - </string-array> - <string-array name="mdnie_negative_entries"> - <item>Normál</item> - <item>Fordított</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-hu/strings.xml b/AdvancedDisplay/res/values-hu/strings.xml deleted file mode 100644 index b8fcba6..0000000 --- a/AdvancedDisplay/res/values-hu/strings.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="defaults_button">Beállítások visszaállítása alaphelyzetbe</string> - <string name="category_screen_title">Kijelző</string> - <string name="screen_colors_title">Színek</string> - <string name="mdnie_scenario_title_head">Megjelenítés</string> - <string name="mdnie_scenario_summary_head">mDNIe megjelenítési beállítások</string> - <string name="mdnie_mode_title_head">Üzemmód</string> - <string name="mdnie_mode_summary_head">mDNIe üzemmódok</string> - <string name="mdnie_negative_title_head">Negatív üzemmód</string> - <string name="mdnie_negative_summary_head">Fordított színek ki/be</string> -</resources> diff --git a/AdvancedDisplay/res/values-nl/arrays.xml b/AdvancedDisplay/res/values-nl/arrays.xml deleted file mode 100644 index d0baeed..0000000 --- a/AdvancedDisplay/res/values-nl/arrays.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (standaard)</item> - <item>Uiterlijk</item> - <item>Video</item> - <item>Video (warm)</item> - <item>Video (koud)</item> - <item>Camera</item> - <item>Navigatie</item> - <item>Galerij</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Dynamisch (standaard)</item> - <item>Standaard</item> - <item>Natuurlijk</item> - <item>Film</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Normaal</item> - <item>Omgedraaid</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-nl/strings.xml b/AdvancedDisplay/res/values-nl/strings.xml deleted file mode 100644 index eafc3a5..0000000 --- a/AdvancedDisplay/res/values-nl/strings.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="defaults_button">Standaardwaarden</string> - - <string name="category_screen_title">Scherm</string> - <string name="screen_colors_title">Kleuren</string> - - <string name="mdnie_scenario_title_head">Scenario</string> - <string name="mdnie_scenario_summary_head">mDNIe-scenario instellen</string> - <string name="mdnie_mode_title_head">Modus</string> - <string name="mdnie_mode_summary_head">mDNIe-modus instellen</string> - <string name="mdnie_negative_title_head">Negatieve modus</string> - <string name="mdnie_negative_summary_head">Negatieve kleuren in-/uitschakelen</string> -</resources> diff --git a/AdvancedDisplay/res/values-pl/arrays.xml b/AdvancedDisplay/res/values-pl/arrays.xml deleted file mode 100644 index 30274f2..0000000 --- a/AdvancedDisplay/res/values-pl/arrays.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (domyślnie)</item> - <item>UI</item> - <item>Wideo</item> - <item>Ciepły film</item> - <item>Zimny film</item> - <item>Kamera</item> - <item>Nawigacja</item> - <item>Galeria</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Dynamicznie (domyślnie)</item> - <item>Standardowo</item> - <item>Naturalnie</item> - <item>Film</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Normalnie</item> - <item>Odwrócony</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-pl/strings.xml b/AdvancedDisplay/res/values-pl/strings.xml deleted file mode 100644 index 06ad53b..0000000 --- a/AdvancedDisplay/res/values-pl/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="category_screen_title">Ekran</string> - <string name="screen_colors_title">Kolory</string> - <string name="mdnie_scenario_title_head">Technologia mDNIe</string> - <string name="mdnie_scenario_summary_head">Ustaw scenariusz mDNIe</string> - <string name="mdnie_mode_title_head">Tryb</string> - <string name="mdnie_mode_summary_head">Ustaw tryb mDNIe</string> - <string name="mdnie_negative_title_head">Tryb negatywu</string> - <string name="mdnie_negative_summary_head">Włącz/wyłącz odwrócone kolory</string> -</resources> diff --git a/AdvancedDisplay/res/values-pt-rBR/arrays.xml b/AdvancedDisplay/res/values-pt-rBR/arrays.xml deleted file mode 100644 index 77a51d2..0000000 --- a/AdvancedDisplay/res/values-pt-rBR/arrays.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (Padrão)</item> - <item>IU</item> - <item>Vídeo</item> - <item>Vídeo Quente</item> - <item>Vídeo Frio</item> - <item>Câmera</item> - <item>Navegação</item> - <item>Galeria</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Padrão</item> - <item>Dinâmico</item> - <item>Natural</item> - <item>Filme</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Normal</item> - <item>Invertido</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-pt-rBR/strings.xml b/AdvancedDisplay/res/values-pt-rBR/strings.xml deleted file mode 100644 index 76487b3..0000000 --- a/AdvancedDisplay/res/values-pt-rBR/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="category_screen_title">Tela</string> - <string name="screen_colors_title">Cores</string> - <string name="mdnie_scenario_title_head">Cenário</string> - <string name="mdnie_scenario_summary_head">Define o Cenário mDNIe</string> - <string name="mdnie_mode_title_head">Modo</string> - <string name="mdnie_mode_summary_head">Define o Modo mDNIe</string> - <string name="mdnie_negative_title_head">Modo Negativo</string> - <string name="mdnie_negative_summary_head">Ativar/Desativar cores invertidas</string> -</resources> diff --git a/AdvancedDisplay/res/values-ru/arrays.xml b/AdvancedDisplay/res/values-ru/arrays.xml deleted file mode 100644 index a32bc26..0000000 --- a/AdvancedDisplay/res/values-ru/arrays.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (По умолч.)</item> - <item>Видео</item> - <item>Видео (тёпл.)</item> - <item>Видео (хол.)</item> - <item>Камера</item> - <item>Навигация</item> - <item>Галерея</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Динамический (По умолч.)</item> - <item>Стандартный</item> - <item>Натуральный</item> - <item>Кино</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Нормально</item> - <item>Инверсия</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-ru/strings.xml b/AdvancedDisplay/res/values-ru/strings.xml deleted file mode 100644 index 9cabd97..0000000 --- a/AdvancedDisplay/res/values-ru/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="category_screen_title">Экран</string> - <string name="screen_colors_title">Цвета</string> - <string name="mdnie_scenario_title_head">Сценарий</string> - <string name="mdnie_scenario_summary_head">Установка сценария mDNIe</string> - <string name="mdnie_mode_title_head">Режим</string> - <string name="mdnie_mode_summary_head">Установка режима mDNIe</string> - <string name="mdnie_negative_title_head">Негатив</string> - <string name="mdnie_negative_summary_head">Вкл./выкл. инверсии цветов</string> -</resources> diff --git a/AdvancedDisplay/res/values-zh-rCN/arrays.xml b/AdvancedDisplay/res/values-zh-rCN/arrays.xml deleted file mode 100644 index 8b295c4..0000000 --- a/AdvancedDisplay/res/values-zh-rCN/arrays.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (默认)</item> - <item>界面</item> - <item>影片</item> - <item>影片 (温)</item> - <item>影片 (冷)</item> - <item>相机</item> - <item>导航</item> - <item>图库</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>动态 (默认)</item> - <item>标准</item> - <item>自然</item> - <item>电影</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>正常</item> - <item>反色</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values-zh-rCN/strings.xml b/AdvancedDisplay/res/values-zh-rCN/strings.xml deleted file mode 100644 index b5ee6f6..0000000 --- a/AdvancedDisplay/res/values-zh-rCN/strings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="category_screen_title">屏幕</string> - <string name="screen_colors_title">颜色</string> - <string name="mdnie_scenario_title_head">场景</string> - <string name="mdnie_scenario_summary_head">设置 mDNIe 场景</string> - <string name="mdnie_mode_title_head">模式</string> - <string name="mdnie_mode_summary_head">设置 mDNIe 模式</string> - <string name="mdnie_negative_title_head">负极模式</string> - <string name="mdnie_negative_summary_head">启用/禁用反色</string> -</resources> diff --git a/AdvancedDisplay/res/values/arrays.xml b/AdvancedDisplay/res/values/arrays.xml deleted file mode 100644 index cff1afa..0000000 --- a/AdvancedDisplay/res/values/arrays.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string-array name="mdnie_scenario_entries"> - <item>CyanogenMod (Default)</item> - <item>UI</item> - <item>Video</item> - <item>Video Warm</item> - <item>Video Cold</item> - <item>Camera</item> - <item>Navigation</item> - <item>Gallery</item> - <item>VT</item> - </string-array> - - <string-array name="mdnie_scenario_entries_values" translatable="false"> - <item>0</item> - <item>1</item> - <item>2</item> - <item>3</item> - <item>4</item> - <item>5</item> - <item>6</item> - <item>7</item> - <item>8</item> - </string-array> - - <string-array name="mdnie_mode_entries"> - <item>Dynamic (Default)</item> - <item>Standard</item> - <item>Natural</item> - <item>Movie</item> - </string-array> - - <string-array name="mdnie_mode_entries_values" translatable="false"> - <item>0</item> - <item>1</item> - <item>2</item> - <item>3</item> - </string-array> - - <string-array name="mdnie_negative_entries"> - <item>Normal</item> - <item>Inverted</item> - </string-array> - - <string-array name="mdnie_negative_entries_values" translatable="false"> - <item>0</item> - <item>1</item> - </string-array> - - <string-array name="touchkey_timeout_entries"> - <item>Never</item> - <item>1 second</item> - <item>2 seconds</item> - <item>3 seconds (Default)</item> - <item>4 seconds</item> - <item>5 seconds</item> - <item>6 seconds</item> - </string-array> - - <string-array name="touchkey_timeout_entries_values" translatable="false"> - <item>0</item> - <item>1</item> - <item>2</item> - <item>3</item> - <item>4</item> - <item>5</item> - <item>6</item> - </string-array> - - <string-array name="led_fade_entries"> - <item>Blinking</item> - <item>Fading</item> - </string-array> - - <string-array name="led_fade_entries_values" translatable="false"> - <item>0</item> - <item>1</item> - </string-array> - - <string-array name="hspa_entries"> - <item>UMTS Only</item> - <item>HSDPA Only</item> - <item>HSDPA + HSUPA</item> - </string-array> - - <string-array name="hspa_entries_values" translatable="false"> - <item>21</item> - <item>22</item> - <item>23</item> - </string-array> -</resources> diff --git a/AdvancedDisplay/res/values/config.xml b/AdvancedDisplay/res/values/config.xml deleted file mode 100644 index 5e4be8f..0000000 --- a/AdvancedDisplay/res/values/config.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2013 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. ---> - -<!-- These resources are around just to allow their values to be customized - for different hardware and product builds. --> -<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - - <!-- Vibrator Tuning --> - <bool name="has_vibrator_tuning">true</bool> - <string name="vibrator_sysfs_file" translatable="false">"/sys/vibrator/pwm_val"</string> - <string name="intensity_max_value" translatable="false">100</string> - <string name="intensity_warning_threshold" translatable="false">75</string> - <string name="intensity_default_value" translatable="false">50</string> - <string name="intensity_min_value" translatable="false">0</string> - - <!-- S-Pen --> - <string name="spen_sysfs_file" translatable="false">"/sys/class/sec/sec_epen"</string> - <string name="spen_powersaving_sysfs_file" translatable="false">"/sys/class/sec/sec_epen/epen_saving_mode"</string> - - <!-- Audio Tuning --> - <bool name="has_incall_audio_tuning">false</bool> - <bool name="has_output_audio_tuning">false</bool> - - <string name="incall_max_value" translatable="false">10</string> - <string name="incall_warning_threshold" translatable="false">9</string> - <string name="incall_default_value" translatable="false">5</string> - <string name="incall_min_value" translatable="false">1</string> - <string name="audioout_max_value" translatable="false">63</string> - <string name="audioout_warning_threshold" translatable="false">60</string> - <string name="audioout_default_value" translatable="false">50</string> - <string name="audioout_min_value" translatable="false">0</string> - - <!-- HSPA --> - <bool name="has_hspa">true</bool> - - <!-- Touchkey --> - <bool name="has_touchkey">true</bool> - - <!-- MDNIE --> - <string name="mdnie_cabc_sysfs_file" translatable="false">"/sys/class/lcd/panel/power_reduce"</string> - <string name="mdnie_scenario_sysfs_file" translatable="false">"/sys/class/mdnie/mdnie/scenario"</string> - <string name="mdnie_mode_sysfs_file" translatable="false">"/sys/class/mdnie/mdnie/mode"</string> - <string name="mdnie_negative_sysfs_file" translatable="false">"/sys/class/mdnie/mdnie/negative"</string> - -</resources> diff --git a/AdvancedDisplay/res/values/custom_attrs.xml b/AdvancedDisplay/res/values/custom_attrs.xml deleted file mode 100644 index b856986..0000000 --- a/AdvancedDisplay/res/values/custom_attrs.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** Copyright 2013, The ChameleonOS Open Source 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="urn:oasis:names:tc:xliff:document:1.2"> - - <declare-styleable name="SeekBarPreference"> - <attr name="min" format="integer" /> - <attr name="unitsLeft" format="string" /> - <attr name="unitsRight" format="string" /> - </declare-styleable> - -</resources>
\ No newline at end of file diff --git a/AdvancedDisplay/res/values/strings.xml b/AdvancedDisplay/res/values/strings.xml deleted file mode 100644 index d7438f4..0000000 --- a/AdvancedDisplay/res/values/strings.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2012-2013 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="urn:oasis:names:tc:xliff:document:1.2"> - <string name="app_name">Advanced Display</string> - - <string name="defaults_button">Reset to default</string> - - <!-- Screen Preference --> - <string name="category_screen_title">Screen</string> - <string name="screen_colors_title">Colors</string> - - <!-- mDNIe --> - <string name="mdnie_scenario_title_head">Scenario</string> - <string name="mdnie_scenario_summary_head">Set the mDNIe Scenario</string> - <string name="mdnie_mode_title_head">Mode</string> - <string name="mdnie_mode_summary_head">Set the mDNIe Mode</string> - <string name="mdnie_negative_title_head">Negative Mode</string> - <string name="mdnie_negative_summary_head">Enable/Disable inverted colors</string> - -</resources> diff --git a/AdvancedDisplay/res/xml/screen_preferences.xml b/AdvancedDisplay/res/xml/screen_preferences.xml deleted file mode 100644 index 56e536c..0000000 --- a/AdvancedDisplay/res/xml/screen_preferences.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> - - <!-- Screen --> - <PreferenceCategory - android:title="@string/screen_colors_title"> - - <!-- mDNIe Scenario modes --> - <com.cyanogenmod.settings.device.mDNIeScenario - android:key="mdnie_scenario" - android:title="@string/mdnie_scenario_title_head" - android:summary="@string/mdnie_scenario_summary_head" - android:entries="@array/mdnie_scenario_entries" - android:entryValues="@array/mdnie_scenario_entries_values" - android:defaultValue="0" /> - - <!-- mDNIe Mode --> - <com.cyanogenmod.settings.device.mDNIeMode - android:key="mdnie_mode" - android:title="@string/mdnie_mode_title_head" - android:summary="@string/mdnie_mode_summary_head" - android:entries="@array/mdnie_mode_entries" - android:entryValues="@array/mdnie_mode_entries_values" - android:defaultValue="0" /> - - <!-- mDNIe Negative mode --> - <com.cyanogenmod.settings.device.mDNIeNegative - android:key="mdnie_negative" - android:title="@string/mdnie_negative_title_head" - android:summary="@string/mdnie_negative_summary_head" - android:entries="@array/mdnie_negative_entries" - android:entryValues="@array/mdnie_negative_entries_values" - android:defaultValue="0" /> - </PreferenceCategory> - -</PreferenceScreen> diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/DisplaySettings.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/DisplaySettings.java deleted file mode 100644 index d838c31..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/DisplaySettings.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.ActionBar; -import android.app.ActionBar.Tab; -import android.app.Activity; -import android.app.Fragment; -import android.app.FragmentTransaction; -import android.content.Context; -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; -import android.support.v13.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.view.MenuItem; - -import com.cyanogenmod.settings.device.R; - -import java.util.ArrayList; - -public class DisplaySettings extends FragmentActivity { - - public static final String SHARED_PREFERENCES_BASENAME = "com.cyanogenmod.settings.device"; - public static final String ACTION_UPDATE_PREFERENCES = "com.cyanogenmod.settings.device.UPDATE"; - public static final String KEY_CABC = "cabc"; - public static final String KEY_MDNIE_SCENARIO = "mdnie_scenario"; - public static final String KEY_MDNIE_MODE = "mdnie_mode"; - public static final String KEY_MDNIE_NEGATIVE = "mdnie_negative"; - 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_HSPA = "hspa"; - public static final String KEY_USE_DOCK_AUDIO = "dock_audio"; - public static final String KEY_CATEGORY_SPEN = "category_spen"; - public static final String KEY_SPEN_POWER_SAVING_MODE = "spen_power_saving"; - - ViewPager mViewPager; - TabsAdapter mTabsAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - mViewPager = new ViewPager(this); - mViewPager.setId(R.id.viewPager); - setContentView(mViewPager); - - final ActionBar bar = getActionBar(); - bar.setTitle(R.string.app_name); - bar.setDisplayHomeAsUpEnabled(true); - - mTabsAdapter = new TabsAdapter(this, mViewPager); - mTabsAdapter.addTab(bar.newTab().setText(R.string.category_screen_title), - ScreenFragmentActivity.class, null); - - if (savedInstanceState != null) { - bar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0)); - } - } - - @Override - protected void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - outState.putInt("tab", getActionBar().getSelectedNavigationIndex()); - } - - public static class TabsAdapter extends FragmentPagerAdapter - implements ActionBar.TabListener, ViewPager.OnPageChangeListener { - private final Context mContext; - private final ActionBar mActionBar; - private final ViewPager mViewPager; - private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>(); - - static final class TabInfo { - private final Class<?> clss; - private final Bundle args; - - TabInfo(Class<?> _class, Bundle _args) { - clss = _class; - args = _args; - } - } - - public TabsAdapter(Activity activity, ViewPager pager) { - super(activity.getFragmentManager()); - mContext = activity; - mActionBar = activity.getActionBar(); - mViewPager = pager; - mViewPager.setAdapter(this); - mViewPager.setOnPageChangeListener(this); - } - - public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) { - TabInfo info = new TabInfo(clss, args); - tab.setTag(info); - tab.setTabListener(this); - mTabs.add(info); - mActionBar.addTab(tab); - notifyDataSetChanged(); - } - - @Override - public int getCount() { - return mTabs.size(); - } - - @Override - public Fragment getItem(int position) { - TabInfo info = mTabs.get(position); - return Fragment.instantiate(mContext, info.clss.getName(), info.args); - } - - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - } - - public void onPageSelected(int position) { - mActionBar.setSelectedNavigationItem(position); - } - - public void onPageScrollStateChanged(int state) { - } - - public void onTabSelected(Tab tab, FragmentTransaction ft) { - Object tag = tab.getTag(); - for (int i=0; i<mTabs.size(); i++) { - if (mTabs.get(i) == tag) { - mViewPager.setCurrentItem(i); - } - } - } - - public void onTabUnselected(Tab tab, FragmentTransaction ft) { - } - - public void onTabReselected(Tab tab, FragmentTransaction ft) { - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - DisplaySettings.this.onBackPressed(); - default: - return super.onOptionsItemSelected(item); - } - } -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java deleted file mode 100644 index 7b64a4f..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/ScreenFragmentActivity.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.content.Context; -import android.content.res.Resources; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.preference.CheckBoxPreference; -import android.preference.ListPreference; -import android.preference.Preference; -import android.preference.PreferenceActivity; -import android.preference.PreferenceCategory; -import android.preference.PreferenceFragment; -import android.preference.PreferenceManager; -import android.preference.PreferenceScreen; -import android.util.Log; - -import com.cyanogenmod.settings.device.R; - -public class ScreenFragmentActivity extends PreferenceFragment { - - private static final String PREF_ENABLED = "1"; - private static final String TAG = "DisplaySettings_Screen"; - private mDNIeScenario mmDNIeScenario; - private mDNIeMode mmDNIeMode; - private mDNIeNegative mmDNIeNegative; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - addPreferencesFromResource(R.xml.screen_preferences); - PreferenceScreen preferenceScreen = getPreferenceScreen(); - Resources res = getResources(); - - /* mDNIe */ - mmDNIeScenario = (mDNIeScenario) findPreference(DisplaySettings.KEY_MDNIE_SCENARIO); - mmDNIeScenario.setEnabled(mDNIeScenario.isSupported(res.getString(R.string.mdnie_scenario_sysfs_file))); - - mmDNIeMode = (mDNIeMode) findPreference(DisplaySettings.KEY_MDNIE_MODE); - mmDNIeMode.setEnabled(mDNIeMode.isSupported(res.getString(R.string.mdnie_mode_sysfs_file))); - - mmDNIeNegative = (mDNIeNegative) findPreference(DisplaySettings.KEY_MDNIE_NEGATIVE); - mmDNIeNegative.setEnabled(mDNIeNegative.isSupported(res.getString(R.string.mdnie_negative_sysfs_file))); - - } - - @Override - public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - - String key = preference.getKey(); - Log.w(TAG, "key: " + key); - - return true; - } - - public static boolean isSupported(String FILE) { - return Utils.fileExists(FILE); - } - - public static void restore(Context context) { - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - } -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/SeekBarPreference.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/SeekBarPreference.java deleted file mode 100644 index 9f614c8..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/SeekBarPreference.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (C) 2013 The ChameleonOS 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.content.Context; -import android.content.res.TypedArray; -import android.preference.Preference; -import android.util.AttributeSet; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.view.ViewParent; -import android.widget.RelativeLayout; -import android.widget.SeekBar; -import android.widget.SeekBar.OnSeekBarChangeListener; -import android.widget.TextView; - -import com.cyanogenmod.settings.device.R; - -public class SeekBarPreference extends Preference implements OnSeekBarChangeListener { - - private final String TAG = getClass().getName(); - - private static final String ANDROIDNS = "http://schemas.android.com/apk/res/android"; - private static final String ADVANCEDDISPLAY = "http://schemas.android.com/apk/res/com.cyanogenmod.settings.device"; - private static final int DEFAULT_VALUE = 50; - - private int mMaxValue = 100; - private int mMinValue = 0; - private int mInterval = 1; - private int mCurrentValue; - private String mUnitsLeft = ""; - private String mUnitsRight = ""; - private SeekBar mSeekBar; - private TextView mTitle; - - private TextView mStatusText; - - public SeekBarPreference(Context context, AttributeSet attrs) { - super(context, attrs); - initPreference(context, attrs); - } - - public SeekBarPreference(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - initPreference(context, attrs); - } - - private void initPreference(Context context, AttributeSet attrs) { - setValuesFromXml(attrs); - mSeekBar = new SeekBar(context, attrs); - mSeekBar.setMax(mMaxValue - mMinValue); - mSeekBar.setOnSeekBarChangeListener(this); - } - - private void setValuesFromXml(AttributeSet attrs) { - mMaxValue = attrs.getAttributeIntValue(ANDROIDNS, "max", 100); - mMinValue = attrs.getAttributeIntValue(ADVANCEDDISPLAY, "min", 0); - mUnitsLeft = getAttributeStringValue(attrs, ADVANCEDDISPLAY, "unitsLeft", ""); - String units = getAttributeStringValue(attrs, ADVANCEDDISPLAY, "units", ""); - mUnitsRight = getAttributeStringValue(attrs, ADVANCEDDISPLAY, "unitsRight", units); - try { - String newInterval = attrs.getAttributeValue(ADVANCEDDISPLAY, "interval"); - if(newInterval != null) - mInterval = Integer.parseInt(newInterval); - } - catch(Exception e) { - Log.e(TAG, "Invalid interval value", e); - } - } - - private String getAttributeStringValue(AttributeSet attrs, String namespace, String name, String defaultValue) { - String value = attrs.getAttributeValue(namespace, name); - if(value == null) - value = defaultValue; - - return value; - } - - @Override - public void onDependencyChanged(Preference dependency, boolean disableDependent) { - super.onDependencyChanged(dependency, disableDependent); - this.setShouldDisableView(true); - if (mTitle != null) - mTitle.setEnabled(!disableDependent); - if (mSeekBar != null) - mSeekBar.setEnabled(!disableDependent); - } - - @Override - protected View onCreateView(ViewGroup parent){ - - RelativeLayout layout = null; - try { - LayoutInflater mInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - layout = (RelativeLayout)mInflater.inflate(R.layout.seek_bar_preference, parent, false); - mTitle = (TextView) layout.findViewById(android.R.id.title); - } - catch(Exception e) - { - Log.e(TAG, "Error creating seek bar preference", e); - } - return layout; - } - - @Override - public void onBindView(View view) { - super.onBindView(view); - try - { - // move our seekbar to the new view we've been given - ViewParent oldContainer = mSeekBar.getParent(); - ViewGroup newContainer = (ViewGroup) view.findViewById(R.id.seekBarPrefBarContainer); - - if (oldContainer != newContainer) { - // remove the seekbar from the old view - if (oldContainer != null) { - ((ViewGroup) oldContainer).removeView(mSeekBar); - } - // remove the existing seekbar (there may not be one) and add ours - newContainer.removeAllViews(); - newContainer.addView(mSeekBar, ViewGroup.LayoutParams.FILL_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT); - } - } - catch(Exception ex) { - Log.e(TAG, "Error binding view: " + ex.toString()); - } - updateView(view); - } - - /** - * Update a SeekBarPreference view with our current state - * @param view - */ - protected void updateView(View view) { - - try { - RelativeLayout layout = (RelativeLayout)view; - mStatusText = (TextView)layout.findViewById(R.id.seekBarPrefValue); - mStatusText.setText(String.valueOf(mCurrentValue)); - mStatusText.setMinimumWidth(30); - mSeekBar.setProgress(mCurrentValue - mMinValue); - - TextView unitsRight = (TextView)layout.findViewById(R.id.seekBarPrefUnitsRight); - unitsRight.setText(mUnitsRight); - TextView unitsLeft = (TextView)layout.findViewById(R.id.seekBarPrefUnitsLeft); - unitsLeft.setText(mUnitsLeft); - } - catch(Exception e) { - Log.e(TAG, "Error updating seek bar preference", e); - } - } - - @Override - public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - int newValue = progress + mMinValue; - if(newValue > mMaxValue) - newValue = mMaxValue; - else if(newValue < mMinValue) - newValue = mMinValue; - else if(mInterval != 1 && newValue % mInterval != 0) - newValue = Math.round(((float)newValue)/mInterval)*mInterval; - - // change rejected, revert to the previous value - if(!callChangeListener(newValue)){ - seekBar.setProgress(mCurrentValue - mMinValue); - return; - } - // change accepted, store it - mCurrentValue = newValue; - mStatusText.setText(String.valueOf(newValue)); - persistInt(newValue); - } - - @Override - public void onStartTrackingTouch(SeekBar seekBar) {} - - @Override - public void onStopTrackingTouch(SeekBar seekBar) { - notifyChanged(); - } - - @Override - protected Object onGetDefaultValue(TypedArray ta, int index){ - int defaultValue = ta.getInt(index, DEFAULT_VALUE); - return defaultValue; - } - - @Override - protected void onSetInitialValue(boolean restoreValue, Object defaultValue) { - if(restoreValue) { - mCurrentValue = getPersistedInt(mCurrentValue); - } - else { - int temp = 0; - try { - temp = (Integer)defaultValue; - } - catch(Exception ex) { - Log.e(TAG, "Invalid default value: " + defaultValue.toString()); - } - persistInt(temp); - mCurrentValue = temp; - } - } - - public void setValue(int value) { - mCurrentValue = value; - } -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/Startup.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/Startup.java deleted file mode 100644 index 2bada88..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/Startup.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -public class Startup extends BroadcastReceiver { - - @Override - public void onReceive(final Context context, final Intent bootintent) { - mDNIeScenario.restore(context); - mDNIeMode.restore(context); - mDNIeNegative.restore(context); - ScreenFragmentActivity.restore(context); - } -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/Utils.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/Utils.java deleted file mode 100644 index 4ca2e9e..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/Utils.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * 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.util.Log; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.SyncFailedException; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.content.Context; - -public class Utils { - - private static final String TAG = "DeviceSettings_Utils"; - private static final String TAG_READ = "DeviceSettings_Utils_Read"; - private static final String TAG_WRITE = "DeviceSettings_Utils_Write"; - - // Read value from sysfs interface - public static String readOneLine(String sFile) { - BufferedReader brBuffer; - String sLine = null; - - try { - brBuffer = new BufferedReader(new FileReader(sFile), 512); - try { - sLine = brBuffer.readLine(); - } finally { - Log.w(TAG_READ, "file " + sFile + ": " + sLine); - brBuffer.close(); - } - } catch (Exception e) { - Log.e(TAG_READ, "IO Exception when reading /sys/ file", e); - } - return sLine; - } - - /** - * Write a string value to the specified file. - * - * @param filename The filename - * @param value The value - */ - public static void writeValue(String filename, String value) { - FileOutputStream fos = null; - try { - fos = new FileOutputStream(new File(filename), false); - fos.write(value.getBytes()); - fos.flush(); - // fos.getFD().sync(); - } catch (FileNotFoundException ex) { - Log.w(TAG, "file " + filename + " not found: " + ex); - } catch (SyncFailedException ex) { - Log.w(TAG, "file " + filename + " sync failed: " + ex); - } catch (IOException ex) { - Log.w(TAG, "IOException trying to sync " + filename + ": " + ex); - } catch (RuntimeException ex) { - Log.w(TAG, "exception while syncing file: ", ex); - } finally { - if (fos != null) { - try { - Log.w(TAG_WRITE, "file " + filename + ": " + value); - fos.close(); - } catch (IOException ex) { - Log.w(TAG, "IOException while closing synced file: ", ex); - } catch (RuntimeException ex) { - Log.w(TAG, "exception while closing file: ", ex); - } - } - } - - } - - /** - * Write a string value to the specified file. - * - * @param filename The filename - * @param value The value - */ - public static void writeValue(String filename, Boolean value) { - FileOutputStream fos = null; - String sEnvia; - try { - fos = new FileOutputStream(new File(filename), false); - if (value) - sEnvia = "1"; - else - sEnvia = "0"; - fos.write(sEnvia.getBytes()); - fos.flush(); - // fos.getFD().sync(); - } catch (FileNotFoundException ex) { - Log.w(TAG, "file " + filename + " not found: " + ex); - } catch (SyncFailedException ex) { - Log.w(TAG, "file " + filename + " sync failed: " + ex); - } catch (IOException ex) { - Log.w(TAG, "IOException trying to sync " + filename + ": " + ex); - } catch (RuntimeException ex) { - Log.w(TAG, "exception while syncing file: ", ex); - } finally { - if (fos != null) { - try { - Log.w(TAG_WRITE, "file " + filename + ": " + value); - fos.close(); - } catch (IOException ex) { - Log.w(TAG, "IOException while closing synced file: ", ex); - } catch (RuntimeException ex) { - Log.w(TAG, "exception while closing file: ", ex); - } - } - } - } - - /** - * Write the "color value" to the specified file. The value is scaled from - * an integer to an unsigned integer by multiplying by 2. - * @param filename The filename - * @param value The value of max value Integer.MAX - */ - public static void writeColor(String filename, int value) { - writeValue(filename, String.valueOf((long) value * 2)); - } - - /** - * Check if the specified file exists. - * @param filename The filename - * @return Whether the file exists or not - */ - public static boolean fileExists(String filename) { - return new File(filename).exists(); - } - - public static void showDialog(Context ctx, String title, String message) { - final AlertDialog alertDialog = new AlertDialog.Builder(ctx).create(); - alertDialog.setTitle(title); - alertDialog.setMessage(message); - alertDialog.setButton("OK", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - alertDialog.dismiss(); - } - }); - alertDialog.show(); - } -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeMode.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeMode.java deleted file mode 100644 index c777d72..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeMode.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.content.Context; - -import android.content.SharedPreferences; -import android.util.AttributeSet; -import android.preference.Preference; -import android.preference.ListPreference; -import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceManager; - -public class mDNIeMode extends ListPreference implements OnPreferenceChangeListener { - - private static String FILE = null; - - public mDNIeMode(Context context, AttributeSet attrs) { - super(context, attrs); - this.setOnPreferenceChangeListener(this); - FILE = context.getResources().getString(R.string.mdnie_mode_sysfs_file); - } - - public static boolean isSupported(String filePath) { - return Utils.fileExists(filePath); - } - - /** - * Restore mdnie user mode setting from SharedPreferences. (Write to kernel.) - * @param context The context to read the SharedPreferences from - */ - public static void restore(Context context) { - FILE = context.getResources().getString(R.string.mdnie_mode_sysfs_file); - if (!isSupported(FILE)) { - return; - } - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - Utils.writeValue(FILE, sharedPrefs.getString(DisplaySettings.KEY_MDNIE_MODE, "0")); - } - - public boolean onPreferenceChange(Preference preference, Object newValue) { - Utils.writeValue(FILE, (String) newValue); - return true; - } - -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeNegative.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeNegative.java deleted file mode 100644 index bde9946..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeNegative.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 java.io.IOException; -import android.content.Context; -import android.util.AttributeSet; -import android.content.SharedPreferences; -import android.preference.Preference; -import android.preference.ListPreference; -import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceManager; - -public class mDNIeNegative extends ListPreference implements OnPreferenceChangeListener { - - private static String FILE = null; - - public mDNIeNegative(Context context, AttributeSet attrs) { - super(context, attrs); - this.setOnPreferenceChangeListener(this); - FILE = context.getResources().getString(R.string.mdnie_negative_sysfs_file); - } - - public static boolean isSupported(String filePath) { - return Utils.fileExists(filePath); - } - - /** - * Restore mdnie user mode setting from SharedPreferences. (Write to kernel.) - * @param context The context to read the SharedPreferences from - */ - public static void restore(Context context) { - FILE = context.getResources().getString(R.string.mdnie_negative_sysfs_file); - if (!isSupported(FILE)) { - return; - } - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - Utils.writeValue(FILE, sharedPrefs.getString(DisplaySettings.KEY_MDNIE_NEGATIVE, "0")); - } - - public boolean onPreferenceChange(Preference preference, Object newValue) { - Utils.writeValue(FILE, (String) newValue); - return true; - } - -} diff --git a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeScenario.java b/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeScenario.java deleted file mode 100644 index cbab69d..0000000 --- a/AdvancedDisplay/src/com/cyanogenmod/settings/device/mDNIeScenario.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.content.Context; - -import android.content.SharedPreferences; -import android.util.AttributeSet; -import android.preference.Preference; -import android.preference.ListPreference; -import android.preference.Preference.OnPreferenceChangeListener; -import android.preference.PreferenceManager; - -public class mDNIeScenario extends ListPreference implements OnPreferenceChangeListener { - - private static String FILE = null; - - public mDNIeScenario(Context context, AttributeSet attrs) { - super(context,attrs); - this.setOnPreferenceChangeListener(this); - FILE = context.getResources().getString(R.string.mdnie_scenario_sysfs_file); - } - - public static boolean isSupported(String filePath) { - return Utils.fileExists(filePath); - } - - /** - * Restore mdnie "camera" setting from SharedPreferences. (Write to kernel.) - * @param context The context to read the SharedPreferences from - */ - public static void restore(Context context) { - FILE = context.getResources().getString(R.string.mdnie_scenario_sysfs_file); - if (!isSupported(FILE)) { - return; - } - - SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - Utils.writeValue(FILE, sharedPrefs.getString(DisplaySettings.KEY_MDNIE_SCENARIO, "0")); - } - - public boolean onPreferenceChange(Preference preference, Object newValue) { - Utils.writeValue(FILE, (String) newValue); - return true; - } - -} |