From 4aefda8d63e0cc887366adf3cc1347af84dfb729 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 20 Nov 2011 21:58:36 -0800 Subject: squash changes --- BoardConfig.mk | 4 +- BoardConfigCommon.mk | 4 + CrespoParts/Android.mk | 13 ++ CrespoParts/AndroidManifest.xml | 24 +++ CrespoParts/res/drawable/color_tuning_preview.xml | 9 + .../res/layout/preference_dialog_color_tuning.xml | 92 ++++++++++ .../res/layout/preference_dialog_gamma_tuning.xml | 92 ++++++++++ CrespoParts/res/values-da/strings.xml | 49 ++++++ CrespoParts/res/values-es/arrays.xml | 22 +++ CrespoParts/res/values-es/strings.xml | 49 ++++++ CrespoParts/res/values-fr/strings.xml | 50 ++++++ CrespoParts/res/values-ja/arrays.xml | 54 ++++++ CrespoParts/res/values-ja/strings.xml | 55 ++++++ CrespoParts/res/values-ko/strings.xml | 49 ++++++ CrespoParts/res/values-nl/strings.xml | 49 ++++++ CrespoParts/res/values-pt-rPT/arrays.xml | 27 +++ CrespoParts/res/values-pt-rPT/strings.xml | 52 ++++++ CrespoParts/res/values-tr/strings.xml | 50 ++++++ CrespoParts/res/values-zh-rTW/arrays.xml | 34 ++++ CrespoParts/res/values-zh-rTW/strings.xml | 54 ++++++ CrespoParts/res/values/arrays.xml | 54 ++++++ CrespoParts/res/values/strings.xml | 54 ++++++ CrespoParts/res/xml/main.xml | 58 +++++++ CrespoParts/res/xml/wm8994_settings.xml | 72 ++++++++ .../CrespoParts/ColorTuningPreference.java | 173 +++++++++++++++++++ .../com/cyanogenmod/CrespoParts/CrespoParts.java | 59 +++++++ .../CrespoParts/GammaTuningPreference.java | 186 +++++++++++++++++++++ .../src/com/cyanogenmod/CrespoParts/Hspa.java | 57 +++++++ .../src/com/cyanogenmod/CrespoParts/Startup.java | 19 +++ .../CrespoParts/TouchKeyBacklightTimeout.java | 36 ++++ .../CrespoParts/TouchKeyBlinkTimeout.java | 36 ++++ .../src/com/cyanogenmod/CrespoParts/Utils.java | 94 +++++++++++ .../CrespoParts/WM8994ControlActivity.java | 107 ++++++++++++ bcm4329.ko | Bin 272296 -> 272744 bytes board-info.txt | 4 +- device_base.mk | 11 +- init.herring.rc | 5 - kernel | Bin 2129464 -> 2152236 bytes libcamera/SecCamera.cpp | 2 +- liblight/lights.c | 59 ++++++- .../packages/apps/CMParts/res/values/config.xml | 10 ++ overlay/packages/apps/Camera/res/values/config.xml | 25 +++ overlay/packages/apps/Torch/res/values/config.xml | 24 +++ scsi_wait_scan.ko | Bin 25264 -> 25244 bytes system.prop | 3 + 45 files changed, 1964 insertions(+), 16 deletions(-) create mode 100644 CrespoParts/Android.mk create mode 100644 CrespoParts/AndroidManifest.xml create mode 100644 CrespoParts/res/drawable/color_tuning_preview.xml create mode 100644 CrespoParts/res/layout/preference_dialog_color_tuning.xml create mode 100644 CrespoParts/res/layout/preference_dialog_gamma_tuning.xml create mode 100644 CrespoParts/res/values-da/strings.xml create mode 100644 CrespoParts/res/values-es/arrays.xml create mode 100644 CrespoParts/res/values-es/strings.xml create mode 100644 CrespoParts/res/values-fr/strings.xml create mode 100644 CrespoParts/res/values-ja/arrays.xml create mode 100644 CrespoParts/res/values-ja/strings.xml create mode 100644 CrespoParts/res/values-ko/strings.xml create mode 100644 CrespoParts/res/values-nl/strings.xml create mode 100644 CrespoParts/res/values-pt-rPT/arrays.xml create mode 100644 CrespoParts/res/values-pt-rPT/strings.xml create mode 100644 CrespoParts/res/values-tr/strings.xml create mode 100644 CrespoParts/res/values-zh-rTW/arrays.xml create mode 100644 CrespoParts/res/values-zh-rTW/strings.xml create mode 100644 CrespoParts/res/values/arrays.xml create mode 100644 CrespoParts/res/values/strings.xml create mode 100644 CrespoParts/res/xml/main.xml create mode 100644 CrespoParts/res/xml/wm8994_settings.xml create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/ColorTuningPreference.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/CrespoParts.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/GammaTuningPreference.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/Hspa.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/Startup.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBacklightTimeout.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBlinkTimeout.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/Utils.java create mode 100644 CrespoParts/src/com/cyanogenmod/CrespoParts/WM8994ControlActivity.java create mode 100644 overlay/packages/apps/CMParts/res/values/config.xml create mode 100644 overlay/packages/apps/Camera/res/values/config.xml create mode 100644 overlay/packages/apps/Torch/res/values/config.xml diff --git a/BoardConfig.mk b/BoardConfig.mk index 0293377..685d0c6 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -25,8 +25,8 @@ BOARD_USES_LIBSECRIL_STUB := true BOARD_NO_PAGE_FLIPPING := true BOARD_NO_32BPP := true -#Kernel Panic Fix -ARCH_ARM_HAVE_ARMV7A_BUG := true +# Enable NFC +BOARD_HAVE_NFC := true # Use the non-open-source parts, if they're present -include vendor/samsung/crespo/BoardConfigVendor.mk diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index f398a85..f980588 100755 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -62,6 +62,10 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912 BOARD_USERDATAIMAGE_PARTITION_SIZE := 1073741824 BOARD_FLASH_BLOCK_SIZE := 4096 +# FPU compilation flags +TARGET_GLOBAL_CFLAGS += -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp +TARGET_GLOBAL_CPPFLAGS += -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp + # Connectivity - Wi-Fi WPA_SUPPLICANT_VERSION := VER_0_6_X BOARD_WPA_SUPPLICANT_DRIVER := WEXT diff --git a/CrespoParts/Android.mk b/CrespoParts/Android.mk new file mode 100644 index 0000000..0ea4504 --- /dev/null +++ b/CrespoParts/Android.mk @@ -0,0 +1,13 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := CrespoParts +LOCAL_CERTIFICATE := platform + +include $(BUILD_PACKAGE) + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/CrespoParts/AndroidManifest.xml b/CrespoParts/AndroidManifest.xml new file mode 100644 index 0000000..681dc51 --- /dev/null +++ b/CrespoParts/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrespoParts/res/drawable/color_tuning_preview.xml b/CrespoParts/res/drawable/color_tuning_preview.xml new file mode 100644 index 0000000..2d83c10 --- /dev/null +++ b/CrespoParts/res/drawable/color_tuning_preview.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/CrespoParts/res/layout/preference_dialog_color_tuning.xml b/CrespoParts/res/layout/preference_dialog_color_tuning.xml new file mode 100644 index 0000000..6154982 --- /dev/null +++ b/CrespoParts/res/layout/preference_dialog_color_tuning.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CrespoParts/res/layout/preference_dialog_gamma_tuning.xml b/CrespoParts/res/layout/preference_dialog_gamma_tuning.xml new file mode 100644 index 0000000..3ece54b --- /dev/null +++ b/CrespoParts/res/layout/preference_dialog_gamma_tuning.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CrespoParts/res/values-da/strings.xml b/CrespoParts/res/values-da/strings.xml new file mode 100644 index 0000000..116377b --- /dev/null +++ b/CrespoParts/res/values-da/strings.xml @@ -0,0 +1,49 @@ + + + Nexus S Indstillinger + + WM8994 Indstillinger ( voodoo ) + Farve Justering + Juster skærm farve + Rød + Grøn + Blå + + + Lyd + + Intern Højtaler Indstillinger + Signal Bearbejdning + Høretelefons Forstærker + Codec Optimering + Digital/Analog Konverterings Indstillinger + Analog Linie Konfiguration + Microfon Indstillinger + + Lyd Instillinger + Lyd Indstillinger + Avanceret kontrol af WM8994 lyd bearbejdnings hardware + Aktiver WM8994 Kontrol + Aktiver avanceret kontrol af WM8994 bearbejdnings hardware + Juster højtaler til musik + Rekonfigurer hardware EQ for mere bas og balanceret lyd + Mono downmix + Downmix stereo lyd til mono (for stereo outputs, så som høretelefoner) + Stereo ekspansion + "Udvid" stereo lyd via digital signal bearbejdning + D/AC direkte + Tilgå digital/analog konverter direkte, udenom channel mixer. Giver renere lyd (sænker signal-to-noise forholdet) + Hi-fi afspilning + Digital-til-analog konverter 128x oversampling -- renere lyd når der afspilles musik + Hi-fi optagelse + Analog-to-digital konverter 128x oversampling -- øger kvaliteten af optagelser + Tuned lyd frekvens + Brug tuned WM8994 lyd frekvens kilde -- øger kvaliteten af lyd + + Touch Knapper + Baggrundslys Timeout + Indstil forsinkelsen for hvornår touch knappernes lys skal slukkes + Blink Timeout + Indstil forsinkelsen for hvornår touch knappernes blink lys automatisk skal slukkes efter en notifikation + + diff --git a/CrespoParts/res/values-es/arrays.xml b/CrespoParts/res/values-es/arrays.xml new file mode 100644 index 0000000..8f0d39d --- /dev/null +++ b/CrespoParts/res/values-es/arrays.xml @@ -0,0 +1,22 @@ + + + 2 segundos + Por defecto (5 segundos) + 10 segundos + 15 segundos + 20 segundos + 30 segundos + Nunca + + + + 1 minuto + 2 minutos + Por defecto (5 minutos) + 10 minutos + 15 minutos + 30 minutos + Nunca + + + diff --git a/CrespoParts/res/values-es/strings.xml b/CrespoParts/res/values-es/strings.xml new file mode 100644 index 0000000..0ba86fd --- /dev/null +++ b/CrespoParts/res/values-es/strings.xml @@ -0,0 +1,49 @@ + + + Parámetros Nexus S + + Parámetros WM8994 ( voodoo ) + Modificar Color + Calibrar color pantalla + Rojo + Verde + Azul + + + Sonido + + Configurar altavoz interno + Procesado de señal + Configurar manoslibres + Optimización codec + Parámetros Digital/Analogico + Parámetros camino analógico + Parámetros del micro + + Parámetros del sonido + Parámetros del sonido + Control avanzado del procesador de sonido del WM8994 + Habilitar control WM8994 + Habilitar el control de procesador de sonido del WM8994 + Ajustar altavoz para música + Reconfigurar el EQ para tener más bajos y sonido balanceado + Mezclador a mono + Degrada estereo para salir en mono (para salidas estereo, como los cascos) + Expansión estereo + "Expande" sonido estereo via procesado digital de señal + D/AC directo + Acceso directo al convertidor digital/analogico, inhibiendo el mezclador de canales. Produce mayor señal limpia + Reproducción Hi-fi + Convertidor Digital-a-analogico 128x sobre muestreada -- sonido más claro al reproducir música + Grabación Hi-fi + Convertidor Digital-a-analogico 128x sobre muestreada -- sonido más claro al grabar + Reloj audio mejorado + Usar el reloj del sonido del WM8994 -- mejora la calidad del sonido + + Teclas + Tiempo de luz teclado + Adjusta el tiempo al que se desactiva la luz de las teclas con la pantalla encendida + Tiempo de parpadeo + Adjusta el tiempo al que deja de parpadear el teclado después de que llegue una notificación + + diff --git a/CrespoParts/res/values-fr/strings.xml b/CrespoParts/res/values-fr/strings.xml new file mode 100644 index 0000000..cd8df9d --- /dev/null +++ b/CrespoParts/res/values-fr/strings.xml @@ -0,0 +1,50 @@ + + + Paramètres Nexus S + + Paramètres WM8994 ( voodoo ) + Réglages Couleurs + Calibrage des couleurs de l\'écran + Rouge + Vert + Bleu + + + Son + + Configuration Haut-Parleur Interne + Traitement du Signal + Amplificateur Ecouteurs + Optimisation du Codec + Configuration du Convertisseur Analogique Numérique + Configuration du Chemin Analogique + Configuration du Micro + + Paramètres du Son + Paamètres du Son + Contrôle Avancé du Matériel de Traitement du Son WM8994 + Activer le Contrôle WM8994 + Activer les Contrôles Avancés du Matériel de Traitement du Son WM8994 + Régler le Haut-Parleur pour la Musique + Reconfigurer le matériel EQ pour un son plus grave et équilibré + Mélangeur Mono + Mixer le signal stéréo en mono (vers une sortie stéréo, comme des écouteurs) + Expansion Stéréo + "Expand" le signal stéréo via le processeur de traitement du signal numérique + D/AC direct + Accéder au convertisseur numérique analogique directement, en court-circuitant le mélangeur de canaux. Produit un son plus propre (signal sur bruit meilleur) + Reproduction HiFi + Suréchantillonnage 128x du convertisseur analogique numérique -- son plus propre pour la reproduction de musique + Enregistrement HiFi + Suréchantillonnage 128x du convertisseur analogique numérique -- améliore la qualité des enregistrements + Horloge audio précise + Utiliser une source horloge audio précise -- améliore la qualité du son + + Touches tactiles + Délai rétroéclairage + Régler le délai avant l\'extinction du rétroéclairage des touches tactiles + Délai clignotement + Régler le délai avant l\'arrêt du clignotement du rétroéclairage des touches tactiles après une notification + + + diff --git a/CrespoParts/res/values-ja/arrays.xml b/CrespoParts/res/values-ja/arrays.xml new file mode 100644 index 0000000..7b6f3e3 --- /dev/null +++ b/CrespoParts/res/values-ja/arrays.xml @@ -0,0 +1,54 @@ + + + 2 秒 + デフォルト (5 秒) + 10 秒 + 15 秒 + 20 秒 + 30 秒 + させない + + + + 2 + 5 + 10 + 15 + 20 + 30 + 0 + + + + 1 分 + 2 分 + デフォルト (5 分) + 10 分 + 15 分 + 30 分 + させない + + + + 1 + 2 + 5 + 10 + 15 + 30 + 0 + + + + UMTS のみ + HSDPA のみ + HSDPA と HSUPA + + + + 21 + 22 + 23 + + + diff --git a/CrespoParts/res/values-ja/strings.xml b/CrespoParts/res/values-ja/strings.xml new file mode 100644 index 0000000..9123ca9 --- /dev/null +++ b/CrespoParts/res/values-ja/strings.xml @@ -0,0 +1,55 @@ + + + Nexus S 設定 + + WM8994 設定 ( voodoo ) + 色の調整 + 画面色の調整 + ガンマの調整 + ガンマ補正の調整 + + + + + + サウンド + + スピーカー設定 + 信号処理 + ヘッドフォンアンプ + Codec最適化 + デジタル/アナログコンバータ設定 + アナログパス設定 + マイク設定 + + サウンド設定 + サウンド設定 + WM8994サウンドプロセッサの高度な制御 + WM8994サウンドプロセッサの制御を有効にする + WM8994サウンドプロセッサの高度な制御を有効にする + 音楽再生用のスピーカー調整 + より豊かな低音とバランスの取れた音質にするためハードウェアEQを再設定する + モノダウンミックス + ステレオサウンドをモノラルサウンドへダウンミックスする(ヘッドホンなどのステレオ出力用) + ステレオ拡張モード + DSPを使用することによりステレオサウンドを拡張する + D/AC ダイレクト + チャンネルのミキサーをバイパスし、直接デジタル/アナログコンバーターにアクセスする。よりクリアな音質を生成(S/N比) + Hi-fi再生 + デジタル - アナログ コンバーター 128x オーバーサンプリング -- よりクリアな音で音楽を再生する + Hi-fi録音 + アナログ - デジタル コンバーター 128x オーバーサンプリング -- 録音品質を向上させる + チューニング済みのaudio clock + チューニング済みのWM8994オーディオクロックソースを使用 -- 音質を向上させる + + タッチキー + バックライトのタイムアウト + タッチキーのバックライトが自動的にオフになるまでの遅延を調整する + 点滅のタイムアウト + タッチキーの点滅のバックライトが通知した後、自動的に消えるまでの遅延時間を調整する + + ラジオ + HSPA + HSDPA/HSUPAを有効にする + + diff --git a/CrespoParts/res/values-ko/strings.xml b/CrespoParts/res/values-ko/strings.xml new file mode 100644 index 0000000..cba12cc --- /dev/null +++ b/CrespoParts/res/values-ko/strings.xml @@ -0,0 +1,49 @@ + + + 넥서스 S 설정 + + WM8994 설정 ( 부두 ) + 색상 조율 + 화면 색상 보정 + 빨강 + 녹색 + 파랑 + + + 소리 + + 내장 스피커 구성 + 신호 처리 + 헤드폰 증폭기 + 코덱 최적화 + 디지털/아날로그 변환기 설정 + 아날로그 경로 구성 + 마이크로폰 설정 + + 소리 설정 + 소리 설정 + WM8994 소리 프로세서 하드웨어 고급 제어 + WM8994 제어 허가 + WM8994 소리 프로세서 하드웨어 고급 제어 허가 + 음악을 위한 스피커 조정 + 더 낮고 균형 잡힌 소리를 위해 하드웨어 이퀄라이저 변경 + 모노 다운믹스 + 스테레오 소리를 모노로 다운믹스 (헤드폰 같은 장치에서 스테레오로 출력하기 위함) + 스테레오 확장 + 디지털 신호 처리를 통해 스테레오 소리 "확장" + 디지털/아날로그 변환기 방향 + 채널 혼합을 거치지 않고 직접 디지털/아날로그 변환기 연결. 깔끔한 음향을 만듦 (신호대잡음비) + 고감도 재생 + 디지털/아날로그 변환기 128x 과 샘플링 -- 깔끔한 소리로 음악 재생 + 고감도 녹음 + 아날로그/디지털 변환기 128x 과 샘플링 -- 녹음 품질 증가 + 조율된 음향 회로 + 조율된 WM8994 음향 회로 소스 사용 -- 소리 품질 향상 + + 터치키 + 조명 지속시간 + 터치키 조명이 자동으로 꺼지기 전 지속시간 조정 + 깜빡임 지속시간 + 알림 뒤 깜빡임 조명이 자동으로 꺼지기 전 지속시간 조정 + + diff --git a/CrespoParts/res/values-nl/strings.xml b/CrespoParts/res/values-nl/strings.xml new file mode 100644 index 0000000..14cc02c --- /dev/null +++ b/CrespoParts/res/values-nl/strings.xml @@ -0,0 +1,49 @@ + + + Nexus S-instellingen + + WM8994-instellingen ( voodoo ) + Kleuraanpassing + Kalibreer schermkleur + Rood + Groen + Blauw + + + Geluid + + Interne luidspreker aanpassen + Signal Processing + Koptelefoon Amplifier + Codec Optimalisatie + Digitaal/Analoog Converter-instellingen + Analog Path aanpassen + Microfoon-instellingen + + Geluidsinstellingen + Geluidsinstellingen + Geavanceerde controle van de WM8994-geluidsprocessor hardware + Schakel WM8994-control in + Schakel geavanceerde controle van de WM8994-geluidsprocessor hardware in + Tune speaker for music + Reconfigures the hardware EQ voor een betere bass en gebalanceerd geluid + Mono downmix + Downmix stereo sound to mono (for stereo outputs, such as headphones) + Stereo-uitbreiding + "Expand" stereo sound via digital signal processing + D/AC direct + Stuur de digitaal/analoog-converter rechtstreeks aan, bypassing the channel mixer. Zorgt voor helderder geluid (lower signal-to-noise ratio) + Hi-fi playback + Digitaal-to-analoog-converter 128x oversampling -- cleaner sound when playing music + Hi-fi recording + Analoog-to-digitaal-converter 128x oversampling -- increases quality of recordings + Tuned audio clock + Use tuned WM8994 audio clock source -- verbetert de geluidskwaliteit + + Touch Keys + Backlight Timeout + Pas de vertraging aan voor het touch key-backlight uitgaat + Blink Timeout + Pas de vertraging aan voor het knipperend touch key-backlight uitgaat na een notificatie + + diff --git a/CrespoParts/res/values-pt-rPT/arrays.xml b/CrespoParts/res/values-pt-rPT/arrays.xml new file mode 100644 index 0000000..790c219 --- /dev/null +++ b/CrespoParts/res/values-pt-rPT/arrays.xml @@ -0,0 +1,27 @@ + + + 2 segundo + Pré-definido (5 segundos) + 10 segundos + 15 segundos + 20 segundos + 30 segundos + Nunca + + + + 1 minuto + 2 minuto + Pré-definido (5 minutos) + 10 minutos + 15 minutos + 30 minutos + Nunca + + + + Apenas UMTS + Apenas HSDPA + HSDPA + HSUPA + + diff --git a/CrespoParts/res/values-pt-rPT/strings.xml b/CrespoParts/res/values-pt-rPT/strings.xml new file mode 100644 index 0000000..3b32960 --- /dev/null +++ b/CrespoParts/res/values-pt-rPT/strings.xml @@ -0,0 +1,52 @@ + + + Definições Nexus S + + Definições WM8994 ( voodoo ) + Ajuste de Cor + Calibrar cor do ecrã + Vermelho + Verde + Azul + + + Som + + Configuração do Altifalante Interno + Processamento de Sinal + Amplificador de auscutador + Optimização de Codec + Definições de conversão Digital/Analógico + Definições de roteamento Analógico + Definições de Microfone + + Definições de Som + Definições de Som + Controlo avançado do processador de som WM8994 + Activar controlo WM8994 + Activar controlo avançado para o processador de som WM8994 + Ajustar altifalante para música + Reconfigurar equalizador de hardware para obter mais Bass/Boost + Downmix Mono + Transforma estéreo sound em mono (para outputs estéreo, tais como headphones) + Expansão estéreo + "Expande" som estéreo através de processamento digital + D/AC directamente + Acede ao conversor digital/analógco directamente, evitando o misturador de canal. Produz áudio mais limpo (rácio de signal-noise mais baixo) + Som Hi-fi + Conversor Digital-para-analógico com 128x de oversampling -- som mais limpo ao tocar música + Gravação Hi-fi + Conversor Analógico-para-digital com 128x de oversampling -- aumenta a qualidade das gravações + Ligar ao relógio de áudio + Usar o processador WM8994 como relógio para áudio -- aumenta a qualidade do som + + Botões Capacitivos + Temporizador Luz de Fundo + Ajusta o tempo que as teclas capacitivas demoram a desligar a sua luz de fundo + Temporizador de Intermitência + Ajusta o tempo que as teclas demoram a desligar a retroiluminação intermitente após notificação. + + Radio + HSPA + Activar HSDPA/HSUPA + diff --git a/CrespoParts/res/values-tr/strings.xml b/CrespoParts/res/values-tr/strings.xml new file mode 100644 index 0000000..469f5fd --- /dev/null +++ b/CrespoParts/res/values-tr/strings.xml @@ -0,0 +1,50 @@ + + + + Nexus S ayarları + + WM8994 ayarları ( voodoo ) + Renk ayarı + Ekran rengi kalibrasyonu + Kırmızı + Yeşil + Mavi + + + Ses + + Dahili hoparlör konfigürasyonu + Sinyal işleme + Kulaklık amplifikatörü + Codec optimizasyonu + Dijital / Analog Dönüştürücü ayarları + Analog yol konfigürasyonu + Mikrofon ayarları + + Ses ayarları + Ses ayarları + WM8994 Ses işlemcisi donanımı gelişmiş kontrolü + WM8994 Kontrolünü etkinleştir + WM8994 ses işlemcisi donanımı için gelişmiş denetimlerini etkinleştirme + Müzik için hoparlör ayarı + Daha fazla bas ve dengeli bir ses elde etmek için EQ donanımını yeniden yapılandırır + Mono indirgeme + Stereo sesi monoya indirgeme (stereo çıkış, kulaklık gibi) + Stereo geliştirme + Dijital sinyal işleme üzerinden stereo ses "Gelistirme" + D / AC direkt + Kanal mikser atlayarak, doğrudan, analog / dijital dönüştürücü erişim. Temiz ses (düşük sinyal-gürültü oranı) üretir. + Hi-fi oynatma + Dijital-analog çevirici 128x örnekleme - Müzik çalarken daha temiz ses + Hi-fi kaydı + Analog-dijital dönüştürücü 128x örnekleme -- kayıtların kalitesini artırır + Ayarlı ses saati + WM8994 ses saati kaynağı ayarlı kullan - ses kalitesini artırır + + Dokunmatik tuşlar + Arka ışık zaman aşımı + Dokunmatik tuşa ışığı otomatik kapanmadan önceki gecikmeyi ayarlayın + Yanıp sönme zaman aşımı + Bir bildirim sonrası dokunmatik tuşun yanıp söner arka ışığın otomatik kapanmadan önceki gecikmeyi ayarlayın. + + diff --git a/CrespoParts/res/values-zh-rTW/arrays.xml b/CrespoParts/res/values-zh-rTW/arrays.xml new file mode 100644 index 0000000..e4b3886 --- /dev/null +++ b/CrespoParts/res/values-zh-rTW/arrays.xml @@ -0,0 +1,34 @@ + + + 2秒 + 預設(5秒) + 10秒 + 15秒 + 20秒 + 30秒 + 永不 + + + + + + 1分鐘 + 2分鐘 + 預設(5分鐘) + 10分鐘 + 15分鐘 + 30分鐘 + 永不 + + + + + + 僅 UMTS + 僅 HSDPA + HSDPA+HSUPA + + + + + diff --git a/CrespoParts/res/values-zh-rTW/strings.xml b/CrespoParts/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000..0f475de --- /dev/null +++ b/CrespoParts/res/values-zh-rTW/strings.xml @@ -0,0 +1,54 @@ + + + Nexus S 設定 + + WM8994 設定(Voodoo) + 色彩增值 + 調整螢幕色彩增值 + 伽馬色彩校正 + 調整伽馬色彩校正 + + + + + + 音效 + + 內置喇叭設定 + 訊號處理 + 耳機擴音 + 編碼優化 + 數碼/類比轉換器設定 + 類比路徑設定 + 麥克風設定 + + 音效設定 + 音效設定 + WM8994 音效處理器硬體進階控制 + 啟用 WM8994 控制 + 啟用 WM8994 音效處理器硬體的進階控制 + 為音樂調整喇叭 + 重新設置硬體等化器以穫取更加低音及均衡的音效 + 單聲道混合 + 將雙聲道混合成單聲道(用於雙聲道輸出,例如耳機) + 雙聲道擴展 + 透過數碼訊號處理,將雙聲道音效“擴展” + 直接轉換數碼/類比 + 繞過頻道混音器,直接存取數碼/類比轉換器,以產生更清晰音訊(較低的訊噪比) + Hi-Fi 播放 + 數碼至類比的128倍過採樣轉換,使播放音樂時的音質更清晰 + Hi-Fi 錄音 + 類比至數碼的128倍過採樣轉換,提升錄音品質 + 調整音訊時脈 + 使用調整了 WM8994 音訊時脈的原始碼,提升音效品質 + + 觸控鍵 + 背光逾時 + 調整觸控鍵背光自動關閉前的延遲時間 + 閃爍逾時 + 調整觸控鍵閃爍通知自動關閉前的延遲時間 + + 行動網路 + HSPA + 啟用 HSDPA/HSUPA + diff --git a/CrespoParts/res/values/arrays.xml b/CrespoParts/res/values/arrays.xml new file mode 100644 index 0000000..874c983 --- /dev/null +++ b/CrespoParts/res/values/arrays.xml @@ -0,0 +1,54 @@ + + + 2 seconds + Default (5 seconds) + 10 seconds + 15 seconds + 20 seconds + 30 seconds + Never + + + + 2 + 5 + 10 + 15 + 20 + 30 + 0 + + + + 1 minute + 2 minutes + Default (5 minutes) + 10 minutes + 15 minutes + 30 minutes + Never + + + + 1 + 2 + 5 + 10 + 15 + 30 + 0 + + + + UMTS Only + HSDPA Only + HSDPA + HSUPA + + + + 21 + 22 + 23 + + + diff --git a/CrespoParts/res/values/strings.xml b/CrespoParts/res/values/strings.xml new file mode 100644 index 0000000..7c3d2eb --- /dev/null +++ b/CrespoParts/res/values/strings.xml @@ -0,0 +1,54 @@ + + + Nexus S Settings + + WM8994 Settings ( voodoo ) + Color Multipliers Tuning + Calibrate multipliers screen color + Color Gamma Tuning + Calibrate gamma color correction + Red + Green + Blue + + + Sound + + Internal Speaker Configuration + Signal Processing + Headphone Amplifier + Codec Optimization + Digital/Analog Converter Settings + Analog Path Configuration + Microphone Settings + + Sound Settings + Sound Settings + Advanced control of the WM8994 sound processor hardware + Enable WM8994 Control + Enable advanced controls for the WM8994 sound processor hardware + Tune speaker for music + Reconfigures the hardware EQ to get more bass and balanced sound + Mono downmix + Downmix stereo sound to mono (for stereo outputs, such as headphones) + Stereo expansion + "Expand" stereo sound via digital signal processing + D/AC direct + Access digital/analog converter directly, bypassing the channel mixer. Produces cleaner audio (lower signal-to-noise ratio) + Hi-fi playback + Digital-to-analog converter 128x oversampling -- cleaner sound when playing music + Hi-fi recording + Analog-to-digital converter 128x oversampling -- increases quality of recordings + Tuned audio clock + Use tuned WM8994 audio clock source -- improves quality of sound + + Touch Keys + Backlight Timeout + Adjust the delay before the touch key backlight automatically turns off + Blink Timeout + Adjust the delay before the touch key blink backlight automatically turns off after a notification + + Radio + HSPA + Enable HSDPA/HSUPA + diff --git a/CrespoParts/res/xml/main.xml b/CrespoParts/res/xml/main.xml new file mode 100644 index 0000000..7d785d4 --- /dev/null +++ b/CrespoParts/res/xml/main.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrespoParts/res/xml/wm8994_settings.xml b/CrespoParts/res/xml/wm8994_settings.xml new file mode 100644 index 0000000..984fd61 --- /dev/null +++ b/CrespoParts/res/xml/wm8994_settings.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/ColorTuningPreference.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/ColorTuningPreference.java new file mode 100644 index 0000000..4eb5f88 --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/ColorTuningPreference.java @@ -0,0 +1,173 @@ +package com.cyanogenmod.CrespoParts; + +import android.content.Context; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.preference.DialogPreference; +import android.preference.PreferenceManager; +import android.util.AttributeSet; +import android.view.View; +import android.widget.SeekBar; +import android.widget.TextView; + +/** + * Special preference type that allows configuration of both the ring volume and + * notification volume. + */ +public class ColorTuningPreference extends DialogPreference { + + enum Colors { + RED, + GREEN, + BLUE + }; + + private static final int[] SEEKBAR_ID = new int[] { + R.id.color_red_seekbar, + R.id.color_green_seekbar, + R.id.color_blue_seekbar + }; + + private static final int[] VALUE_DISPLAY_ID = new int[] { + R.id.color_red_value, + R.id.color_green_value, + R.id.color_blue_value + }; + + private static final String[] FILE_PATH = new String[] { + "/sys/class/misc/voodoo_color/red_multiplier", + "/sys/class/misc/voodoo_color/green_multiplier", + "/sys/class/misc/voodoo_color/blue_multiplier" + }; + + private ColorSeekBar mSeekBars[] = new ColorSeekBar[3]; + + private static final int MAX_VALUE = Integer.MAX_VALUE; + + // Track instances to know when to restore original color + // (when the orientation changes, a new dialog is created before the old one is destroyed) + private static int sInstances = 0; + + public ColorTuningPreference(Context context, AttributeSet attrs) { + super(context, attrs); + + setDialogLayoutResource(R.layout.preference_dialog_color_tuning); + } + + @Override + protected void onBindDialogView(View view) { + super.onBindDialogView(view); + + sInstances++; + + for (int i = 0; i < SEEKBAR_ID.length; i++) { + SeekBar seekBar = (SeekBar) view.findViewById(SEEKBAR_ID[i]); + TextView valueDisplay = (TextView) view.findViewById(VALUE_DISPLAY_ID[i]); + mSeekBars[i] = new ColorSeekBar(seekBar, valueDisplay, FILE_PATH[i]); + } + } + + @Override + protected void onDialogClosed(boolean positiveResult) { + super.onDialogClosed(positiveResult); + + sInstances--; + + if (positiveResult) { + for (ColorSeekBar csb : mSeekBars) { + csb.save(); + } + } else if (sInstances == 0) { + for (ColorSeekBar csb : mSeekBars) { + csb.reset(); + } + } + } + + /** + * Restore screen color tuning from SharedPreferences. (Write to kernel.) + * @param context The context to read the SharedPreferences from + */ + public static void restore(Context context) { + if (!isSupported()) { + return; + } + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + for (String filePath : FILE_PATH) { + int value = sharedPrefs.getInt(filePath, MAX_VALUE); + Utils.writeColor(filePath, value); + } + } + + /** + * Check whether the running kernel supports color tuning or not. + * @return Whether color tuning is supported or not + */ + public static boolean isSupported() { + boolean supported = true; + for (String filePath : FILE_PATH) { + if (!Utils.fileExists(filePath)) { + supported = false; + } + } + + return supported; + } + + class ColorSeekBar implements SeekBar.OnSeekBarChangeListener { + + private String mFilePath; + private int mOriginal; + private SeekBar mSeekBar; + private TextView mValueDisplay; + + public ColorSeekBar(SeekBar seekBar, TextView valueDisplay, String filePath) { + mSeekBar = seekBar; + mValueDisplay = valueDisplay; + mFilePath = filePath; + + // Read original value + SharedPreferences sharedPreferences = getSharedPreferences(); + mOriginal = sharedPreferences.getInt(mFilePath, MAX_VALUE); + + seekBar.setMax(MAX_VALUE); + reset(); + seekBar.setOnSeekBarChangeListener(this); + } + + public void reset() { + mSeekBar.setProgress(mOriginal); + updateValue(mOriginal); + } + + public void save() { + Editor editor = getEditor(); + editor.putInt(mFilePath, mSeekBar.getProgress()); + editor.commit(); + } + + @Override + public void onProgressChanged(SeekBar seekBar, int progress, + boolean fromUser) { + Utils.writeColor(mFilePath, progress); + updateValue(progress); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + // Do nothing + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + // Do nothing + } + + private void updateValue(int progress) { + mValueDisplay.setText(String.format("%.10f", (double) progress / MAX_VALUE)); + } + + } + +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/CrespoParts.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/CrespoParts.java new file mode 100644 index 0000000..c8ce364 --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/CrespoParts.java @@ -0,0 +1,59 @@ +package com.cyanogenmod.CrespoParts; + +import android.os.Bundle; +import android.preference.ListPreference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; +import android.preference.PreferenceScreen; + +public class CrespoParts extends PreferenceActivity { + + public static final String KEY_COLOR_TUNING = "color_tuning"; + public static final String KEY_GAMMA_TUNING = "gamma_tuning"; + public static final String KEY_BACKLIGHT_TIMEOUT = "backlight_timeout"; + public static final String KEY_BLINK_TIMEOUT = "blink_timeout"; + public static final String KEY_CATEGORY_RADIO = "category_radio"; + public static final String KEY_HSPA = "hspa"; + + private ColorTuningPreference mColorTuning; + private GammaTuningPreference mGammaTuning; + private ListPreference mBacklightTimeout; + private ListPreference mBlinkTimeout; + private ListPreference mHspa; + private PreferenceCategory mHsapCategory; + private PreferenceScreen mPreferenceScreen; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.main); + + mColorTuning = (ColorTuningPreference) findPreference(KEY_COLOR_TUNING); + mColorTuning.setEnabled(ColorTuningPreference.isSupported()); + + mGammaTuning = (GammaTuningPreference) findPreference(KEY_GAMMA_TUNING); + mGammaTuning.setEnabled(ColorTuningPreference.isSupported()); + + mBacklightTimeout = (ListPreference) findPreference(KEY_BACKLIGHT_TIMEOUT); + mBacklightTimeout.setEnabled(TouchKeyBacklightTimeout.isSupported()); + mBacklightTimeout.setOnPreferenceChangeListener(new TouchKeyBacklightTimeout()); + + mBlinkTimeout = (ListPreference) findPreference(KEY_BLINK_TIMEOUT); + mBlinkTimeout.setEnabled(TouchKeyBacklightTimeout.isSupported()); + mBlinkTimeout.setOnPreferenceChangeListener(new TouchKeyBlinkTimeout()); + + mHspa = (ListPreference) findPreference(KEY_HSPA); + + if (Hspa.isSupported()) { + mHspa.setEnabled(true); + mHspa.setOnPreferenceChangeListener(new Hspa(this)); + } else { + mHsapCategory = (PreferenceCategory) findPreference(KEY_CATEGORY_RADIO); + mPreferenceScreen = getPreferenceScreen(); + + mHspa.setEnabled(false); + mHsapCategory.removePreference(mHspa); + mPreferenceScreen.removePreference(mHsapCategory); + } + } +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/GammaTuningPreference.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/GammaTuningPreference.java new file mode 100644 index 0000000..28edb8f --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/GammaTuningPreference.java @@ -0,0 +1,186 @@ +package com.cyanogenmod.CrespoParts; + +import android.content.Context; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.preference.DialogPreference; +import android.preference.PreferenceManager; +import android.util.AttributeSet; +import android.view.View; +import android.widget.SeekBar; +import android.widget.TextView; + +/** + * Special preference type that allows configuration of both the ring volume and + * notification volume. + */ +public class GammaTuningPreference extends DialogPreference { + + private static final String TAG = "GAMMA..."; + + enum Colors { + RED, + GREEN, + BLUE + }; + + private static final int[] SEEKBAR_ID = new int[] { + R.id.gamma_red_seekbar, + R.id.gamma_green_seekbar, + R.id.gamma_blue_seekbar + }; + + private static final int[] VALUE_DISPLAY_ID = new int[] { + R.id.gamma_red_value, + R.id.gamma_green_value, + R.id.gamma_blue_value + }; + + private static final String[] FILE_PATH = new String[] { + "/sys/class/misc/voodoo_color/red_v1_offset", + "/sys/class/misc/voodoo_color/green_v1_offset", + "/sys/class/misc/voodoo_color/blue_v1_offset" + }; + + private GammaSeekBar mSeekBars[] = new GammaSeekBar[3]; + + private static final int MAX_VALUE = 80; + + // Track instances to know when to restore original color + // (when the orientation changes, a new dialog is created before the old one is destroyed) + private static int sInstances = 0; + + public GammaTuningPreference(Context context, AttributeSet attrs) { + super(context, attrs); + + setDialogLayoutResource(R.layout.preference_dialog_gamma_tuning); + } + + @Override + protected void onBindDialogView(View view) { + super.onBindDialogView(view); + + sInstances++; + + for (int i = 0; i < SEEKBAR_ID.length; i++) { + SeekBar seekBar = (SeekBar) view.findViewById(SEEKBAR_ID[i]); + TextView valueDisplay = (TextView) view.findViewById(VALUE_DISPLAY_ID[i]); + mSeekBars[i] = new GammaSeekBar(seekBar, valueDisplay, FILE_PATH[i]); + } + } + + @Override + protected void onDialogClosed(boolean positiveResult) { + super.onDialogClosed(positiveResult); + + sInstances--; + + if (positiveResult) { + for (GammaSeekBar csb : mSeekBars) { + csb.save(); + } + } else if (sInstances == 0) { + for (GammaSeekBar csb : mSeekBars) { + csb.reset(); + } + } + } + + /** + * Restore screen color tuning from SharedPreferences. (Write to kernel.) + * @param context The context to read the SharedPreferences from + */ + public static void restore(Context context) { + if (!isSupported()) { + return; + } + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + for (String filePath : FILE_PATH) { + String sDefaultValue = Utils.readOneLine(filePath); + int iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue)); + Utils.writeValue(filePath, String.valueOf((long) iValue)); + } + } + + /** + * Check whether the running kernel supports color tuning or not. + * @return Whether color tuning is supported or not + */ + public static boolean isSupported() { + boolean supported = true; + for (String filePath : FILE_PATH) { + if (!Utils.fileExists(filePath)) { + supported = false; + } + } + + return supported; + } + + class GammaSeekBar implements SeekBar.OnSeekBarChangeListener { + + private String mFilePath; + private int mOriginal; + private SeekBar mSeekBar; + private TextView mValueDisplay; + + public GammaSeekBar(SeekBar seekBar, TextView valueDisplay, String filePath) { + mSeekBar = seekBar; + mValueDisplay = valueDisplay; + mFilePath = filePath; + + // Read original value + SharedPreferences sharedPreferences = getSharedPreferences(); + mOriginal = sharedPreferences.getInt(mFilePath, MAX_VALUE); + + seekBar.setMax(MAX_VALUE); + + reset(); + seekBar.setOnSeekBarChangeListener(this); + } + + public void reset() { + int iValue; + + iValue = mOriginal+60; + mSeekBar.setProgress(iValue); + updateValue(mOriginal); + } + + public void save() { + int iValue; + + iValue = mSeekBar.getProgress()-60; + Editor editor = getEditor(); + editor.putInt(mFilePath, iValue); + editor.commit(); + } + + @Override + public void onProgressChanged(SeekBar seekBar, int progress, + boolean fromUser) { + int iValue; + + iValue = progress-60; + Utils.writeValue(mFilePath, String.valueOf((long) iValue)); + updateValue(iValue); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + // Do nothing + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + // Do nothing + } + + private void updateValue(int progress) { + mValueDisplay.setText(String.format("%d",(int) progress )); + } + + } + +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/Hspa.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/Hspa.java new file mode 100644 index 0000000..5f85302 --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/Hspa.java @@ -0,0 +1,57 @@ +package com.cyanogenmod.CrespoParts; + +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.SystemProperties; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceManager; + +public class Hspa implements OnPreferenceChangeListener { + + private static final String APK_FILE = "/system/app/SamsungServiceMode.apk"; + private static final String HSPA_PROP = "ro.crespoparts.rild.hspa"; + private static final String HSPA_PROP_ENABLED = "1"; + + private Context mCtx; + + public Hspa(Context context) { + mCtx = context; + } + + public static boolean isSupported() { + String mHspa = SystemProperties.get(HSPA_PROP,"0"); + if (mHspa.equals(HSPA_PROP_ENABLED)) { + return true; + } else { + return false; + } + } + + /** + * Restore HSPA setting from SharedPreferences. (Write to kernel.) + * @param context The context to read the SharedPreferences from + */ + public static void restore(Context context) { + if (!isSupported()) { + return; + } + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + sendIntent(context, sharedPrefs.getString(CrespoParts.KEY_HSPA, "23")); + } + + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + sendIntent(mCtx, (String) newValue); + return true; + } + + private static void sendIntent(Context context, String value) { + Intent i = new Intent("com.cyanogenmod.SamsungServiceMode.EXECUTE"); + i.putExtra("sub_type", 20); // HSPA Setting + i.putExtra("data", value); + context.sendBroadcast(i); + } +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/Startup.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/Startup.java new file mode 100644 index 0000000..5cb715a --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/Startup.java @@ -0,0 +1,19 @@ +package com.cyanogenmod.CrespoParts; + +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) { + ColorTuningPreference.restore(context); + GammaTuningPreference.restore(context); + TouchKeyBacklightTimeout.restore(context); + WM8994ControlActivity.restore(context); + if (Hspa.isSupported()) { + Hspa.restore(context); + } + } +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBacklightTimeout.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBacklightTimeout.java new file mode 100644 index 0000000..c07f042 --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBacklightTimeout.java @@ -0,0 +1,36 @@ +package com.cyanogenmod.CrespoParts; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceManager; + +public class TouchKeyBacklightTimeout implements OnPreferenceChangeListener { + + private static final String FILE = "/sys/class/misc/notification/bl_timeout"; + + public static boolean isSupported() { + return Utils.fileExists(FILE); + } + + /** + * Restore backlight timeout setting from SharedPreferences. (Write to kernel.) + * @param context The context to read the SharedPreferences from + */ + public static void restore(Context context) { + if (!isSupported()) { + return; + } + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + Utils.writeValue(FILE, sharedPrefs.getString(CrespoParts.KEY_BACKLIGHT_TIMEOUT, "5")); + } + + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + Utils.writeValue(FILE, (String) newValue); + return true; + } + +} \ No newline at end of file diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBlinkTimeout.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBlinkTimeout.java new file mode 100644 index 0000000..3fdcf4d --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/TouchKeyBlinkTimeout.java @@ -0,0 +1,36 @@ +package com.cyanogenmod.CrespoParts; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceManager; + +public class TouchKeyBlinkTimeout implements OnPreferenceChangeListener { + + private static final String FILE = "/sys/class/misc/notification/blinktimeout"; + + public static boolean isSupported() { + return Utils.fileExists(FILE); + } + + /** + * Restore backlight timeout setting from SharedPreferences. (Write to kernel.) + * @param context The context to read the SharedPreferences from + */ + public static void restore(Context context) { + if (!isSupported()) { + return; + } + + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); + Utils.writeValue(FILE, sharedPrefs.getString(CrespoParts.KEY_BLINK_TIMEOUT, "5")); + } + + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + Utils.writeValue(FILE, (String) newValue); + return true; + } + +} \ No newline at end of file diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/Utils.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/Utils.java new file mode 100644 index 0000000..eb7dc57 --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/Utils.java @@ -0,0 +1,94 @@ +package com.cyanogenmod.CrespoParts; + +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 android.util.Log; + +public class Utils { + private static final String TAG = "CrespoParts_Utils"; + + /** + * Write a string value to the specified file. + * @param filename The filename + * @param value The value + */ + public static void writeValue(String filename, String value) { + try { + FileOutputStream fos = new FileOutputStream(new File(filename)); + fos.write(value.getBytes()); + fos.flush(); + fos.getFD().sync(); + fos.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Write a string value to the specified file. + * @param filename The filename + * @param value The value + */ + public static void writeValue(String filename, Boolean value) { + try { + String sEnvia; + FileOutputStream fos = new FileOutputStream(new File(filename)); + if(value) + sEnvia = "1"; + else + sEnvia = "0"; + fos.write(sEnvia.getBytes()); + fos.flush(); + fos.getFD().sync(); + fos.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 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(); + } + + // 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 { + brBuffer.close(); + } + } catch (Exception e) { + Log.e(TAG, "IO Exception when reading /sys/ file", e); + } + return sLine; + } +} diff --git a/CrespoParts/src/com/cyanogenmod/CrespoParts/WM8994ControlActivity.java b/CrespoParts/src/com/cyanogenmod/CrespoParts/WM8994ControlActivity.java new file mode 100644 index 0000000..cde224c --- /dev/null +++ b/CrespoParts/src/com/cyanogenmod/CrespoParts/WM8994ControlActivity.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2011 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.CrespoParts; + +import com.cyanogenmod.CrespoParts.R; + +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.CheckBoxPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceManager; +import android.preference.PreferenceScreen; +import android.util.Log; + +// WM8994 sound control stuff +public class WM8994ControlActivity extends PreferenceActivity /*implements + Preference.OnPreferenceChangeListener */{ + + public static final String aOptionControl[][] = { + {"/sys/class/misc/voodoo_sound_control/enable","pref_wm8994_control_enable"}, + {"/sys/class/misc/voodoo_sound/speaker_tuning","pref_wm8994_speaker_tuning"}, + {"/sys/class/misc/voodoo_sound/mono_downmix","pref_wm8994_mono_downmix"}, + {"/sys/class/misc/voodoo_sound/stereo_expansion","pref_wm8994_stereo_expansion"}, + {"/sys/class/misc/voodoo_sound/dac_direct","pref_wm8994_dac_direct"}, + {"/sys/class/misc/voodoo_sound/dac_osr128","pref_wm8994_dac_osr128"}, + {"/sys/class/misc/voodoo_sound/adc_osr128","pref_wm8994_adc_osr128"}, + {"/sys/class/misc/voodoo_sound/fll_tuning","pref_wm8994_fll_tuning"} + }; + private static final Integer iTotalOptions = aOptionControl.length; + private CheckBoxPreference cbpStatus[] = new CheckBoxPreference[iTotalOptions]; + + // Misc + private static final String PREF_ENABLED = "1"; + private static final String TAG = "CrespoParts_WM8994ControlSound"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setTitle(R.string.wm8994_settings_title_subhead); + addPreferencesFromResource(R.xml.wm8994_settings); + + PreferenceScreen prefSet = getPreferenceScreen(); + + // Set status value for all options created + Integer iPosition; + for(iPosition=0;iPosition * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +15,7 @@ * limitations under the License. */ +// #define LOG_NDEBUG 0 #define LOG_TAG "lights" #include #include @@ -29,13 +31,12 @@ static pthread_once_t g_init = PTHREAD_ONCE_INIT; static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; char const *const LCD_FILE = "/sys/class/backlight/s5p_bl/brightness"; +char const *const LED_FILE = "/sys/class/misc/notification/led"; static int write_int(char const *path, int value) { int fd; - static int already_warned; - - already_warned = 0; + static int already_warned = 0; LOGV("write_int: path %s, value %d", path, value); fd = open(path, O_RDWR); @@ -55,6 +56,32 @@ static int write_int(char const *path, int value) } } +static int read_int(char const *path) +{ + int fd; + static int already_warned = 0; + + LOGV("read_int: path %s", path); + fd = open(path, O_RDWR); + + if (fd >= 0) { + char cValor; + int amt = read(fd, &cValor, 1); + close(fd); + if (amt == -1 ) + return -errno; + else + return atoi(&cValor); + return amt == -1 ? -errno : 0; + } else { + if (already_warned == 0) { + LOGE("read_int failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } +} + static int rgb_to_brightness(struct light_state_t const *state) { int color = state->color & 0x00ffffff; @@ -63,6 +90,30 @@ static int rgb_to_brightness(struct light_state_t const *state) + (150*((color>>8) & 0x00ff)) + (29*(color & 0x00ff))) >> 8; } +static int set_light_notifications(struct light_device_t* dev, + struct light_state_t const* state) +{ + int brightness = rgb_to_brightness(state); + int v = 0; + int ret = 0; + int iAct; + + pthread_mutex_lock(&g_lock); + if (brightness+state->color == 0 || brightness > 100) { + if (state->color & 0x00ffffff) + v = 1; + } else + v = 0; + iAct = read_int(LED_FILE); + LOGI("color %u fm %u status %u is lit %u brightness iAct: %d", state->color, state->flashMode, v, (state->color & 0x00ffffff), brightness, iAct); + if ( iAct == 2 && v == 1 ) + v = 2; + ret = write_int(LED_FILE, v); + pthread_mutex_unlock(&g_lock); + + return ret; +} + static int set_light_backlight(struct light_device_t *dev, struct light_state_t const *state) { @@ -95,6 +146,8 @@ static int open_lights(const struct hw_module_t *module, char const *name, if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) set_light = set_light_backlight; + else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) + set_light = set_light_notifications; else return -EINVAL; diff --git a/overlay/packages/apps/CMParts/res/values/config.xml b/overlay/packages/apps/CMParts/res/values/config.xml new file mode 100644 index 0000000..4efc9ac --- /dev/null +++ b/overlay/packages/apps/CMParts/res/values/config.xml @@ -0,0 +1,10 @@ + + + + false + + + true + + true + diff --git a/overlay/packages/apps/Camera/res/values/config.xml b/overlay/packages/apps/Camera/res/values/config.xml new file mode 100644 index 0000000..4ae35ee --- /dev/null +++ b/overlay/packages/apps/Camera/res/values/config.xml @@ -0,0 +1,25 @@ + + + + + + + touch-focus + diff --git a/overlay/packages/apps/Torch/res/values/config.xml b/overlay/packages/apps/Torch/res/values/config.xml new file mode 100644 index 0000000..219163c --- /dev/null +++ b/overlay/packages/apps/Torch/res/values/config.xml @@ -0,0 +1,24 @@ + + + + + + true + diff --git a/scsi_wait_scan.ko b/scsi_wait_scan.ko index e2483da..e68d272 100644 Binary files a/scsi_wait_scan.ko and b/scsi_wait_scan.ko differ diff --git a/system.prop b/system.prop index a3e7507..e31d565 100644 --- a/system.prop +++ b/system.prop @@ -8,3 +8,6 @@ ro.sf.lcd_density=240 # Define to manage ril to manage modem answere when going from 2G to 3G ro.ril.ntmodeglobal=true + +# Define whether device has hspa +ro.crespoparts.rild.hspa=1 -- cgit v1.1