From 83ac03a566e30fd6fab4a332ae9db22e3b51fb6d Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 18 Feb 2012 19:15:26 +0100 Subject: shake it! --- BoardConfig.mk | 2 +- audio/Android.mk | 103 -- audio/AudioPolicyCompatClient.cpp | 142 -- audio/AudioPolicyCompatClient.h | 79 - audio/AudioPolicyInterface.h | 238 --- audio/AudioPolicyManagerBase.cpp | 2439 ----------------------------- audio/AudioPolicyManagerBase.h | 393 ----- audio/AudioPolicyManagerDefault.cpp | 34 - audio/AudioPolicyManagerDefault.h | 43 - audio/AudioSystem.h | 562 ------- audio/MODULE_LICENSE_APACHE2 | 0 audio/NOTICE | 190 --- audio/audio_policy_hal.cpp | 425 ----- configs/apns-conf.xml | 1331 ---------------- configs/apns.conf | 1330 ---------------- configs/asound.conf | 12 - configs/audio_effects.conf | 126 -- configs/gps.conf | 0 configs/gps.xml | 58 - configs/main.conf | 66 - configs/media_profiles.xml | 0 configs/nvram_mfg.txt | 112 ++ configs/nvram_net.txt | 94 +- configs/sec_touchscreen.idc | 56 - configs/sec_ts_ics_bio.idc | 56 - configs/secomxregistry | 0 configs/somxreg.conf | 0 configs/soundbooster.txt | 4 - configs/spn-conf.xml | 60 - configs/vold.fstab | 0 configs/wpa_supplicant.conf | 12 +- galaxynote.mk | 97 +- init.smdk4210.rc | 828 +++++----- init.smdk4210.usb.rc | 178 +-- init.smdkc210.rc | 2 - kernel | Bin 8387840 -> 0 bytes keylayout/AVRCP.kl | 10 - keylayout/Broadcom_Bluetooth_HID.kl | 114 -- keylayout/Vendor_04E8_Product_7021.kl | 141 -- keylayout/qwerty.kl | 91 -- keylayout/sec_e-pen.kl | 3 - keylayout/sec_jack.kl | 5 - keylayout/sec_key.kl | 11 - keylayout/sec_touchkey.kl | 3 - lpm.rc | 18 +- modules/Si4709_driver.ko | Bin 23496 -> 23360 bytes modules/dhd.ko | Bin 422788 -> 419768 bytes modules/j4fs.ko | Bin 47596 -> 47596 bytes modules/scsi_wait_scan.ko | Bin 1900 -> 1900 bytes recovery.fstab | 1 + recovery.rc | 49 +- system.prop | 2 +- ueventd.smdk4210.rc | 79 +- usr/idc/melfas_ts.idc | 24 + usr/idc/mxt224_ts_input.idc | 24 + usr/idc/qwerty.idc | 28 + usr/idc/qwerty2.idc | 28 + usr/idc/sec_touchscreen.idc | 56 + usr/keychars/Generic.kcm | 672 ++++++++ usr/keychars/Virtual.kcm | 544 +++++++ usr/keychars/qwerty.kcm | 508 ++++++ usr/keychars/qwerty2.kcm | 505 ++++++ usr/keylayout/AVRCP.kl | 23 + usr/keylayout/Generic.kl | 422 +++++ usr/keylayout/Vendor_045e_Product_028e.kl | 46 + usr/keylayout/Vendor_046d_Product_c216.kl | 37 + usr/keylayout/Vendor_046d_Product_c294.kl | 53 + usr/keylayout/Vendor_046d_Product_c299.kl | 62 + usr/keylayout/Vendor_046d_Product_c532.kl | 133 ++ usr/keylayout/Vendor_04e8_Product_7021.kl | 393 +++++ usr/keylayout/Vendor_054c_Product_0268.kl | 76 + usr/keylayout/Vendor_05ac_Product_0239.kl | 119 ++ usr/keylayout/Vendor_22b8_Product_093d.kl | 105 ++ usr/keylayout/gpio-keys.kl | 11 + usr/keylayout/max8997-muic.kl | 6 + usr/keylayout/melfas-touchkey.kl | 3 + usr/keylayout/qwerty.kl | 112 ++ usr/keylayout/samsung-keypad.kl | 10 + usr/keylayout/sec_key.kl | 11 + usr/keylayout/sec_touchkey.kl | 3 + usr/keylayout/sii9234_rcp.kl | 28 + vibrator/tspdrv.c | 116 -- vibrator/tspdrv.h | 30 - zImage | Bin 0 -> 4482408 bytes 84 files changed, 4790 insertions(+), 8997 deletions(-) delete mode 100755 audio/Android.mk delete mode 100755 audio/AudioPolicyCompatClient.cpp delete mode 100755 audio/AudioPolicyCompatClient.h delete mode 100755 audio/AudioPolicyInterface.h delete mode 100755 audio/AudioPolicyManagerBase.cpp delete mode 100755 audio/AudioPolicyManagerBase.h delete mode 100755 audio/AudioPolicyManagerDefault.cpp delete mode 100755 audio/AudioPolicyManagerDefault.h delete mode 100755 audio/AudioSystem.h delete mode 100755 audio/MODULE_LICENSE_APACHE2 delete mode 100755 audio/NOTICE delete mode 100755 audio/audio_policy_hal.cpp delete mode 100755 configs/apns-conf.xml delete mode 100755 configs/apns.conf mode change 100755 => 100644 configs/asound.conf delete mode 100755 configs/audio_effects.conf mode change 100755 => 100644 configs/gps.conf delete mode 100755 configs/gps.xml delete mode 100755 configs/main.conf mode change 100755 => 100644 configs/media_profiles.xml create mode 100644 configs/nvram_mfg.txt mode change 100755 => 100644 configs/nvram_net.txt delete mode 100755 configs/sec_touchscreen.idc delete mode 100755 configs/sec_ts_ics_bio.idc mode change 100755 => 100644 configs/secomxregistry mode change 100755 => 100644 configs/somxreg.conf delete mode 100755 configs/soundbooster.txt delete mode 100755 configs/spn-conf.xml mode change 100755 => 100644 configs/vold.fstab mode change 100755 => 100644 configs/wpa_supplicant.conf mode change 100755 => 100644 init.smdk4210.rc mode change 100755 => 100644 init.smdk4210.usb.rc delete mode 100755 init.smdkc210.rc delete mode 100755 kernel delete mode 100755 keylayout/AVRCP.kl delete mode 100755 keylayout/Broadcom_Bluetooth_HID.kl delete mode 100755 keylayout/Vendor_04E8_Product_7021.kl delete mode 100755 keylayout/qwerty.kl delete mode 100755 keylayout/sec_e-pen.kl delete mode 100755 keylayout/sec_jack.kl delete mode 100755 keylayout/sec_key.kl delete mode 100755 keylayout/sec_touchkey.kl mode change 100755 => 100644 lpm.rc mode change 100755 => 100644 modules/Si4709_driver.ko mode change 100755 => 100644 modules/dhd.ko mode change 100755 => 100644 modules/j4fs.ko mode change 100755 => 100644 modules/scsi_wait_scan.ko mode change 100755 => 100644 recovery.fstab mode change 100755 => 100644 recovery.rc mode change 100755 => 100644 system.prop mode change 100755 => 100644 ueventd.smdk4210.rc create mode 100644 usr/idc/melfas_ts.idc create mode 100644 usr/idc/mxt224_ts_input.idc create mode 100644 usr/idc/qwerty.idc create mode 100644 usr/idc/qwerty2.idc create mode 100644 usr/idc/sec_touchscreen.idc create mode 100644 usr/keychars/Generic.kcm create mode 100644 usr/keychars/Virtual.kcm create mode 100644 usr/keychars/qwerty.kcm create mode 100644 usr/keychars/qwerty2.kcm create mode 100644 usr/keylayout/AVRCP.kl create mode 100644 usr/keylayout/Generic.kl create mode 100644 usr/keylayout/Vendor_045e_Product_028e.kl create mode 100644 usr/keylayout/Vendor_046d_Product_c216.kl create mode 100644 usr/keylayout/Vendor_046d_Product_c294.kl create mode 100644 usr/keylayout/Vendor_046d_Product_c299.kl create mode 100644 usr/keylayout/Vendor_046d_Product_c532.kl create mode 100644 usr/keylayout/Vendor_04e8_Product_7021.kl create mode 100644 usr/keylayout/Vendor_054c_Product_0268.kl create mode 100644 usr/keylayout/Vendor_05ac_Product_0239.kl create mode 100644 usr/keylayout/Vendor_22b8_Product_093d.kl create mode 100644 usr/keylayout/gpio-keys.kl create mode 100644 usr/keylayout/max8997-muic.kl create mode 100644 usr/keylayout/melfas-touchkey.kl create mode 100644 usr/keylayout/qwerty.kl create mode 100644 usr/keylayout/samsung-keypad.kl create mode 100644 usr/keylayout/sec_key.kl create mode 100644 usr/keylayout/sec_touchkey.kl create mode 100644 usr/keylayout/sii9234_rcp.kl delete mode 100755 vibrator/tspdrv.c delete mode 100755 vibrator/tspdrv.h create mode 100755 zImage diff --git a/BoardConfig.mk b/BoardConfig.mk index 2536afe..268debc 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -51,7 +51,7 @@ BOARD_NAND_PAGE_SIZE := 4096 -s 128 BOARD_KERNEL_PAGESIZE := 4096 BOARD_KERNEL_BASE := 0x40000000 BOARD_KERNEL_CMDLINE := console=ttySAC2,115200 consoleblank=0 -TARGET_PREBUILT_KERNEL := device/samsung/galaxynote/kernel +TARGET_PREBUILT_KERNEL := device/samsung/galaxynote/zImage # Filesystem TARGET_USERIMAGES_USE_EXT4 := true diff --git a/audio/Android.mk b/audio/Android.mk deleted file mode 100755 index 5026c54..0000000 --- a/audio/Android.mk +++ /dev/null @@ -1,103 +0,0 @@ -# -# Copyright (C) 2011 The Android 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. - -ifeq ($(BOARD_USES_AUDIO_LEGACY),true) -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM) -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw -LOCAL_MODULE_TAGS := optional - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libutils \ - libmedia \ - libhardware_legacy - -LOCAL_SHARED_LIBRARIES += libdl - -LOCAL_SHARED_LIBRARIES += libaudio - -ifeq ($(BOARD_FORCE_STATIC_A2DP),true) - LOCAL_SHARED_LIBRARIES += liba2dp -endif - - -LOCAL_STATIC_LIBRARIES := \ - libmedia_helper - -LOCAL_WHOLE_STATIC_LIBRARIES := \ - libaudiohw_legacy - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - AudioPolicyManagerBase.cpp \ - AudioPolicyCompatClient.cpp \ - audio_policy_hal.cpp - -ifeq ($(AUDIO_POLICY_TEST),true) - LOCAL_CFLAGS += -DAUDIO_POLICY_TEST -endif - -ifeq ($(BOARD_HAVE_BLUETOOTH),true) - LOCAL_CFLAGS += -DWITH_A2DP -endif - -LOCAL_STATIC_LIBRARIES := libmedia_helper -LOCAL_MODULE := libaudiopolicy_legacy2 -LOCAL_MODULE_TAGS := optional - -include $(BUILD_STATIC_LIBRARY) - - -# The default audio policy, for now still implemented on top of legacy -# policy code -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - AudioPolicyManagerDefault.cpp - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libutils \ - libmedia - -LOCAL_STATIC_LIBRARIES := \ - libmedia_helper - -LOCAL_WHOLE_STATIC_LIBRARIES := \ - libaudiopolicy_legacy2 - -ifeq ($(BOARD_USES_AUDIO_LEGACY),true) -LOCAL_SHARED_LIBRARIES += libaudiopolicy -endif - -LOCAL_C_INCLUDES := $(LOCAL_PATH) -LOCAL_MODULE := audio_policy.$(TARGET_BOARD_PLATFORM) -LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw -LOCAL_MODULE_TAGS := optional - -ifeq ($(BOARD_HAVE_BLUETOOTH),true) - LOCAL_CFLAGS += -DWITH_A2DP -endif - -include $(BUILD_SHARED_LIBRARY) - -endif ## AUDIOPOLICY diff --git a/audio/AudioPolicyCompatClient.cpp b/audio/AudioPolicyCompatClient.cpp deleted file mode 100755 index 53ae657..0000000 --- a/audio/AudioPolicyCompatClient.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2011 The Android 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. - */ - -#define LOG_TAG "AudioPolicyCompatClient" -#define LOG_NDEBUG 0 - -#include - -#include -#include -#include -#include - -#include - -#include "AudioPolicyCompatClient.h" - -namespace android_audio_legacy { - -audio_io_handle_t AudioPolicyCompatClient::openOutput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t *pLatencyMs, - AudioSystem::output_flags flags) -{ - return mServiceOps->open_output(mService, pDevices, pSamplingRate, pFormat, - pChannels, pLatencyMs, - (audio_policy_output_flags_t)flags); -} - -audio_io_handle_t AudioPolicyCompatClient::openDuplicateOutput(audio_io_handle_t output1, - audio_io_handle_t output2) -{ - return mServiceOps->open_duplicate_output(mService, output1, output2); -} - -status_t AudioPolicyCompatClient::closeOutput(audio_io_handle_t output) -{ - return mServiceOps->close_output(mService, output); -} - -status_t AudioPolicyCompatClient::suspendOutput(audio_io_handle_t output) -{ - return mServiceOps->suspend_output(mService, output); -} - -status_t AudioPolicyCompatClient::restoreOutput(audio_io_handle_t output) -{ - return mServiceOps->restore_output(mService, output); -} - -audio_io_handle_t AudioPolicyCompatClient::openInput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t acoustics) -{ - return mServiceOps->open_input(mService, pDevices, pSamplingRate, pFormat, - pChannels, acoustics); -} - -status_t AudioPolicyCompatClient::closeInput(audio_io_handle_t input) -{ - return mServiceOps->close_input(mService, input); -} - -status_t AudioPolicyCompatClient::setStreamOutput(AudioSystem::stream_type stream, - audio_io_handle_t output) -{ - return mServiceOps->set_stream_output(mService, (audio_stream_type_t)stream, - output); -} - -status_t AudioPolicyCompatClient::moveEffects(int session, audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput) -{ - return mServiceOps->move_effects(mService, session, srcOutput, dstOutput); -} - -String8 AudioPolicyCompatClient::getParameters(audio_io_handle_t ioHandle, const String8& keys) -{ - char *str; - String8 out_str8; - - str = mServiceOps->get_parameters(mService, ioHandle, keys.string()); - out_str8 = String8(str); - free(str); - - return out_str8; -} - -void AudioPolicyCompatClient::setParameters(audio_io_handle_t ioHandle, - const String8& keyValuePairs, - int delayMs) -{ - mServiceOps->set_parameters(mService, ioHandle, keyValuePairs.string(), - delayMs); -} - -status_t AudioPolicyCompatClient::setStreamVolume( - AudioSystem::stream_type stream, - float volume, - audio_io_handle_t output, - int delayMs) -{ - return mServiceOps->set_stream_volume(mService, (audio_stream_type_t)stream, - volume, output, delayMs); -} - -status_t AudioPolicyCompatClient::startTone(ToneGenerator::tone_type tone, - AudioSystem::stream_type stream) -{ - return mServiceOps->start_tone(mService, - AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION, - (audio_stream_type_t)stream); -} - -status_t AudioPolicyCompatClient::stopTone() -{ - return mServiceOps->stop_tone(mService); -} - -status_t AudioPolicyCompatClient::setVoiceVolume(float volume, int delayMs) -{ - return mServiceOps->set_voice_volume(mService, volume, delayMs); -} - -}; // namespace android_audio_legacy diff --git a/audio/AudioPolicyCompatClient.h b/audio/AudioPolicyCompatClient.h deleted file mode 100755 index 4feee37..0000000 --- a/audio/AudioPolicyCompatClient.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2011 The Android 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. - */ - -#ifndef ANDROID_AUDIOPOLICYCLIENTLEGACY_H -#define ANDROID_AUDIOPOLICYCLIENTLEGACY_H - -#include -#include -#include - -#include -#include - -/************************************/ -/* FOR BACKWARDS COMPATIBILITY ONLY */ -/************************************/ -namespace android_audio_legacy { - -class AudioPolicyCompatClient : public AudioPolicyClientInterface { -public: - AudioPolicyCompatClient(struct audio_policy_service_ops *serviceOps, - void *service) : - mServiceOps(serviceOps) , mService(service) {} - - virtual audio_io_handle_t openOutput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t *pLatencyMs, - AudioSystem::output_flags flags); - virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, - audio_io_handle_t output2); - virtual status_t closeOutput(audio_io_handle_t output); - virtual status_t suspendOutput(audio_io_handle_t output); - virtual status_t restoreOutput(audio_io_handle_t output); - virtual audio_io_handle_t openInput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t acoustics); - virtual status_t closeInput(audio_io_handle_t input); - virtual status_t setStreamOutput(AudioSystem::stream_type stream, audio_io_handle_t output); - virtual status_t moveEffects(int session, - audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput); - - virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - virtual void setParameters(audio_io_handle_t ioHandle, - const String8& keyValuePairs, - int delayMs = 0); - virtual status_t setStreamVolume(AudioSystem::stream_type stream, - float volume, - audio_io_handle_t output, - int delayMs = 0); - virtual status_t startTone(ToneGenerator::tone_type tone, AudioSystem::stream_type stream); - virtual status_t stopTone(); - virtual status_t setVoiceVolume(float volume, int delayMs = 0); - -private: - struct audio_policy_service_ops* mServiceOps; - void* mService; -}; - -}; // namespace android_audio_legacy - -#endif // ANDROID_AUDIOPOLICYCLIENTLEGACY_H diff --git a/audio/AudioPolicyInterface.h b/audio/AudioPolicyInterface.h deleted file mode 100755 index 78f87da..0000000 --- a/audio/AudioPolicyInterface.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2009 The Android 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. - */ - -#ifndef ANDROID_AUDIOPOLICYINTERFACE_H -#define ANDROID_AUDIOPOLICYINTERFACE_H - -#include -#include -#include - -#include - -namespace android_audio_legacy { - using android::Vector; - using android::String8; - using android::ToneGenerator; - -// ---------------------------------------------------------------------------- - -// The AudioPolicyInterface and AudioPolicyClientInterface classes define the communication interfaces -// between the platform specific audio policy manager and Android generic audio policy manager. -// The platform specific audio policy manager must implement methods of the AudioPolicyInterface class. -// This implementation makes use of the AudioPolicyClientInterface to control the activity and -// configuration of audio input and output streams. -// -// The platform specific audio policy manager is in charge of the audio routing and volume control -// policies for a given platform. -// The main roles of this module are: -// - keep track of current system state (removable device connections, phone state, user requests...). -// System state changes and user actions are notified to audio policy manager with methods of the AudioPolicyInterface. -// - process getOutput() queries received when AudioTrack objects are created: Those queries -// return a handler on an output that has been selected, configured and opened by the audio policy manager and that -// must be used by the AudioTrack when registering to the AudioFlinger with the createTrack() method. -// When the AudioTrack object is released, a putOutput() query is received and the audio policy manager can decide -// to close or reconfigure the output depending on other streams using this output and current system state. -// - similarly process getInput() and putInput() queries received from AudioRecord objects and configure audio inputs. -// - process volume control requests: the stream volume is converted from an index value (received from UI) to a float value -// applicable to each output as a function of platform specific settings and current output route (destination device). It -// also make sure that streams are not muted if not allowed (e.g. camera shutter sound in some countries). -// -// The platform specific audio policy manager is provided as a shared library by platform vendors (as for libaudio.so) -// and is linked with libaudioflinger.so - - -// Audio Policy Manager Interface -class AudioPolicyInterface -{ - -public: - virtual ~AudioPolicyInterface() {} - // - // configuration functions - // - - // indicate a change in device connection status - virtual status_t setDeviceConnectionState(AudioSystem::audio_devices device, - AudioSystem::device_connection_state state, - const char *device_address) = 0; - // retreive a device connection status - virtual AudioSystem::device_connection_state getDeviceConnectionState(AudioSystem::audio_devices device, - const char *device_address) = 0; - // indicate a change in phone state. Valid phones states are defined by AudioSystem::audio_mode - virtual void setPhoneState(int state) = 0; - // indicate a change in ringer mode - virtual void setRingerMode(uint32_t mode, uint32_t mask) = 0; - // force using a specific device category for the specified usage - virtual void setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config) = 0; - // retreive current device category forced for a given usage - virtual AudioSystem::forced_config getForceUse(AudioSystem::force_use usage) = 0; - // set a system property (e.g. camera sound always audible) - virtual void setSystemProperty(const char* property, const char* value) = 0; - // check proper initialization - virtual status_t initCheck() = 0; - - // - // Audio routing query functions - // - - // request an output appriate for playback of the supplied stream type and parameters - virtual audio_io_handle_t getOutput(AudioSystem::stream_type stream, - uint32_t samplingRate = 0, - uint32_t format = AudioSystem::FORMAT_DEFAULT, - uint32_t channels = 0, - AudioSystem::output_flags flags = AudioSystem::OUTPUT_FLAG_INDIRECT) = 0; - // indicates to the audio policy manager that the output starts being used by corresponding stream. - virtual status_t startOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0) = 0; - // indicates to the audio policy manager that the output stops being used by corresponding stream. - virtual status_t stopOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0) = 0; - // releases the output. - virtual void releaseOutput(audio_io_handle_t output) = 0; - - // request an input appriate for record from the supplied device with supplied parameters. - virtual audio_io_handle_t getInput(int inputSource, - uint32_t samplingRate = 0, - uint32_t Format = AudioSystem::FORMAT_DEFAULT, - uint32_t channels = 0, - AudioSystem::audio_in_acoustics acoustics = (AudioSystem::audio_in_acoustics)0) = 0; - // indicates to the audio policy manager that the input starts being used. - virtual status_t startInput(audio_io_handle_t input) = 0; - // indicates to the audio policy manager that the input stops being used. - virtual status_t stopInput(audio_io_handle_t input) = 0; - // releases the input. - virtual void releaseInput(audio_io_handle_t input) = 0; - - // - // volume control functions - // - - // initialises stream volume conversion parameters by specifying volume index range. - virtual void initStreamVolume(AudioSystem::stream_type stream, - int indexMin, - int indexMax) = 0; - - // sets the new stream volume at a level corresponding to the supplied index - virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index) = 0; - // retreive current volume index for the specified stream - virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index) = 0; - - // return the strategy corresponding to a given stream type - virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream) = 0; - - // return the enabled output devices for the given stream type - virtual uint32_t getDevicesForStream(AudioSystem::stream_type stream) = 0; - - // Audio effect management - virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; - virtual status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) = 0; - virtual status_t unregisterEffect(int id) = 0; - - virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const = 0; - - //dump state - virtual status_t dump(int fd) = 0; -}; - - -// Audio Policy client Interface -class AudioPolicyClientInterface -{ -public: - virtual ~AudioPolicyClientInterface() {} - - // - // Audio output Control functions - // - - // opens an audio output with the requested parameters. The parameter values can indicate to use the default values - // in case the audio policy manager has no specific requirements for the output being opened. - // When the function returns, the parameter values reflect the actual values used by the audio hardware output stream. - // The audio policy manager can check if the proposed parameters are suitable or not and act accordingly. - virtual audio_io_handle_t openOutput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t *pLatencyMs, - AudioSystem::output_flags flags) = 0; - // creates a special output that is duplicated to the two outputs passed as arguments. The duplication is performed by - // a special mixer thread in the AudioFlinger. - virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, audio_io_handle_t output2) = 0; - // closes the output stream - virtual status_t closeOutput(audio_io_handle_t output) = 0; - // suspends the output. When an output is suspended, the corresponding audio hardware output stream is placed in - // standby and the AudioTracks attached to the mixer thread are still processed but the output mix is discarded. - virtual status_t suspendOutput(audio_io_handle_t output) = 0; - // restores a suspended output. - virtual status_t restoreOutput(audio_io_handle_t output) = 0; - - // - // Audio input Control functions - // - - // opens an audio input - virtual audio_io_handle_t openInput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t acoustics) = 0; - // closes an audio input - virtual status_t closeInput(audio_io_handle_t input) = 0; - // - // misc control functions - // - - // set a stream volume for a particular output. For the same user setting, a given stream type can have different volumes - // for each output (destination device) it is attached to. - virtual status_t setStreamVolume(AudioSystem::stream_type stream, float volume, audio_io_handle_t output, int delayMs = 0) = 0; - - // reroute a given stream type to the specified output - virtual status_t setStreamOutput(AudioSystem::stream_type stream, audio_io_handle_t output) = 0; - - // function enabling to send proprietary informations directly from audio policy manager to audio hardware interface. - virtual void setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs, int delayMs = 0) = 0; - // function enabling to receive proprietary informations directly from audio hardware interface to audio policy manager. - virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys) = 0; - - // request the playback of a tone on the specified stream: used for instance to replace notification sounds when playing - // over a telephony device during a phone call. - virtual status_t startTone(ToneGenerator::tone_type tone, AudioSystem::stream_type stream) = 0; - virtual status_t stopTone() = 0; - - // set down link audio volume. - virtual status_t setVoiceVolume(float volume, int delayMs = 0) = 0; - - // move effect to the specified output - virtual status_t moveEffects(int session, - audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput) = 0; - -}; - -extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface); -extern "C" void destroyAudioPolicyManager(AudioPolicyInterface *interface); - - -}; // namespace android - -#endif // ANDROID_AUDIOPOLICYINTERFACE_H diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp deleted file mode 100755 index 0c3c119..0000000 --- a/audio/AudioPolicyManagerBase.cpp +++ /dev/null @@ -1,2439 +0,0 @@ -/* - * Copyright (C) 2009 The Android 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. - */ - -#define LOG_TAG "AudioPolicyManagerBase" -#define LOG_NDEBUG 0 -#include -#include -#include -#include - -namespace android_audio_legacy { - -// ---------------------------------------------------------------------------- -// AudioPolicyInterface implementation -// ---------------------------------------------------------------------------- - - -status_t AudioPolicyManagerBase::setDeviceConnectionState(AudioSystem::audio_devices device, - AudioSystem::device_connection_state state, - const char *device_address) -{ - - LOGV("setDeviceConnectionState() device: %x, state %d, address %s", device, state, device_address); - - // connect/disconnect only 1 device at a time - if (AudioSystem::popCount(device) != 1) return BAD_VALUE; - - if (strlen(device_address) >= MAX_DEVICE_ADDRESS_LEN) { - LOGE("setDeviceConnectionState() invalid address: %s", device_address); - return BAD_VALUE; - } - - // handle output devices - if (AudioSystem::isOutputDevice(device)) { - -#ifndef WITH_A2DP - if (AudioSystem::isA2dpDevice(device)) { - LOGE("setDeviceConnectionState() invalid device: %x", device); - return BAD_VALUE; - } -#endif - - switch (state) - { - // handle output device connection - case AudioSystem::DEVICE_STATE_AVAILABLE: - if (mAvailableOutputDevices & device) { - LOGW("setDeviceConnectionState() device already connected: %x", device); - return INVALID_OPERATION; - } - LOGV("setDeviceConnectionState() connecting device %x", device); - - // register new device as available - mAvailableOutputDevices |= device; - -#ifdef WITH_A2DP - // handle A2DP device connection - if (AudioSystem::isA2dpDevice(device)) { - status_t status = handleA2dpConnection(device, device_address); - if (status != NO_ERROR) { - mAvailableOutputDevices &= ~device; - return status; - } - } else -#endif - { - if (AudioSystem::isBluetoothScoDevice(device)) { - LOGV("setDeviceConnectionState() BT SCO device, address %s", device_address); - // keep track of SCO device address - mScoDeviceAddress = String8(device_address, MAX_DEVICE_ADDRESS_LEN); - } - } - break; - // handle output device disconnection - case AudioSystem::DEVICE_STATE_UNAVAILABLE: { - if (!(mAvailableOutputDevices & device)) { - LOGW("setDeviceConnectionState() device not connected: %x", device); - return INVALID_OPERATION; - } - - - LOGV("setDeviceConnectionState() disconnecting device %x", device); - // remove device from available output devices - mAvailableOutputDevices &= ~device; - -#ifdef WITH_A2DP - // handle A2DP device disconnection - if (AudioSystem::isA2dpDevice(device)) { - status_t status = handleA2dpDisconnection(device, device_address); - if (status != NO_ERROR) { - mAvailableOutputDevices |= device; - return status; - } - } else -#endif - { - if (AudioSystem::isBluetoothScoDevice(device)) { - mScoDeviceAddress = ""; - } - } - } break; - - default: - LOGE("setDeviceConnectionState() invalid state: %x", state); - return BAD_VALUE; - } - - // request routing change if necessary - uint32_t newDevice = getNewDevice(mHardwareOutput, false); -#ifdef WITH_A2DP - checkA2dpSuspend(); - checkOutputForAllStrategies(); - // A2DP outputs must be closed after checkOutputForAllStrategies() is executed - if (state == AudioSystem::DEVICE_STATE_UNAVAILABLE && AudioSystem::isA2dpDevice(device)) { - closeA2dpOutputs(); - } -#endif - updateDeviceForStrategy(); - setOutputDevice(mHardwareOutput, newDevice); - - if (device == AudioSystem::DEVICE_OUT_WIRED_HEADSET) { - device = AudioSystem::DEVICE_IN_WIRED_HEADSET; - } else if (device == AudioSystem::DEVICE_OUT_BLUETOOTH_SCO || - device == AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET || - device == AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT) { - device = AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET; - } else { - return NO_ERROR; - } - } - // handle input devices - if (AudioSystem::isInputDevice(device)) { - - switch (state) - { - // handle input device connection - case AudioSystem::DEVICE_STATE_AVAILABLE: { - if (mAvailableInputDevices & device) { - LOGW("setDeviceConnectionState() device already connected: %d", device); - return INVALID_OPERATION; - } - mAvailableInputDevices |= device; - } - break; - - // handle input device disconnection - case AudioSystem::DEVICE_STATE_UNAVAILABLE: { - if (!(mAvailableInputDevices & device)) { - LOGW("setDeviceConnectionState() device not connected: %d", device); - return INVALID_OPERATION; - } - mAvailableInputDevices &= ~device; - } break; - - default: - LOGE("setDeviceConnectionState() invalid state: %x", state); - return BAD_VALUE; - } - - audio_io_handle_t activeInput = getActiveInput(); - if (activeInput != 0) { - AudioInputDescriptor *inputDesc = mInputs.valueFor(activeInput); - uint32_t newDevice = getDeviceForInputSource(inputDesc->mInputSource); - if (newDevice != inputDesc->mDevice) { - LOGV("setDeviceConnectionState() changing device from %x to %x for input %d", - inputDesc->mDevice, newDevice, activeInput); - inputDesc->mDevice = newDevice; - AudioParameter param = AudioParameter(); - param.addInt(String8(AudioParameter::keyRouting), (int)newDevice); - mpClientInterface->setParameters(activeInput, param.toString()); - } - } - - return NO_ERROR; - } - - LOGW("setDeviceConnectionState() invalid device: %x", device); - return BAD_VALUE; -} - -AudioSystem::device_connection_state AudioPolicyManagerBase::getDeviceConnectionState(AudioSystem::audio_devices device, - const char *device_address) -{ - AudioSystem::device_connection_state state = AudioSystem::DEVICE_STATE_UNAVAILABLE; - String8 address = String8(device_address); - if (AudioSystem::isOutputDevice(device)) { - if (device & mAvailableOutputDevices) { -#ifdef WITH_A2DP - if (AudioSystem::isA2dpDevice(device) && - address != "" && mA2dpDeviceAddress != address) { - return state; - } -#endif - if (AudioSystem::isBluetoothScoDevice(device) && - address != "" && mScoDeviceAddress != address) { - return state; - } - state = AudioSystem::DEVICE_STATE_AVAILABLE; - } - } else if (AudioSystem::isInputDevice(device)) { - if (device & mAvailableInputDevices) { - state = AudioSystem::DEVICE_STATE_AVAILABLE; - } - } - - return state; -} - -void AudioPolicyManagerBase::setPhoneState(int state) -{ - LOGV("setPhoneState() state %d", state); - uint32_t newDevice = 0; - if (state < 0 || state >= AudioSystem::NUM_MODES) { - LOGW("setPhoneState() invalid state %d", state); - return; - } - - if (state == mPhoneState ) { - LOGW("setPhoneState() setting same state %d", state); - return; - } - - // if leaving call state, handle special case of active streams - // pertaining to sonification strategy see handleIncallSonification() - if (isInCall()) { - LOGV("setPhoneState() in call state management: new state is %d", state); - for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { - handleIncallSonification(stream, false, true); - } - } - - // store previous phone state for management of sonification strategy below - int oldState = mPhoneState; - mPhoneState = state; - bool force = false; - - // are we entering or starting a call - if (!isStateInCall(oldState) && isStateInCall(state)) { - LOGV(" Entering call in setPhoneState()"); - // force routing command to audio hardware when starting a call - // even if no device change is needed - force = true; - } else if (isStateInCall(oldState) && !isStateInCall(state)) { - LOGV(" Exiting call in setPhoneState()"); - // force routing command to audio hardware when exiting a call - // even if no device change is needed - force = true; - } else if (isStateInCall(state) && (state != oldState)) { - LOGV(" Switching between telephony and VoIP in setPhoneState()"); - // force routing command to audio hardware when switching between telephony and VoIP - // even if no device change is needed - force = true; - } - - // check for device and output changes triggered by new phone state - newDevice = getNewDevice(mHardwareOutput, false); -#ifdef WITH_A2DP - checkA2dpSuspend(); - checkOutputForAllStrategies(); -#endif - updateDeviceForStrategy(); - - AudioOutputDescriptor *hwOutputDesc = mOutputs.valueFor(mHardwareOutput); - - // force routing command to audio hardware when ending call - // even if no device change is needed - if (isStateInCall(oldState) && newDevice == 0) { - newDevice = hwOutputDesc->device(); - } - - // when changing from ring tone to in call mode, mute the ringing tone - // immediately and delay the route change to avoid sending the ring tone - // tail into the earpiece or headset. - int delayMs = 0; - if (isStateInCall(state) && oldState == AudioSystem::MODE_RINGTONE) { - // delay the device change command by twice the output latency to have some margin - // and be sure that audio buffers not yet affected by the mute are out when - // we actually apply the route change - delayMs = hwOutputDesc->mLatency*2; - setStreamMute(AudioSystem::RING, true, mHardwareOutput); - } - - // change routing is necessary - setOutputDevice(mHardwareOutput, newDevice, force, delayMs); - - // if entering in call state, handle special case of active streams - // pertaining to sonification strategy see handleIncallSonification() - if (isStateInCall(state)) { - LOGV("setPhoneState() in call state management: new state is %d", state); - // unmute the ringing tone after a sufficient delay if it was muted before - // setting output device above - if (oldState == AudioSystem::MODE_RINGTONE) { - setStreamMute(AudioSystem::RING, false, mHardwareOutput, MUTE_TIME_MS); - } - for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { - handleIncallSonification(stream, true, true); - } - } - - // Flag that ringtone volume must be limited to music volume until we exit MODE_RINGTONE - if (state == AudioSystem::MODE_RINGTONE && - isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY)) { - mLimitRingtoneVolume = true; - } else { - mLimitRingtoneVolume = false; - } -} - -void AudioPolicyManagerBase::setRingerMode(uint32_t mode, uint32_t mask) -{ - LOGV("setRingerMode() mode %x, mask %x", mode, mask); - - mRingerMode = mode; -} - -void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config) -{ - LOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState); - - bool forceVolumeReeval = false; - switch(usage) { - case AudioSystem::FOR_COMMUNICATION: - if (config != AudioSystem::FORCE_SPEAKER && config != AudioSystem::FORCE_BT_SCO && - config != AudioSystem::FORCE_NONE) { - LOGW("setForceUse() invalid config %d for FOR_COMMUNICATION", config); - return; - } - forceVolumeReeval = true; - mForceUse[usage] = config; - break; - case AudioSystem::FOR_MEDIA: - if (config != AudioSystem::FORCE_HEADPHONES && config != AudioSystem::FORCE_BT_A2DP && - config != AudioSystem::FORCE_WIRED_ACCESSORY && - config != AudioSystem::FORCE_ANALOG_DOCK && - config != AudioSystem::FORCE_DIGITAL_DOCK && config != AudioSystem::FORCE_NONE) { - LOGW("setForceUse() invalid config %d for FOR_MEDIA", config); - return; - } - mForceUse[usage] = config; - break; - case AudioSystem::FOR_RECORD: - if (config != AudioSystem::FORCE_BT_SCO && config != AudioSystem::FORCE_WIRED_ACCESSORY && - config != AudioSystem::FORCE_NONE) { - LOGW("setForceUse() invalid config %d for FOR_RECORD", config); - return; - } - mForceUse[usage] = config; - break; - case AudioSystem::FOR_DOCK: - if (config != AudioSystem::FORCE_NONE && config != AudioSystem::FORCE_BT_CAR_DOCK && - config != AudioSystem::FORCE_BT_DESK_DOCK && - config != AudioSystem::FORCE_WIRED_ACCESSORY && - config != AudioSystem::FORCE_ANALOG_DOCK && - config != AudioSystem::FORCE_DIGITAL_DOCK) { - LOGW("setForceUse() invalid config %d for FOR_DOCK", config); - } - forceVolumeReeval = true; - mForceUse[usage] = config; - break; - default: - LOGW("setForceUse() invalid usage %d", usage); - break; - } - - // check for device and output changes triggered by new phone state - uint32_t newDevice = getNewDevice(mHardwareOutput, false); -#ifdef WITH_A2DP - checkA2dpSuspend(); - checkOutputForAllStrategies(); -#endif - updateDeviceForStrategy(); - setOutputDevice(mHardwareOutput, newDevice); - if (forceVolumeReeval) { - applyStreamVolumes(mHardwareOutput, newDevice, 0, true); - } - - audio_io_handle_t activeInput = getActiveInput(); - if (activeInput != 0) { - AudioInputDescriptor *inputDesc = mInputs.valueFor(activeInput); - newDevice = getDeviceForInputSource(inputDesc->mInputSource); - if (newDevice != inputDesc->mDevice) { - LOGV("setForceUse() changing device from %x to %x for input %d", - inputDesc->mDevice, newDevice, activeInput); - inputDesc->mDevice = newDevice; - AudioParameter param = AudioParameter(); - param.addInt(String8(AudioParameter::keyRouting), (int)newDevice); - mpClientInterface->setParameters(activeInput, param.toString()); - } - } - -} - -AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::force_use usage) -{ - return mForceUse[usage]; -} - -void AudioPolicyManagerBase::setSystemProperty(const char* property, const char* value) -{ - LOGV("setSystemProperty() property %s, value %s", property, value); - if (strcmp(property, "ro.camera.sound.forced") == 0) { - if (atoi(value)) { - LOGV("ENFORCED_AUDIBLE cannot be muted"); - mStreams[AudioSystem::ENFORCED_AUDIBLE].mCanBeMuted = false; - } else { - LOGV("ENFORCED_AUDIBLE can be muted"); - mStreams[AudioSystem::ENFORCED_AUDIBLE].mCanBeMuted = true; - } - } -} - -audio_io_handle_t AudioPolicyManagerBase::getOutput(AudioSystem::stream_type stream, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - AudioSystem::output_flags flags) -{ - audio_io_handle_t output = 0; - uint32_t latency = 0; - routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream); - uint32_t device = getDeviceForStrategy(strategy); - LOGV("getOutput() stream %d, samplingRate %d, format %d, channels %x, flags %x", stream, samplingRate, format, channels, flags); - -#ifdef AUDIO_POLICY_TEST - if (mCurOutput != 0) { - LOGV("getOutput() test output mCurOutput %d, samplingRate %d, format %d, channels %x, mDirectOutput %d", - mCurOutput, mTestSamplingRate, mTestFormat, mTestChannels, mDirectOutput); - - if (mTestOutputs[mCurOutput] == 0) { - LOGV("getOutput() opening test output"); - AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); - outputDesc->mDevice = mTestDevice; - outputDesc->mSamplingRate = mTestSamplingRate; - outputDesc->mFormat = mTestFormat; - outputDesc->mChannels = mTestChannels; - outputDesc->mLatency = mTestLatencyMs; - outputDesc->mFlags = (AudioSystem::output_flags)(mDirectOutput ? AudioSystem::OUTPUT_FLAG_DIRECT : 0); - outputDesc->mRefCount[stream] = 0; - mTestOutputs[mCurOutput] = mpClientInterface->openOutput(&outputDesc->mDevice, - &outputDesc->mSamplingRate, - &outputDesc->mFormat, - &outputDesc->mChannels, - &outputDesc->mLatency, - outputDesc->mFlags); - if (mTestOutputs[mCurOutput]) { - AudioParameter outputCmd = AudioParameter(); - outputCmd.addInt(String8("set_id"),mCurOutput); - mpClientInterface->setParameters(mTestOutputs[mCurOutput],outputCmd.toString()); - addOutput(mTestOutputs[mCurOutput], outputDesc); - } - } - return mTestOutputs[mCurOutput]; - } -#endif //AUDIO_POLICY_TEST - - // open a direct output if required by specified parameters - if (needsDirectOuput(stream, samplingRate, format, channels, flags, device)) { - - LOGV("getOutput() opening direct output device %x", device); - AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); - outputDesc->mDevice = device; - outputDesc->mSamplingRate = samplingRate; - outputDesc->mFormat = format; - outputDesc->mChannels = channels; - outputDesc->mLatency = 0; - outputDesc->mFlags = (AudioSystem::output_flags)(flags | AudioSystem::OUTPUT_FLAG_DIRECT); - outputDesc->mRefCount[stream] = 0; - outputDesc->mStopTime[stream] = 0; - output = mpClientInterface->openOutput(&outputDesc->mDevice, - &outputDesc->mSamplingRate, - &outputDesc->mFormat, - &outputDesc->mChannels, - &outputDesc->mLatency, - outputDesc->mFlags); - - // only accept an output with the requeted parameters - if (output == 0 || - (samplingRate != 0 && samplingRate != outputDesc->mSamplingRate) || - (format != 0 && format != outputDesc->mFormat) || - (channels != 0 && channels != outputDesc->mChannels)) { - LOGV("getOutput() failed opening direct output: samplingRate %d, format %d, channels %d", - samplingRate, format, channels); - if (output != 0) { - mpClientInterface->closeOutput(output); - } - delete outputDesc; - return 0; - } - addOutput(output, outputDesc); - return output; - } - - if (channels != 0 && channels != AudioSystem::CHANNEL_OUT_MONO && - channels != AudioSystem::CHANNEL_OUT_STEREO) { - return 0; - } - // open a non direct output - - // get which output is suitable for the specified stream. The actual routing change will happen - // when startOutput() will be called - uint32_t a2dpDevice = device & AudioSystem::DEVICE_OUT_ALL_A2DP; - if (AudioSystem::popCount((AudioSystem::audio_devices)device) == 2) { -#ifdef WITH_A2DP - if (a2dpUsedForSonification() && a2dpDevice != 0) { - // if playing on 2 devices among which one is A2DP, use duplicated output - LOGV("getOutput() using duplicated output"); - LOGW_IF((mA2dpOutput == 0), "getOutput() A2DP device in multiple %x selected but A2DP output not opened", device); - output = mDuplicatedOutput; - } else -#endif - { - // if playing on 2 devices among which none is A2DP, use hardware output - output = mHardwareOutput; - } - LOGV("getOutput() using output %d for 2 devices %x", output, device); - } else { -#ifdef WITH_A2DP - if (a2dpDevice != 0) { - // if playing on A2DP device, use a2dp output - LOGW_IF((mA2dpOutput == 0), "getOutput() A2DP device %x selected but A2DP output not opened", device); - output = mA2dpOutput; - } else -#endif - { - // if playing on not A2DP device, use hardware output - output = mHardwareOutput; - } - } - - - LOGW_IF((output ==0), "getOutput() could not find output for stream %d, samplingRate %d, format %d, channels %x, flags %x", - stream, samplingRate, format, channels, flags); - - return output; -} - -status_t AudioPolicyManagerBase::startOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session) -{ - LOGV("startOutput() output %d, stream %d, session %d", output, stream, session); - ssize_t index = mOutputs.indexOfKey(output); - if (index < 0) { - LOGW("startOutput() unknow output %d", output); - return BAD_VALUE; - } - - AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index); - routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream); - -#ifdef WITH_A2DP - if (mA2dpOutput != 0 && !a2dpUsedForSonification() && - (strategy == STRATEGY_SONIFICATION || strategy == STRATEGY_ENFORCED_AUDIBLE)) { - setStrategyMute(STRATEGY_MEDIA, true, mA2dpOutput); - } -#endif - - // incremenent usage count for this stream on the requested output: - // NOTE that the usage count is the same for duplicated output and hardware output which is - // necassary for a correct control of hardware output routing by startOutput() and stopOutput() - outputDesc->changeRefCount(stream, 1); - - uint32_t prevDevice = outputDesc->mDevice; - setOutputDevice(output, getNewDevice(output)); - - // handle special case for sonification while in call - if (isInCall()) { - handleIncallSonification(stream, true, false); - } - - // apply volume rules for current stream and device if necessary - checkAndSetVolume(stream, mStreams[stream].mIndexCur, output, outputDesc->device()); - - // FIXME: need a delay to make sure that audio path switches to speaker before sound - // starts. Should be platform specific? - if (stream == AudioSystem::ENFORCED_AUDIBLE && - prevDevice != outputDesc->mDevice) { - usleep(outputDesc->mLatency*4*1000); - } - - return NO_ERROR; -} - -status_t AudioPolicyManagerBase::stopOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session) -{ - LOGV("stopOutput() output %d, stream %d, session %d", output, stream, session); - ssize_t index = mOutputs.indexOfKey(output); - if (index < 0) { - LOGW("stopOutput() unknow output %d", output); - return BAD_VALUE; - } - - AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index); - routing_strategy strategy = getStrategy((AudioSystem::stream_type)stream); - - // handle special case for sonification while in call - if (isInCall()) { - handleIncallSonification(stream, false, false); - } - - if (outputDesc->mRefCount[stream] > 0) { - // decrement usage count of this stream on the output - outputDesc->changeRefCount(stream, -1); - // store time at which the stream was stopped - see isStreamActive() - outputDesc->mStopTime[stream] = systemTime(); - - setOutputDevice(output, getNewDevice(output), false, outputDesc->mLatency*2); - -#ifdef WITH_A2DP - if (mA2dpOutput != 0 && !a2dpUsedForSonification() && - (strategy == STRATEGY_SONIFICATION || strategy == STRATEGY_ENFORCED_AUDIBLE)) { - setStrategyMute(STRATEGY_MEDIA, - false, - mA2dpOutput, - mOutputs.valueFor(mHardwareOutput)->mLatency*2); - } -#endif - if (output != mHardwareOutput) { - setOutputDevice(mHardwareOutput, getNewDevice(mHardwareOutput), true); - } - return NO_ERROR; - } else { - LOGW("stopOutput() refcount is already 0 for output %d", output); - return INVALID_OPERATION; - } -} - -void AudioPolicyManagerBase::releaseOutput(audio_io_handle_t output) -{ - LOGV("releaseOutput() %d", output); - ssize_t index = mOutputs.indexOfKey(output); - if (index < 0) { - LOGW("releaseOutput() releasing unknown output %d", output); - return; - } - -#ifdef AUDIO_POLICY_TEST - int testIndex = testOutputIndex(output); - if (testIndex != 0) { - AudioOutputDescriptor *outputDesc = mOutputs.valueAt(index); - if (outputDesc->refCount() == 0) { - mpClientInterface->closeOutput(output); - delete mOutputs.valueAt(index); - mOutputs.removeItem(output); - mTestOutputs[testIndex] = 0; - } - return; - } -#endif //AUDIO_POLICY_TEST - - if (mOutputs.valueAt(index)->mFlags & AudioSystem::OUTPUT_FLAG_DIRECT) { - mpClientInterface->closeOutput(output); - delete mOutputs.valueAt(index); - mOutputs.removeItem(output); - } -} - -audio_io_handle_t AudioPolicyManagerBase::getInput(int inputSource, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - AudioSystem::audio_in_acoustics acoustics) -{ - audio_io_handle_t input = 0; - uint32_t device = getDeviceForInputSource(inputSource); - - LOGV("getInput() inputSource %d, samplingRate %d, format %d, channels %x, acoustics %x", inputSource, samplingRate, format, channels, acoustics); - - if (device == 0) { - return 0; - } - - // adapt channel selection to input source - switch(inputSource) { - case AUDIO_SOURCE_VOICE_UPLINK: - channels = AudioSystem::CHANNEL_IN_VOICE_UPLINK; - break; - case AUDIO_SOURCE_VOICE_DOWNLINK: - channels = AudioSystem::CHANNEL_IN_VOICE_DNLINK; - break; - case AUDIO_SOURCE_VOICE_CALL: - channels = (AudioSystem::CHANNEL_IN_VOICE_UPLINK | AudioSystem::CHANNEL_IN_VOICE_DNLINK); - break; - default: - break; - } - - AudioInputDescriptor *inputDesc = new AudioInputDescriptor(); - - inputDesc->mInputSource = inputSource; - inputDesc->mDevice = device; - inputDesc->mSamplingRate = samplingRate; - inputDesc->mFormat = format; - inputDesc->mChannels = channels; - inputDesc->mAcoustics = acoustics; - inputDesc->mRefCount = 0; - input = mpClientInterface->openInput(&inputDesc->mDevice, - &inputDesc->mSamplingRate, - &inputDesc->mFormat, - &inputDesc->mChannels, - inputDesc->mAcoustics); - - // only accept input with the exact requested set of parameters - if (input == 0 || - (samplingRate != inputDesc->mSamplingRate) || - (format != inputDesc->mFormat) || - (channels != inputDesc->mChannels)) { - LOGV("getInput() failed opening input: samplingRate %d, format %d, channels %d", - samplingRate, format, channels); - if (input != 0) { - mpClientInterface->closeInput(input); - } - delete inputDesc; - return 0; - } - mInputs.add(input, inputDesc); - return input; -} - -status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) -{ - LOGV("startInput() input %d", input); - ssize_t index = mInputs.indexOfKey(input); - if (index < 0) { - LOGW("startInput() bad bad bad. unknow input %d", input); - return BAD_VALUE; - } - AudioInputDescriptor *inputDesc = mInputs.valueAt(index); - -#ifdef AUDIO_POLICY_TEST - if (mTestInput == 0) -#endif //AUDIO_POLICY_TEST - { - // refuse 2 active AudioRecord clients at the same time - if (getActiveInput() != 0) { - LOGW("startInput() input %d failed: other input already started", input); - return INVALID_OPERATION; - } - } - - AudioParameter param = AudioParameter(); - param.addInt(String8(AudioParameter::keyRouting), (int)inputDesc->mDevice); - - param.addInt(String8(AudioParameter::keyInputSource), (int)inputDesc->mInputSource); - LOGV("AudioPolicyManager::startInput() input source = %d", inputDesc->mInputSource); - - mpClientInterface->setParameters(input, param.toString()); - - inputDesc->mRefCount = 1; - return NO_ERROR; -} - -status_t AudioPolicyManagerBase::stopInput(audio_io_handle_t input) -{ - LOGV("stopInput() input %d", input); - ssize_t index = mInputs.indexOfKey(input); - if (index < 0) { - LOGW("stopInput() unknow input %d", input); - return BAD_VALUE; - } - AudioInputDescriptor *inputDesc = mInputs.valueAt(index); - - if (inputDesc->mRefCount == 0) { - LOGW("stopInput() input %d already stopped", input); - return INVALID_OPERATION; - } else { - AudioParameter param = AudioParameter(); - param.addInt(String8(AudioParameter::keyRouting), 0); - mpClientInterface->setParameters(input, param.toString()); - inputDesc->mRefCount = 0; - return NO_ERROR; - } -} - -void AudioPolicyManagerBase::releaseInput(audio_io_handle_t input) -{ - LOGV("releaseInput() %d", input); - ssize_t index = mInputs.indexOfKey(input); - if (index < 0) { - LOGW("releaseInput() releasing unknown input %d", input); - return; - } - mpClientInterface->closeInput(input); - delete mInputs.valueAt(index); - mInputs.removeItem(input); - LOGV("releaseInput() exit"); -} - -void AudioPolicyManagerBase::initStreamVolume(AudioSystem::stream_type stream, - int indexMin, - int indexMax) -{ - LOGV("initStreamVolume() stream %d, min %d, max %d", stream , indexMin, indexMax); - if (indexMin < 0 || indexMin >= indexMax) { - LOGW("initStreamVolume() invalid index limits for stream %d, min %d, max %d", stream , indexMin, indexMax); - return; - } - mStreams[stream].mIndexMin = indexMin; - mStreams[stream].mIndexMax = indexMax; -} - -status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type stream, int index) -{ - - if ((index < mStreams[stream].mIndexMin) || (index > mStreams[stream].mIndexMax)) { - return BAD_VALUE; - } - - // Force max volume if stream cannot be muted - if (!mStreams[stream].mCanBeMuted) index = mStreams[stream].mIndexMax; - - LOGV("setStreamVolumeIndex() stream %d, index %d", stream, index); - mStreams[stream].mIndexCur = index; - - // compute and apply stream volume on all outputs according to connected device - status_t status = NO_ERROR; - for (size_t i = 0; i < mOutputs.size(); i++) { - status_t volStatus = checkAndSetVolume(stream, index, mOutputs.keyAt(i), mOutputs.valueAt(i)->device()); - if (volStatus != NO_ERROR) { - status = volStatus; - } - } - return status; -} - -status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type stream, int *index) -{ - if (index == 0) { - return BAD_VALUE; - } - LOGV("getStreamVolumeIndex() stream %d", stream); - *index = mStreams[stream].mIndexCur; - return NO_ERROR; -} - -audio_io_handle_t AudioPolicyManagerBase::getOutputForEffect(effect_descriptor_t *desc) -{ - LOGV("getOutputForEffect()"); - // apply simple rule where global effects are attached to the same output as MUSIC streams - return getOutput(AudioSystem::MUSIC); -} - -status_t AudioPolicyManagerBase::registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) -{ - ssize_t index = mOutputs.indexOfKey(io); - if (index < 0) { - index = mInputs.indexOfKey(io); - if (index < 0) { - LOGW("registerEffect() unknown io %d", io); - return INVALID_OPERATION; - } - } - - if (mTotalEffectsMemory + desc->memoryUsage > getMaxEffectsMemory()) { - LOGW("registerEffect() memory limit exceeded for Fx %s, Memory %d KB", - desc->name, desc->memoryUsage); - return INVALID_OPERATION; - } - mTotalEffectsMemory += desc->memoryUsage; - LOGV("registerEffect() effect %s, io %d, strategy %d session %d id %d", - desc->name, io, strategy, session, id); - LOGV("registerEffect() memory %d, total memory %d", desc->memoryUsage, mTotalEffectsMemory); - - EffectDescriptor *pDesc = new EffectDescriptor(); - memcpy (&pDesc->mDesc, desc, sizeof(effect_descriptor_t)); - pDesc->mIo = io; - pDesc->mStrategy = (routing_strategy)strategy; - pDesc->mSession = session; - pDesc->mEnabled = false; - - mEffects.add(id, pDesc); - - return NO_ERROR; -} - -status_t AudioPolicyManagerBase::unregisterEffect(int id) -{ - ssize_t index = mEffects.indexOfKey(id); - if (index < 0) { - LOGW("unregisterEffect() unknown effect ID %d", id); - return INVALID_OPERATION; - } - - EffectDescriptor *pDesc = mEffects.valueAt(index); - - setEffectEnabled(pDesc, false); - - if (mTotalEffectsMemory < pDesc->mDesc.memoryUsage) { - LOGW("unregisterEffect() memory %d too big for total %d", - pDesc->mDesc.memoryUsage, mTotalEffectsMemory); - pDesc->mDesc.memoryUsage = mTotalEffectsMemory; - } - mTotalEffectsMemory -= pDesc->mDesc.memoryUsage; - LOGV("unregisterEffect() effect %s, ID %d, memory %d total memory %d", - pDesc->mDesc.name, id, pDesc->mDesc.memoryUsage, mTotalEffectsMemory); - - mEffects.removeItem(id); - delete pDesc; - - return NO_ERROR; -} - -status_t AudioPolicyManagerBase::setEffectEnabled(int id, bool enabled) -{ - ssize_t index = mEffects.indexOfKey(id); - if (index < 0) { - LOGW("unregisterEffect() unknown effect ID %d", id); - return INVALID_OPERATION; - } - - return setEffectEnabled(mEffects.valueAt(index), enabled); -} - -status_t AudioPolicyManagerBase::setEffectEnabled(EffectDescriptor *pDesc, bool enabled) -{ - if (enabled == pDesc->mEnabled) { - LOGV("setEffectEnabled(%s) effect already %s", - enabled?"true":"false", enabled?"enabled":"disabled"); - return INVALID_OPERATION; - } - - if (enabled) { - if (mTotalEffectsCpuLoad + pDesc->mDesc.cpuLoad > getMaxEffectsCpuLoad()) { - LOGW("setEffectEnabled(true) CPU Load limit exceeded for Fx %s, CPU %f MIPS", - pDesc->mDesc.name, (float)pDesc->mDesc.cpuLoad/10); - return INVALID_OPERATION; - } - mTotalEffectsCpuLoad += pDesc->mDesc.cpuLoad; - LOGV("setEffectEnabled(true) total CPU %d", mTotalEffectsCpuLoad); - } else { - if (mTotalEffectsCpuLoad < pDesc->mDesc.cpuLoad) { - LOGW("setEffectEnabled(false) CPU load %d too high for total %d", - pDesc->mDesc.cpuLoad, mTotalEffectsCpuLoad); - pDesc->mDesc.cpuLoad = mTotalEffectsCpuLoad; - } - mTotalEffectsCpuLoad -= pDesc->mDesc.cpuLoad; - LOGV("setEffectEnabled(false) total CPU %d", mTotalEffectsCpuLoad); - } - pDesc->mEnabled = enabled; - return NO_ERROR; -} - -bool AudioPolicyManagerBase::isStreamActive(int stream, uint32_t inPastMs) const -{ - nsecs_t sysTime = systemTime(); - for (size_t i = 0; i < mOutputs.size(); i++) { - if (mOutputs.valueAt(i)->mRefCount[stream] != 0 || - ns2ms(sysTime - mOutputs.valueAt(i)->mStopTime[stream]) < inPastMs) { - return true; - } - } - return false; -} - - -status_t AudioPolicyManagerBase::dump(int fd) -{ - const size_t SIZE = 256; - char buffer[SIZE]; - String8 result; - - snprintf(buffer, SIZE, "\nAudioPolicyManager Dump: %p\n", this); - result.append(buffer); - snprintf(buffer, SIZE, " Hardware Output: %d\n", mHardwareOutput); - result.append(buffer); -#ifdef WITH_A2DP - snprintf(buffer, SIZE, " A2DP Output: %d\n", mA2dpOutput); - result.append(buffer); - snprintf(buffer, SIZE, " Duplicated Output: %d\n", mDuplicatedOutput); - result.append(buffer); - snprintf(buffer, SIZE, " A2DP device address: %s\n", mA2dpDeviceAddress.string()); - result.append(buffer); -#endif - snprintf(buffer, SIZE, " SCO device address: %s\n", mScoDeviceAddress.string()); - result.append(buffer); - snprintf(buffer, SIZE, " Output devices: %08x\n", mAvailableOutputDevices); - result.append(buffer); - snprintf(buffer, SIZE, " Input devices: %08x\n", mAvailableInputDevices); - result.append(buffer); - snprintf(buffer, SIZE, " Phone state: %d\n", mPhoneState); - result.append(buffer); - snprintf(buffer, SIZE, " Ringer mode: %d\n", mRingerMode); - result.append(buffer); - snprintf(buffer, SIZE, " Force use for communications %d\n", mForceUse[AudioSystem::FOR_COMMUNICATION]); - result.append(buffer); - snprintf(buffer, SIZE, " Force use for media %d\n", mForceUse[AudioSystem::FOR_MEDIA]); - result.append(buffer); - snprintf(buffer, SIZE, " Force use for record %d\n", mForceUse[AudioSystem::FOR_RECORD]); - result.append(buffer); - snprintf(buffer, SIZE, " Force use for dock %d\n", mForceUse[AudioSystem::FOR_DOCK]); - result.append(buffer); - write(fd, result.string(), result.size()); - - snprintf(buffer, SIZE, "\nOutputs dump:\n"); - write(fd, buffer, strlen(buffer)); - for (size_t i = 0; i < mOutputs.size(); i++) { - snprintf(buffer, SIZE, "- Output %d dump:\n", mOutputs.keyAt(i)); - write(fd, buffer, strlen(buffer)); - mOutputs.valueAt(i)->dump(fd); - } - - snprintf(buffer, SIZE, "\nInputs dump:\n"); - write(fd, buffer, strlen(buffer)); - for (size_t i = 0; i < mInputs.size(); i++) { - snprintf(buffer, SIZE, "- Input %d dump:\n", mInputs.keyAt(i)); - write(fd, buffer, strlen(buffer)); - mInputs.valueAt(i)->dump(fd); - } - - snprintf(buffer, SIZE, "\nStreams dump:\n"); - write(fd, buffer, strlen(buffer)); - snprintf(buffer, SIZE, " Stream Index Min Index Max Index Cur Can be muted\n"); - write(fd, buffer, strlen(buffer)); - for (size_t i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) { - snprintf(buffer, SIZE, " %02d", i); - mStreams[i].dump(buffer + 3, SIZE); - write(fd, buffer, strlen(buffer)); - } - - snprintf(buffer, SIZE, "\nTotal Effects CPU: %f MIPS, Total Effects memory: %d KB\n", - (float)mTotalEffectsCpuLoad/10, mTotalEffectsMemory); - write(fd, buffer, strlen(buffer)); - - snprintf(buffer, SIZE, "Registered effects:\n"); - write(fd, buffer, strlen(buffer)); - for (size_t i = 0; i < mEffects.size(); i++) { - snprintf(buffer, SIZE, "- Effect %d dump:\n", mEffects.keyAt(i)); - write(fd, buffer, strlen(buffer)); - mEffects.valueAt(i)->dump(fd); - } - - - return NO_ERROR; -} - -// ---------------------------------------------------------------------------- -// AudioPolicyManagerBase -// ---------------------------------------------------------------------------- - -AudioPolicyManagerBase::AudioPolicyManagerBase(AudioPolicyClientInterface *clientInterface) - : -#ifdef AUDIO_POLICY_TEST - Thread(false), -#endif //AUDIO_POLICY_TEST - mPhoneState(AudioSystem::MODE_NORMAL), mRingerMode(0), - mLimitRingtoneVolume(false), mLastVoiceVolume(-1.0f), - mTotalEffectsCpuLoad(0), mTotalEffectsMemory(0), - mA2dpSuspended(false) -{ - mpClientInterface = clientInterface; - - for (int i = 0; i < AudioSystem::NUM_FORCE_USE; i++) { - mForceUse[i] = AudioSystem::FORCE_NONE; - } - - initializeVolumeCurves(); - - // devices available by default are speaker, ear piece and microphone - mAvailableOutputDevices = AudioSystem::DEVICE_OUT_EARPIECE | - AudioSystem::DEVICE_OUT_SPEAKER; - mAvailableInputDevices = AudioSystem::DEVICE_IN_BUILTIN_MIC; - -#ifdef WITH_A2DP - mA2dpOutput = 0; - mDuplicatedOutput = 0; - mA2dpDeviceAddress = String8(""); -#endif - mScoDeviceAddress = String8(""); - - // open hardware output - AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); - outputDesc->mDevice = (uint32_t)AudioSystem::DEVICE_OUT_SPEAKER; - mHardwareOutput = mpClientInterface->openOutput(&outputDesc->mDevice, - &outputDesc->mSamplingRate, - &outputDesc->mFormat, - &outputDesc->mChannels, - &outputDesc->mLatency, - outputDesc->mFlags); - - if (mHardwareOutput == 0) { - LOGE("Failed to initialize hardware output stream, samplingRate: %d, format %d, channels %d", - outputDesc->mSamplingRate, outputDesc->mFormat, outputDesc->mChannels); - } else { - addOutput(mHardwareOutput, outputDesc); - setOutputDevice(mHardwareOutput, (uint32_t)AudioSystem::DEVICE_OUT_SPEAKER, true); - //TODO: configure audio effect output stage here - } - - updateDeviceForStrategy(); -#ifdef AUDIO_POLICY_TEST - if (mHardwareOutput != 0) { - AudioParameter outputCmd = AudioParameter(); - outputCmd.addInt(String8("set_id"), 0); - mpClientInterface->setParameters(mHardwareOutput, outputCmd.toString()); - - mTestDevice = AudioSystem::DEVICE_OUT_SPEAKER; - mTestSamplingRate = 44100; - mTestFormat = AudioSystem::PCM_16_BIT; - mTestChannels = AudioSystem::CHANNEL_OUT_STEREO; - mTestLatencyMs = 0; - mCurOutput = 0; - mDirectOutput = false; - for (int i = 0; i < NUM_TEST_OUTPUTS; i++) { - mTestOutputs[i] = 0; - } - - const size_t SIZE = 256; - char buffer[SIZE]; - snprintf(buffer, SIZE, "AudioPolicyManagerTest"); - run(buffer, ANDROID_PRIORITY_AUDIO); - } -#endif //AUDIO_POLICY_TEST -} - -AudioPolicyManagerBase::~AudioPolicyManagerBase() -{ -#ifdef AUDIO_POLICY_TEST - exit(); -#endif //AUDIO_POLICY_TEST - for (size_t i = 0; i < mOutputs.size(); i++) { - mpClientInterface->closeOutput(mOutputs.keyAt(i)); - delete mOutputs.valueAt(i); - } - mOutputs.clear(); - for (size_t i = 0; i < mInputs.size(); i++) { - mpClientInterface->closeInput(mInputs.keyAt(i)); - delete mInputs.valueAt(i); - } - mInputs.clear(); -} - -status_t AudioPolicyManagerBase::initCheck() -{ - return (mHardwareOutput == 0) ? NO_INIT : NO_ERROR; -} - -#ifdef AUDIO_POLICY_TEST -bool AudioPolicyManagerBase::threadLoop() -{ - LOGV("entering threadLoop()"); - while (!exitPending()) - { - String8 command; - int valueInt; - String8 value; - - Mutex::Autolock _l(mLock); - mWaitWorkCV.waitRelative(mLock, milliseconds(50)); - - command = mpClientInterface->getParameters(0, String8("test_cmd_policy")); - AudioParameter param = AudioParameter(command); - - if (param.getInt(String8("test_cmd_policy"), valueInt) == NO_ERROR && - valueInt != 0) { - LOGV("Test command %s received", command.string()); - String8 target; - if (param.get(String8("target"), target) != NO_ERROR) { - target = "Manager"; - } - if (param.getInt(String8("test_cmd_policy_output"), valueInt) == NO_ERROR) { - param.remove(String8("test_cmd_policy_output")); - mCurOutput = valueInt; - } - if (param.get(String8("test_cmd_policy_direct"), value) == NO_ERROR) { - param.remove(String8("test_cmd_policy_direct")); - if (value == "false") { - mDirectOutput = false; - } else if (value == "true") { - mDirectOutput = true; - } - } - if (param.getInt(String8("test_cmd_policy_input"), valueInt) == NO_ERROR) { - param.remove(String8("test_cmd_policy_input")); - mTestInput = valueInt; - } - - if (param.get(String8("test_cmd_policy_format"), value) == NO_ERROR) { - param.remove(String8("test_cmd_policy_format")); - int format = AudioSystem::INVALID_FORMAT; - if (value == "PCM 16 bits") { - format = AudioSystem::PCM_16_BIT; - } else if (value == "PCM 8 bits") { - format = AudioSystem::PCM_8_BIT; - } else if (value == "Compressed MP3") { - format = AudioSystem::MP3; - } - if (format != AudioSystem::INVALID_FORMAT) { - if (target == "Manager") { - mTestFormat = format; - } else if (mTestOutputs[mCurOutput] != 0) { - AudioParameter outputParam = AudioParameter(); - outputParam.addInt(String8("format"), format); - mpClientInterface->setParameters(mTestOutputs[mCurOutput], outputParam.toString()); - } - } - } - if (param.get(String8("test_cmd_policy_channels"), value) == NO_ERROR) { - param.remove(String8("test_cmd_policy_channels")); - int channels = 0; - - if (value == "Channels Stereo") { - channels = AudioSystem::CHANNEL_OUT_STEREO; - } else if (value == "Channels Mono") { - channels = AudioSystem::CHANNEL_OUT_MONO; - } - if (channels != 0) { - if (target == "Manager") { - mTestChannels = channels; - } else if (mTestOutputs[mCurOutput] != 0) { - AudioParameter outputParam = AudioParameter(); - outputParam.addInt(String8("channels"), channels); - mpClientInterface->setParameters(mTestOutputs[mCurOutput], outputParam.toString()); - } - } - } - if (param.getInt(String8("test_cmd_policy_sampleRate"), valueInt) == NO_ERROR) { - param.remove(String8("test_cmd_policy_sampleRate")); - if (valueInt >= 0 && valueInt <= 96000) { - int samplingRate = valueInt; - if (target == "Manager") { - mTestSamplingRate = samplingRate; - } else if (mTestOutputs[mCurOutput] != 0) { - AudioParameter outputParam = AudioParameter(); - outputParam.addInt(String8("sampling_rate"), samplingRate); - mpClientInterface->setParameters(mTestOutputs[mCurOutput], outputParam.toString()); - } - } - } - - if (param.get(String8("test_cmd_policy_reopen"), value) == NO_ERROR) { - param.remove(String8("test_cmd_policy_reopen")); - - mpClientInterface->closeOutput(mHardwareOutput); - delete mOutputs.valueFor(mHardwareOutput); - mOutputs.removeItem(mHardwareOutput); - - AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); - outputDesc->mDevice = (uint32_t)AudioSystem::DEVICE_OUT_SPEAKER; - mHardwareOutput = mpClientInterface->openOutput(&outputDesc->mDevice, - &outputDesc->mSamplingRate, - &outputDesc->mFormat, - &outputDesc->mChannels, - &outputDesc->mLatency, - outputDesc->mFlags); - if (mHardwareOutput == 0) { - LOGE("Failed to reopen hardware output stream, samplingRate: %d, format %d, channels %d", - outputDesc->mSamplingRate, outputDesc->mFormat, outputDesc->mChannels); - } else { - AudioParameter outputCmd = AudioParameter(); - outputCmd.addInt(String8("set_id"), 0); - mpClientInterface->setParameters(mHardwareOutput, outputCmd.toString()); - addOutput(mHardwareOutput, outputDesc); - } - } - - - mpClientInterface->setParameters(0, String8("test_cmd_policy=")); - } - } - return false; -} - -void AudioPolicyManagerBase::exit() -{ - { - AutoMutex _l(mLock); - requestExit(); - mWaitWorkCV.signal(); - } - requestExitAndWait(); -} - -int AudioPolicyManagerBase::testOutputIndex(audio_io_handle_t output) -{ - for (int i = 0; i < NUM_TEST_OUTPUTS; i++) { - if (output == mTestOutputs[i]) return i; - } - return 0; -} -#endif //AUDIO_POLICY_TEST - -// --- - -void AudioPolicyManagerBase::addOutput(audio_io_handle_t id, AudioOutputDescriptor *outputDesc) -{ - outputDesc->mId = id; - mOutputs.add(id, outputDesc); -} - - -#ifdef WITH_A2DP -status_t AudioPolicyManagerBase::handleA2dpConnection(AudioSystem::audio_devices device, - const char *device_address) -{ - // when an A2DP device is connected, open an A2DP and a duplicated output - LOGV("opening A2DP output for device %s", device_address); - AudioOutputDescriptor *outputDesc = new AudioOutputDescriptor(); - outputDesc->mDevice = device; - mA2dpOutput = mpClientInterface->openOutput(&outputDesc->mDevice, - &outputDesc->mSamplingRate, - &outputDesc->mFormat, - &outputDesc->mChannels, - &outputDesc->mLatency, - outputDesc->mFlags); - if (mA2dpOutput) { - // add A2DP output descriptor - addOutput(mA2dpOutput, outputDesc); - - //TODO: configure audio effect output stage here - - // set initial stream volume for A2DP device - applyStreamVolumes(mA2dpOutput, device); - if (a2dpUsedForSonification()) { - mDuplicatedOutput = mpClientInterface->openDuplicateOutput(mA2dpOutput, mHardwareOutput); - } - if (mDuplicatedOutput != 0 || - !a2dpUsedForSonification()) { - // If both A2DP and duplicated outputs are open, send device address to A2DP hardware - // interface - AudioParameter param; - param.add(String8("a2dp_sink_address"), String8(device_address)); - mpClientInterface->setParameters(mA2dpOutput, param.toString()); - mA2dpDeviceAddress = String8(device_address, MAX_DEVICE_ADDRESS_LEN); - - if (a2dpUsedForSonification()) { - // add duplicated output descriptor - AudioOutputDescriptor *dupOutputDesc = new AudioOutputDescriptor(); - dupOutputDesc->mOutput1 = mOutputs.valueFor(mHardwareOutput); - dupOutputDesc->mOutput2 = mOutputs.valueFor(mA2dpOutput); - dupOutputDesc->mSamplingRate = outputDesc->mSamplingRate; - dupOutputDesc->mFormat = outputDesc->mFormat; - dupOutputDesc->mChannels = outputDesc->mChannels; - dupOutputDesc->mLatency = outputDesc->mLatency; - addOutput(mDuplicatedOutput, dupOutputDesc); - applyStreamVolumes(mDuplicatedOutput, device); - } - } else { - LOGW("getOutput() could not open duplicated output for %d and %d", - mHardwareOutput, mA2dpOutput); - mpClientInterface->closeOutput(mA2dpOutput); - mOutputs.removeItem(mA2dpOutput); - mA2dpOutput = 0; - delete outputDesc; - return NO_INIT; - } - } else { - LOGW("setDeviceConnectionState() could not open A2DP output for device %x", device); - delete outputDesc; - return NO_INIT; - } - AudioOutputDescriptor *hwOutputDesc = mOutputs.valueFor(mHardwareOutput); - - if (!a2dpUsedForSonification()) { - // mute music on A2DP output if a notification or ringtone is playing - uint32_t refCount = hwOutputDesc->strategyRefCount(STRATEGY_SONIFICATION); - refCount += hwOutputDesc->strategyRefCount(STRATEGY_ENFORCED_AUDIBLE); - for (uint32_t i = 0; i < refCount; i++) { - setStrategyMute(STRATEGY_MEDIA, true, mA2dpOutput); - } - } - - mA2dpSuspended = false; - - return NO_ERROR; -} - -status_t AudioPolicyManagerBase::handleA2dpDisconnection(AudioSystem::audio_devices device, - const char *device_address) -{ - if (mA2dpOutput == 0) { - LOGW("setDeviceConnectionState() disconnecting A2DP and no A2DP output!"); - return INVALID_OPERATION; - } - - if (mA2dpDeviceAddress != device_address) { - LOGW("setDeviceConnectionState() disconnecting unknow A2DP sink address %s", device_address); - return INVALID_OPERATION; - } - - // mute media strategy to avoid outputting sound on hardware output while music stream - // is switched from A2DP output and before music is paused by music application - setStrategyMute(STRATEGY_MEDIA, true, mHardwareOutput); - setStrategyMute(STRATEGY_MEDIA, false, mHardwareOutput, MUTE_TIME_MS); - - if (!a2dpUsedForSonification()) { - // unmute music on A2DP output if a notification or ringtone is playing - uint32_t refCount = mOutputs.valueFor(mHardwareOutput)->strategyRefCount(STRATEGY_SONIFICATION); - refCount += mOutputs.valueFor(mHardwareOutput)->strategyRefCount(STRATEGY_ENFORCED_AUDIBLE); - for (uint32_t i = 0; i < refCount; i++) { - setStrategyMute(STRATEGY_MEDIA, false, mA2dpOutput); - } - } - mA2dpDeviceAddress = ""; - mA2dpSuspended = false; - return NO_ERROR; -} - -void AudioPolicyManagerBase::closeA2dpOutputs() -{ - - LOGV("setDeviceConnectionState() closing A2DP and duplicated output!"); - - if (mDuplicatedOutput != 0) { - AudioOutputDescriptor *dupOutputDesc = mOutputs.valueFor(mDuplicatedOutput); - AudioOutputDescriptor *hwOutputDesc = mOutputs.valueFor(mHardwareOutput); - // As all active tracks on duplicated output will be deleted, - // and as they were also referenced on hardware output, the reference - // count for their stream type must be adjusted accordingly on - // hardware output. - for (int i = 0; i < (int)AudioSystem::NUM_STREAM_TYPES; i++) { - int refCount = dupOutputDesc->mRefCount[i]; - hwOutputDesc->changeRefCount((AudioSystem::stream_type)i,-refCount); - } - - mpClientInterface->closeOutput(mDuplicatedOutput); - delete mOutputs.valueFor(mDuplicatedOutput); - mOutputs.removeItem(mDuplicatedOutput); - mDuplicatedOutput = 0; - } - if (mA2dpOutput != 0) { - AudioParameter param; - param.add(String8("closing"), String8("true")); - mpClientInterface->setParameters(mA2dpOutput, param.toString()); - - mpClientInterface->closeOutput(mA2dpOutput); - delete mOutputs.valueFor(mA2dpOutput); - mOutputs.removeItem(mA2dpOutput); - mA2dpOutput = 0; - } -} - -void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy) -{ - uint32_t prevDevice = getDeviceForStrategy(strategy); - uint32_t curDevice = getDeviceForStrategy(strategy, false); - bool a2dpWasUsed = AudioSystem::isA2dpDevice((AudioSystem::audio_devices)(prevDevice & ~AudioSystem::DEVICE_OUT_SPEAKER)); - bool a2dpIsUsed = AudioSystem::isA2dpDevice((AudioSystem::audio_devices)(curDevice & ~AudioSystem::DEVICE_OUT_SPEAKER)); - audio_io_handle_t srcOutput = 0; - audio_io_handle_t dstOutput = 0; - - if (a2dpWasUsed && !a2dpIsUsed) { - bool dupUsed = a2dpUsedForSonification() && a2dpWasUsed && (AudioSystem::popCount(prevDevice) == 2); - dstOutput = mHardwareOutput; - if (dupUsed) { - LOGV("checkOutputForStrategy() moving strategy %d from duplicated", strategy); - srcOutput = mDuplicatedOutput; - } else { - LOGV("checkOutputForStrategy() moving strategy %d from a2dp", strategy); - srcOutput = mA2dpOutput; - } - } - if (a2dpIsUsed && !a2dpWasUsed) { - bool dupUsed = a2dpUsedForSonification() && a2dpIsUsed && (AudioSystem::popCount(curDevice) == 2); - srcOutput = mHardwareOutput; - if (dupUsed) { - LOGV("checkOutputForStrategy() moving strategy %d to duplicated", strategy); - dstOutput = mDuplicatedOutput; - } else { - LOGV("checkOutputForStrategy() moving strategy %d to a2dp", strategy); - dstOutput = mA2dpOutput; - } - } - - if (srcOutput != 0 && dstOutput != 0) { - // Move effects associated to this strategy from previous output to new output - for (size_t i = 0; i < mEffects.size(); i++) { - EffectDescriptor *desc = mEffects.valueAt(i); - if (desc->mSession != AudioSystem::SESSION_OUTPUT_STAGE && - desc->mStrategy == strategy && - desc->mIo == srcOutput) { - LOGV("checkOutputForStrategy() moving effect %d to output %d", mEffects.keyAt(i), dstOutput); - mpClientInterface->moveEffects(desc->mSession, srcOutput, dstOutput); - desc->mIo = dstOutput; - } - } - // Move tracks associated to this strategy from previous output to new output - for (int i = 0; i < (int)AudioSystem::NUM_STREAM_TYPES; i++) { - if (getStrategy((AudioSystem::stream_type)i) == strategy) { - mpClientInterface->setStreamOutput((AudioSystem::stream_type)i, dstOutput); - } - } - } -} - -void AudioPolicyManagerBase::checkOutputForAllStrategies() -{ - checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE); - checkOutputForStrategy(STRATEGY_PHONE); - checkOutputForStrategy(STRATEGY_SONIFICATION); - checkOutputForStrategy(STRATEGY_MEDIA); - checkOutputForStrategy(STRATEGY_DTMF); -} - -void AudioPolicyManagerBase::checkA2dpSuspend() -{ - // suspend A2DP output if: - // (NOT already suspended) && - // ((SCO device is connected && - // (forced usage for communication || for record is SCO))) || - // (phone state is ringing || in call) - // - // restore A2DP output if: - // (Already suspended) && - // ((SCO device is NOT connected || - // (forced usage NOT for communication && NOT for record is SCO))) && - // (phone state is NOT ringing && NOT in call) - // - if (mA2dpOutput == 0) { - return; - } - - if (mA2dpSuspended) { - if (((mScoDeviceAddress == "") || - ((mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO) && - (mForceUse[AudioSystem::FOR_RECORD] != AudioSystem::FORCE_BT_SCO))) && - ((mPhoneState != AudioSystem::MODE_IN_CALL) && - (mPhoneState != AudioSystem::MODE_RINGTONE))) { - - mpClientInterface->restoreOutput(mA2dpOutput); - mA2dpSuspended = false; - } - } else { - if (((mScoDeviceAddress != "") && - ((mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) || - (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO))) || - ((mPhoneState == AudioSystem::MODE_IN_CALL) || - (mPhoneState == AudioSystem::MODE_RINGTONE))) { - - mpClientInterface->suspendOutput(mA2dpOutput); - mA2dpSuspended = true; - } - } -} - - -#endif - -uint32_t AudioPolicyManagerBase::getNewDevice(audio_io_handle_t output, bool fromCache) -{ - uint32_t device = 0; - - AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); - // check the following by order of priority to request a routing change if necessary: - // 1: the strategy enforced audible is active on the output: - // use device for strategy enforced audible - // 2: we are in call or the strategy phone is active on the output: - // use device for strategy phone - // 3: the strategy sonification is active on the output: - // use device for strategy sonification - // 4: the strategy media is active on the output: - // use device for strategy media - // 5: the strategy DTMF is active on the output: - // use device for strategy DTMF - if (outputDesc->isUsedByStrategy(STRATEGY_ENFORCED_AUDIBLE)) { - device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache); - } else if (isInCall() || - outputDesc->isUsedByStrategy(STRATEGY_PHONE)) { - device = getDeviceForStrategy(STRATEGY_PHONE, fromCache); - } else if (outputDesc->isUsedByStrategy(STRATEGY_SONIFICATION)) { - device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache); - } else if (outputDesc->isUsedByStrategy(STRATEGY_MEDIA)) { - device = getDeviceForStrategy(STRATEGY_MEDIA, fromCache); - } else if (outputDesc->isUsedByStrategy(STRATEGY_DTMF)) { - device = getDeviceForStrategy(STRATEGY_DTMF, fromCache); - } - - LOGV("getNewDevice() selected device %x", device); - return device; -} - -uint32_t AudioPolicyManagerBase::getStrategyForStream(AudioSystem::stream_type stream) { - return (uint32_t)getStrategy(stream); -} - -uint32_t AudioPolicyManagerBase::getDevicesForStream(AudioSystem::stream_type stream) { - uint32_t devices; - // By checking the range of stream before calling getStrategy, we avoid - // getStrategy's behavior for invalid streams. getStrategy would do a LOGE - // and then return STRATEGY_MEDIA, but we want to return the empty set. - if (stream < (AudioSystem::stream_type) 0 || stream >= AudioSystem::NUM_STREAM_TYPES) { - devices = 0; - } else { - AudioPolicyManagerBase::routing_strategy strategy = getStrategy(stream); - devices = getDeviceForStrategy(strategy, true); - } - return devices; -} - -AudioPolicyManagerBase::routing_strategy AudioPolicyManagerBase::getStrategy( - AudioSystem::stream_type stream) { - // stream to strategy mapping - switch (stream) { - case AudioSystem::VOICE_CALL: -#ifdef HAVE_FM_RADIO - case AudioSystem::FM: -#endif - case AudioSystem::BLUETOOTH_SCO: - return STRATEGY_PHONE; - case AudioSystem::RING: - case AudioSystem::NOTIFICATION: - case AudioSystem::ALARM: - return STRATEGY_SONIFICATION; - case AudioSystem::DTMF: - return STRATEGY_DTMF; - default: - LOGE("unknown stream type"); - case AudioSystem::SYSTEM: - // NOTE: SYSTEM stream uses MEDIA strategy because muting music and switching outputs - // while key clicks are played produces a poor result - case AudioSystem::TTS: - case AudioSystem::MUSIC: - return STRATEGY_MEDIA; - case AudioSystem::ENFORCED_AUDIBLE: - return STRATEGY_ENFORCED_AUDIBLE; - } -} - -uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, bool fromCache) -{ - uint32_t device = 0; - - if (fromCache) { - LOGV("getDeviceForStrategy() from cache strategy %d, device %x", strategy, mDeviceForStrategy[strategy]); - return mDeviceForStrategy[strategy]; - } - - switch (strategy) { - case STRATEGY_DTMF: - if (!isInCall()) { - // when off call, DTMF strategy follows the same rules as MEDIA strategy - device = getDeviceForStrategy(STRATEGY_MEDIA, false); - break; - } - // when in call, DTMF and PHONE strategies follow the same rules - // FALL THROUGH - - case STRATEGY_PHONE: - // for phone strategy, we first consider the forced use and then the available devices by order - // of priority - switch (mForceUse[AudioSystem::FOR_COMMUNICATION]) { - case AudioSystem::FORCE_BT_SCO: - if (!isInCall() || strategy != STRATEGY_DTMF) { - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT; - if (device) break; - } - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_HEADSET; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO; - if (device) break; - // if SCO device is requested but no SCO device is available, fall back to default case - // FALL THROUGH - - default: // FORCE_NONE - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; - if (device) break; -#ifdef WITH_A2DP - // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to A2DP - if (!isInCall() && !mA2dpSuspended) { - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES; - if (device) break; - } -#endif - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_EARPIECE; - if (device == 0) { - LOGE("getDeviceForStrategy() earpiece device not found"); - } - break; - - case AudioSystem::FORCE_SPEAKER: -#ifdef WITH_A2DP - // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to - // A2DP speaker when forcing to speaker output - if (!isInCall() && !mA2dpSuspended) { - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER; - if (device) break; - } -#endif - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET; - if (device) break; - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; - if (device == 0) { - LOGE("getDeviceForStrategy() speaker device not found"); - } - break; - } - break; - - case STRATEGY_SONIFICATION: - - // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by - // handleIncallSonification(). - if (isInCall()) { - device = getDeviceForStrategy(STRATEGY_PHONE, false); - break; - } - // FALL THROUGH - - case STRATEGY_ENFORCED_AUDIBLE: - // strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION - // except when in call where it doesn't default to STRATEGY_PHONE behavior - - device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; - if (device == 0) { - LOGE("getDeviceForStrategy() speaker device not found"); - } - // The second device used for sonification is the same as the device used by media strategy - // FALL THROUGH - - case STRATEGY_MEDIA: { - uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; - } -#ifdef WITH_A2DP - if ((mA2dpOutput != 0) && !mA2dpSuspended && - (strategy == STRATEGY_MEDIA || a2dpUsedForSonification())) { - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER; - } - } -#endif - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; - } - - // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION or - // STRATEGY_ENFORCED_AUDIBLE, 0 otherwise - device |= device2; - if (device == 0) { - LOGE("getDeviceForStrategy() speaker device not found"); - } - } break; - - default: - LOGW("getDeviceForStrategy() unknown strategy: %d", strategy); - break; - } - - LOGV("getDeviceForStrategy() strategy %d, device %x", strategy, device); - return device; -} - -void AudioPolicyManagerBase::updateDeviceForStrategy() -{ - for (int i = 0; i < NUM_STRATEGIES; i++) { - mDeviceForStrategy[i] = getDeviceForStrategy((routing_strategy)i, false); - } -} - -void AudioPolicyManagerBase::setOutputDevice(audio_io_handle_t output, uint32_t device, bool force, int delayMs) -{ - LOGV("setOutputDevice() output %d device %x delayMs %d", output, device, delayMs); - AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); - - - if (outputDesc->isDuplicated()) { - setOutputDevice(outputDesc->mOutput1->mId, device, force, delayMs); - setOutputDevice(outputDesc->mOutput2->mId, device, force, delayMs); - return; - } -#ifdef WITH_A2DP - // filter devices according to output selected - if (output == mA2dpOutput) { - device &= AudioSystem::DEVICE_OUT_ALL_A2DP; - } else { - device &= ~AudioSystem::DEVICE_OUT_ALL_A2DP; - } -#endif - - uint32_t prevDevice = (uint32_t)outputDesc->device(); - // Do not change the routing if: - // - the requestede device is 0 - // - the requested device is the same as current device and force is not specified. - // Doing this check here allows the caller to call setOutputDevice() without conditions - if ((device == 0 || device == prevDevice) && !force) { - LOGV("setOutputDevice() setting same device %x or null device for output %d", device, output); - return; - } - - outputDesc->mDevice = device; - // mute media streams if both speaker and headset are selected - if (output == mHardwareOutput && AudioSystem::popCount(device) == 2) { - setStrategyMute(STRATEGY_MEDIA, true, output); - // wait for the PCM output buffers to empty before proceeding with the rest of the command - // FIXME: increased delay due to larger buffers used for low power audio mode. - // remove when low power audio is controlled by policy manager. - usleep(outputDesc->mLatency*8*1000); - } - - // do the routing - AudioParameter param = AudioParameter(); - param.addInt(String8(AudioParameter::keyRouting), (int)device); - mpClientInterface->setParameters(mHardwareOutput, param.toString(), delayMs); - // update stream volumes according to new device - applyStreamVolumes(output, device, delayMs); - - // if changing from a combined headset + speaker route, unmute media streams - if (output == mHardwareOutput && AudioSystem::popCount(prevDevice) == 2) { - setStrategyMute(STRATEGY_MEDIA, false, output, delayMs); - } -} - -uint32_t AudioPolicyManagerBase::getDeviceForInputSource(int inputSource) -{ - uint32_t device; - - switch(inputSource) { - case AUDIO_SOURCE_DEFAULT: - case AUDIO_SOURCE_MIC: - case AUDIO_SOURCE_VOICE_RECOGNITION: - case AUDIO_SOURCE_VOICE_COMMUNICATION: - if (mForceUse[AudioSystem::FOR_RECORD] == AudioSystem::FORCE_BT_SCO && - mAvailableInputDevices & AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET) { - device = AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET; - } else if (mAvailableInputDevices & AudioSystem::DEVICE_IN_WIRED_HEADSET) { - device = AudioSystem::DEVICE_IN_WIRED_HEADSET; - } else { - device = AudioSystem::DEVICE_IN_BUILTIN_MIC; - } - break; - case AUDIO_SOURCE_CAMCORDER: - if (hasBackMicrophone()) { - device = AudioSystem::DEVICE_IN_BACK_MIC; - } else { - device = AudioSystem::DEVICE_IN_BUILTIN_MIC; - } - break; - case AUDIO_SOURCE_VOICE_UPLINK: - case AUDIO_SOURCE_VOICE_DOWNLINK: - case AUDIO_SOURCE_VOICE_CALL: - LOGV("getDeviceForInputSource() CALL/UPLINK/DOWNLINK returning DEVICE_IN_VOICE_CALL"); - device = AudioSystem::DEVICE_IN_BUILTIN_MIC; - break; - default: - LOGW("getDeviceForInputSource() invalid input source %d", inputSource); - //device = 0; - device = AudioSystem::DEVICE_IN_BUILTIN_MIC; - break; - } - LOGV("getDeviceForInputSource()input source %d, device %08x", inputSource, device); - return device; -} - -audio_io_handle_t AudioPolicyManagerBase::getActiveInput() -{ - for (size_t i = 0; i < mInputs.size(); i++) { - if (mInputs.valueAt(i)->mRefCount > 0) { - return mInputs.keyAt(i); - } - } - return 0; -} - - -AudioPolicyManagerBase::device_category AudioPolicyManagerBase::getDeviceCategory(uint32_t device) -{ - if (device == 0) { - // this happens when forcing a route update and no track is active on an output. - // In this case the returned category is not important. - return DEVICE_CATEGORY_SPEAKER; - } - - if (AudioSystem::popCount(device) > 1) { - // Multiple device selection is either: - // - speaker + one other device: give priority to speaker in this case. - // - one A2DP device + another device: happens with duplicated output. In this case - // retain the device on the A2DP output as the other must not correspond to an active - // selection if not the speaker. - if (device & AUDIO_DEVICE_OUT_SPEAKER) - return DEVICE_CATEGORY_SPEAKER; - - device &= AUDIO_DEVICE_OUT_ALL_A2DP; - } - - LOGW_IF(AudioSystem::popCount(device) != 1, - "getDeviceCategory() invalid device combination: %08x", - device); - - switch(device) { - case AUDIO_DEVICE_OUT_EARPIECE: - return DEVICE_CATEGORY_EARPIECE; - case AUDIO_DEVICE_OUT_WIRED_HEADSET: - case AUDIO_DEVICE_OUT_WIRED_HEADPHONE: - case AUDIO_DEVICE_OUT_BLUETOOTH_SCO: - case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET: - case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP: - case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES: - return DEVICE_CATEGORY_HEADSET; - case AUDIO_DEVICE_OUT_SPEAKER: - case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT: - case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER: - default: - return DEVICE_CATEGORY_SPEAKER; - } -} - -float AudioPolicyManagerBase::volIndexToAmpl(uint32_t device, const StreamDescriptor& streamDesc, - int indexInUi) -{ - device_category deviceCategory = getDeviceCategory(device); - const VolumeCurvePoint *curve = streamDesc.mVolumeCurve[deviceCategory]; - - // the volume index in the UI is relative to the min and max volume indices for this stream type - int nbSteps = 1 + curve[VOLMAX].mIndex - - curve[VOLMIN].mIndex; - int volIdx = (nbSteps * (indexInUi - streamDesc.mIndexMin)) / - (streamDesc.mIndexMax - streamDesc.mIndexMin); - - // find what part of the curve this index volume belongs to, or if it's out of bounds - int segment = 0; - if (volIdx < curve[VOLMIN].mIndex) { // out of bounds - return 0.0f; - } else if (volIdx < curve[VOLKNEE1].mIndex) { - segment = 0; - } else if (volIdx < curve[VOLKNEE2].mIndex) { - segment = 1; - } else if (volIdx <= curve[VOLMAX].mIndex) { - segment = 2; - } else { // out of bounds - return 1.0f; - } - - // linear interpolation in the attenuation table in dB - float decibels = curve[segment].mDBAttenuation + - ((float)(volIdx - curve[segment].mIndex)) * - ( (curve[segment+1].mDBAttenuation - - curve[segment].mDBAttenuation) / - ((float)(curve[segment+1].mIndex - - curve[segment].mIndex)) ); - - float amplification = exp( decibels * 0.115129f); // exp( dB * ln(10) / 20 ) - - LOGV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f] ampl=%.5f", - curve[segment].mIndex, volIdx, - curve[segment+1].mIndex, - curve[segment].mDBAttenuation, - decibels, - curve[segment+1].mDBAttenuation, - amplification); - - return amplification; -} - -const AudioPolicyManagerBase::VolumeCurvePoint - AudioPolicyManagerBase::sDefaultVolumeCurve[AudioPolicyManagerBase::VOLCNT] = { - {1, -49.5f}, {33, -33.5f}, {66, -17.0f}, {100, 0.0f} -}; - -const AudioPolicyManagerBase::VolumeCurvePoint - AudioPolicyManagerBase::sDefaultMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT] = { - {1, -58.0f}, {20, -40.0f}, {60, -17.0f}, {100, 0.0f} -}; - -const AudioPolicyManagerBase::VolumeCurvePoint - AudioPolicyManagerBase::sSpeakerMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT] = { - {1, -56.0f}, {20, -34.0f}, {60, -11.0f}, {100, 0.0f} -}; - -const AudioPolicyManagerBase::VolumeCurvePoint - AudioPolicyManagerBase::sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT] = { - {1, -29.7f}, {33, -20.1f}, {66, -10.2f}, {100, 0.0f} -}; - - -const AudioPolicyManagerBase::VolumeCurvePoint - *AudioPolicyManagerBase::sVolumeProfiles[AudioPolicyManagerBase::NUM_STRATEGIES] - [AudioPolicyManagerBase::DEVICE_CATEGORY_CNT] = { - { // STRATEGY_MEDIA - sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_HEADSET - sSpeakerMediaVolumeCurve, // DEVICE_CATEGORY_SPEAKER - sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EARPIECE - }, - { // STRATEGY_PHONE - sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET - sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER - sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE - }, - { // STRATEGY_SONIFICATION - sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET - sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER - sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE - }, - { // STRATEGY_DTMF - sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET - sDefaultVolumeCurve, // DEVICE_CATEGORY_SPEAKER - sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE - }, - { // STRATEGY_ENFORCED_AUDIBLE - sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET - sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER - sDefaultVolumeCurve // DEVICE_CATEGORY_EARPIECE - }, -}; - -void AudioPolicyManagerBase::initializeVolumeCurves() -{ - for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) { - for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) { - mStreams[i].mVolumeCurve[j] = - sVolumeProfiles[getStrategy((AudioSystem::stream_type)i)][j]; - } - } -} - -float AudioPolicyManagerBase::computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device) -{ - float volume = 1.0; - AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); - StreamDescriptor &streamDesc = mStreams[stream]; - - if (device == 0) { - device = outputDesc->device(); - } - - // if volume is not 0 (not muted), force media volume to max on digital output - if (stream == AudioSystem::MUSIC && - index != mStreams[stream].mIndexMin && - (device == AudioSystem::DEVICE_OUT_AUX_DIGITAL || - device == AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET)) { - return 1.0; - } - - volume = volIndexToAmpl(device, streamDesc, index); - - // if a headset is connected, apply the following rules to ring tones and notifications - // to avoid sound level bursts in user's ears: - // - always attenuate ring tones and notifications volume by 6dB - // - if music is playing, always limit the volume to current music volume, - // with a minimum threshold at -36dB so that notification is always perceived. - if ((device & - (AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP | - AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AudioSystem::DEVICE_OUT_WIRED_HEADSET | - AudioSystem::DEVICE_OUT_WIRED_HEADPHONE)) && - ((getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) || - (stream == AudioSystem::SYSTEM)) && - streamDesc.mCanBeMuted) { - volume *= SONIFICATION_HEADSET_VOLUME_FACTOR; - // when the phone is ringing we must consider that music could have been paused just before - // by the music application and behave as if music was active if the last music track was - // just stopped - if (outputDesc->mRefCount[AudioSystem::MUSIC] || mLimitRingtoneVolume) { - float musicVol = computeVolume(AudioSystem::MUSIC, mStreams[AudioSystem::MUSIC].mIndexCur, output, device); - float minVol = (musicVol > SONIFICATION_HEADSET_VOLUME_MIN) ? musicVol : SONIFICATION_HEADSET_VOLUME_MIN; - if (volume > minVol) { - volume = minVol; - LOGV("computeVolume limiting volume to %f musicVol %f", minVol, musicVol); - } - } - } - - return volume; -} - -status_t AudioPolicyManagerBase::checkAndSetVolume(int stream, int index, audio_io_handle_t output, uint32_t device, int delayMs, bool force) -{ - - // do not change actual stream volume if the stream is muted - if (mOutputs.valueFor(output)->mMuteCount[stream] != 0) { - LOGV("checkAndSetVolume() stream %d muted count %d", stream, mOutputs.valueFor(output)->mMuteCount[stream]); - return NO_ERROR; - } - - // do not change in call volume if bluetooth is connected and vice versa - if ((stream == AudioSystem::VOICE_CALL && mForceUse[AudioSystem::FOR_COMMUNICATION] == AudioSystem::FORCE_BT_SCO) || - (stream == AudioSystem::BLUETOOTH_SCO && mForceUse[AudioSystem::FOR_COMMUNICATION] != AudioSystem::FORCE_BT_SCO)) { - LOGV("checkAndSetVolume() cannot set stream %d volume with force use = %d for comm", - stream, mForceUse[AudioSystem::FOR_COMMUNICATION]); - return INVALID_OPERATION; - } - - float volume = computeVolume(stream, index, output, device); - // We actually change the volume if: - // - the float value returned by computeVolume() changed - // - the force flag is set - if (volume != mOutputs.valueFor(output)->mCurVolume[stream] || - force) { - mOutputs.valueFor(output)->mCurVolume[stream] = volume; - LOGV("setStreamVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs); - if (stream == AudioSystem::VOICE_CALL || - stream == AudioSystem::DTMF || - stream == AudioSystem::BLUETOOTH_SCO) { - // offset value to reflect actual hardware volume that never reaches 0 - // 1% corresponds roughly to first step in VOICE_CALL stream volume setting (see AudioService.java) - volume = 0.01 + 0.99 * volume; - // Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is - // enabled - if (stream == AudioSystem::BLUETOOTH_SCO) { - mpClientInterface->setStreamVolume(AudioSystem::VOICE_CALL, volume, output, delayMs); - } - } - - mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs); - } - - if (stream == AudioSystem::VOICE_CALL || - stream == AudioSystem::BLUETOOTH_SCO) { - float voiceVolume; - // Force voice volume to max for bluetooth SCO as volume is managed by the headset - if (stream == AudioSystem::VOICE_CALL) { - voiceVolume = (float)index/(float)mStreams[stream].mIndexMax; - } else { - voiceVolume = 1.0; - } - - if (voiceVolume != mLastVoiceVolume && output == mHardwareOutput) { - mpClientInterface->setVoiceVolume(voiceVolume, delayMs); - mLastVoiceVolume = voiceVolume; - } - } - - return NO_ERROR; -} - -void AudioPolicyManagerBase::applyStreamVolumes(audio_io_handle_t output, uint32_t device, int delayMs, bool force) -{ - LOGV("applyStreamVolumes() for output %d and device %x", output, device); - - for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { - checkAndSetVolume(stream, mStreams[stream].mIndexCur, output, device, delayMs, force); - } -} - -void AudioPolicyManagerBase::setStrategyMute(routing_strategy strategy, bool on, audio_io_handle_t output, int delayMs) -{ - LOGV("setStrategyMute() strategy %d, mute %d, output %d", strategy, on, output); - for (int stream = 0; stream < AudioSystem::NUM_STREAM_TYPES; stream++) { - if (getStrategy((AudioSystem::stream_type)stream) == strategy) { - setStreamMute(stream, on, output, delayMs); - } - } -} - -void AudioPolicyManagerBase::setStreamMute(int stream, bool on, audio_io_handle_t output, int delayMs) -{ - StreamDescriptor &streamDesc = mStreams[stream]; - AudioOutputDescriptor *outputDesc = mOutputs.valueFor(output); - - LOGV("setStreamMute() stream %d, mute %d, output %d, mMuteCount %d", stream, on, output, outputDesc->mMuteCount[stream]); - - if (on) { - if (outputDesc->mMuteCount[stream] == 0) { - if (streamDesc.mCanBeMuted) { - checkAndSetVolume(stream, 0, output, outputDesc->device(), delayMs); - } - } - // increment mMuteCount after calling checkAndSetVolume() so that volume change is not ignored - outputDesc->mMuteCount[stream]++; - } else { - if (outputDesc->mMuteCount[stream] == 0) { - LOGW("setStreamMute() unmuting non muted stream!"); - return; - } - if (--outputDesc->mMuteCount[stream] == 0) { - checkAndSetVolume(stream, streamDesc.mIndexCur, output, outputDesc->device(), delayMs); - } - } -} - -void AudioPolicyManagerBase::handleIncallSonification(int stream, bool starting, bool stateChange) -{ - // if the stream pertains to sonification strategy and we are in call we must - // mute the stream if it is low visibility. If it is high visibility, we must play a tone - // in the device used for phone strategy and play the tone if the selected device does not - // interfere with the device used for phone strategy - // if stateChange is true, we are called from setPhoneState() and we must mute or unmute as - // many times as there are active tracks on the output - - if (getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) { - AudioOutputDescriptor *outputDesc = mOutputs.valueFor(mHardwareOutput); - LOGV("handleIncallSonification() stream %d starting %d device %x stateChange %d", - stream, starting, outputDesc->mDevice, stateChange); - if (outputDesc->mRefCount[stream]) { - int muteCount = 1; - if (stateChange) { - muteCount = outputDesc->mRefCount[stream]; - } - if (AudioSystem::isLowVisibility((AudioSystem::stream_type)stream)) { - LOGV("handleIncallSonification() low visibility, muteCount %d", muteCount); - for (int i = 0; i < muteCount; i++) { - setStreamMute(stream, starting, mHardwareOutput); - } - } else { - LOGV("handleIncallSonification() high visibility"); - if (outputDesc->device() & getDeviceForStrategy(STRATEGY_PHONE)) { - LOGV("handleIncallSonification() high visibility muted, muteCount %d", muteCount); - for (int i = 0; i < muteCount; i++) { - setStreamMute(stream, starting, mHardwareOutput); - } - } - if (starting) { - mpClientInterface->startTone(ToneGenerator::TONE_SUP_CALL_WAITING, AudioSystem::VOICE_CALL); - } else { - mpClientInterface->stopTone(); - } - } - } - } -} - -bool AudioPolicyManagerBase::isInCall() -{ - return isStateInCall(mPhoneState); -} - -bool AudioPolicyManagerBase::isStateInCall(int state) { - return ((state == AudioSystem::MODE_IN_CALL) || - (state == AudioSystem::MODE_IN_COMMUNICATION)); -} - -bool AudioPolicyManagerBase::needsDirectOuput(AudioSystem::stream_type stream, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - AudioSystem::output_flags flags, - uint32_t device) -{ - return ((flags & AudioSystem::OUTPUT_FLAG_DIRECT) || - (format !=0 && !AudioSystem::isLinearPCM(format))); -} - -uint32_t AudioPolicyManagerBase::getMaxEffectsCpuLoad() -{ - return MAX_EFFECTS_CPU_LOAD; -} - -uint32_t AudioPolicyManagerBase::getMaxEffectsMemory() -{ - return MAX_EFFECTS_MEMORY; -} - -// --- AudioOutputDescriptor class implementation - -AudioPolicyManagerBase::AudioOutputDescriptor::AudioOutputDescriptor() - : mId(0), mSamplingRate(0), mFormat(0), mChannels(0), mLatency(0), - mFlags((AudioSystem::output_flags)0), mDevice(0), mOutput1(0), mOutput2(0) -{ - // clear usage count for all stream types - for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) { - mRefCount[i] = 0; - mCurVolume[i] = -1.0; - mMuteCount[i] = 0; - mStopTime[i] = 0; - } -} - -uint32_t AudioPolicyManagerBase::AudioOutputDescriptor::device() -{ - uint32_t device = 0; - if (isDuplicated()) { - device = mOutput1->mDevice | mOutput2->mDevice; - } else { - device = mDevice; - } - return device; -} - -void AudioPolicyManagerBase::AudioOutputDescriptor::changeRefCount(AudioSystem::stream_type stream, int delta) -{ - // forward usage count change to attached outputs - if (isDuplicated()) { - mOutput1->changeRefCount(stream, delta); - mOutput2->changeRefCount(stream, delta); - } - if ((delta + (int)mRefCount[stream]) < 0) { - LOGW("changeRefCount() invalid delta %d for stream %d, refCount %d", delta, stream, mRefCount[stream]); - mRefCount[stream] = 0; - return; - } - mRefCount[stream] += delta; - LOGV("changeRefCount() stream %d, count %d", stream, mRefCount[stream]); -} - -uint32_t AudioPolicyManagerBase::AudioOutputDescriptor::refCount() -{ - uint32_t refcount = 0; - for (int i = 0; i < (int)AudioSystem::NUM_STREAM_TYPES; i++) { - refcount += mRefCount[i]; - } - return refcount; -} - -uint32_t AudioPolicyManagerBase::AudioOutputDescriptor::strategyRefCount(routing_strategy strategy) -{ - uint32_t refCount = 0; - for (int i = 0; i < (int)AudioSystem::NUM_STREAM_TYPES; i++) { - if (getStrategy((AudioSystem::stream_type)i) == strategy) { - refCount += mRefCount[i]; - } - } - return refCount; -} - -status_t AudioPolicyManagerBase::AudioOutputDescriptor::dump(int fd) -{ - const size_t SIZE = 256; - char buffer[SIZE]; - String8 result; - - snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); - result.append(buffer); - snprintf(buffer, SIZE, " Format: %d\n", mFormat); - result.append(buffer); - snprintf(buffer, SIZE, " Channels: %08x\n", mChannels); - result.append(buffer); - snprintf(buffer, SIZE, " Latency: %d\n", mLatency); - result.append(buffer); - snprintf(buffer, SIZE, " Flags %08x\n", mFlags); - result.append(buffer); - snprintf(buffer, SIZE, " Devices %08x\n", device()); - result.append(buffer); - snprintf(buffer, SIZE, " Stream volume refCount muteCount\n"); - result.append(buffer); - for (int i = 0; i < AudioSystem::NUM_STREAM_TYPES; i++) { - snprintf(buffer, SIZE, " %02d %.03f %02d %02d\n", i, mCurVolume[i], mRefCount[i], mMuteCount[i]); - result.append(buffer); - } - write(fd, result.string(), result.size()); - - return NO_ERROR; -} - -// --- AudioInputDescriptor class implementation - -AudioPolicyManagerBase::AudioInputDescriptor::AudioInputDescriptor() - : mSamplingRate(0), mFormat(0), mChannels(0), - mAcoustics((AudioSystem::audio_in_acoustics)0), mDevice(0), mRefCount(0), - mInputSource(0) -{ -} - -status_t AudioPolicyManagerBase::AudioInputDescriptor::dump(int fd) -{ - const size_t SIZE = 256; - char buffer[SIZE]; - String8 result; - - snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); - result.append(buffer); - snprintf(buffer, SIZE, " Format: %d\n", mFormat); - result.append(buffer); - snprintf(buffer, SIZE, " Channels: %08x\n", mChannels); - result.append(buffer); - snprintf(buffer, SIZE, " Acoustics %08x\n", mAcoustics); - result.append(buffer); - snprintf(buffer, SIZE, " Devices %08x\n", mDevice); - result.append(buffer); - snprintf(buffer, SIZE, " Ref Count %d\n", mRefCount); - result.append(buffer); - write(fd, result.string(), result.size()); - - return NO_ERROR; -} - -// --- StreamDescriptor class implementation - -void AudioPolicyManagerBase::StreamDescriptor::dump(char* buffer, size_t size) -{ - snprintf(buffer, size, " %02d %02d %02d %d\n", - mIndexMin, - mIndexMax, - mIndexCur, - mCanBeMuted); -} - -// --- EffectDescriptor class implementation - -status_t AudioPolicyManagerBase::EffectDescriptor::dump(int fd) -{ - const size_t SIZE = 256; - char buffer[SIZE]; - String8 result; - - snprintf(buffer, SIZE, " I/O: %d\n", mIo); - result.append(buffer); - snprintf(buffer, SIZE, " Strategy: %d\n", mStrategy); - result.append(buffer); - snprintf(buffer, SIZE, " Session: %d\n", mSession); - result.append(buffer); - snprintf(buffer, SIZE, " Name: %s\n", mDesc.name); - result.append(buffer); - snprintf(buffer, SIZE, " %s\n", mEnabled ? "Enabled" : "Disabled"); - result.append(buffer); - write(fd, result.string(), result.size()); - - return NO_ERROR; -} - - - -}; // namespace android diff --git a/audio/AudioPolicyManagerBase.h b/audio/AudioPolicyManagerBase.h deleted file mode 100755 index 3ab748d..0000000 --- a/audio/AudioPolicyManagerBase.h +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (C) 2009 The Android 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. - */ - - -#include -#include -#include -#include -#include -#include - - -namespace android_audio_legacy { - using android::KeyedVector; - -// ---------------------------------------------------------------------------- - -#define MAX_DEVICE_ADDRESS_LEN 20 -// Attenuation applied to STRATEGY_SONIFICATION streams when a headset is connected: 6dB -#define SONIFICATION_HEADSET_VOLUME_FACTOR 0.5 -// Min volume for STRATEGY_SONIFICATION streams when limited by music volume: -36dB -#define SONIFICATION_HEADSET_VOLUME_MIN 0.016 -// Time in milliseconds during which we consider that music is still active after a music -// track was stopped - see computeVolume() -#define SONIFICATION_HEADSET_MUSIC_DELAY 5000 -// Time in milliseconds during witch some streams are muted while the audio path -// is switched -#define MUTE_TIME_MS 2000 - -#define NUM_TEST_OUTPUTS 5 - -#define NUM_VOL_CURVE_KNEES 2 - -// ---------------------------------------------------------------------------- -// AudioPolicyManagerBase implements audio policy manager behavior common to all platforms. -// Each platform must implement an AudioPolicyManager class derived from AudioPolicyManagerBase -// and override methods for which the platform specific behavior differs from the implementation -// in AudioPolicyManagerBase. Even if no specific behavior is required, the AudioPolicyManager -// class must be implemented as well as the class factory function createAudioPolicyManager() -// and provided in a shared library libaudiopolicy.so. -// ---------------------------------------------------------------------------- - -class AudioPolicyManagerBase: public AudioPolicyInterface -#ifdef AUDIO_POLICY_TEST - , public Thread -#endif //AUDIO_POLICY_TEST -{ - -public: - AudioPolicyManagerBase(AudioPolicyClientInterface *clientInterface); - virtual ~AudioPolicyManagerBase(); - - // AudioPolicyInterface - virtual status_t setDeviceConnectionState(AudioSystem::audio_devices device, - AudioSystem::device_connection_state state, - const char *device_address); - virtual AudioSystem::device_connection_state getDeviceConnectionState(AudioSystem::audio_devices device, - const char *device_address); - virtual void setPhoneState(int state); - virtual void setRingerMode(uint32_t mode, uint32_t mask); - virtual void setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config); - virtual AudioSystem::forced_config getForceUse(AudioSystem::force_use usage); - virtual void setSystemProperty(const char* property, const char* value); - virtual status_t initCheck(); - virtual audio_io_handle_t getOutput(AudioSystem::stream_type stream, - uint32_t samplingRate = 0, - uint32_t format = AudioSystem::FORMAT_DEFAULT, - uint32_t channels = 0, - AudioSystem::output_flags flags = - AudioSystem::OUTPUT_FLAG_INDIRECT); - virtual status_t startOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0); - virtual status_t stopOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0); - virtual void releaseOutput(audio_io_handle_t output); - virtual audio_io_handle_t getInput(int inputSource, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - AudioSystem::audio_in_acoustics acoustics); - // indicates to the audio policy manager that the input starts being used. - virtual status_t startInput(audio_io_handle_t input); - // indicates to the audio policy manager that the input stops being used. - virtual status_t stopInput(audio_io_handle_t input); - virtual void releaseInput(audio_io_handle_t input); - virtual void initStreamVolume(AudioSystem::stream_type stream, - int indexMin, - int indexMax); - virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index); - virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index); - - // return the strategy corresponding to a given stream type - virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream); - - // return the enabled output devices for the given stream type - virtual uint32_t getDevicesForStream(AudioSystem::stream_type stream); - - virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); - virtual status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id); - virtual status_t unregisterEffect(int id); - virtual status_t setEffectEnabled(int id, bool enabled); - - virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const; - - virtual status_t dump(int fd); - -protected: - - enum routing_strategy { - STRATEGY_MEDIA, - STRATEGY_PHONE, - STRATEGY_SONIFICATION, - STRATEGY_DTMF, - STRATEGY_ENFORCED_AUDIBLE, - NUM_STRATEGIES - }; - - // 4 points to define the volume attenuation curve, each characterized by the volume - // index (from 0 to 100) at which they apply, and the attenuation in dB at that index. - // we use 100 steps to avoid rounding errors when computing the volume in volIndexToAmpl() - - enum { VOLMIN = 0, VOLKNEE1 = 1, VOLKNEE2 = 2, VOLMAX = 3, VOLCNT = 4}; - - class VolumeCurvePoint - { - public: - int mIndex; - float mDBAttenuation; - }; - - // device categories used for volume curve management. - enum device_category { - DEVICE_CATEGORY_HEADSET, - DEVICE_CATEGORY_SPEAKER, - DEVICE_CATEGORY_EARPIECE, - DEVICE_CATEGORY_CNT - }; - - // default volume curve - static const VolumeCurvePoint sDefaultVolumeCurve[AudioPolicyManagerBase::VOLCNT]; - // default volume curve for media strategy - static const VolumeCurvePoint sDefaultMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT]; - // volume curve for media strategy on speakers - static const VolumeCurvePoint sSpeakerMediaVolumeCurve[AudioPolicyManagerBase::VOLCNT]; - // volume curve for sonification strategy on speakers - static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManagerBase::VOLCNT]; - // default volume curves per strategy and device category. See initializeVolumeCurves() - static const VolumeCurvePoint *sVolumeProfiles[NUM_STRATEGIES][DEVICE_CATEGORY_CNT]; - - // descriptor for audio outputs. Used to maintain current configuration of each opened audio output - // and keep track of the usage of this output by each audio stream type. - class AudioOutputDescriptor - { - public: - AudioOutputDescriptor(); - - status_t dump(int fd); - - uint32_t device(); - void changeRefCount(AudioSystem::stream_type, int delta); - uint32_t refCount(); - uint32_t strategyRefCount(routing_strategy strategy); - bool isUsedByStrategy(routing_strategy strategy) { return (strategyRefCount(strategy) != 0);} - bool isDuplicated() { return (mOutput1 != NULL && mOutput2 != NULL); } - - audio_io_handle_t mId; // output handle - uint32_t mSamplingRate; // - uint32_t mFormat; // - uint32_t mChannels; // output configuration - uint32_t mLatency; // - AudioSystem::output_flags mFlags; // - uint32_t mDevice; // current device this output is routed to - uint32_t mRefCount[AudioSystem::NUM_STREAM_TYPES]; // number of streams of each type using this output - nsecs_t mStopTime[AudioSystem::NUM_STREAM_TYPES]; - AudioOutputDescriptor *mOutput1; // used by duplicated outputs: first output - AudioOutputDescriptor *mOutput2; // used by duplicated outputs: second output - float mCurVolume[AudioSystem::NUM_STREAM_TYPES]; // current stream volume - int mMuteCount[AudioSystem::NUM_STREAM_TYPES]; // mute request counter - }; - - // descriptor for audio inputs. Used to maintain current configuration of each opened audio input - // and keep track of the usage of this input. - class AudioInputDescriptor - { - public: - AudioInputDescriptor(); - - status_t dump(int fd); - - uint32_t mSamplingRate; // - uint32_t mFormat; // input configuration - uint32_t mChannels; // - AudioSystem::audio_in_acoustics mAcoustics; // - uint32_t mDevice; // current device this input is routed to - uint32_t mRefCount; // number of AudioRecord clients using this output - int mInputSource; // input source selected by application (mediarecorder.h) - }; - - // stream descriptor used for volume control - class StreamDescriptor - { - public: - StreamDescriptor() - : mIndexMin(0), mIndexMax(1), mIndexCur(1), mCanBeMuted(true) {} - - void dump(char* buffer, size_t size); - - int mIndexMin; // min volume index - int mIndexMax; // max volume index - int mIndexCur; // current volume index - bool mCanBeMuted; // true is the stream can be muted - - const VolumeCurvePoint *mVolumeCurve[DEVICE_CATEGORY_CNT]; - }; - - // stream descriptor used for volume control - class EffectDescriptor - { - public: - - status_t dump(int fd); - - int mIo; // io the effect is attached to - routing_strategy mStrategy; // routing strategy the effect is associated to - int mSession; // audio session the effect is on - effect_descriptor_t mDesc; // effect descriptor - bool mEnabled; // enabled state: CPU load being used or not - }; - - void addOutput(audio_io_handle_t id, AudioOutputDescriptor *outputDesc); - - // return the strategy corresponding to a given stream type - static routing_strategy getStrategy(AudioSystem::stream_type stream); - // return appropriate device for streams handled by the specified strategy according to current - // phone state, connected devices... - // if fromCache is true, the device is returned from mDeviceForStrategy[], otherwise it is determined - // by current state (device connected, phone state, force use, a2dp output...) - // This allows to: - // 1 speed up process when the state is stable (when starting or stopping an output) - // 2 access to either current device selection (fromCache == true) or - // "future" device selection (fromCache == false) when called from a context - // where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND - // before updateDeviceForStrategy() is called. - virtual uint32_t getDeviceForStrategy(routing_strategy strategy, bool fromCache = true); - // change the route of the specified output - void setOutputDevice(audio_io_handle_t output, uint32_t device, bool force = false, int delayMs = 0); - // select input device corresponding to requested audio source - virtual uint32_t getDeviceForInputSource(int inputSource); - // return io handle of active input or 0 if no input is active - audio_io_handle_t getActiveInput(); - // initialize volume curves for each strategy and device category - void initializeVolumeCurves(); - // compute the actual volume for a given stream according to the requested index and a particular - // device - virtual float computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device); - // check that volume change is permitted, compute and send new volume to audio hardware - status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false); - // apply all stream volumes to the specified output and device - void applyStreamVolumes(audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false); - // Mute or unmute all streams handled by the specified strategy on the specified output - void setStrategyMute(routing_strategy strategy, bool on, audio_io_handle_t output, int delayMs = 0); - // Mute or unmute the stream on the specified output - void setStreamMute(int stream, bool on, audio_io_handle_t output, int delayMs = 0); - // handle special cases for sonification strategy while in call: mute streams or replace by - // a special tone in the device used for communication - void handleIncallSonification(int stream, bool starting, bool stateChange); - // true is current platform implements a back microphone - virtual bool hasBackMicrophone() const { return false; } - // true if device is in a telephony or VoIP call - virtual bool isInCall(); - // true if given state represents a device in a telephony or VoIP call - virtual bool isStateInCall(int state); - -#ifdef WITH_A2DP - // true is current platform supports suplication of notifications and ringtones over A2DP output - virtual bool a2dpUsedForSonification() const { return true; } - status_t handleA2dpConnection(AudioSystem::audio_devices device, - const char *device_address); - status_t handleA2dpDisconnection(AudioSystem::audio_devices device, - const char *device_address); - void closeA2dpOutputs(); - // checks and if necessary changes output (a2dp, duplicated or hardware) used for all strategies. - // must be called every time a condition that affects the output choice for a given strategy is - // changed: connected device, phone state, force use... - // Must be called before updateDeviceForStrategy() - void checkOutputForStrategy(routing_strategy strategy); - // Same as checkOutputForStrategy() but for a all strategies in order of priority - void checkOutputForAllStrategies(); - // manages A2DP output suspend/restore according to phone state and BT SCO usage - void checkA2dpSuspend(); -#endif - // selects the most appropriate device on output for current state - // must be called every time a condition that affects the device choice for a given output is - // changed: connected device, phone state, force use, output start, output stop.. - // see getDeviceForStrategy() for the use of fromCache parameter - uint32_t getNewDevice(audio_io_handle_t output, bool fromCache = true); - // updates cache of device used by all strategies (mDeviceForStrategy[]) - // must be called every time a condition that affects the device choice for a given strategy is - // changed: connected device, phone state, force use... - // cached values are used by getDeviceForStrategy() if parameter fromCache is true. - // Must be called after checkOutputForAllStrategies() - void updateDeviceForStrategy(); - // true if current platform requires a specific output to be opened for this particular - // set of parameters. This function is called by getOutput() and is implemented by platform - // specific audio policy manager. - virtual bool needsDirectOuput(AudioSystem::stream_type stream, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - AudioSystem::output_flags flags, - uint32_t device); - virtual uint32_t getMaxEffectsCpuLoad(); - virtual uint32_t getMaxEffectsMemory(); -#ifdef AUDIO_POLICY_TEST - virtual bool threadLoop(); - void exit(); - int testOutputIndex(audio_io_handle_t output); -#endif //AUDIO_POLICY_TEST - - status_t setEffectEnabled(EffectDescriptor *pDesc, bool enabled); - - // returns the category the device belongs to with regard to volume curve management - static device_category getDeviceCategory(uint32_t device); - - AudioPolicyClientInterface *mpClientInterface; // audio policy client interface - audio_io_handle_t mHardwareOutput; // hardware output handler - audio_io_handle_t mA2dpOutput; // A2DP output handler - audio_io_handle_t mDuplicatedOutput; // duplicated output handler: outputs to hardware and A2DP. - - KeyedVector mOutputs; // list of output descriptors - KeyedVector mInputs; // list of input descriptors - uint32_t mAvailableOutputDevices; // bit field of all available output devices - uint32_t mAvailableInputDevices; // bit field of all available input devices - int mPhoneState; // current phone state - uint32_t mRingerMode; // current ringer mode - AudioSystem::forced_config mForceUse[AudioSystem::NUM_FORCE_USE]; // current forced use configuration - - StreamDescriptor mStreams[AudioSystem::NUM_STREAM_TYPES]; // stream descriptors for volume control - String8 mA2dpDeviceAddress; // A2DP device MAC address - String8 mScoDeviceAddress; // SCO device MAC address - bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected - uint32_t mDeviceForStrategy[NUM_STRATEGIES]; - float mLastVoiceVolume; // last voice volume value sent to audio HAL - - // Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units - static const uint32_t MAX_EFFECTS_CPU_LOAD = 1000; - // Maximum memory allocated to audio effects in KB - static const uint32_t MAX_EFFECTS_MEMORY = 512; - uint32_t mTotalEffectsCpuLoad; // current CPU load used by effects - uint32_t mTotalEffectsMemory; // current memory used by effects - KeyedVector mEffects; // list of registered audio effects - bool mA2dpSuspended; // true if A2DP output is suspended - -#ifdef AUDIO_POLICY_TEST - Mutex mLock; - Condition mWaitWorkCV; - - int mCurOutput; - bool mDirectOutput; - audio_io_handle_t mTestOutputs[NUM_TEST_OUTPUTS]; - int mTestInput; - uint32_t mTestDevice; - uint32_t mTestSamplingRate; - uint32_t mTestFormat; - uint32_t mTestChannels; - uint32_t mTestLatencyMs; -#endif //AUDIO_POLICY_TEST - -private: - static float volIndexToAmpl(uint32_t device, const StreamDescriptor& streamDesc, - int indexInUi); -}; - -}; diff --git a/audio/AudioPolicyManagerDefault.cpp b/audio/AudioPolicyManagerDefault.cpp deleted file mode 100755 index 0b726d2..0000000 --- a/audio/AudioPolicyManagerDefault.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2009 The Android 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. - */ - -#define LOG_TAG "AudioPolicyManagerDefault" -#define LOG_NDEBUG 0 - -#include "AudioPolicyManagerDefault.h" - -namespace android_audio_legacy { - -extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface) -{ - return new AudioPolicyManagerDefault(clientInterface); -} - -extern "C" void destroyAudioPolicyManager(AudioPolicyInterface *interface) -{ - delete interface; -} - -}; // namespace android diff --git a/audio/AudioPolicyManagerDefault.h b/audio/AudioPolicyManagerDefault.h deleted file mode 100755 index b2b2576..0000000 --- a/audio/AudioPolicyManagerDefault.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2009 The Android 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. - */ - - -#include -#include - -#include - -namespace android_audio_legacy { - -class AudioPolicyManagerDefault: public AudioPolicyManagerBase -{ - -public: - AudioPolicyManagerDefault(AudioPolicyClientInterface *clientInterface) - : AudioPolicyManagerBase(clientInterface) {} - - virtual ~AudioPolicyManagerDefault() {} - -protected: - // true is current platform implements a back microphone - virtual bool hasBackMicrophone() const { return false; } -#ifdef WITH_A2DP - // true is current platform supports suplication of notifications and ringtones over A2DP output - virtual bool a2dpUsedForSonification() const { return true; } -#endif - -}; -}; diff --git a/audio/AudioSystem.h b/audio/AudioSystem.h deleted file mode 100755 index bd75a73..0000000 --- a/audio/AudioSystem.h +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Copyright (C) 2008 The Android 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. - */ - -#ifndef ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOPARAMETER_H_ - -#include -#include -#include - -namespace android { - -typedef void (*audio_error_callback)(status_t err); -typedef int audio_io_handle_t; - -class IAudioPolicyService; -class String8; - -class AudioSystem -{ -public: - - enum stream_type { - DEFAULT =-1, - VOICE_CALL = 0, - SYSTEM = 1, - RING = 2, - MUSIC = 3, - ALARM = 4, - NOTIFICATION = 5, - BLUETOOTH_SCO = 6, - ENFORCED_AUDIBLE = 7, // Sounds that cannot be muted by user and must be routed to speaker - DTMF = 8, - TTS = 9, -#ifdef HAVE_FM_RADIO - FM = 10, -#endif - NUM_STREAM_TYPES - }; - - // Audio sub formats (see AudioSystem::audio_format). - enum pcm_sub_format { - PCM_SUB_16_BIT = 0x1, // must be 1 for backward compatibility - PCM_SUB_8_BIT = 0x2, // must be 2 for backward compatibility - }; - - // MP3 sub format field definition : can use 11 LSBs in the same way as MP3 frame header to specify - // bit rate, stereo mode, version... - enum mp3_sub_format { - //TODO - }; - - // AMR NB/WB sub format field definition: specify frame block interleaving, bandwidth efficient or octet aligned, - // encoding mode for recording... - enum amr_sub_format { - //TODO - }; - - // AAC sub format field definition: specify profile or bitrate for recording... - enum aac_sub_format { - //TODO - }; - - // VORBIS sub format field definition: specify quality for recording... - enum vorbis_sub_format { - //TODO - }; - - // Audio format consists in a main format field (upper 8 bits) and a sub format field (lower 24 bits). - // The main format indicates the main codec type. The sub format field indicates options and parameters - // for each format. The sub format is mainly used for record to indicate for instance the requested bitrate - // or profile. It can also be used for certain formats to give informations not present in the encoded - // audio stream (e.g. octet alignement for AMR). - enum audio_format { - INVALID_FORMAT = -1, - FORMAT_DEFAULT = 0, - PCM = 0x00000000, // must be 0 for backward compatibility - MP3 = 0x01000000, - AMR_NB = 0x02000000, - AMR_WB = 0x03000000, - AAC = 0x04000000, - HE_AAC_V1 = 0x05000000, - HE_AAC_V2 = 0x06000000, - VORBIS = 0x07000000, - MAIN_FORMAT_MASK = 0xFF000000, - SUB_FORMAT_MASK = 0x00FFFFFF, - // Aliases - PCM_16_BIT = (PCM|PCM_SUB_16_BIT), - PCM_8_BIT = (PCM|PCM_SUB_8_BIT) - }; - - - // Channel mask definitions must be kept in sync with JAVA values in /media/java/android/media/AudioFormat.java - enum audio_channels { - // output channels - CHANNEL_OUT_FRONT_LEFT = 0x4, - CHANNEL_OUT_FRONT_RIGHT = 0x8, - CHANNEL_OUT_FRONT_CENTER = 0x10, - CHANNEL_OUT_LOW_FREQUENCY = 0x20, - CHANNEL_OUT_BACK_LEFT = 0x40, - CHANNEL_OUT_BACK_RIGHT = 0x80, - CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x100, - CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x200, - CHANNEL_OUT_BACK_CENTER = 0x400, - CHANNEL_OUT_MONO = CHANNEL_OUT_FRONT_LEFT, - CHANNEL_OUT_STEREO = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT), - CHANNEL_OUT_QUAD = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | - CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT), - CHANNEL_OUT_SURROUND = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | - CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_BACK_CENTER), - CHANNEL_OUT_5POINT1 = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | - CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_LOW_FREQUENCY | CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT), - CHANNEL_OUT_7POINT1 = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | - CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_LOW_FREQUENCY | CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT | - CHANNEL_OUT_FRONT_LEFT_OF_CENTER | CHANNEL_OUT_FRONT_RIGHT_OF_CENTER), - CHANNEL_OUT_ALL = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | - CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_LOW_FREQUENCY | CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT | - CHANNEL_OUT_FRONT_LEFT_OF_CENTER | CHANNEL_OUT_FRONT_RIGHT_OF_CENTER | CHANNEL_OUT_BACK_CENTER), - - // input channels - CHANNEL_IN_LEFT = 0x4, - CHANNEL_IN_RIGHT = 0x8, - CHANNEL_IN_FRONT = 0x10, - CHANNEL_IN_BACK = 0x20, - CHANNEL_IN_LEFT_PROCESSED = 0x40, - CHANNEL_IN_RIGHT_PROCESSED = 0x80, - CHANNEL_IN_FRONT_PROCESSED = 0x100, - CHANNEL_IN_BACK_PROCESSED = 0x200, - CHANNEL_IN_PRESSURE = 0x400, - CHANNEL_IN_X_AXIS = 0x800, - CHANNEL_IN_Y_AXIS = 0x1000, - CHANNEL_IN_Z_AXIS = 0x2000, - CHANNEL_IN_VOICE_UPLINK = 0x4000, - CHANNEL_IN_VOICE_DNLINK = 0x8000, -#ifdef OMAP_ENHANCEMENT - CHANNEL_IN_VOICE_UPLINK_DNLINK = 0x10000, -#endif - CHANNEL_IN_MONO = CHANNEL_IN_FRONT, - CHANNEL_IN_STEREO = (CHANNEL_IN_LEFT | CHANNEL_IN_RIGHT), - CHANNEL_IN_ALL = (CHANNEL_IN_LEFT | CHANNEL_IN_RIGHT | CHANNEL_IN_FRONT | CHANNEL_IN_BACK| - CHANNEL_IN_LEFT_PROCESSED | CHANNEL_IN_RIGHT_PROCESSED | CHANNEL_IN_FRONT_PROCESSED | CHANNEL_IN_BACK_PROCESSED| - CHANNEL_IN_PRESSURE | CHANNEL_IN_X_AXIS | CHANNEL_IN_Y_AXIS | CHANNEL_IN_Z_AXIS | -#ifdef OMAP_ENHANCEMENT - CHANNEL_IN_VOICE_UPLINK | CHANNEL_IN_VOICE_DNLINK | CHANNEL_IN_VOICE_UPLINK_DNLINK) -#else - CHANNEL_IN_VOICE_UPLINK | CHANNEL_IN_VOICE_DNLINK ) -#endif - }; - - enum audio_mode { - MODE_INVALID = -2, - MODE_CURRENT = -1, - MODE_NORMAL = 0, - MODE_RINGTONE, - MODE_IN_CALL, - MODE_IN_COMMUNICATION, - NUM_MODES // not a valid entry, denotes end-of-list - }; - - enum audio_in_acoustics { - AGC_ENABLE = 0x0001, - AGC_DISABLE = 0, - NS_ENABLE = 0x0002, - NS_DISABLE = 0, - TX_IIR_ENABLE = 0x0004, - TX_DISABLE = 0 - }; - - // special audio session values - enum audio_sessions { - SESSION_OUTPUT_STAGE = -1, // session for effects attached to a particular output stream - // (value must be less than 0) - SESSION_OUTPUT_MIX = 0, // session for effects applied to output mix. These effects can - // be moved by audio policy manager to another output stream - // (value must be 0) - }; - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - - // mute/unmute microphone - static status_t muteMicrophone(bool state); - static status_t isMicrophoneMuted(bool *state); - - // set/get master volume - static status_t setMasterVolume(float value); - static status_t getMasterVolume(float* volume); - // mute/unmute audio outputs - static status_t setMasterMute(bool mute); - static status_t getMasterMute(bool* mute); - - // set/get stream volume on specified output - static status_t setStreamVolume(int stream, float value, int output); - static status_t getStreamVolume(int stream, float* volume, int output); - - // mute/unmute stream - static status_t setStreamMute(int stream, bool mute); - static status_t getStreamMute(int stream, bool* mute); - - // set audio mode in audio hardware (see AudioSystem::audio_mode) - static status_t setMode(int mode); - - // returns true in *state if tracks are active on the specified stream - static status_t isStreamActive(int stream, bool *state); - - // set/get audio hardware parameters. The function accepts a list of parameters - // key value pairs in the form: key1=value1;key2=value2;... - // Some keys are reserved for standard parameters (See AudioParameter class). - static status_t setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs); - static String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - - static void setErrorCallback(audio_error_callback cb); - - // helper function to obtain AudioFlinger service handle - static const sp& get_audio_flinger(); - - static float linearToLog(int volume); - static int logToLinear(float volume); - - static status_t getOutputSamplingRate(int* samplingRate, int stream = DEFAULT); - static status_t getOutputFrameCount(int* frameCount, int stream = DEFAULT); - static status_t getOutputLatency(uint32_t* latency, int stream = DEFAULT); - - static bool routedToA2dpOutput(int streamType); - - static status_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount, - size_t* buffSize); - - static status_t setVoiceVolume(float volume); -#ifdef HAVE_FM_RADIO - static status_t setFmVolume(float volume); -#endif - - // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specificed stream is playing - // has exited standby. - // returned status (from utils/Errors.h) can be: - // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data - // - INVALID_OPERATION: Not supported on current hardware platform - // - BAD_VALUE: invalid parameter - // NOTE: this feature is not supported on all hardware platforms and it is - // necessary to check returned status before using the returned values. - static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream = DEFAULT); - - static unsigned int getInputFramesLost(audio_io_handle_t ioHandle); - - static int newAudioSessionId(); - // - // AudioPolicyService interface - // - - enum audio_devices { - // output devices - DEVICE_OUT_EARPIECE = 0x1, - DEVICE_OUT_SPEAKER = 0x2, - DEVICE_OUT_WIRED_HEADSET = 0x4, - DEVICE_OUT_WIRED_HEADPHONE = 0x8, - DEVICE_OUT_BLUETOOTH_SCO = 0x10, - DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20, - DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40, - DEVICE_OUT_BLUETOOTH_A2DP = 0x80, - DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100, - DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200, - DEVICE_OUT_AUX_DIGITAL = 0x400, -#ifdef HAVE_FM_RADIO - DEVICE_OUT_FM = 0x800, - DEVICE_OUT_FM_SPEAKER = 0x1000, - DEVICE_OUT_FM_ALL = (DEVICE_OUT_FM | DEVICE_OUT_FM_SPEAKER), -#elif defined(OMAP_ENHANCEMENT) - DEVICE_OUT_FM_TRANSMIT = 0x800, - DEVICE_OUT_LOW_POWER = 0x1000, -#endif - DEVICE_OUT_HDMI = 0x2000, - DEVICE_OUT_DEFAULT = 0x8000, - DEVICE_OUT_ALL = (DEVICE_OUT_EARPIECE | DEVICE_OUT_SPEAKER | DEVICE_OUT_WIRED_HEADSET | -#ifdef HAVE_FM_RADIO - DEVICE_OUT_WIRED_HEADPHONE | DEVICE_OUT_FM | DEVICE_OUT_FM_SPEAKER | DEVICE_OUT_BLUETOOTH_SCO | DEVICE_OUT_BLUETOOTH_SCO_HEADSET | -#else - DEVICE_OUT_WIRED_HEADPHONE | DEVICE_OUT_BLUETOOTH_SCO | DEVICE_OUT_BLUETOOTH_SCO_HEADSET | -#endif - DEVICE_OUT_BLUETOOTH_SCO_CARKIT | DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | -#if defined(OMAP_ENHANCEMENT) && !defined(HAVE_FM_RADIO) - DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | DEVICE_OUT_AUX_DIGITAL | DEVICE_OUT_LOW_POWER | - DEVICE_OUT_FM_TRANSMIT | DEVICE_OUT_DEFAULT), -#else - DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | DEVICE_OUT_AUX_DIGITAL | DEVICE_OUT_HDMI | DEVICE_OUT_DEFAULT), -#endif - DEVICE_OUT_ALL_A2DP = (DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER), - - // input devices - DEVICE_IN_COMMUNICATION = 0x10000, - DEVICE_IN_AMBIENT = 0x20000, - DEVICE_IN_BUILTIN_MIC = 0x40000, - DEVICE_IN_BLUETOOTH_SCO_HEADSET = 0x80000, - DEVICE_IN_WIRED_HEADSET = 0x100000, - DEVICE_IN_AUX_DIGITAL = 0x200000, - DEVICE_IN_VOICE_CALL = 0x400000, - DEVICE_IN_BACK_MIC = 0x800000, -#ifdef HAVE_FM_RADIO - DEVICE_IN_FM_RX = 0x1000000, - DEVICE_IN_FM_RX_A2DP = 0x2000000, -#endif -#ifdef OMAP_ENHANCEMENT - DEVICE_IN_FM_ANALOG = 0x1000000, -#endif - DEVICE_IN_DEFAULT = 0x80000000, - - DEVICE_IN_ALL = (DEVICE_IN_COMMUNICATION | DEVICE_IN_AMBIENT | DEVICE_IN_BUILTIN_MIC | - DEVICE_IN_BLUETOOTH_SCO_HEADSET | DEVICE_IN_WIRED_HEADSET | DEVICE_IN_AUX_DIGITAL | -#ifdef HAVE_FM_RADIO - DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_FM_RX | DEVICE_IN_FM_RX_A2DP | DEVICE_IN_DEFAULT) -#elif OMAP_ENHANCEMENT - DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_FM_ANALOG | DEVICE_IN_DEFAULT) -#else - DEVICE_IN_VOICE_CALL | DEVICE_IN_BACK_MIC | DEVICE_IN_DEFAULT) -#endif - - }; - - // device connection states used for setDeviceConnectionState() - enum device_connection_state { - DEVICE_STATE_UNAVAILABLE, - DEVICE_STATE_AVAILABLE, - NUM_DEVICE_STATES - }; - - // request to open a direct output with getOutput() (by opposition to sharing an output with other AudioTracks) - enum output_flags { - OUTPUT_FLAG_INDIRECT = 0x0, - OUTPUT_FLAG_DIRECT = 0x1 - }; - - // device categories used for setForceUse() - enum forced_config { - FORCE_NONE, - FORCE_SPEAKER, - FORCE_HEADPHONES, - FORCE_BT_SCO, - FORCE_BT_A2DP, - FORCE_WIRED_ACCESSORY, - FORCE_BT_CAR_DOCK, - FORCE_BT_DESK_DOCK, - NUM_FORCE_CONFIG, - FORCE_DEFAULT = FORCE_NONE - }; - - // usages used for setForceUse() - enum force_use { - FOR_COMMUNICATION, - FOR_MEDIA, - FOR_RECORD, - FOR_DOCK, - NUM_FORCE_USE - }; - - // types of io configuration change events received with ioConfigChanged() - enum io_config_event { - OUTPUT_OPENED, - OUTPUT_CLOSED, - OUTPUT_CONFIG_CHANGED, - INPUT_OPENED, - INPUT_CLOSED, - INPUT_CONFIG_CHANGED, - STREAM_CONFIG_CHANGED, - NUM_CONFIG_EVENTS - }; - - // audio output descritor used to cache output configurations in client process to avoid frequent calls - // through IAudioFlinger - class OutputDescriptor { - public: - OutputDescriptor() - : samplingRate(0), format(0), channels(0), frameCount(0), latency(0) {} - - uint32_t samplingRate; - int32_t format; - int32_t channels; - size_t frameCount; - uint32_t latency; - }; - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - static status_t setDeviceConnectionState(audio_devices device, device_connection_state state, const char *device_address); - static device_connection_state getDeviceConnectionState(audio_devices device, const char *device_address); - static status_t setPhoneState(int state); - static status_t setRingerMode(uint32_t mode, uint32_t mask); - static status_t setForceUse(force_use usage, forced_config config); - static forced_config getForceUse(force_use usage); - static audio_io_handle_t getOutput(stream_type stream, - uint32_t samplingRate = 0, - uint32_t format = FORMAT_DEFAULT, - uint32_t channels = CHANNEL_OUT_STEREO, - output_flags flags = OUTPUT_FLAG_INDIRECT); - static status_t startOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0); - static status_t stopOutput(audio_io_handle_t output, - AudioSystem::stream_type stream, - int session = 0); - static void releaseOutput(audio_io_handle_t output); - static audio_io_handle_t getInput(int inputSource, - uint32_t samplingRate = 0, - uint32_t format = FORMAT_DEFAULT, - uint32_t channels = CHANNEL_IN_MONO, - audio_in_acoustics acoustics = (audio_in_acoustics)0); - static status_t startInput(audio_io_handle_t input); - static status_t stopInput(audio_io_handle_t input); - static void releaseInput(audio_io_handle_t input); - static status_t initStreamVolume(stream_type stream, - int indexMin, - int indexMax); - static status_t setStreamVolumeIndex(stream_type stream, int index); - static status_t getStreamVolumeIndex(stream_type stream, int *index); - - static uint32_t getStrategyForStream(stream_type stream); - - static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); - static status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t output, - uint32_t strategy, - int session, - int id); - static status_t unregisterEffect(int id); - - static const sp& get_audio_policy_service(); - - // ---------------------------------------------------------------------------- - - static uint32_t popCount(uint32_t u); - static bool isOutputDevice(audio_devices device); - static bool isInputDevice(audio_devices device); - static bool isA2dpDevice(audio_devices device); -#ifdef HAVE_FM_RADIO - static bool isFmDevice(audio_devices device); -#endif - static bool isBluetoothScoDevice(audio_devices device); - static bool isLowVisibility(stream_type stream); - static bool isOutputChannel(uint32_t channel); - static bool isInputChannel(uint32_t channel); - static bool isValidFormat(uint32_t format); - static bool isLinearPCM(uint32_t format); - -private: - - class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient - { - public: - AudioFlingerClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - - // IAudioFlingerClient - - // indicate a change in the configuration of an output or input: keeps the cached - // values for output/input parameters upto date in client process - virtual void ioConfigChanged(int event, int ioHandle, void *param2); - }; - - class AudioPolicyServiceClient: public IBinder::DeathRecipient - { - public: - AudioPolicyServiceClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - }; - - static sp gAudioFlingerClient; - static sp gAudioPolicyServiceClient; - friend class AudioFlingerClient; - friend class AudioPolicyServiceClient; - - static Mutex gLock; - static sp gAudioFlinger; - static audio_error_callback gAudioErrorCallback; - - static size_t gInBuffSize; - // previous parameters for recording buffer size queries - static uint32_t gPrevInSamplingRate; - static int gPrevInFormat; - static int gPrevInChannelCount; - - static sp gAudioPolicyService; - - // mapping between stream types and outputs - static DefaultKeyedVector gStreamOutputMap; - // list of output descritor containing cached parameters (sampling rate, framecount, channel count...) - static DefaultKeyedVector gOutputs; -}; - -class AudioParameter { - -public: - AudioParameter() {} - AudioParameter(const String8& keyValuePairs); - virtual ~AudioParameter(); - - // reserved parameter keys for changing standard parameters with setParameters() function. - // Using these keys is mandatory for AudioFlinger to properly monitor audio output/input - // configuration changes and act accordingly. - // keyRouting: to change audio routing, value is an int in AudioSystem::audio_devices - // keySamplingRate: to change sampling rate routing, value is an int - // keyFormat: to change audio format, value is an int in AudioSystem::audio_format - // keyChannels: to change audio channel configuration, value is an int in AudioSystem::audio_channels - // keyFrameCount: to change audio output frame count, value is an int - // keyInputSource: to change audio input source, value is an int in audio_source - // (defined in media/mediarecorder.h) - static const char *keyRouting; - static const char *keySamplingRate; - static const char *keyFormat; - static const char *keyChannels; - static const char *keyFrameCount; -#ifdef HAVE_FM_RADIO - static const char *keyFmOn; - static const char *keyFmOff; -#endif - static const char *keyInputSource; - - String8 toString(); - - status_t add(const String8& key, const String8& value); - status_t addInt(const String8& key, const int value); - status_t addFloat(const String8& key, const float value); - - status_t remove(const String8& key); - - status_t get(const String8& key, String8& value); - status_t getInt(const String8& key, int& value); - status_t getFloat(const String8& key, float& value); - status_t getAt(size_t index, String8& key, String8& value); - - size_t size() { return mParameters.size(); } - -private: - String8 mKeyValuePairs; - KeyedVector mParameters; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOSYSTEM_H_*/ diff --git a/audio/MODULE_LICENSE_APACHE2 b/audio/MODULE_LICENSE_APACHE2 deleted file mode 100755 index e69de29..0000000 diff --git a/audio/NOTICE b/audio/NOTICE deleted file mode 100755 index 3237da6..0000000 --- a/audio/NOTICE +++ /dev/null @@ -1,190 +0,0 @@ - - Copyright (c) 2008-2009, The Android 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. - - 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. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - diff --git a/audio/audio_policy_hal.cpp b/audio/audio_policy_hal.cpp deleted file mode 100755 index 110a919..0000000 --- a/audio/audio_policy_hal.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (C) 2011 The Android 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. - */ - -#define LOG_TAG "legacy_audio_policy_hal" -#define LOG_NDEBUG 0 - -#include - -#include -#include -#include -#include - -#include -#include - -#include "AudioPolicyCompatClient.h" - -namespace android_audio_legacy { - -extern "C" { - -struct legacy_ap_module { - struct audio_policy_module module; -}; - -struct legacy_ap_device { - struct audio_policy_device device; -}; - -struct legacy_audio_policy { - struct audio_policy policy; - - void *service; - struct audio_policy_service_ops *aps_ops; - AudioPolicyCompatClient *service_client; - AudioPolicyInterface *apm; -}; - -static inline struct legacy_audio_policy * to_lap(struct audio_policy *pol) -{ - return reinterpret_cast(pol); -} - -static inline const struct legacy_audio_policy * to_clap(const struct audio_policy *pol) -{ - return reinterpret_cast(pol); -} - - -static int ap_set_device_connection_state(struct audio_policy *pol, - audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->setDeviceConnectionState( - (AudioSystem::audio_devices)device, - (AudioSystem::device_connection_state)state, - device_address); -} - -static audio_policy_dev_state_t ap_get_device_connection_state( - const struct audio_policy *pol, - audio_devices_t device, - const char *device_address) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return (audio_policy_dev_state_t)lap->apm->getDeviceConnectionState( - (AudioSystem::audio_devices)device, - device_address); -} - -static void ap_set_phone_state(struct audio_policy *pol, int state) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->setPhoneState(state); -} - - /* indicate a change in ringer mode */ -static void ap_set_ringer_mode(struct audio_policy *pol, uint32_t mode, - uint32_t mask) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->setRingerMode(mode, mask); -} - - /* force using a specific device category for the specified usage */ -static void ap_set_force_use(struct audio_policy *pol, - audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->setForceUse((AudioSystem::force_use)usage, - (AudioSystem::forced_config)config); -} - - /* retreive current device category forced for a given usage */ -static audio_policy_forced_cfg_t ap_get_force_use( - const struct audio_policy *pol, - audio_policy_force_use_t usage) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return (audio_policy_forced_cfg_t)lap->apm->getForceUse( - (AudioSystem::force_use)usage); -} - -/* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE - * can still be muted. */ -static void ap_set_can_mute_enforced_audible(struct audio_policy *pol, - bool can_mute) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->setSystemProperty("ro.camera.sound.forced", can_mute ? "0" : "1"); -} - -static int ap_init_check(const struct audio_policy *pol) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->initCheck(); -} - -static audio_io_handle_t ap_get_output(struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t sampling_rate, - uint32_t format, - uint32_t channels, - audio_policy_output_flags_t flags) -{ - struct legacy_audio_policy *lap = to_lap(pol); - - LOGV("%s: tid %d", __func__, gettid()); - return lap->apm->getOutput((AudioSystem::stream_type)stream, - sampling_rate, format, channels, - (AudioSystem::output_flags)flags); -} - -static int ap_start_output(struct audio_policy *pol, audio_io_handle_t output, - audio_stream_type_t stream, int session) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->startOutput(output, (AudioSystem::stream_type)stream, - session); -} - -static int ap_stop_output(struct audio_policy *pol, audio_io_handle_t output, - audio_stream_type_t stream, int session) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->stopOutput(output, (AudioSystem::stream_type)stream, - session); -} - -static void ap_release_output(struct audio_policy *pol, - audio_io_handle_t output) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->releaseOutput(output); -} - -static audio_io_handle_t ap_get_input(struct audio_policy *pol, int inputSource, - uint32_t sampling_rate, - uint32_t format, - uint32_t channels, - audio_in_acoustics_t acoustics) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->getInput(inputSource, sampling_rate, format, channels, - (AudioSystem::audio_in_acoustics)acoustics); -} - -static int ap_start_input(struct audio_policy *pol, audio_io_handle_t input) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->startInput(input); -} - -static int ap_stop_input(struct audio_policy *pol, audio_io_handle_t input) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->stopInput(input); -} - -static void ap_release_input(struct audio_policy *pol, audio_io_handle_t input) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->releaseInput(input); -} - -static void ap_init_stream_volume(struct audio_policy *pol, - audio_stream_type_t stream, int index_min, - int index_max) -{ - struct legacy_audio_policy *lap = to_lap(pol); - lap->apm->initStreamVolume((AudioSystem::stream_type)stream, index_min, - index_max); -} - -static int ap_set_stream_volume_index(struct audio_policy *pol, - audio_stream_type_t stream, - int index) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->setStreamVolumeIndex((AudioSystem::stream_type)stream, - index); -} - -static int ap_get_stream_volume_index(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->getStreamVolumeIndex((AudioSystem::stream_type)stream, - index); -} - -static uint32_t ap_get_strategy_for_stream(const struct audio_policy *pol, - audio_stream_type_t stream) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->getStrategyForStream((AudioSystem::stream_type)stream); -} - -static uint32_t ap_get_devices_for_stream(const struct audio_policy *pol, - audio_stream_type_t stream) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->getDevicesForStream((AudioSystem::stream_type)stream); -} - -static audio_io_handle_t ap_get_output_for_effect(struct audio_policy *pol, - struct effect_descriptor_s *desc) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->getOutputForEffect(desc); -} - -static int ap_register_effect(struct audio_policy *pol, - struct effect_descriptor_s *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->registerEffect(desc, io, strategy, session, id); -} - -static int ap_unregister_effect(struct audio_policy *pol, int id) -{ - struct legacy_audio_policy *lap = to_lap(pol); - return lap->apm->unregisterEffect(id); -} - -static int ap_set_effect_enabled(struct audio_policy *pol, int id, bool enabled) -{ - return NO_ERROR; -} - -static bool ap_is_stream_active(const struct audio_policy *pol, int stream, - uint32_t in_past_ms) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->isStreamActive(stream, in_past_ms); -} - -static int ap_dump(const struct audio_policy *pol, int fd) -{ - const struct legacy_audio_policy *lap = to_clap(pol); - return lap->apm->dump(fd); -} - -static int create_legacy_ap(const struct audio_policy_device *device, - struct audio_policy_service_ops *aps_ops, - void *service, - struct audio_policy **ap) -{ - struct legacy_audio_policy *lap; - int ret; - - if (!service || !aps_ops) - return -EINVAL; - - lap = (struct legacy_audio_policy *)calloc(1, sizeof(*lap)); - if (!lap) - return -ENOMEM; - - lap->policy.set_device_connection_state = ap_set_device_connection_state; - lap->policy.get_device_connection_state = ap_get_device_connection_state; - lap->policy.set_phone_state = ap_set_phone_state; - lap->policy.set_ringer_mode = ap_set_ringer_mode; - lap->policy.set_force_use = ap_set_force_use; - lap->policy.get_force_use = ap_get_force_use; - lap->policy.set_can_mute_enforced_audible = - ap_set_can_mute_enforced_audible; - lap->policy.init_check = ap_init_check; - lap->policy.get_output = ap_get_output; - lap->policy.start_output = ap_start_output; - lap->policy.stop_output = ap_stop_output; - lap->policy.release_output = ap_release_output; - lap->policy.get_input = ap_get_input; - lap->policy.start_input = ap_start_input; - lap->policy.stop_input = ap_stop_input; - lap->policy.release_input = ap_release_input; - lap->policy.init_stream_volume = ap_init_stream_volume; - lap->policy.set_stream_volume_index = ap_set_stream_volume_index; - lap->policy.get_stream_volume_index = ap_get_stream_volume_index; - lap->policy.get_strategy_for_stream = ap_get_strategy_for_stream; - lap->policy.get_devices_for_stream = ap_get_devices_for_stream; - lap->policy.get_output_for_effect = ap_get_output_for_effect; - lap->policy.register_effect = ap_register_effect; - lap->policy.unregister_effect = ap_unregister_effect; - lap->policy.set_effect_enabled = ap_set_effect_enabled; - lap->policy.is_stream_active = ap_is_stream_active; - lap->policy.dump = ap_dump; - - lap->service = service; - lap->aps_ops = aps_ops; - lap->service_client = - new AudioPolicyCompatClient(aps_ops, service); - if (!lap->service_client) { - ret = -ENOMEM; - goto err_new_compat_client; - } - - lap->apm = createAudioPolicyManager(lap->service_client); - if (!lap->apm) { - ret = -ENOMEM; - goto err_create_apm; - } - - *ap = &lap->policy; - return 0; - -err_create_apm: - delete lap->service_client; -err_new_compat_client: - free(lap); - *ap = NULL; - return ret; -} - -static int destroy_legacy_ap(const struct audio_policy_device *ap_dev, - struct audio_policy *ap) -{ - struct legacy_audio_policy *lap = to_lap(ap); - - if (!lap) - return 0; - - if (lap->apm) - destroyAudioPolicyManager(lap->apm); - if (lap->service_client) - delete lap->service_client; - free(lap); - return 0; -} - -static int legacy_ap_dev_close(hw_device_t* device) -{ - if (device) - free(device); - return 0; -} - -static int legacy_ap_dev_open(const hw_module_t* module, const char* name, - hw_device_t** device) -{ - struct legacy_ap_device *dev; - - if (strcmp(name, AUDIO_POLICY_INTERFACE) != 0) - return -EINVAL; - - dev = (struct legacy_ap_device *)calloc(1, sizeof(*dev)); - if (!dev) - return -ENOMEM; - - dev->device.common.tag = HARDWARE_DEVICE_TAG; - dev->device.common.version = 0; - dev->device.common.module = const_cast(module); - dev->device.common.close = legacy_ap_dev_close; - dev->device.create_audio_policy = create_legacy_ap; - dev->device.destroy_audio_policy = destroy_legacy_ap; - - *device = &dev->device.common; - - return 0; -} - -static struct hw_module_methods_t legacy_ap_module_methods = { - open: legacy_ap_dev_open -}; - -struct legacy_ap_module HAL_MODULE_INFO_SYM = { - module: { - common: { - tag: HARDWARE_MODULE_TAG, - version_major: 1, - version_minor: 0, - id: AUDIO_POLICY_HARDWARE_MODULE_ID, - name: "LEGACY Audio Policy HAL", - author: "The Android Open Source Project", - methods: &legacy_ap_module_methods, - dso : NULL, - reserved : {0}, - }, - }, -}; - -}; // extern "C" - -}; // namespace android_audio_legacy diff --git a/configs/apns-conf.xml b/configs/apns-conf.xml deleted file mode 100755 index 6cbe9d8..0000000 --- a/configs/apns-conf.xml +++ /dev/null @@ -1,1331 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configs/apns.conf b/configs/apns.conf deleted file mode 100755 index dd319f7..0000000 --- a/configs/apns.conf +++ /dev/null @@ -1,1330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/configs/asound.conf b/configs/asound.conf old mode 100755 new mode 100644 index 1163934..6144596 --- a/configs/asound.conf +++ b/configs/asound.conf @@ -42,18 +42,6 @@ pcm.bluetooth { } } -pcm.record { - type plug - slave.pcm { - type hw - card 0 - device 1 - format S16_LE - channels 2 - rate 44100 - } -} - # ---------------------------------------- # Mixer Interface # diff --git a/configs/audio_effects.conf b/configs/audio_effects.conf deleted file mode 100755 index b8fa487..0000000 --- a/configs/audio_effects.conf +++ /dev/null @@ -1,126 +0,0 @@ -# List of effect libraries to load. Each library element must contain a "path" element -# giving the full path of the library .so file. -# libraries { -# { -# path -# } -# } -libraries { - bundle { - path /system/lib/soundfx/libbundlewrapper.so - } - reverb { - path /system/lib/soundfx/libreverbwrapper.so - } - visualizer { - path /system/lib/soundfx/libvisualizer.so - } - pre_processing { - path /system/lib/soundfx/libaudiopreprocessing.so - } -} - -# list of effects to load. Each effect element must contain a "library" and a "uuid" element. -# The value of the "library" element must correspond to the name of one library element in the -# "libraries" element. -# The name of the effect element is indicative, only the value of the "uuid" element -# designates the effect. -# The uuid is the implementation specific UUID as specified by the effect vendor. This is not the -# generic effect type UUID. -# effects { -# { -# library -# uuid -# } -# ... -# } - -effects { - bassboost { - library bundle - uuid 8631f300-72e2-11df-b57e-0002a5d5c51b - } - virtualizer { - library bundle - uuid 1d4033c0-8557-11df-9f2d-0002a5d5c51b - } - equalizer { - library bundle - uuid ce772f20-847d-11df-bb17-0002a5d5c51b - } - volume { - library bundle - uuid 119341a0-8469-11df-81f9- 0002a5d5c51b - } - reverb_env_aux { - library reverb - uuid 4a387fc0-8ab3-11df-8bad- 0002a5d5c51b - } - reverb_env_ins { - library reverb - uuid c7a511a0-a3bb-11df-860e-0002a5d5c51b - } - reverb_pre_aux { - library reverb - uuid f29a1400-a3bb-11df-8ddc-0002a5d5c51b - } - reverb_pre_ins { - library reverb - uuid 172cdf00-a3bc-11df-a72f-0002a5d5c51b - } - visualizer { - library visualizer - uuid d069d9e0-8329-11df-9168-0002a5d5c51b - } - agc { - library pre_processing - uuid aa8130e0-66fc-11e0-bad0-0002a5d5c51b - } - aec { - library pre_processing - uuid bb392ec0-8d4d-11e0-a896-0002a5d5c51b - } - ns { - library pre_processing - uuid c06c8400-8e06-11e0-9cb6-0002a5d5c51b - } -} -# Audio preprocessor configurations. -# The pre processor configuration consists in a list of elements each describing -# pre processor settings for a given input source. Valid input source names are: -# "mic", "camcorder", "voice_recognition", "voice_communication" -# Each input source element contains a list of effects elements. The name of the effect -# element must be the name of one of the effects in the "effects" list of the file. -# Each effect element may optionally contain a list of parameters and their -# default value to apply when the pre processor effect is created. -# A parameter is defined by a "param" element and a "value" element. Each of these elements -# consists in one or more elements specifying a type followed by a value. -# The types defined are: "int", "short", "float", "bool" and "string" -# When both "param" and "value" are a single int, a simple form is allowed where just -# the param and value pair is present in the parameter description -# pre_processing { -# { -# { -# { -# param { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# value { -# int|short|float|bool|string -# [ int|short|float|bool|string ] -# ... -# } -# } -# { } -# ... -# } -# ... -# } -# ... -# } - -# -# TODO: add default audio pre processor configurations after debug and tuning phase -# diff --git a/configs/gps.conf b/configs/gps.conf old mode 100755 new mode 100644 diff --git a/configs/gps.xml b/configs/gps.xml deleted file mode 100755 index 612da9a..0000000 --- a/configs/gps.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - diff --git a/configs/main.conf b/configs/main.conf deleted file mode 100755 index b9fb19d..0000000 --- a/configs/main.conf +++ /dev/null @@ -1,66 +0,0 @@ -[General] - -# List of plugins that should not be loaded on bluetoothd startup -#DisablePlugins = network,input - -# Default adaper name -# %h - substituted for hostname -# %d - substituted for adapter id -# %b - substituted for ro.product.brand -# %m - substituted for ro.product.model -# %n - substituted for ro.product.name -Name = %m - -# Default device class. Only the major and minor device class bits are -# considered. -# Local device class -# 0x400000 - Service class: Telephony -# 0x000200 - Major class: Phone -# 0x00000C - Minor class: Smart phone -Class = 0x40020C - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -DiscoverableTimeout = 120 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -PairableTimeout = 0 - -# Use some other page timeout than the controller default one -# which is 16384 (10 seconds). -PageTimeout = 8192 - -# Discover scheduler interval used in Adapter.DiscoverDevices -# The value is in seconds. Defaults is 0 to use controller scheduler. -DiscoverSchedulerInterval = 0 - -# What value should be assumed for the adapter Powered property when -# SetProperty(Powered, ...) hasn't been called yet. Defaults to true -InitiallyPowered = true - -# Remember the previously stored Powered state when initializing adapters -RememberPowered = true - -# Use vendor, product and version information for DID profile support. -# The values are separated by ":" and VID, PID and version. -DeviceID = android:generic:1.5 - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to true. -ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -NameResolving = true - -# The link policy for connections. By default it's set to 15(0x000f) which is -# a bitwise OR of role switch(0x0001), hold mode(0x0002), sniff mode(0x0004) -# and park state(0x0008) are all enabled. However, some devices have -# connection stability issue or fail to setup SCO when the link is in park -# state, which requires park state bit cleared. -DefaultLinkPolicy = 7 \ No newline at end of file diff --git a/configs/media_profiles.xml b/configs/media_profiles.xml old mode 100755 new mode 100644 diff --git a/configs/nvram_mfg.txt b/configs/nvram_mfg.txt new file mode 100644 index 0000000..5311632 --- /dev/null +++ b/configs/nvram_mfg.txt @@ -0,0 +1,112 @@ +manfid=0x2d0 +prodid=0x0532 +vendid=0x14e4 +devid=0x4360 +boardtype=0x0532 +boardrev=0x20 +boardflags=0x10080201 + +nocrc=1 +xtalfreq=37400 +xtalmode=0x20,0x4,0 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +ag0=255 +ag1=255 +aa2g=1 +ccode=ALL + +btc_params80=0 +btc_params6=10 +btc_params8=10000 + +sd_gpout=0 +sd_oobonly=1 + +# 2G PA para B42G_R08_110729 +pa0b0=0x14CF +pa0b1=0xFD9F +pa0b2=0xFF6D +#pa0itssit=62 +rssismf2g=0xa +rssismc2g=0x3 +rssisav2g=0x7 + +# rssi params for 5GHz B42G_R08_110729 +#rssismf5g=0x4 +rssismf5g=0xa +rssismc5g=0x7 +rssisav5g=0x1 +#PA parameters for lower band +pa1lob0=5907 +pa1lob1=64797 +pa1lob2=65324 +#PA parameters for midband +pa1b0=6071 +pa1b1=64780 +pa1b2=65325 +#PA parameters for high band +pa1hib0=6015 +pa1hib1=64782 +pa1hib2=65321 + +# 2G PA offset B42G_R08_110825 +maxp2ga0=76 +sromrev=3 +cckpo=0 +ofdm2gpo=0x66666666 +mcs2gpo0=0x8888 +mcs2gpo1=0x8888 + +# 5G PA offset B42G_R08_110825 +maxp5ga0=66 +maxp5gla0=66 +maxp5gha0=66 +ofdm5gpo=0x00000000 +ofdm5glpo=0x11111111 +ofdm5ghpo=0x11111111 +mcs5gpo0=0x2222 +mcs5gpo1=0x2222 +mcs5glpo0=0x3333 +mcs5glpo1=0x3333 +mcs5ghpo0=0x3333 +mcs5ghpo1=0x3333 + +cckPwrOffset=4 +cckdigfilttype=21 +ofdmdigfilttype=2 +extpagain5g=2 +#wl0id=0x431b + +# For 2GHz Tx EVM/SM +rfreg033=0x19 +rfreg033_cck=0x1f +pacalidx2g=65 +dacrate2g=160 +txalpfbyp2g=1 +bphyscale=17 + +#5GHz LOFT and IQ CAL +txgaintbl5g=1 +txiqlopapu5g=1 +txiqlopag5g=0x10 +iqlocalidx5g=24 + +# 5GHz Noise CAL parameter +noise_cal_po_5g=5 +noise_cal_enable_5g=0 + +# 2GHz RxPER at low rates +noise_cal_ref_2g=56 +noise_cal_po_bias_2g=-4 +noise_cal_enable_2g=1 + +# Max input level on a-band +triso5g=1 + +# Tx power control, especially temp. +tssitime=1 + +swctrlmap_2g=0x84048404, 0x82028202, 0x84048404, 0x010202, 0x1ff +swctrlmap_5g=0xC040C040, 0xB030A020, 0xA020C040, 0x010A02, 0x2F8 + diff --git a/configs/nvram_net.txt b/configs/nvram_net.txt old mode 100755 new mode 100644 index 62ef864..c1d5a9b --- a/configs/nvram_net.txt +++ b/configs/nvram_net.txt @@ -11,71 +11,74 @@ xtalfreq=37400 xtalmode=0x20,0x4,0 boardnum=22 macaddr=00:90:4c:c5:12:38 -ag0=255 +ag0=252 ag1=255 aa2g=1 ccode=GB btc_params80=0 btc_params6=10 +btc_params8=10000 sd_gpout=0 sd_oobonly=1 -# 2G PA para_SMST_0502 -pa0b0=5477 -pa0b1=64918 -pa0b2=65396 +# 2G PA para B42G_R08_110729 +pa0b0=0x14CF +pa0b1=0xFD9F +pa0b2=0xFF6D #pa0itssit=62 rssismf2g=0xa rssismc2g=0x3 rssisav2g=0x7 -# rssi params for 5GHz +# rssi params for 5GHz B42G_R08_110729 #rssismf5g=0x4 rssismf5g=0xa rssismc5g=0x7 rssisav5g=0x1 #PA parameters for lower band -pa1lob0=5408 -pa1lob1=64851 -pa1lob2=65337 +pa1lob0=5907 +pa1lob1=64797 +pa1lob2=65324 #PA parameters for midband -pa1b0=5351 -pa1b1=64860 -pa1b2=65345 +pa1b0=6071 +pa1b1=64780 +pa1b2=65325 #PA parameters for high band -pa1hib0=4924 -pa1hib1=64895 -pa1hib2=65329 +pa1hib0=6015 +pa1hib1=64782 +pa1hib2=65321 -# 2G PA offset -maxp2ga0=72 +# 2G PA offset B42G_R08_110825 +maxp2ga0=80 sromrev=3 cckpo=0 ofdm2gpo=0x66666666 -mcs2gpo0=0xaaaa -mcs2gpo1=0xaaaa - -# 5G PA offset -maxp5ga0=60 -maxp5gla0=60 -maxp5gha0=60 -ofdm5gpo=0x33333333 -ofdm5glpo=0x33333333 -ofdm5ghpo=0x33333333 -mcs5gpo0=0x9999 -mcs5gpo1=0x9999 -mcs5glpo0=0x9999 -mcs5glpo1=0x9999 -mcs5ghpo0=0x9999 -mcs5ghpo1=0x9999 +mcs2gpo0=0x8888 +mcs2gpo1=0x8888 + +# 5G PA offset B42G_R08_110825 +maxp5ga0=66 +maxp5gla0=66 +maxp5gha0=66 +ofdm5gpo=0x00000000 +ofdm5glpo=0x11111111 +ofdm5ghpo=0x11111111 +mcs5gpo0=0x2222 +mcs5gpo1=0x2222 +mcs5glpo0=0x3333 +mcs5glpo1=0x3333 +mcs5ghpo0=0x3333 +mcs5ghpo1=0x3333 cckPwrOffset=4 -cckdigfilttype=20 +cckdigfilttype=21 ofdmdigfilttype=2 -#wl0id=0x431b extpagain5g=2 +#wl0id=0x431b + +# For 2GHz Tx EVM/SM rfreg033=0x19 rfreg033_cck=0x1f pacalidx2g=65 @@ -83,10 +86,27 @@ dacrate2g=160 txalpfbyp2g=1 bphyscale=17 -#5GHz Carrier +#5GHz LOFT and IQ CAL +txgaintbl5g=1 txiqlopapu5g=1 txiqlopag5g=0x10 +iqlocalidx5g=24 + +# 5GHz Noise CAL parameter +noise_cal_po_5g=5 +noise_cal_enable_5g=0 + +# 2GHz RxPER at low rates +noise_cal_ref_2g=56 +noise_cal_po_bias_2g=-4 +noise_cal_enable_2g=1 + +# Max input level on a-band +triso5g=1 + +# Tx power control, especially temp. +tssitime=1 swctrlmap_2g=0x84048404, 0x82028202, 0x84048404, 0x010202, 0x1ff -swctrlmap_5g=0xC040C040, 0xB030A020, 0x8000C040, 0x010A02, 0x2F8 +swctrlmap_5g=0xC040C040, 0xB030A020, 0xA020C040, 0x010A02, 0x2F8 diff --git a/configs/sec_touchscreen.idc b/configs/sec_touchscreen.idc deleted file mode 100755 index d258f04..0000000 --- a/configs/sec_touchscreen.idc +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2010 The Android 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. - -# -# Input Device Calibration File for the Crespo touch screen. -# -# These calibration values are derived from empirical measurements -# and may not be appropriate for use with other touch screens. -# Refer to the input device calibration documentation for more details. -# - -# Basic Parameters -touch.deviceType = touchScreen -touch.orientationAware = 1 - -# Touch Size -touch.touchSize.calibration = pressure - -# Tool Size -# Driver reports tool size as an area measurement. -# -# Based on empirical measurements, we estimate the size of the tool -# using size = sqrt(22 * rawToolArea + 0) * 9.2 + 0. -touch.toolSize.calibration = area -touch.toolSize.areaScale = 22 -touch.toolSize.areaBias = 0 -touch.toolSize.linearScale = 9.2 -touch.toolSize.linearBias = 0 -touch.toolSize.isSummed = 0 - -# Pressure -# Driver reports signal strength as pressure. -# -# A normal thumb touch typically registers about 100 signal strength -# units although we don't expect these values to be accurate. -touch.pressure.calibration = amplitude -touch.pressure.source = default -touch.pressure.scale = 0.01 - -# Size -touch.size.calibration = normalized - -# Orientation -touch.orientation.calibration = none - diff --git a/configs/sec_ts_ics_bio.idc b/configs/sec_ts_ics_bio.idc deleted file mode 100755 index eb46d0a..0000000 --- a/configs/sec_ts_ics_bio.idc +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2010 The Android 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. - -# -# Input Device Calibration File for the Crespo touch screen. -# -# These calibration values are derived from empirical measurements -# and may not be appropriate for use with other touch screens. -# Refer to the input device calibration documentation for more details. -# - -# Basic Parameters -touch.deviceType = touchScreen -touch.orientationAware = 1 - -# Touch Size -touch.touchSize.calibration = pressure - -# Tool Size -# Driver reports tool size as an area measurement. -# -# Based on empirical measurements, we estimate the size of the tool -# using size = sqrt(22 * rawToolArea + 0) * 9.2 + 0. -touch.toolSize.calibration = area -touch.toolSize.areaScale = 22 -touch.toolSize.areaBias = 0 -touch.toolSize.linearScale = 9.2 -touch.toolSize.linearBias = 0 -touch.toolSize.isSummed = 0 - -# Pressure -# Driver reports signal strength as pressure. -# -# A normal thumb touch typically registers about 100 signal strength -# units although we don't expect these values to be accurate. -touch.pressure.calibration = amplitude -touch.pressure.source = default -touch.pressure.scale = 0.01 - -# Size -touch.size.calibration = normalized - -# Orientation -touch.orientation.calibration = none - diff --git a/configs/secomxregistry b/configs/secomxregistry old mode 100755 new mode 100644 diff --git a/configs/somxreg.conf b/configs/somxreg.conf old mode 100755 new mode 100644 diff --git a/configs/soundbooster.txt b/configs/soundbooster.txt deleted file mode 100755 index 42a6ad9..0000000 --- a/configs/soundbooster.txt +++ /dev/null @@ -1,4 +0,0 @@ -H,0 -G,6 -C,2 -S,2 diff --git a/configs/spn-conf.xml b/configs/spn-conf.xml deleted file mode 100755 index d724fba..0000000 --- a/configs/spn-conf.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - ...... - ...... - - - - .... - - - .... - - - .... - - - .... - - - .... - - - - .... - - - .... - - - .... - - - .... - - - .... - - - ..... - - - .... - - diff --git a/configs/vold.fstab b/configs/vold.fstab old mode 100755 new mode 100644 diff --git a/configs/wpa_supplicant.conf b/configs/wpa_supplicant.conf old mode 100755 new mode 100644 index 110543b..ca9c83c --- a/configs/wpa_supplicant.conf +++ b/configs/wpa_supplicant.conf @@ -1,9 +1,9 @@ -##### wpa_supplicant configuration file template ##### -ctrl_interface=eth0 update_config=1 -device_name=Wireless Client -manufacturer=Samsung Electronics -device_type=1-0050F204-1 +ctrl_interface=wlan0 eapol_version=1 ap_scan=1 -fast_reauth=1 \ No newline at end of file +fast_reauth=1 +p2p_listen_reg_class=81 +p2p_listen_channel=1 +p2p_oper_reg_class=81 +p2p_oper_channel=11 diff --git a/galaxynote.mk b/galaxynote.mk index a261906..1add378 100755 --- a/galaxynote.mk +++ b/galaxynote.mk @@ -22,20 +22,12 @@ PRODUCT_LOCALES += xhdpi PRODUCT_COPY_FILES := \ device/samsung/galaxynote/lpm.rc:root/lpm.rc \ device/samsung/galaxynote/init.smdk4210.usb.rc:root/init.smdk4210.usb.rc \ - device/samsung/galaxynote/init.smdkc210.rc:root/init.smdkc210.rc \ device/samsung/galaxynote/init.smdk4210.rc:root/init.smdk4210.rc \ device/samsung/galaxynote/ueventd.smdk4210.rc:root/ueventd.smdk4210.rc -# APNs - REMOVE IF VENDOR CYANOGEN IS BACK -PRODUCT_COPY_FILES += \ - device/samsung/galaxynote/configs/apns-conf.xml:system/etc/apns-conf.xml \ - device/samsung/galaxynote/configs/spn-conf.xml:system/etc/spn-conf.xml - # Audio -# soundbooster.txt - needs to be at /data/soundbooster.txt PRODUCT_COPY_FILES += \ - device/samsung/galaxynote/configs/asound.conf:system/etc/asound.conf \ - device/samsung/galaxynote/configs/soundbooster.txt:system/etc/audio/soundbooster.txt + device/samsung/galaxynote/configs/asound.conf:system/etc/asound.conf # omx PRODUCT_COPY_FILES += \ @@ -43,34 +35,14 @@ PRODUCT_COPY_FILES += \ device/samsung/galaxynote/configs/secomxregistry:system/etc/secomxregistry \ device/samsung/galaxynote/configs/somxreg.conf:system/etc/somxreg.conf -# Touchscreen -PRODUCT_COPY_FILES += \ - device/samsung/galaxynote/configs/sec_ts_ics_bio.idc:system/usr/idc/sec_ts_ics_bio.idc \ - device/samsung/galaxynote/configs/sec_ts_ics_bio.idc:system/usr/idc/sec_touchscreen.idc \ - device/samsung/galaxynote/configs/sec_ts_ics_bio.idc:system/usr/idc/sec_e-pen.idc \ - -# Keylayout -PRODUCT_COPY_FILES += \ - device/samsung/galaxynote/keylayout/AVRCP.kl:/system/usr/keylayout/AVRCP.kl \ - device/samsung/galaxynote/keylayout/Broadcom_Bluetooth_HID.kl:/system/usr/keylayout/Broadcom_Bluetooth_HID.kl \ - device/samsung/galaxynote/keylayout/sec_jack.kl:/system/usr/keylayout/sec_jack.kl \ - device/samsung/galaxynote/keylayout/sec_key.kl:/system/usr/keylayout/sec_key.kl \ - device/samsung/galaxynote/keylayout/sec_touchkey.kl:/system/usr/keylayout/sec_touchkey.kl \ - device/samsung/galaxynote/keylayout/sec_e-pen.kl:/system/usr/keylayout/sec_e-pen.kl \ - device/samsung/galaxynote/keylayout/qwerty.kl:/system/usr/keylayout/qwerty.kl \ - device/samsung/galaxynote/keylayout/Vendor_04E8_Product_7021.kl:/system/usr/keylayout/Vendor_04E8_Product_7021.kl - # Vold PRODUCT_COPY_FILES += \ device/samsung/galaxynote/configs/vold.fstab:system/etc/vold.fstab - -# Bluetooth configuration files -PRODUCT_COPY_FILES += \ - system/bluetooth/data/main.le.conf:system/etc/bluetooth/main.conf # Wifi PRODUCT_COPY_FILES += \ device/samsung/galaxynote/configs/nvram_net.txt:system/etc/nvram_net.txt \ + device/samsung/galaxynote/configs/nvram_mfg.txt:system/etc/nvram_mfg.txt \ device/samsung/galaxynote/configs/bcmdhd.cal:system/etc/wifi/bcmdhd.cal PRODUCT_PROPERTY_OVERRIDES := \ @@ -79,8 +51,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ # Gps PRODUCT_COPY_FILES += \ - device/samsung/galaxynote/configs/gps.conf:system/etc/gps.conf \ - device/samsung/galaxynote/configs/gps.xml:system/etc/gps.xml + device/samsung/galaxynote/configs/gps.conf:system/etc/gps.conf # Packages PRODUCT_PACKAGES := \ @@ -89,11 +60,6 @@ PRODUCT_PACKAGES := \ TvOutHack \ com.android.future.usb.accessory \ -# Charger -#PRODUCT_PACKAGES += \ -# charger \ -# charger_res_images - # Camera PRODUCT_PACKAGES += \ Camera @@ -105,9 +71,7 @@ PRODUCT_PACKAGES += \ # Ril PRODUCT_PROPERTY_OVERRIDES += \ - ro.telephony.ril_class=samsung \ - ro.telephony.ril.v3=icccardstatus,datacall,signalstrength,facilitylock \ - ro.telephony.sends_barcount=1 \ + ro.telephony.ril_class=Smdk4210RIL \ mobiledata.interfaces=pdp0,wlan0,gprs,ppp0 # Filesystem management tools @@ -132,6 +96,43 @@ PRODUCT_PACKAGES += \ VisualizationWallpapers \ librs_jni +# Keylayout +PRODUCT_COPY_FILES += \ + device/samsung/galaxynote/usr/keylayout/AVRCP.kl:system/usr/keylayout/AVRCP.kl \ + device/samsung/galaxynote/usr/keylayout/Generic.kl:system/usr/keylayout/Generic.kl \ + device/samsung/galaxynote/usr/keylayout/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \ + device/samsung/galaxynote/usr/keylayout/max8997-muic.kl:system/usr/keylayout/max8997-muic.kl \ + device/samsung/galaxynote/usr/keylayout/melfas-touchkey.kl:system/usr/keylayout/melfas-touchkey.kl \ + device/samsung/galaxynote/usr/keylayout/qwerty.kl:system/usr/keylayout/qwerty.kl \ + device/samsung/galaxynote/usr/keylayout/samsung-keypad.kl:system/usr/keylayout/samsung-keypad.kl \ + device/samsung/galaxynote/usr/keylayout/sec_key.kl:system/usr/keylayout/sec_key.kl \ + device/samsung/galaxynote/usr/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl \ + device/samsung/galaxynote/usr/keylayout/sii9234_rcp.kl:system/usr/keylayout/sii9234_rcp.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_04e8_Product_7021.kl:system/usr/keylayout/Vendor_04e8_Product_7021.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_05ac_Product_0239.kl:system/usr/keylayout/Vendor_05ac_Product_0239.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_22b8_Product_093d.kl:system/usr/keylayout/Vendor_22b8_Product_093d.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_045e_Product_028e.kl:system/usr/keylayout/Vendor_045e_Product_028e.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_046d_Product_c216.kl:system/usr/keylayout/Vendor_046d_Product_c216.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_046d_Product_c294.kl:system/usr/keylayout/Vendor_046d_Product_c294.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_046d_Product_c299.kl:system/usr/keylayout/Vendor_046d_Product_c299.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_046d_Product_c532.kl:system/usr/keylayout/Vendor_046d_Product_c532.kl \ + device/samsung/galaxynote/usr/keylayout/Vendor_054c_Product_0268.kl:system/usr/keylayout/Vendor_054c_Product_0268.kl + +# Keychars +PRODUCT_COPY_FILES += \ + device/samsung/galaxynote/usr/keychars/Generic.kcm:system/usr/keychars/Generic.kcm \ + device/samsung/galaxynote/usr/keychars/qwerty.kcm:system/usr/keychars/qwerty.kcm \ + device/samsung/galaxynote/usr/keychars/qwerty2.kcm:system/usr/keychars/qwerty2.kcm \ + device/samsung/galaxynote/usr/keychars/Virtual.kcm:system/usr/keychars/Virtual.kcm + +#idc +PRODUCT_COPY_FILES += \ + device/samsung/galaxynote/usr/idc/melfas_ts.idc:system/usr/idc/melfas_ts.idc \ + device/samsung/galaxynote/usr/idc/mxt224_ts_input.idc:system/usr/idc/mxt224_ts_input.idc \ + device/samsung/galaxynote/usr/idc/qwerty.idc:system/usr/idc/qwerty.idc \ + device/samsung/galaxynote/usr/idc/qwerty2.idc:system/usr/idc/qwerty2.idc \ + device/samsung/galaxynote/usr/idc/sec_touchscreen.idc:system/usr/idc/sec_touchscreen.idc + # These are the hardware-specific features PRODUCT_COPY_FILES += \ frameworks/base/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \ @@ -162,8 +163,8 @@ PRODUCT_PROPERTY_OVERRIDES += \ # enable Google-specific location features, # like NetworkLocationProvider and LocationCollector PRODUCT_PROPERTY_OVERRIDES += \ - ro.com.google.locationfeatures=1 \ - ro.com.google.networklocation=1 + ro.com.google.locationfeatures=1 \ + ro.com.google.networklocation=1 PRODUCT_TAGS += dalvik.gc.type-precise @@ -172,8 +173,8 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ persist.sys.usb.config=mtp # kernel modules for ramdisk -RAMDISK_MODULES := $(addprefix device/samsung/galaxynote/modules/, gspca_main.ko j4fs.ko \ - scsi_wait_scan.ko vibrator.ko) +RAMDISK_MODULES := $(addprefix device/samsung/galaxynote/modules/, dhd.ko j4fs.ko \ + scsi_wait_scan.ko Si4709_driver.ko) PRODUCT_COPY_FILES += $(foreach module,\ $(RAMDISK_MODULES),\ $(module):root/lib/modules/$(notdir $(module))) @@ -187,15 +188,9 @@ PRODUCT_COPY_FILES += $(foreach module,\ PRODUCT_COPY_FILES += \ device/samsung/galaxynote/modules/j4fs.ko:recovery/root/lib/modules/j4fs.ko -ifeq ($(TARGET_PREBUILT_KERNEL),) - LOCAL_KERNEL := device/samsung/galaxynote/kernel -else - LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) -endif - # the kernel itself PRODUCT_COPY_FILES += \ - $(LOCAL_KERNEL):kernel + device/samsung/galaxynote/zImage:kernel $(call inherit-product, frameworks/base/build/phone-xhdpi-1024-dalvik-heap.mk) diff --git a/init.smdk4210.rc b/init.smdk4210.rc old mode 100755 new mode 100644 index 9737e76..1c5c8aa --- a/init.smdk4210.rc +++ b/init.smdk4210.rc @@ -1,454 +1,374 @@ -import init.smdk4210.usb.rc - -on early-init - export EXTERNAL_STORAGE /mnt/sdcard - export SECONDARY_STORAGE /mnt/emmc - mkdir /mnt 0775 system system - mkdir /mnt/sdcard 0775 system system - mkdir /mnt/emmc 0775 system system - mkdir /mnt/usbdisk 0775 system system - mkdir /efs 0771 radio system - mkdir /preload 0771 system system - mkdir /mnt/.lfs 0755 root root - - # for backwards compatibility - symlink /mnt/sdcard /sdcard - symlink /mnt/emmc /emmc - - # Disable CFQ slice idle delay - write /sys/block/mmcblk0/queue/iosched/slice_idle 0 - - write /proc/sys/kernel/panic_on_oops 1 - write /proc/sys/kernel/hung_task_timeout_secs 0 - write /proc/cpu/alignment 4 - write /proc/sys/kernel/sched_latency_ns 10000000 - write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 - write /proc/sys/kernel/sched_compat_yield 1 - write /proc/sys/kernel/sched_child_runs_first 0 - - # permissions for tvout - chmod 0777 /dev/graphics/fb0 - chmod 0777 /dev/graphics/fb10 - chmod 0777 /dev/graphics/fb11 - chown media graphics /sys/class/switch/hdmi - chmod 0777 /sys/class/switch/hdmi - - # FIXME: permission for HDMI audio path - chown media audio /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext - chmod 0777 /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext - - -on post-fs-data - # to eliminate delay of "wait_for_coldboot_done", move these 2 lines here - insmod /lib/modules/j4fs.ko - insmod /lib/modules/j4fs.ko - - # mount param.lfs - mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs - - # GPS - chown root system /dev/ttySAC1 - chmod 0660 /dev/ttySAC1 - chown root system /sys/class/sec/gps/GPS_PWR_EN/value - chmod 0664 /sys/class/sec/gps/GPS_PWR_EN/value - chown root system /sys/class/sec/gps/GPS_nRST/value - chmod 0664 /sys/class/sec/gps/GPS_nRST/value - mkdir /data/gps 771 system system - chown system system /data/gps - - # we will remap this as /mnt/sdcard with the sdcard fuse tool - mkdir /data/media 0775 media_rw media_rw - chown media_rw media_rw /data/media - mkdir /data/misc/wifi 0770 wifi wifi - mkdir /data/misc/wifi/sockets 0770 wifi wifi - mkdir /data/misc/dhcp 0770 dhcp dhcp - chown dhcp dhcp /data/misc/dhcp - mkdir /data/smc 0770 drmrpc drmrpc - mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth - mkdir /data/misc/bluetooth 0770 system system - chown drmrpc drmrpc /data/smc/counter.bin - chown drmrpc drmrpc /data/smc/storage.bin - chown drmrpc drmrpc /data/smc/system.bin - setprop wifi.interface "wlan0" - - write /data/.psm.info 1 - chown system system /data/.psm.info - chmod 0600 /data/.psm.info - - setprop vold.post_fs_data_done 1 - - #DRM directory creation - mkdir /system/etc/security/.drm 0775 - chown root root /system/etc/security/.drm - chmod 0775 /system/etc/security/.drm - - # Added for Playready DRM Support - mkdir /data/data/.drm 0775 - chown drm system /data/data/.drm - chmod 0775 /data/data/.drm - mkdir /data/data/.drm/.playready 0775 - chown drm system /data/data/.drm/.playready - chmod 0775 /data/data/.drm/.playready - - #Added drm folder to copy drm plugins - mkdir /system/lib/drm 0775 - chown root root /system/lib/drm - chmod 0775 /system/lib/drm - - # DivX DRM - mkdir /efs/.files 0775 - mkdir /efs/.files/.dx1 0775 - mkdir /efs/.files/.dm33 0775 - mkdir /efs/.files/.mp301 0775 - chown media system /efs/.files/.dx1 - chown media system /efs/.files/.dm33 - chown media system /efs/.files/.mp301 - chmod 0775 /efs/.files/.dx1 - chmod 0775 /efs/.files/.dm33 - chmod 0775 /efs/.files/.mp301 - - # MTP Device permission. - chmod 0660 /dev/usb_mtp_gadget - chown system system /dev/usb_mtp_gadget - - # NFC - setprop ro.nfc.port "I2C" - chmod 0600 /dev/pn544 - chown nfc nfc /dev/pn544 - - # setup for alsa snd device - chmod 0770 /dev/snd/pcmC0D0c - chmod 0770 /dev/snd/pcmC0D0p - chmod 0770 /dev/snd/controlC0 - chmod 0770 /dev/snd/timer - chmod 0770 /dev/snd/hwC0D0 - - # create log system - mkdir /data/log 0775 system log - chown system log /data/log - - chmod 0775 /data/log - chmod 0775 /data/anr - - chmod 0662 /dev/log/radio - chmod 0662 /dev/log/main - chmod 0662 /dev/log/event - - # terminal mode - chmod 0660 /sys/class/android_usb/android0/terminal_version - chown system system /sys/class/android_usb/android0/terminal_version - - # panorama directory creation - mkdir /data/pxtmpdir 0775 - chown system system /data/pxtmpdir - chmod 0775 /data/pxtmpdir - - # DVFS - cpufreq ondemand - write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 5 - write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 85 - -on boot - mount debugfs /sys/kernel/debug /sys/kernel/debug - -on fs - # Mount /system rw first to give the filesystem a chance to save a checkpoint - mount ext4 /dev/block/mmcblk0p9 /system wait ro - mount ext4 /dev/block/mmcblk0p7 /cache nosuid nodev noatime wait - mount ext4 /dev/block/mmcblk0p10 /data nosuid nodev noatime wait crypt discard,noauto_da_alloc - mount ext4 /dev/block/mmcblk0p12 /preload nosuid nodev noatime wait - - mount ext4 /dev/block/mmcblk0p1 /efs nosuid nodev noatime wait - mkdir /efs/bluetooth - mkdir /efs/wifi - chown radio system /efs/bluetooth - chown radio system /efs/wifi - chmod 0775 /efs/bluetooth - chmod 0775 /efs/wifi - - mkdir /data/misc/vpn/profiles 0770 system system - mkdir /data/misc/radio 0775 radio system - chmod 0770 /data/misc/wifi - - # create log system - mkdir /data/log 0777 system system - - chmod 0777 /data/log - chmod 0777 /data/anr - - chmod 0662 /dev/log/radio - chmod 0662 /dev/log/main - chmod 0662 /dev/log/event - - # permissions for backlight - chown system system /sys/class/backlight/pwm-backlight/brightness - chmod 0777 /sys/class/misc/melfas_touchkey/brightness - chown system system /sys/class/misc/melfas_touchkey/brightness - - # Tweak background writeout - write /proc/sys/vm/dirty_expire_centisecs 200 - write /proc/sys/vm/dirty_background_ratio 5 - - # allow net_raw to have access to /dev/socket directory - chown root net_raw /dev/socket - chmod 0775 /dev/socket - - # UART switch - # Request of manufacturing application!!! - chown radio system /sys/class/sec/uart_switch/UART_SEL/value - chmod 0664 /sys/class/sec/uart_switch/UART_SEL/value - - # allow system to modify cpufreq control files - chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq - chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq - chown root system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq - chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq - - # USB Device permission - chown system system /sys/devices/platform/android_usb/UsbMenuSel - chown system system /sys/devices/platform/android_usb/tethering - - # Permissions for dvfs lock - chown system system /sys/power/cpufreq_max_limit - chown system system /sys/power/cpufreq_min_limit - chmod 0660 /sys/power/cpufreq_max_limit - chmod 0660 /sys/power/cpufreq_min_limit - - # Permissions for gpio_keys - chown radio system /sys/devices/platform/sec_key.0/wakeup_keys - write /sys/devices/platform/sec_key.0/wakeup_keys 102,116 - - # Permissions for LCD - chown radio radio /sys/class/backlight/pwm-backlight/device/acl_set - - # mDNIe - chown radio system /sys/devices/virtual/mdnieset_outdoor/switch_mdnieset_outdoor/mdnieset_outdoor_file_cmd - chown radio system /sys/devices/virtual/mdnieset_ui/switch_mdnieset_ui/mdnieset_init_file_cmd - chown radio system /sys/devices/virtual/mdnieset_ui/switch_mdnieset_ui/mdnieset_user_select_file_cmd - chown radio system /sys/devices/virtual/mdnieset_ui/switch_mdnieset_ui/mdnieset_ui_file_cmd - write /sys/class/mdnieset_ui/switch_mdnieset_ui/mdnieset_init_file_cmd 0 - write /sys/class/mdnieset_ui/switch_mdnieset_ui/mdnieset_ui_file_cmd 0 - write /sys/class/mdnieset_ui/switch_mdnieset_ui/mdnieset_user_select_file_cmd 1 - - chown radio system /sys/power/state - chown radio system /sys/power/wake_lock - chown radio system /sys/power/wake_unlock - chown radio system /sys/power/dvfslock_ctrl - chown radio system /sys/power/dvfslimit_ctrl - chmod 0660 /sys/power/state - chmod 0660 /sys/power/wake_lock - chmod 0660 /sys/power/wake_unlock - chmod 0660 /sys/power/dvfslock_ctrl - chmod 0660 /sys/power/dvfslimit_ctrl - - # permissions for touch test - chown radio system /sys/devices/virtual/misc/melfas_touchkey/enable_disable - chown radio system /sys/devices/virtual/misc/melfas_touchkey/brightness - chown radio system /sys/devices/virtual/misc/melfas_touchkey/touch_update - chown radio system /sys/devices/virtual/misc/melfas_touchkey/touch_version - chown radio system /sys/devices/virtual/misc/melfas_touchkey/brightness - chown radio system /sys/devices/virtual/misc/melfas_touchkey/touchkey_menu - chown radio system /sys/devices/virtual/misc/melfas_touchkey/touchkey_back - chown radio system /sys/devices/virtual/misc/melfas_touchkey/touch_sensitivity - chown radio system /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_panel - chown radio system /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_phone - chown radio system /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update_status - chown radio system /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_firm_version - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_threshould - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_delta4 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_refer4 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_delta3 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_refer3 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_delta2 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_refer2 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_delta1 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_refer1 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_delta0 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_refer0 - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_module_on - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_module_off - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_all_refer - chown radio system /sys/devices/virtual/sec/tsp_noise_test/disp_all_refdata - chown radio system /sys/devices/virtual/sec/tsp_noise_test/set_all_delta - chown radio system /sys/devices/virtual/sec/tsp_noise_test/disp_all_deltadata - chown radio system /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_panel - chown radio system /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_phone - chown radio system /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update_status - chown radio system /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update - chown radio system /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold - chown radio system /sys/devices/virtual/sec/sec_touchscreen/mxt_touchtype - - # Add permission for ATM. - chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_selftest - chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_get_temp - chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_power_on - chown radio system /sys/devices/virtual/accelerometer/accelerometer/acc_file - chown radio system /sys/devices/virtual/sec/gsensorcal/calibration - chown radio system /sys/class/sensors/barometer_sensor/sea_level_pressure - chown radio system /sys/class/sensors/barometer_sensor/eeprom_check - chown radio system /sys/class/sec/sec_epen/epen_firm_update - chown radio system /sys/class/sec/sec_epen/epen_rotation - chown radio system /sys/class/sec/sec_epen/epen_hand - chown radio system /sys/class/sec/sec_epen/epen_reset - chown radio system /sys/class/sec/sec_epen/epen_reset_result - chown radio system /sys/class/sec/sec_epen/epen_checksum - chown radio system /sys/class/sec/sec_epen/epen_checksum_result - - chown radio system /sys/devices/platform/android_usb/tethering - chown radio system /sys/devices/platform/android_usb/UsbMenuSel - chown radio system /sys/devices/virtual/gpio/gpio225/value - - chown radio system /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_read_soc - chown radio system /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_reset_soc - chown radio system /sys/devices/platform/s3c2410-i2c.5/i2c-5/5-0066/max8997-muic/usb_sel - chown radio system /sys/devices/platform/s3c2410-i2c.5/i2c-5/5-0066/max8997-muic/audio_path - chown radio system /sys/devices/platform/s3c2410-i2c.5/i2c-5/5-0066/max8997-muic/otg_test - chown radio system /sys/devices/platform/s3c2410-i2c.5/i2c-5/5-0066/max8997-muic/adc_debounce_time - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_lpm_state - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/fg_psoc - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/system_rev - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_current_now - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_current_adc - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_test_value - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_spec - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_check - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_full_check - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_type - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/mp3 - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/video - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_lp_charging - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/charging_source - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_avg - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_temp - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_vfocv - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_soc - chown radio system /sys/devices/platform/sec-battery/power_supply/battery/batt_vol - - chown system radio /sys/class/lcd/panel/lcd_power - chown system radio /sys/class/lcd/panel/lcd_type - chown system media_rw /sys/class/lcd/panel/gamma_mode - chown system media_rw /sys/class/lcd/panel/power_reduce - - # OTG Test - chown system radio /sys/class/host_notify/usb_otg/booster - chmod 0664 /sys/class/host_notify/usb_otg/booster - - # HSIC - chown radio system /sys/devices/platform/s5p-ehci/ehci_runtime - chown radio system /sys/devices/platform/modemctl/wakeup - chown radio system /sys/devices/platform/modemctl/control - chown radio system /sys/devices/platform/s5p-ehci/ehci_power - chown radio system /sys/devices/virtual/net/svnet0/waketime - - #bluetooth - setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" - chown bluetooth bluetooth ro.bt.bdaddr_path - chown bluetooth bluetooth /dev/ttySAC0 - chmod 0600 /dev/ttySAC0 - chmod 0660 /sys/class/rfkill/rfkill0/state - chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state - chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type - - # for datarouter - chown system system /dev/ttyGS0 - chown system system /dev/dun - - # Device Encryption by B2B Security Lab. - setprop ro.crypto.keyfile.userdata /efs/metadata - - # Vibetonz - chmod 0660 /dev/tspdrv - chown root shell /dev/tspdrv - - # Audio Tunning Files - chmod 0777 /system/etc/audio/stream_speaker.txt - chmod 0777 /system/etc/audio/stream_headset.txt - chmod 0777 /system/etc/audio/stream_earpiece.txt - chmod 0777 /system/etc/audio/situation.txt - chmod 0777 /system/etc/audio/aeqcoe.txt - chmod 0777 /system/etc/audio/soundbooster.txt - chmod 0777 /system/etc/audio/srstunning.txt - chmod 0777 /system/etc/audio/ArkamysTuning.txt - -# wi-fi -service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL - class main - disabled - oneshot - -service dhcpcd_p2p /system/bin/dhcpcd -aABKL - class main - disabled - oneshot - -service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL - class main - disabled - oneshot - -service iprenew_wlan0 /system/bin/dhcpcd -n - class main - disabled - oneshot - -service iprenew_p2p /system/bin/dhcpcd -n - class main - disabled - oneshot - -service iprenew_bnep0 /system/bin/dhcpcd -n - class main - disabled - oneshot - -service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin - class main - socket wpa_wlan0 dgram 0660 wifi wifi - disabled - oneshot - -# for bluetooth -service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes --tosleep 50000 \ - --baudrate 3000000 --use_baudrate_for_download --patchram /system/bin/bcm4330B1.hcd \ - --scopcm=0,0,0,0,0,0,0,3,3,0 /dev/ttySAC0 - class main - user bluetooth - group bluetooth net_bt_admin - disabled - oneshot - -# bluetooth mac address -service bdaddr /system/bin/bdaddr_read - class main - user root - disabled - oneshot - -# bluetooth mac address -service bdaddr /system/bin/bdaddr_read - class main - user root - disabled - oneshot - -# TVout -service TvoutService_C /system/bin/bintvoutservice - class main - user system - group graphics - -service gpsd /system/bin/gpsd -c /system/etc/gps.xml - class main - socket gps seqpacket 0660 gps system - user gps - group system inet - -# bugreport is triggered by holding down volume down, volume up and power -service bugreport /system/bin/bugmailer.sh -v - class main - disabled - oneshot - keycodes 114 115 116 \ No newline at end of file +import init.smdk4210.usb.rc + +on early-init + export EXTERNAL_STORAGE /mnt/sdcard + export SECONDARY_STORAGE /mnt/emmc + mkdir /mnt 0775 system system + mkdir /mnt/sdcard 0775 system system + mkdir /mnt/emmc 0775 system system + mkdir /mnt/usbdisk 0775 system system + mkdir /efs 0771 radio system + mkdir /preload 0771 system system + mkdir /mnt/.lfs 0755 root root + + # for backwards compatibility + symlink /mnt/sdcard /sdcard + symlink /mnt/emmc /emmc + +# Disable CFQ slice idle delay + write /sys/block/mmcblk0/queue/iosched/slice_idle 0 + +# FIXME: permissions for tvout + chmod 0777 /dev/graphics/fb0 + chmod 0777 /dev/graphics/fb10 + chmod 0777 /dev/graphics/fb11 + chown media graphics /sys/class/switch/hdmi + chmod 0777 /sys/class/switch/hdmi + +# FIXME: permission for HDMI audio path + chown media audio /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext + chmod 0777 /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext + +on fs +# mount ext4 partitions + mount ext4 /dev/block/mmcblk0p9 /system + mount ext4 /dev/block/mmcblk0p9 /system noatime wait ro + mount ext4 /dev/block/mmcblk0p7 /cache nosuid nodev noatime wait + mount ext4 /dev/block/mmcblk0p10 /data nosuid nodev noatime wait noauto_da_alloc + mount ext4 /dev/block/mmcblk0p12 /preload nosuid nodev noatime wait + + mount ext4 /dev/block/mmcblk0p1 /efs nosuid nodev noatime wait + mkdir /efs/bluetooth + mkdir /efs/wifi + chown radio system /efs/bluetooth + chown radio system /efs/wifi + chmod 0775 /efs/bluetooth + chmod 0775 /efs/wifi + + mkdir /data/misc/vpn/profiles 0770 system system + mkdir /data/misc/radio 0775 radio system + chmod 0770 /data/misc/wifi + +on post-fs-data +# insmod kernel modules + insmod /lib/modules/Si4709_driver.ko + insmod /lib/modules/j4fs.ko + +# mount param.lfs + mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs + +# GPS + chown root system /dev/ttySAC1 + chmod 0660 /dev/ttySAC1 + chown root system /sys/class/sec/gps/GPS_PWR_EN/value + chmod 0664 /sys/class/sec/gps/GPS_PWR_EN/value + chown root system /sys/class/sec/gps/GPS_nRST/value + chmod 0664 /sys/class/sec/gps/GPS_nRST/value + mkdir /data/gps 771 system system + chown system system /data/gps + + # give system access to wpa_supplicant.conf for backup and restore + mkdir /data/misc/wifi 0770 wifi wifi + chmod 0770 /data/misc/wifi + chmod 0660 /data/misc/wifi/wpa_supplicant.conf + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/dhcp 0770 dhcp dhcp + chown dhcp dhcp /data/misc/dhcp + +#DRM directory creation + mkdir /system/etc/security/.drm 0775 + chown root root /system/etc/security/.drm + chmod 0775 /system/etc/security/.drm + + # Added for Playready DRM Support + mkdir /data/data/.drm 0775 + chown drm system /data/data/.drm + chmod 0775 /data/data/.drm + mkdir /data/data/.drm/.playready 0775 + chown drm system /data/data/.drm/.playready + chmod 0775 /data/data/.drm/.playready + + #Added drm folder to copy drm plugins + mkdir /system/lib/drm 0775 + chown root root /system/lib/drm + chmod 0775 /system/lib/drm + + # DivX DRM + mkdir /efs/.files 0775 + mkdir /efs/.files/.dx1 0775 + mkdir /efs/.files/.dm33 0775 + mkdir /efs/.files/.mp301 0775 + chown media system /efs/.files/.dx1 + chown media system /efs/.files/.dm33 + chown media system /efs/.files/.mp301 + chmod 0775 /efs/.files/.dx1 + chmod 0775 /efs/.files/.dm33 + chmod 0775 /efs/.files/.mp301 + +# MTP Device permission. + chmod 0660 /dev/usb_mtp_gadget + chown system system /dev/usb_mtp_gadget + +# terminal mode + chmod 0660 /sys/class/android_usb/android0/terminal_version + chown system system /sys/class/android_usb/android0/terminal_version + +# NFC + setprop ro.nfc.port "I2C" + chmod 0600 /dev/pn544 + chown nfc nfc /dev/pn544 + +# setup for alsa snd device + chmod 0770 /dev/snd/pcmC0D0c + chmod 0770 /dev/snd/pcmC0D0p + chmod 0770 /dev/snd/controlC0 + chmod 0770 /dev/snd/timer + chmod 0770 /dev/snd/hwC0D0 + + # create log system + mkdir /data/log 0775 system log + chown system log /data/log + + chmod 0775 /data/log + chmod 0775 /data/anr + + chmod 0662 /dev/log/radio + chmod 0662 /dev/log/main + chmod 0662 /dev/log/event + +#panorama directory creation + mkdir /data/pxtmpdir 0775 + chown system system /data/pxtmpdir + chmod 0775 /data/pxtmpdir + + # permission for HDMI audio path + chown media audio /sys/class/hdmi_audio/hdmi_audio/hdmi_audio_set_ext + +# Permissions for gpio_keys. + chown system radio /sys/class/sec/sec_key/wakeup_keys + write /sys/class/sec/sec_key/wakeup_keys 102,116 + +# Add permission for ATM. 2010.03.20 + chown system radio /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_read_soc + chown system radio /sys/devices/platform/i2c-gpio.9/i2c-9/9-0036/power_supply/fuelgauge/fg_reset_soc + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_lpm_state + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/fg_psoc + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/system_rev + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_current_adc + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_test_value + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_spec + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_check + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_full_check + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_type + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/mp3 + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/video + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_lp_charging + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/charging_source + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc_avg + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp_adc + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_temp + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_vfocv + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_soc + chown system radio /sys/devices/platform/sec-battery/power_supply/battery/batt_vol + + chown system system /sys/class/backlight/panel/brightness + chown system system /sys/class/power_supply/battery/temp + +# Permissions for input devices + chown system radio /sys/devices/virtual/sec/sec_key/sec_key_pressed + + chown system radio /sys/devices/virtual/sec/sec_touchkey/enable_disable + chown system radio /sys/devices/virtual/sec/sec_touchkey/recommended_version + chown system radio /sys/devices/virtual/sec/sec_touchkey/touch_sensitivity + chown system radio /sys/devices/virtual/sec/sec_touchkey/brightness + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_back + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_menu + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_panel + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_version_phone + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update_status + chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_firm_update + chown system radio /sys/devices/virtual/sec/sec_touchkey/updated_version + + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_firm_version + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_threshould + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_all_delta + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_all_refer + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta4 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer4 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta3 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer3 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta2 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer2 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta1 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer1 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_delta0 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_refer0 + chown system radio /sys/devices/virtual/sec/tsp_noise_test/disp_all_deltadata + chown system radio /sys/devices/virtual/sec/tsp_noise_test/disp_all_refdata + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_module_off + chown system radio /sys/devices/virtual/sec/tsp_noise_test/set_module_on + + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_panel + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_version_phone + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update_status + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_firm_update + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_config_version + chown system radio /sys/devices/virtual/sec/sec_touchscreen/tsp_touchtype + +# Permissions for bluetooth + setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" + chown bluetooth bluetooth ro.bt.bdaddr_path + chown bluetooth bluetooth /dev/ttySAC0 + chmod 0600 /dev/ttySAC0 + chmod 0660 /sys/class/rfkill/rfkill0/state + chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state + chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type + +# Vibetonz + chmod 0660 /dev/tspdrv + chown root shell /dev/tspdrv + +# Permissions for LCD + chown system radio /sys/class/lcd/panel/lcd_power + chown system radio /sys/class/lcd/panel/lcd_type + chown system media_rw /sys/class/lcd/panel/gamma_mode + chown system media_rw /sys/class/lcd/panel/power_reduce + +# Permissions for mDNIe + chown system media_rw /sys/class/mdnie/mdnie/mode + chown system media_rw /sys/class/mdnie/mdnie/outdoor + chown system media_rw /sys/class/mdnie/mdnie/scenario + write /sys/class/mdnie/mdnie/scenario 4 + +# Permissions for uart_sel and usb_sel + chown system radio /sys/class/sec/switch/uart_sel/value + chown system radio /sys/class/sec/switch/usb_sel + chown system radio /sys/class/sec/switch/audio_path + chown system radio /sys/class/sec/switch/otg_test + chown system radio /sys/class/sec/switch/adc_debounce_time + chown system radio /sys/class/sec/switch/status + chown system radio /sys/class/sec/switch/adc + chown system radio /mnt/.lfs/sw_sel + +# Permissions for OTG Test + chown system radio /sys/class/host_notify/usb_otg/booster + chmod 0664 /sys/class/host_notify/usb_otg/booster + +# Permission for radio + chown system radio /sys/devices/platform/s5p-ehci/ehci_power + chown system radio /sys/devices/platform/s5p-ehci/ehci_runtime + chown system radio /sys/devices/virtual/misc/multipdp/waketime + +# for datarouter + chown system system /dev/dun + chown system system /dev/ttyGS0 + chown system system /dev/ttyGS1 + chown system system /dev/ttyGS2 + chown system system /dev/ttyGS3 + +# DVFS - cpufreq ondemand + write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 5 + write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 85 + +on boot + chown system system /sys/class/backlight/pwm-backlight/brightness + chmod 0660 /sys/class/backlight/pwm-backlight/brightness + chown radio system /sys/devices/virtual/misc/melfas_touchkey/brightness + chmod 0660 /sys/devices/virtual/misc/melfas_touchkey/brightness + +#panorama directory creation + mkdir /data/pxtmpdir 0775 + chown system system /data/pxtmpdir + chmod 0775 /data/pxtmpdir + +# Permissions for dvfs lock + chown system system /sys/power/cpufreq_max_limit + chown system system /sys/power/cpufreq_min_limit + chmod 0660 /sys/power/cpufreq_max_limit + chmod 0660 /sys/power/cpufreq_min_limit + + mount debugfs /sys/kernel/debug /sys/kernel/debug + + setprop ro.build.product GT-I9100 + setprop ro.product.device GT-I9100 + setprop ro.radio.noril yes + +# Permisions for sensors + chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_selftest + chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_get_temp + chown radio system /sys/devices/virtual/K3G_GYRO-dev/k3g/gyro_power_on + chown radio system /sys/devices/virtual/accelerometer/accelerometer/acc_file + chown radio system /sys/devices/virtual/sec/gsensorcal/calibration + +# permissions for NFC + setprop ro.nfc.port "I2C" + chmod 0600 /dev/pn544 + chown nfc nfc /dev/pn544 + +# Device Encryption by B2B Security Lab. + setprop ro.crypto.keyfile.userdata /efs/metadata + +# fake some battery state + setprop status.battery.state Slow + setprop status.battery.level 5 + setprop status.battery.level_raw 50 + setprop status.battery.level_scale 9 + +service wpa_supplicant /system/bin/wpa_supplicant \ + -Dnl80211 -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin + class main + socket wpa_wlan0 dgram 0660 wifi wifi + disabled + oneshot + +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL + class main + disabled + oneshot + +service dhcpcd_p2p /system/bin/dhcpcd -aABKL + class main + disabled + oneshot + +service iprenew_wlan0 /system/bin/dhcpcd -n + class main + disabled + oneshot + +service iprenew_p2p /system/bin/dhcpcd -n + class main + disabled + oneshot + +# for bluetooth +service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes --tosleep 50000 \ + --baudrate 3000000 --use_baudrate_for_download --patchram /system/bin/bcm4330B1.hcd \ + --scopcm=0,0,0,0,0,0,0,3,3,0 /dev/ttySAC0 + class main + user bluetooth + group bluetooth net_bt_admin + disabled + oneshot + +# bluetooth mac address +service bdaddr /system/bin/bdaddr_read + class main + user root + disabled + oneshot + +# TVout +service TvoutService_C /system/bin/bintvoutservice + class main + user system + group graphics + +# bugreport is triggered by holding down volume down, volume up and power +service bugreport /system/bin/bugmailer.sh -v + class main + disabled + oneshot + keycodes 114 115 116 diff --git a/init.smdk4210.usb.rc b/init.smdk4210.usb.rc old mode 100755 new mode 100644 index 4731122..7545695 --- a/init.smdk4210.usb.rc +++ b/init.smdk4210.usb.rc @@ -1,89 +1,89 @@ -on init - write /sys/class/android_usb/android0/iSerial $ro.serialno - write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung - write /sys/class/android_usb/android0/f_rndis/vendorID 04e8 - write /sys/class/android_usb/android0/f_rndis/wceis 1 - -on boot - write /sys/class/android_usb/android0/iManufacturer $ro.manufacturer - write /sys/class/android_usb/android0/iProduct $ro.model - write /sys/class/android_usb/android0/iSerial $ro.serialno - write /sys/class/android_usb/f_mass_storage/inquiry_string "Samsung" - -on property:sys.usb.config=mtp - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6860 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=mtp,adb - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6860 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=rndis - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6863 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/bDeviceClass 224 - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=rndis,adb - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6864 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/bDeviceClass 224 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=ptp - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6865 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=ptp,adb - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6866 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=rndis,dm - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 6862 - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=mass_storage - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 685B - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state $sys.usb.config - -on property:sys.usb.config=mass_storage,adb - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 04e8 - write /sys/class/android_usb/android0/idProduct 685e - write /sys/class/android_usb/android0/functions $sys.usb.config - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state $sys.usb.config \ No newline at end of file +on init + write /sys/class/android_usb/android0/iSerial $ro.serialno + write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung + write /sys/class/android_usb/android0/f_rndis/vendorID 04e8 + write /sys/class/android_usb/android0/f_rndis/wceis 1 + +on boot + write /sys/class/android_usb/android0/iManufacturer $ro.manufacturer + write /sys/class/android_usb/android0/iProduct $ro.model + write /sys/class/android_usb/android0/iSerial $ro.serialno + write /sys/class/android_usb/f_mass_storage/inquiry_string "Samsung" + +on property:sys.usb.config=mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=rndis + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6863 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=rndis,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=ptp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6865 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=ptp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6866 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=rndis,dm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685B + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state $sys.usb.config + +on property:sys.usb.config=mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685e + write /sys/class/android_usb/android0/functions $sys.usb.config + write /sys/class/android_usb/android0/enable 1 + start adbd + setprop sys.usb.state $sys.usb.config diff --git a/init.smdkc210.rc b/init.smdkc210.rc deleted file mode 100755 index 9562922..0000000 --- a/init.smdkc210.rc +++ /dev/null @@ -1,2 +0,0 @@ -# samsung messed up at naming their board. we've fixed it. -# use this fake file so that rommanager still recognizes our device correctly. \ No newline at end of file diff --git a/kernel b/kernel deleted file mode 100755 index e347314..0000000 Binary files a/kernel and /dev/null differ diff --git a/keylayout/AVRCP.kl b/keylayout/AVRCP.kl deleted file mode 100755 index 40f4d3b..0000000 --- a/keylayout/AVRCP.kl +++ /dev/null @@ -1,10 +0,0 @@ -key 200 MEDIA_PLAY_PAUSE WAKE -key 201 MEDIA_PLAY_PAUSE WAKE -key 166 MEDIA_STOP WAKE -key 163 MEDIA_NEXT WAKE -key 165 MEDIA_PREVIOUS WAKE -key 168 MEDIA_REWIND WAKE -key 208 MEDIA_FAST_FORWARD WAKE -key 164 MEDIA_PLAY_PAUSE WAKE -key 128 MEDIA_STOP WAKE -key 159 MEDIA_FAST_FORWARD WAKE \ No newline at end of file diff --git a/keylayout/Broadcom_Bluetooth_HID.kl b/keylayout/Broadcom_Bluetooth_HID.kl deleted file mode 100755 index d49ae42..0000000 --- a/keylayout/Broadcom_Bluetooth_HID.kl +++ /dev/null @@ -1,114 +0,0 @@ -key 150 EXPLORER -key 139 MENU WAKE_DROPPED -key 102 HOME WAKE -key 158 BACK WAKE_DROPPED -key 217 SEARCH WAKE_DROPPED -key 230 SOFT_RIGHT WAKE -key 60 SOFT_RIGHT WAKE -key 107 ENDCALL WAKE_DROPPED -key 62 ENDCALL WAKE_DROPPED -key 229 MENU WAKE_DROPPED -key 59 MENU WAKE_DROPPED - -key 127 SEARCH WAKE_DROPPED -key 228 POUND -key 227 STAR -key 231 CALL WAKE_DROPPED -key 61 CALL WAKE_DROPPED -key 232 DPAD_CENTER WAKE_DROPPED - -key 115 VOLUME_UP WAKE -key 114 VOLUME_DOWN WAKE -key 116 POWER WAKE - -key 211 FOCUS -key 212 CAMERA - -key 41 GRAVE -key 1 BACK WAKE_DROPPED -key 2 1 -key 3 2 -key 4 3 -key 5 4 -key 6 5 -key 7 6 -key 8 7 -key 9 8 -key 10 9 -key 11 0 -key 12 MINUS -key 13 EQUALS -key 14 DEL - -key 15 TAB -key 16 Q -key 17 W -key 18 E -key 19 R -key 20 T -key 21 Y -key 22 U -key 23 I -key 24 O -key 25 P -key 26 LEFT_BRACKET -key 27 RIGHT_BRACKET -key 43 BACKSLASH - -key 30 A -key 31 S -key 32 D -key 33 F -key 34 G -key 35 H -key 36 J -key 37 K -key 38 L -key 39 SEMICOLON -key 40 APOSTROPHE -key 28 ENTER - -key 42 SHIFT_LEFT -key 44 Z -key 45 X -key 46 C -key 47 V -key 48 B -key 49 N -key 50 M -key 51 COMMA -key 52 PERIOD -key 53 SLASH -key 54 SHIFT_RIGHT - -key 57 SPACE - -key 108 DPAD_DOWN WAKE_DROPPED -key 103 DPAD_UP WAKE_DROPPED -key 105 DPAD_LEFT WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED - -key 56 ALT_LEFT -key 100 ALT_RIGHT -key 155 ENVELOPE - -key 215 AT - -key 79 1 -key 80 2 -key 81 3 -key 75 4 -key 76 5 -key 77 6 -key 71 7 -key 72 8 -key 73 9 -key 82 0 -key 83 PERIOD -key 78 PLUS -key 74 MINUS -key 98 SLASH -key 55 STAR -key 96 ENTER -key 104 PAGE_UP -key 109 PAGE_DOWN diff --git a/keylayout/Vendor_04E8_Product_7021.kl b/keylayout/Vendor_04E8_Product_7021.kl deleted file mode 100755 index 6668307..0000000 --- a/keylayout/Vendor_04E8_Product_7021.kl +++ /dev/null @@ -1,141 +0,0 @@ -key 1 BACK WAKE_DROPPED -key 2 1 -key 3 2 -key 4 3 -key 5 4 -key 6 5 -key 7 6 -key 8 7 -key 9 8 -key 10 9 - -key 11 0 -key 12 MINUS -key 13 EQUALS -key 14 DEL -key 15 TAB -key 16 Q -key 17 W -key 18 E -key 19 R -key 20 T - -key 21 Y -key 22 U -key 23 I -key 24 O -key 25 P -key 26 LEFT_BRACKET -key 27 RIGHT_BRACKET -key 28 ENTER -key 30 A - -key 31 S -key 32 D -key 33 F -key 34 G -key 35 H -key 36 J -key 37 K -key 38 L -key 39 SEMICOLON -key 40 APOSTROPHE - -key 41 GRAVE -key 42 SHIFT_LEFT -key 43 BACKSLASH -key 44 Z -key 45 X -key 46 C -key 47 V -key 48 B -key 49 N -key 50 M - -key 51 COMMA -key 52 PERIOD -key 53 SLASH -key 54 SHIFT_RIGHT -key 55 STAR -key 57 SPACE -key 58 CAPSLOCK -key 56 ALT_LEFT -key 59 MENU WAKE_DROPPED -key 60 SOFT_RIGHT WAKE - -key 61 CALL WAKE_DROPPED -key 62 ENDCALL WAKE_DROPPED - -key 71 7 -key 72 8 -key 73 9 -key 74 MINUS -key 75 4 -key 76 5 -key 77 6 -key 78 PLUS -key 79 1 -key 80 2 - -key 81 3 -key 82 0 -key 83 PERIOD - -key 96 ENTER -key 98 SLASH - -key 102 HOME WAKE -key 103 DPAD_UP WAKE_DROPPED -key 104 PAGE_UP -key 105 DPAD_LEFT WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED -key 107 ENDCALL WAKE_DROPPED -key 108 DPAD_DOWN WAKE_DROPPED -key 109 PAGE_DOWN -key 100 ALT_RIGHT -#key 111 FORWARD_DEL - -key 113 MUTE -key 114 VOLUME_DOWN WAKE -key 115 VOLUME_UP WAKE -key 116 POWER WAKE - -key 127 SEARCH WAKE_DROPPED - -key 139 MENU WAKE_DROPPED - -key 150 EXPLORER - -key 152 POWER WAKE -key 155 EMAIL -key 158 BACK WAKE_DROPPED - -key 163 MEDIA_NEXT -key 164 MEDIA_PLAY_PAUSE -key 165 MEDIA_PREVIOUS - -key 172 HOME - -key 211 FOCUS -key 212 CAMERA -key 215 AT -key 217 SEARCH WAKE_DROPPED - -key 224 BRIGHTNESS_DOWN -key 225 BRIGHTNESS_UP -key 227 STAR -key 228 POUND -key 229 MENU WAKE_DROPPED -key 230 SOFT_RIGHT WAKE - -key 231 CALL WAKE_DROPPED -key 232 DPAD_CENTER WAKE_DROPPED - -key 368 LANG - -key 704 RECENTAPPS -key 705 APPLICATION -key 706 SIP_ON_OFF -key 707 VOICESEARCH -key 708 QPANEL_ON_OFF - diff --git a/keylayout/qwerty.kl b/keylayout/qwerty.kl deleted file mode 100755 index 201c798..0000000 --- a/keylayout/qwerty.kl +++ /dev/null @@ -1,91 +0,0 @@ -key 399 GRAVE -key 2 1 -key 3 2 -key 4 3 -key 5 4 -key 6 5 -key 7 6 -key 8 7 -key 9 8 -key 10 9 -key 11 0 -key 158 BACK WAKE_DROPPED -key 230 SOFT_RIGHT WAKE -key 60 SOFT_RIGHT WAKE -key 107 ENDCALL WAKE_DROPPED -key 62 ENDCALL WAKE_DROPPED -key 229 MENU WAKE_DROPPED -key 139 MENU WAKE_DROPPED -key 59 MENU WAKE_DROPPED -key 127 SEARCH WAKE_DROPPED -key 217 SEARCH WAKE_DROPPED -key 228 POUND -key 227 STAR -key 231 CALL WAKE_DROPPED -key 61 CALL WAKE_DROPPED -key 232 DPAD_CENTER WAKE_DROPPED -key 108 DPAD_DOWN WAKE_DROPPED -key 103 DPAD_UP WAKE_DROPPED -key 102 HOME WAKE -key 105 DPAD_LEFT WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED -key 115 VOLUME_UP WAKE -key 114 VOLUME_DOWN WAKE -key 116 POWER WAKE -key 212 CAMERA - -key 16 Q -key 17 W -key 18 E -key 19 R -key 20 T -key 21 Y -key 22 U -key 23 I -key 24 O -key 25 P -key 26 LEFT_BRACKET -key 27 RIGHT_BRACKET -key 43 BACKSLASH - -key 30 A -key 31 S -key 32 D -key 33 F -key 34 G -key 35 H -key 36 J -key 37 K -key 38 L -key 39 SEMICOLON -key 40 APOSTROPHE -key 14 DEL - -key 44 Z -key 45 X -key 46 C -key 47 V -key 48 B -key 49 N -key 50 M -key 51 COMMA -key 52 PERIOD -key 53 SLASH -key 28 ENTER - -key 56 ALT_LEFT -key 100 ALT_RIGHT -key 42 SHIFT_LEFT -key 54 SHIFT_RIGHT -key 15 TAB -key 57 SPACE -key 150 EXPLORER -key 155 ENVELOPE - -key 12 MINUS -key 13 EQUALS -key 215 AT - -# On an AT keyboard: ESC, F10 -key 1 BACK WAKE_DROPPED -key 68 MENU WAKE_DROPPED diff --git a/keylayout/sec_e-pen.kl b/keylayout/sec_e-pen.kl deleted file mode 100755 index b98fbf2..0000000 --- a/keylayout/sec_e-pen.kl +++ /dev/null @@ -1,3 +0,0 @@ -key 544 PEN WAKE -key 545 ERASER WAKE -key 555 SIDE_SWITCH WAKE diff --git a/keylayout/sec_jack.kl b/keylayout/sec_jack.kl deleted file mode 100755 index 5a0b16d..0000000 --- a/keylayout/sec_jack.kl +++ /dev/null @@ -1,5 +0,0 @@ -key 115 VOLUME_UP WAKE -key 114 VOLUME_DOWN WAKE -key 163 MEDIA_NEXT WAKE -key 165 MEDIA_PREVIOUS WAKE -key 226 HEADSETHOOK WAKE diff --git a/keylayout/sec_key.kl b/keylayout/sec_key.kl deleted file mode 100755 index 6fc9f2a..0000000 --- a/keylayout/sec_key.kl +++ /dev/null @@ -1,11 +0,0 @@ -key 115 VOLUME_UP WAKE -key 114 VOLUME_DOWN WAKE -key 172 HOME WAKE -key 107 ENDCALL -key 105 DPAD_LEFT -key 106 DPAD_RIGHT -key 103 DPAD_UP -key 108 DPAD_DOWN -key 232 DPAD_CENTER -key 116 POWER WAKE -key 212 CAMERA WAKE diff --git a/keylayout/sec_touchkey.kl b/keylayout/sec_touchkey.kl deleted file mode 100755 index 22db299..0000000 --- a/keylayout/sec_touchkey.kl +++ /dev/null @@ -1,3 +0,0 @@ -key 158 BACK VIRTUAL -key 139 MENU VIRTUAL - diff --git a/lpm.rc b/lpm.rc old mode 100755 new mode 100644 index 2cc5bde..be98378 --- a/lpm.rc +++ b/lpm.rc @@ -2,7 +2,6 @@ on early-init start ueventd on init - export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin export LD_LIBRARY_PATH /vendor/lib:/system/lib export ANDROID_ROOT /system @@ -28,29 +27,27 @@ on init mkdir /mnt/.lfs 0775 root root #mount /tmp /tmp tmpfs -on early-fs - insmod /lib/modules/j4fs.ko - mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs ro - insmod /lib/modules/vibrator.ko - +on fs mount ext4 /dev/block/mmcblk0p9 /system wait ro mount ext4 /dev/block/mmcblk0p10 /data nosuid nodev noatime wait mkdir /data/log 0777 mkdir /data/anr 0777 + mount ext4 /dev/block/mmcblk0p10 /data remount ro chmod 0666 /dev/log/radio chmod 0666 /dev/log/main chmod 0666 /dev/log/event - mount ext4 /dev/block/mmcblk0p10 /data remount ro +on post-fs-data +# insmod kernel modules + insmod /lib/modules/j4fs.ko + mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs ro on boot -# write /sys/class/sec/switch/usb_sel PDA - # CPU Frequency Governor write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave - + ifup lo hostname localhost domainname localdomain @@ -62,7 +59,6 @@ service debuggerd /system/bin/debuggerd service ueventd /sbin/ueventd critical -#service console /bin/sh service console /system/bin/sh console diff --git a/modules/Si4709_driver.ko b/modules/Si4709_driver.ko old mode 100755 new mode 100644 index 8b425ae..3e59cc4 Binary files a/modules/Si4709_driver.ko and b/modules/Si4709_driver.ko differ diff --git a/modules/dhd.ko b/modules/dhd.ko old mode 100755 new mode 100644 index 46e0881..9a6accb Binary files a/modules/dhd.ko and b/modules/dhd.ko differ diff --git a/modules/j4fs.ko b/modules/j4fs.ko old mode 100755 new mode 100644 index 0a0bd67..675845d Binary files a/modules/j4fs.ko and b/modules/j4fs.ko differ diff --git a/modules/scsi_wait_scan.ko b/modules/scsi_wait_scan.ko old mode 100755 new mode 100644 index 724f4cf..0d5880e Binary files a/modules/scsi_wait_scan.ko and b/modules/scsi_wait_scan.ko differ diff --git a/recovery.fstab b/recovery.fstab old mode 100755 new mode 100644 index e310a96..78624dc --- a/recovery.fstab +++ b/recovery.fstab @@ -7,6 +7,7 @@ /cache ext4 /dev/block/mmcblk0p7 /system ext4 /dev/block/mmcblk0p9 /data ext4 /dev/block/mmcblk0p10 +/preload ext4 /dev/block/mmcblk0p12 /sdcard vfat /dev/block/mmcblk0p11 /emmc vfat /dev/block/mmcblk1p1 diff --git a/recovery.rc b/recovery.rc old mode 100755 new mode 100644 index 45a2ef0..81cd283 --- a/recovery.rc +++ b/recovery.rc @@ -2,47 +2,33 @@ on early-init start ueventd on init - export PATH /sbin + export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin export ANDROID_ROOT /system export ANDROID_DATA /data export EXTERNAL_STORAGE /sdcard symlink /system/etc /etc - mkdir /boot mkdir /sdcard - mkdir /sd-ext - mkdir /datadata mkdir /emmc + mkdir /usbdisk mkdir /system mkdir /data mkdir /cache + mkdir /preload mount /tmp /tmp tmpfs - mkdir /efs -on early-fs - # parameter block - mkdir /mnt/.lfs 0755 root root - insmod /lib/modules/j4fs.ko - mount j4fs /dev/block/mmcblk0p4 /mnt/.lfs - -on fs - mount ext4 /dev/block/mmcblk0p9 /system wait rw - mount ext4 /dev/block/mmcblk0p1 /efs nosuid nodev noatime wait - chown radio system /efs - chmod 0771 /efs - -on post-fs - write /proc/sys/kernel/panic_on_oops 1 - write /proc/sys/kernel/hung_task_timeout_secs 0 - write /proc/cpu/alignment 4 - write /proc/sys/kernel/sched_latency_ns 10000000 - write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 - write /proc/sys/kernel/sched_compat_yield 1 - write /proc/sys/kernel/sched_child_runs_first 0 +on fs + mount ext4 /dev/block/mmcblk0p9 /system on boot +# Permissions for mDNIe + chown system media_rw /sys/class/mdnie/mdnie/mode + chown system media_rw /sys/class/mdnie/mdnie/outdoor + chown system media_rw /sys/class/mdnie/mdnie/scenario + write /sys/class/mdnie/mdnie/scenario 4 + ifup lo hostname localhost domainname localdomain @@ -52,6 +38,15 @@ on boot service ueventd /sbin/ueventd critical +service console /sbin/sh + class core + console + disabled + group log + +on property:ro.debuggable=1 + start console + service recovery /sbin/recovery service adbd /sbin/adbd recovery @@ -60,8 +55,8 @@ service adbd /sbin/adbd recovery # Always start adbd on userdebug and eng builds on property:ro.debuggable=1 write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/idVendor 18D1 - write /sys/class/android_usb/android0/idProduct D001 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 write /sys/class/android_usb/android0/functions adb write /sys/class/android_usb/android0/enable 1 write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer diff --git a/system.prop b/system.prop old mode 100755 new mode 100644 index 62a6b88..90c6593 --- a/system.prop +++ b/system.prop @@ -1,5 +1,5 @@ # -# system.prop for galaxynote +# system.prop for galaxys2 # rild.libpath=/system/lib/libsec-ril.so diff --git a/ueventd.smdk4210.rc b/ueventd.smdk4210.rc old mode 100755 new mode 100644 index f37b686..95e6691 --- a/ueventd.smdk4210.rc +++ b/ueventd.smdk4210.rc @@ -1,47 +1,32 @@ -# video -/dev/video14 0660 system system -/dev/video21 0660 system system -/dev/pmem_gpu1 0660 system graphics -/dev/fimg2d 0666 system system -/dev/mali 0666 system system -/dev/ump 0666 system graphics -/dev/s5p-jpeg 0660 system system -/dev/s3c-mfc 0660 system graphics -/dev/s3c-mem 0666 system system - -# camera -/dev/video0 0660 system camera -/dev/video1 0660 system camera -/dev/video2 0660 system camera -/dev/video3 0660 system camera - -# for usb printer -/dev/usb/lp* 0660 system usb - -/dev/log/* 0662 root log -/dev/i2c-7 0660 system system -/dev/i2c-15 0660 system system -/dev/CEC 0660 system system -/dev/HPD 0660 system system - -# for Sensor HAL -/dev/akm8975 0660 system system -/dev/accelerometer 0660 system system - -# for bluetooth -/dev/s3c2410_serial0 0660 bluetooth bluetooth - -# for gps -/dev/s3c2410_serial1 0660 root system -/dev/tspdrv 0660 system system -/dev/block/mmcblk0p8 0660 system radio - -# for MTP -/dev/usb_mtp_gadget 0660 system system - -# for ULP Audio -/dev/s5p-rp 0660 system audio -/dev/s5p-rp_ctrl 0660 system audio - -# for fmradio -/dev/radio0 0777 system audio \ No newline at end of file +/dev/mali 0666 system system +/dev/ump 0666 system graphics +/dev/exynos-mem 0666 system graphics +/dev/s3c-mem 0666 system system +/dev/s3c-mfc 0666 system graphics +/dev/s5p-mfc 0666 system graphics +/dev/video0 0666 system m2m +/dev/video1 0666 system camera +/dev/video2 0666 system m2m +/dev/video3 0666 system m2m +/dev/video4 0666 system m2m +/dev/s5p-jpeg 0666 system camera +/dev/video14 0666 system system +/dev/video21 0666 system system +/dev/pmem 0660 system graphics +/dev/pmem_gpu1 0660 system graphics +# logger should be world writable (for logging) but not readable +/dev/log/* 0662 root log +/dev/i2c-7 0666 system system +/dev/CEC 0666 system system +/dev/HPD 0666 system system +/dev/fimg2d 0666 system graphics +/dev/fmradio 0660 system audio +/dev/input/* 0666 root input +/dev/srp 0666 system audio +/dev/srp_ctrl 0666 system audio +/dev/umts* 0660 system radio +/dev/link_pm 0660 system radio +/dev/block/mmcblk0p8 0660 system radio +/dev/akm8975 0660 system system +/dev/accelerometer 0660 system system +/dev/graphics/fb0 0777 root graphics diff --git a/usr/idc/melfas_ts.idc b/usr/idc/melfas_ts.idc new file mode 100644 index 0000000..703e73b --- /dev/null +++ b/usr/idc/melfas_ts.idc @@ -0,0 +1,24 @@ +# Copyright (C) 2010 The Android 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. + +# +# Input Device Configuration File for the Atmel Maxtouch touch screen. +# +# These calibration values are derived from empirical measurements +# and may not be appropriate for use with other touch screens. +# Refer to the input device configuration documentation for more details. +# + +# Basic Parameters +touch.deviceType = touchScreen diff --git a/usr/idc/mxt224_ts_input.idc b/usr/idc/mxt224_ts_input.idc new file mode 100644 index 0000000..703e73b --- /dev/null +++ b/usr/idc/mxt224_ts_input.idc @@ -0,0 +1,24 @@ +# Copyright (C) 2010 The Android 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. + +# +# Input Device Configuration File for the Atmel Maxtouch touch screen. +# +# These calibration values are derived from empirical measurements +# and may not be appropriate for use with other touch screens. +# Refer to the input device configuration documentation for more details. +# + +# Basic Parameters +touch.deviceType = touchScreen diff --git a/usr/idc/qwerty.idc b/usr/idc/qwerty.idc new file mode 100644 index 0000000..375d785 --- /dev/null +++ b/usr/idc/qwerty.idc @@ -0,0 +1,28 @@ +# Copyright (C) 2010 The Android 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. + +# +# Emulator keyboard configuration file #1. +# + +touch.deviceType = touchScreen +touch.orientationAware = 1 + +keyboard.layout = qwerty +keyboard.characterMap = qwerty +keyboard.orientationAware = 1 +keyboard.builtIn = 1 + +cursor.mode = navigation +cursor.orientationAware = 1 diff --git a/usr/idc/qwerty2.idc b/usr/idc/qwerty2.idc new file mode 100644 index 0000000..369205e --- /dev/null +++ b/usr/idc/qwerty2.idc @@ -0,0 +1,28 @@ +# Copyright (C) 2010 The Android 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. + +# +# Emulator keyboard configuration file #2. +# + +touch.deviceType = touchScreen +touch.orientationAware = 1 + +keyboard.layout = qwerty +keyboard.characterMap = qwerty2 +keyboard.orientationAware = 1 +keyboard.builtIn = 1 + +cursor.mode = navigation +cursor.orientationAware = 1 diff --git a/usr/idc/sec_touchscreen.idc b/usr/idc/sec_touchscreen.idc new file mode 100644 index 0000000..4bd511a --- /dev/null +++ b/usr/idc/sec_touchscreen.idc @@ -0,0 +1,56 @@ +# Copyright (C) 2010 The Android 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. + +# +# Input Device Configuration File for the Atmel Maxtouch touch screen. +# +# These calibration values are derived from empirical measurements +# and may not be appropriate for use with other touch screens. +# Refer to the input device configuration documentation for more details. +# + +# Basic Parameters +touch.deviceType = touchScreen +touch.orientationAware = 1 + +# Touch Size +touch.touchSize.calibration = pressure + +# Tool Size +# Driver reports tool size as an area measurement. +# +# Based on empirical measurements, we estimate the size of the tool +# using size = sqrt(22 * rawToolArea + 0) * 6 + 0. +touch.toolSize.calibration = area +touch.toolSize.areaScale = 22 +touch.toolSize.areaBias = 0 +touch.toolSize.linearScale = 6 +touch.toolSize.linearBias = 0 +touch.toolSize.isSummed = 0 + +# Pressure +# Driver reports signal strength as pressure. +# +# A normal index finger touch typically registers about 80 signal strength +# units although we don't expect these values to be accurate. +touch.pressure.calibration = amplitude +touch.pressure.source = default +touch.pressure.scale = 0.0125 + +# Size +touch.size.calibration = normalized + +# Orientation +touch.orientation.calibration = vector + diff --git a/usr/keychars/Generic.kcm b/usr/keychars/Generic.kcm new file mode 100644 index 0000000..b5f6897 --- /dev/null +++ b/usr/keychars/Generic.kcm @@ -0,0 +1,672 @@ +# Copyright (C) 2010 The Android 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. + +# +# Generic key character map for full alphabetic US English PC style external keyboards. +# +# This file is intentionally very generic and is intended to support a broad rang of keyboards. +# Do not edit the generic key character map to support a specific keyboard; instead, create +# a new key character map file with the required keyboard configuration. +# + +type FULL + +### Basic QWERTY keys ### + +key A { + label: 'A' + base: 'a' + shift, capslock: 'A' + ctrl, alt, meta: none +} + +key B { + label: 'B' + base: 'b' + shift, capslock: 'B' + ctrl, alt, meta: none +} + +key C { + label: 'C' + base: 'c' + shift, capslock: 'C' + alt: '\u00e7' + shift+alt: '\u00c7' + ctrl, meta: none +} + +key D { + label: 'D' + base: 'd' + shift, capslock: 'D' + ctrl, alt, meta: none +} + +key E { + label: 'E' + base: 'e' + shift, capslock: 'E' + alt: '\u0301' + ctrl, meta: none +} + +key F { + label: 'F' + base: 'f' + shift, capslock: 'F' + ctrl, alt, meta: none +} + +key G { + label: 'G' + base: 'g' + shift, capslock: 'G' + ctrl, alt, meta: none +} + +key H { + label: 'H' + base: 'h' + shift, capslock: 'H' + ctrl, alt, meta: none +} + +key I { + label: 'I' + base: 'i' + shift, capslock: 'I' + alt: '\u0302' + ctrl, meta: none +} + +key J { + label: 'J' + base: 'j' + shift, capslock: 'J' + ctrl, alt, meta: none +} + +key K { + label: 'K' + base: 'k' + shift, capslock: 'K' + ctrl, alt, meta: none +} + +key L { + label: 'L' + base: 'l' + shift, capslock: 'L' + ctrl, alt, meta: none +} + +key M { + label: 'M' + base: 'm' + shift, capslock: 'M' + ctrl, alt, meta: none +} + +key N { + label: 'N' + base: 'n' + shift, capslock: 'N' + alt: '\u0303' + ctrl, meta: none +} + +key O { + label: 'O' + base: 'o' + shift, capslock: 'O' + ctrl, alt, meta: none +} + +key P { + label: 'P' + base: 'p' + shift, capslock: 'P' + ctrl, alt, meta: none +} + +key Q { + label: 'Q' + base: 'q' + shift, capslock: 'Q' + ctrl, alt, meta: none +} + +key R { + label: 'R' + base: 'r' + shift, capslock: 'R' + ctrl, alt, meta: none +} + +key S { + label: 'S' + base: 's' + shift, capslock: 'S' + alt: '\u00df' + ctrl, meta: none +} + +key T { + label: 'T' + base: 't' + shift, capslock: 'T' + ctrl, alt, meta: none +} + +key U { + label: 'U' + base: 'u' + shift, capslock: 'U' + alt: '\u0308' + ctrl, meta: none +} + +key V { + label: 'V' + base: 'v' + shift, capslock: 'V' + ctrl, alt, meta: none +} + +key W { + label: 'W' + base: 'w' + shift, capslock: 'W' + ctrl, alt, meta: none +} + +key X { + label: 'X' + base: 'x' + shift, capslock: 'X' + ctrl, alt, meta: none +} + +key Y { + label: 'Y' + base: 'y' + shift, capslock: 'Y' + ctrl, alt, meta: none +} + +key Z { + label: 'Z' + base: 'z' + shift, capslock: 'Z' + ctrl, alt, meta: none +} + +key 0 { + label, number: '0' + base: '0' + shift: ')' + ctrl, alt, meta: none +} + +key 1 { + label, number: '1' + base: '1' + shift: '!' + ctrl, alt, meta: none +} + +key 2 { + label, number: '2' + base: '2' + shift: '@' + ctrl, alt, meta: none +} + +key 3 { + label, number: '3' + base: '3' + shift: '#' + ctrl, alt, meta: none +} + +key 4 { + label, number: '4' + base: '4' + shift: '$' + ctrl, alt, meta: none +} + +key 5 { + label, number: '5' + base: '5' + shift: '%' + ctrl, alt, meta: none +} + +key 6 { + label, number: '6' + base: '6' + shift: '^' + ctrl, alt, meta: none + alt+shift: '\u0302' +} + +key 7 { + label, number: '7' + base: '7' + shift: '&' + ctrl, alt, meta: none +} + +key 8 { + label, number: '8' + base: '8' + shift: '*' + ctrl, alt, meta: none +} + +key 9 { + label, number: '9' + base: '9' + shift: '(' + ctrl, alt, meta: none +} + +key SPACE { + label: ' ' + base: ' ' + ctrl: none + alt, meta: fallback SEARCH +} + +key ENTER { + label: '\n' + base: '\n' + ctrl, alt, meta: none +} + +key TAB { + label: '\t' + base: '\t' + ctrl, alt, meta: none +} + +key COMMA { + label, number: ',' + base: ',' + shift: '<' + ctrl, alt, meta: none +} + +key PERIOD { + label, number: '.' + base: '.' + shift: '>' + ctrl, alt, meta: none +} + +key SLASH { + label, number: '/' + base: '/' + shift: '?' + ctrl, alt, meta: none +} + +key GRAVE { + label, number: '`' + base: '`' + shift: '~' + alt: '\u0300' + alt+shift: '\u0303' + ctrl, meta: none +} + +key MINUS { + label, number: '-' + base: '-' + shift: '_' + ctrl, alt, meta: none +} + +key EQUALS { + label, number: '=' + base: '=' + shift: '+' + ctrl, alt, meta: none +} + +key LEFT_BRACKET { + label, number: '[' + base: '[' + shift: '{' + ctrl, alt, meta: none +} + +key RIGHT_BRACKET { + label, number: ']' + base: ']' + shift: '}' + ctrl, alt, meta: none +} + +key BACKSLASH { + label, number: '\\' + base: '\\' + shift: '|' + ctrl, alt, meta: none +} + +key SEMICOLON { + label, number: ';' + base: ';' + shift: ':' + ctrl, alt, meta: none +} + +key APOSTROPHE { + label, number: '\'' + base: '\'' + shift: '"' + ctrl, alt, meta: none +} + +### Numeric keypad ### + +key NUMPAD_0 { + label, number: '0' + base: fallback INSERT + numlock: '0' + ctrl, alt, meta: none +} + +key NUMPAD_1 { + label, number: '1' + base: fallback MOVE_END + numlock: '1' + ctrl, alt, meta: none +} + +key NUMPAD_2 { + label, number: '2' + base: fallback DPAD_DOWN + numlock: '2' + ctrl, alt, meta: none +} + +key NUMPAD_3 { + label, number: '3' + base: fallback PAGE_DOWN + numlock: '3' + ctrl, alt, meta: none +} + +key NUMPAD_4 { + label, number: '4' + base: fallback DPAD_LEFT + numlock: '4' + ctrl, alt, meta: none +} + +key NUMPAD_5 { + label, number: '5' + base: fallback DPAD_CENTER + numlock: '5' + ctrl, alt, meta: none +} + +key NUMPAD_6 { + label, number: '6' + base: fallback DPAD_RIGHT + numlock: '6' + ctrl, alt, meta: none +} + +key NUMPAD_7 { + label, number: '7' + base: fallback MOVE_HOME + numlock: '7' + ctrl, alt, meta: none +} + +key NUMPAD_8 { + label, number: '8' + base: fallback DPAD_UP + numlock: '8' + ctrl, alt, meta: none +} + +key NUMPAD_9 { + label, number: '9' + base: fallback PAGE_UP + numlock: '9' + ctrl, alt, meta: none +} + +key NUMPAD_LEFT_PAREN { + label, number: '(' + base: '(' + ctrl, alt, meta: none +} + +key NUMPAD_RIGHT_PAREN { + label, number: ')' + base: ')' + ctrl, alt, meta: none +} + +key NUMPAD_DIVIDE { + label, number: '/' + base: '/' + ctrl, alt, meta: none +} + +key NUMPAD_MULTIPLY { + label, number: '*' + base: '*' + ctrl, alt, meta: none +} + +key NUMPAD_SUBTRACT { + label, number: '-' + base: '-' + ctrl, alt, meta: none +} + +key NUMPAD_ADD { + label, number: '+' + base: '+' + ctrl, alt, meta: none +} + +key NUMPAD_DOT { + label, number: '.' + base: fallback FORWARD_DEL + numlock: '.' + ctrl, alt, meta: none +} + +key NUMPAD_COMMA { + label, number: ',' + base: ',' + ctrl, alt, meta: none +} + +key NUMPAD_EQUALS { + label, number: '=' + base: '=' + ctrl, alt, meta: none +} + +key NUMPAD_ENTER { + label: '\n' + base: '\n' fallback ENTER + ctrl, alt, meta: none fallback ENTER +} + +### Special keys on phones ### + +key AT { + label, number: '@' + base: '@' +} + +key STAR { + label, number: '*' + base: '*' +} + +key POUND { + label, number: '#' + base: '#' +} + +key PLUS { + label, number: '+' + base: '+' +} + +### Non-printing keys ### + +key ESCAPE { + base: fallback BACK + alt, meta: fallback HOME + ctrl: fallback MENU +} + +### Gamepad buttons ### + +key BUTTON_A { + base: fallback BACK +} + +key BUTTON_B { + base: fallback BACK +} + +key BUTTON_C { + base: fallback BACK +} + +key BUTTON_X { + base: fallback DPAD_CENTER +} + +key BUTTON_Y { + base: fallback DPAD_CENTER +} + +key BUTTON_Z { + base: fallback DPAD_CENTER +} + +key BUTTON_L1 { + base: none +} + +key BUTTON_R1 { + base: none +} + +key BUTTON_L2 { + base: none +} + +key BUTTON_R2 { + base: none +} + +key BUTTON_THUMBL { + base: fallback DPAD_CENTER +} + +key BUTTON_THUMBR { + base: fallback DPAD_CENTER +} + +key BUTTON_START { + base: fallback HOME +} + +key BUTTON_SELECT { + base: fallback MENU +} + +key BUTTON_MODE { + base: fallback MENU +} + +key BUTTON_1 { + base: fallback DPAD_CENTER +} + +key BUTTON_2 { + base: fallback DPAD_CENTER +} + +key BUTTON_3 { + base: fallback DPAD_CENTER +} + +key BUTTON_4 { + base: fallback DPAD_CENTER +} + +key BUTTON_5 { + base: fallback DPAD_CENTER +} + +key BUTTON_6 { + base: fallback DPAD_CENTER +} + +key BUTTON_7 { + base: fallback DPAD_CENTER +} + +key BUTTON_8 { + base: fallback DPAD_CENTER +} + +key BUTTON_9 { + base: fallback DPAD_CENTER +} + +key BUTTON_10 { + base: fallback DPAD_CENTER +} + +key BUTTON_11 { + base: fallback DPAD_CENTER +} + +key BUTTON_12 { + base: fallback DPAD_CENTER +} + +key BUTTON_13 { + base: fallback DPAD_CENTER +} + +key BUTTON_14 { + base: fallback DPAD_CENTER +} + +key BUTTON_15 { + base: fallback DPAD_CENTER +} + +key BUTTON_16 { + base: fallback DPAD_CENTER +} diff --git a/usr/keychars/Virtual.kcm b/usr/keychars/Virtual.kcm new file mode 100644 index 0000000..0ce4a68 --- /dev/null +++ b/usr/keychars/Virtual.kcm @@ -0,0 +1,544 @@ +# Copyright (C) 2010 The Android 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. + +# +# Key character map for a built-in generic virtual keyboard primarily used +# for instrumentation and testing purposes. +# + +type FULL + +### Basic QWERTY keys ### + +key A { + label: 'A' + base: 'a' + shift, capslock: 'A' + ctrl, alt, meta: none +} + +key B { + label: 'B' + base: 'b' + shift, capslock: 'B' + ctrl, alt, meta: none +} + +key C { + label: 'C' + base: 'c' + shift, capslock: 'C' + alt: '\u00e7' + shift+alt: '\u00c7' + ctrl, meta: none +} + +key D { + label: 'D' + base: 'd' + shift, capslock: 'D' + ctrl, alt, meta: none +} + +key E { + label: 'E' + base: 'e' + shift, capslock: 'E' + alt: '\u0301' + ctrl, meta: none +} + +key F { + label: 'F' + base: 'f' + shift, capslock: 'F' + ctrl, alt, meta: none +} + +key G { + label: 'G' + base: 'g' + shift, capslock: 'G' + ctrl, alt, meta: none +} + +key H { + label: 'H' + base: 'h' + shift, capslock: 'H' + ctrl, alt, meta: none +} + +key I { + label: 'I' + base: 'i' + shift, capslock: 'I' + alt: '\u0302' + ctrl, meta: none +} + +key J { + label: 'J' + base: 'j' + shift, capslock: 'J' + ctrl, alt, meta: none +} + +key K { + label: 'K' + base: 'k' + shift, capslock: 'K' + ctrl, alt, meta: none +} + +key L { + label: 'L' + base: 'l' + shift, capslock: 'L' + ctrl, alt, meta: none +} + +key M { + label: 'M' + base: 'm' + shift, capslock: 'M' + ctrl, alt, meta: none +} + +key N { + label: 'N' + base: 'n' + shift, capslock: 'N' + alt: '\u0303' + ctrl, meta: none +} + +key O { + label: 'O' + base: 'o' + shift, capslock: 'O' + ctrl, alt, meta: none +} + +key P { + label: 'P' + base: 'p' + shift, capslock: 'P' + ctrl, alt, meta: none +} + +key Q { + label: 'Q' + base: 'q' + shift, capslock: 'Q' + ctrl, alt, meta: none +} + +key R { + label: 'R' + base: 'r' + shift, capslock: 'R' + ctrl, alt, meta: none +} + +key S { + label: 'S' + base: 's' + shift, capslock: 'S' + alt: '\u00df' + ctrl, meta: none +} + +key T { + label: 'T' + base: 't' + shift, capslock: 'T' + ctrl, alt, meta: none +} + +key U { + label: 'U' + base: 'u' + shift, capslock: 'U' + alt: '\u0308' + ctrl, meta: none +} + +key V { + label: 'V' + base: 'v' + shift, capslock: 'V' + ctrl, alt, meta: none +} + +key W { + label: 'W' + base: 'w' + shift, capslock: 'W' + ctrl, alt, meta: none +} + +key X { + label: 'X' + base: 'x' + shift, capslock: 'X' + ctrl, alt, meta: none +} + +key Y { + label: 'Y' + base: 'y' + shift, capslock: 'Y' + ctrl, alt, meta: none +} + +key Z { + label: 'Z' + base: 'z' + shift, capslock: 'Z' + ctrl, alt, meta: none +} + +key 0 { + label, number: '0' + base: '0' + shift: ')' + ctrl, alt, meta: none +} + +key 1 { + label, number: '1' + base: '1' + shift: '!' + ctrl, alt, meta: none +} + +key 2 { + label, number: '2' + base: '2' + shift: '@' + ctrl, alt, meta: none +} + +key 3 { + label, number: '3' + base: '3' + shift: '#' + ctrl, alt, meta: none +} + +key 4 { + label, number: '4' + base: '4' + shift: '$' + ctrl, alt, meta: none +} + +key 5 { + label, number: '5' + base: '5' + shift: '%' + ctrl, alt, meta: none +} + +key 6 { + label, number: '6' + base: '6' + shift: '^' + ctrl, alt, meta: none + alt+shift: '\u0302' +} + +key 7 { + label, number: '7' + base: '7' + shift: '&' + ctrl, alt, meta: none +} + +key 8 { + label, number: '8' + base: '8' + shift: '*' + ctrl, alt, meta: none +} + +key 9 { + label, number: '9' + base: '9' + shift: '(' + ctrl, alt, meta: none +} + +key SPACE { + label: ' ' + base: ' ' + ctrl, alt: none + meta: fallback SEARCH +} + +key ENTER { + label: '\n' + base: '\n' + ctrl, alt, meta: none +} + +key TAB { + label: '\t' + base: '\t' + ctrl, alt: none + meta: fallback APP_SWITCH +} + +key COMMA { + label, number: ',' + base: ',' + shift: '<' + ctrl, alt, meta: none +} + +key PERIOD { + label, number: '.' + base: '.' + shift: '>' + ctrl, alt, meta: none +} + +key SLASH { + label, number: '/' + base: '/' + shift: '?' + ctrl, alt, meta: none +} + +key GRAVE { + label, number: '`' + base: '`' + shift: '~' + alt: '\u0300' + alt+shift: '\u0303' + ctrl, meta: none +} + +key MINUS { + label, number: '-' + base: '-' + shift: '_' + ctrl, alt, meta: none +} + +key EQUALS { + label, number: '=' + base: '=' + shift: '+' + ctrl, alt, meta: none +} + +key LEFT_BRACKET { + label, number: '[' + base: '[' + shift: '{' + ctrl, alt, meta: none +} + +key RIGHT_BRACKET { + label, number: ']' + base: ']' + shift: '}' + ctrl, alt, meta: none +} + +key BACKSLASH { + label, number: '\\' + base: '\\' + shift: '|' + ctrl, alt, meta: none +} + +key SEMICOLON { + label, number: ';' + base: ';' + shift: ':' + ctrl, alt, meta: none +} + +key APOSTROPHE { + label, number: '\'' + base: '\'' + shift: '"' + ctrl, alt, meta: none +} + +### Numeric keypad ### + +key NUMPAD_0 { + label, number: '0' + base: fallback INSERT + numlock: '0' + ctrl, alt, meta: none +} + +key NUMPAD_1 { + label, number: '1' + base: fallback MOVE_END + numlock: '1' + ctrl, alt, meta: none +} + +key NUMPAD_2 { + label, number: '2' + base: fallback DPAD_DOWN + numlock: '2' + ctrl, alt, meta: none +} + +key NUMPAD_3 { + label, number: '3' + base: fallback PAGE_DOWN + numlock: '3' + ctrl, alt, meta: none +} + +key NUMPAD_4 { + label, number: '4' + base: fallback DPAD_LEFT + numlock: '4' + ctrl, alt, meta: none +} + +key NUMPAD_5 { + label, number: '5' + base: fallback DPAD_CENTER + numlock: '5' + ctrl, alt, meta: none +} + +key NUMPAD_6 { + label, number: '6' + base: fallback DPAD_RIGHT + numlock: '6' + ctrl, alt, meta: none +} + +key NUMPAD_7 { + label, number: '7' + base: fallback MOVE_HOME + numlock: '7' + ctrl, alt, meta: none +} + +key NUMPAD_8 { + label, number: '8' + base: fallback DPAD_UP + numlock: '8' + ctrl, alt, meta: none +} + +key NUMPAD_9 { + label, number: '9' + base: fallback PAGE_UP + numlock: '9' + ctrl, alt, meta: none +} + +key NUMPAD_LEFT_PAREN { + label, number: '(' + base: '(' + ctrl, alt, meta: none +} + +key NUMPAD_RIGHT_PAREN { + label, number: ')' + base: ')' + ctrl, alt, meta: none +} + +key NUMPAD_DIVIDE { + label, number: '/' + base: '/' + ctrl, alt, meta: none +} + +key NUMPAD_MULTIPLY { + label, number: '*' + base: '*' + ctrl, alt, meta: none +} + +key NUMPAD_SUBTRACT { + label, number: '-' + base: '-' + ctrl, alt, meta: none +} + +key NUMPAD_ADD { + label, number: '+' + base: '+' + ctrl, alt, meta: none +} + +key NUMPAD_DOT { + label, number: '.' + base: fallback FORWARD_DEL + numlock: '.' + ctrl, alt, meta: none +} + +key NUMPAD_COMMA { + label, number: ',' + base: ',' + ctrl, alt, meta: none +} + +key NUMPAD_EQUALS { + label, number: '=' + base: '=' + ctrl, alt, meta: none +} + +key NUMPAD_ENTER { + label: '\n' + base: '\n' fallback ENTER + ctrl, alt, meta: none fallback ENTER +} + +### Special keys on phones ### + +key AT { + label, number: '@' + base: '@' +} + +key STAR { + label, number: '*' + base: '*' +} + +key POUND { + label, number: '#' + base: '#' +} + +key PLUS { + label, number: '+' + base: '+' +} + +### Non-printing keys ### + +key ESCAPE { + base: fallback BACK + meta: fallback HOME + alt: fallback MENU +} diff --git a/usr/keychars/qwerty.kcm b/usr/keychars/qwerty.kcm new file mode 100644 index 0000000..f3e1524 --- /dev/null +++ b/usr/keychars/qwerty.kcm @@ -0,0 +1,508 @@ +# Copyright (C) 2010 The Android 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. + +# +# Emulator keyboard character map #1. +# +# This file is no longer used as the platform's default keyboard character map. +# Refer to Generic.kcm and Virtual.kcm instead. +# + +type ALPHA + +key A { + label: 'A' + number: '2' + base: 'a' + shift, capslock: 'A' + alt: '#' + shift+alt, capslock+alt: none +} + +key B { + label: 'B' + number: '2' + base: 'b' + shift, capslock: 'B' + alt: '<' + shift+alt, capslock+alt: none +} + +key C { + label: 'C' + number: '2' + base: 'c' + shift, capslock: 'C' + alt: '9' + shift+alt, capslock+alt: '\u00e7' +} + +key D { + label: 'D' + number: '3' + base: 'd' + shift, capslock: 'D' + alt: '5' + shift+alt, capslock+alt: none +} + +key E { + label: 'E' + number: '3' + base: 'e' + shift, capslock: 'E' + alt: '2' + shift+alt, capslock+alt: '\u0301' +} + +key F { + label: 'F' + number: '3' + base: 'f' + shift, capslock: 'F' + alt: '6' + shift+alt, capslock+alt: '\u00a5' +} + +key G { + label: 'G' + number: '4' + base: 'g' + shift, capslock: 'G' + alt: '-' + shift+alt, capslock+alt: '_' +} + +key H { + label: 'H' + number: '4' + base: 'h' + shift, capslock: 'H' + alt: '[' + shift+alt, capslock+alt: '{' +} + +key I { + label: 'I' + number: '4' + base: 'i' + shift, capslock: 'I' + alt: '$' + shift+alt, capslock+alt: '\u0302' +} + +key J { + label: 'J' + number: '5' + base: 'j' + shift, capslock: 'J' + alt: ']' + shift+alt, capslock+alt: '}' +} + +key K { + label: 'K' + number: '5' + base: 'k' + shift, capslock: 'K' + alt: '"' + shift+alt, capslock+alt: '~' +} + +key L { + label: 'L' + number: '5' + base: 'l' + shift, capslock: 'L' + alt: '\'' + shift+alt, capslock+alt: '`' +} + +key M { + label: 'M' + number: '6' + base: 'm' + shift, capslock: 'M' + alt: '!' + shift+alt, capslock+alt: none +} + +key N { + label: 'N' + number: '6' + base: 'n' + shift, capslock: 'N' + alt: '>' + shift+alt, capslock+alt: '\u0303' +} + +key O { + label: 'O' + number: '6' + base: 'o' + shift, capslock: 'O' + alt: '(' + shift+alt, capslock+alt: none +} + +key P { + label: 'P' + number: '7' + base: 'p' + shift, capslock: 'P' + alt: ')' + shift+alt, capslock+alt: none +} + +key Q { + label: 'Q' + number: '7' + base: 'q' + shift, capslock: 'Q' + alt: '*' + shift+alt, capslock+alt: '\u0300' +} + +key R { + label: 'R' + number: '7' + base: 'r' + shift, capslock: 'R' + alt: '3' + shift+alt, capslock+alt: '\u20ac' +} + +key S { + label: 'S' + number: '7' + base: 's' + shift, capslock: 'S' + alt: '4' + shift+alt, capslock+alt: '\u00df' +} + +key T { + label: 'T' + number: '8' + base: 't' + shift, capslock: 'T' + alt: '+' + shift+alt, capslock+alt: '\u00a3' +} + +key U { + label: 'U' + number: '8' + base: 'u' + shift, capslock: 'U' + alt: '&' + shift+alt, capslock+alt: '\u0308' +} + +key V { + label: 'V' + number: '8' + base: 'v' + shift, capslock: 'V' + alt: '=' + shift+alt, capslock+alt: '^' +} + +key W { + label: 'W' + number: '9' + base: 'w' + shift, capslock: 'W' + alt: '1' + shift+alt, capslock+alt: none +} + +key X { + label: 'X' + number: '9' + base: 'x' + shift, capslock: 'X' + alt: '8' + shift+alt, capslock+alt: '\uef00' +} + +key Y { + label: 'Y' + number: '9' + base: 'y' + shift, capslock: 'Y' + alt: '%' + shift+alt, capslock+alt: '\u00a1' +} + +key Z { + label: 'Z' + number: '9' + base: 'z' + shift, capslock: 'Z' + alt: '7' + shift+alt, capslock+alt: none +} + +key COMMA { + label: ',' + number: ',' + base: ',' + shift: ';' + alt: ';' + shift+alt: '|' +} + +key PERIOD { + label: '.' + number: '.' + base: '.' + shift: ':' + alt: ':' + shift+alt: '\u2026' +} + +key AT { + label: '@' + number: '0' + base: '@' + shift: '0' + alt: '0' + shift+alt: '\u2022' +} + +key SLASH { + label: '/' + number: '/' + base: '/' + shift: '?' + alt: '?' + shift+alt: '\\' +} + +key SPACE { + label: ' ' + number: ' ' + base: ' ' + shift: ' ' + alt: '\uef01' + shift+alt: '\uef01' +} + +key ENTER { + label: '\n' + number: '\n' + base: '\n' + shift: '\n' + alt: '\n' + shift+alt: '\n' +} + +key TAB { + label: '\t' + number: '\t' + base: '\t' + shift: '\t' + alt: '\t' + shift+alt: '\t' +} + +key 0 { + label: '0' + number: '0' + base: '0' + shift: ')' + alt: ')' + shift+alt: ')' +} + +key 1 { + label: '1' + number: '1' + base: '1' + shift: '!' + alt: '!' + shift+alt: '!' +} + +key 2 { + label: '2' + number: '2' + base: '2' + shift: '@' + alt: '@' + shift+alt: '@' +} + +key 3 { + label: '3' + number: '3' + base: '3' + shift: '#' + alt: '#' + shift+alt: '#' +} + +key 4 { + label: '4' + number: '4' + base: '4' + shift: '$' + alt: '$' + shift+alt: '$' +} + +key 5 { + label: '5' + number: '5' + base: '5' + shift: '%' + alt: '%' + shift+alt: '%' +} + +key 6 { + label: '6' + number: '6' + base: '6' + shift: '^' + alt: '^' + shift+alt: '^' +} + +key 7 { + label: '7' + number: '7' + base: '7' + shift: '&' + alt: '&' + shift+alt: '&' +} + +key 8 { + label: '8' + number: '8' + base: '8' + shift: '*' + alt: '*' + shift+alt: '*' +} + +key 9 { + label: '9' + number: '9' + base: '9' + shift: '(' + alt: '(' + shift+alt: '(' +} + +key GRAVE { + label: '`' + number: '`' + base: '`' + shift: '~' + alt: '`' + shift+alt: '~' +} + +key MINUS { + label: '-' + number: '-' + base: '-' + shift: '_' + alt: '-' + shift+alt: '_' +} + +key EQUALS { + label: '=' + number: '=' + base: '=' + shift: '+' + alt: '=' + shift+alt: '+' +} + +key LEFT_BRACKET { + label: '[' + number: '[' + base: '[' + shift: '{' + alt: '[' + shift+alt: '{' +} + +key RIGHT_BRACKET { + label: ']' + number: ']' + base: ']' + shift: '}' + alt: ']' + shift+alt: '}' +} + +key BACKSLASH { + label: '\\' + number: '\\' + base: '\\' + shift: '|' + alt: '\\' + shift+alt: '|' +} + +key SEMICOLON { + label: ';' + number: ';' + base: ';' + shift: ':' + alt: ';' + shift+alt: ':' +} + +key APOSTROPHE { + label: '\'' + number: '\'' + base: '\'' + shift: '"' + alt: '\'' + shift+alt: '"' +} + +key STAR { + label: '*' + number: '*' + base: '*' + shift: '*' + alt: '*' + shift+alt: '*' +} + +key POUND { + label: '#' + number: '#' + base: '#' + shift: '#' + alt: '#' + shift+alt: '#' +} + +key PLUS { + label: '+' + number: '+' + base: '+' + shift: '+' + alt: '+' + shift+alt: '+' +} diff --git a/usr/keychars/qwerty2.kcm b/usr/keychars/qwerty2.kcm new file mode 100644 index 0000000..d96914f --- /dev/null +++ b/usr/keychars/qwerty2.kcm @@ -0,0 +1,505 @@ +# Copyright (C) 2010 The Android 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. + +# +# Emulator keyboard character map #2. +# + +type ALPHA + +key A { + label: 'A' + number: '2' + base: 'a' + shift, capslock: 'A' + alt: 'a' + shift+alt, capslock+alt: 'A' +} + +key B { + label: 'B' + number: '2' + base: 'b' + shift, capslock: 'B' + alt: 'b' + shift+alt, capslock+alt: 'B' +} + +key C { + label: 'C' + number: '2' + base: 'c' + shift, capslock: 'C' + alt: '\u00e7' + shift+alt, capslock+alt: '\u00e7' +} + +key D { + label: 'D' + number: '3' + base: 'd' + shift, capslock: 'D' + alt: '\'' + shift+alt, capslock+alt: '\'' +} + +key E { + label: 'E' + number: '3' + base: 'e' + shift, capslock: 'E' + alt: '"' + shift+alt, capslock+alt: '\u0301' +} + +key F { + label: 'F' + number: '3' + base: 'f' + shift, capslock: 'F' + alt: '[' + shift+alt, capslock+alt: '[' +} + +key G { + label: 'G' + number: '4' + base: 'g' + shift, capslock: 'G' + alt: ']' + shift+alt, capslock+alt: ']' +} + +key H { + label: 'H' + number: '4' + base: 'h' + shift, capslock: 'H' + alt: '<' + shift+alt, capslock+alt: '<' +} + +key I { + label: 'I' + number: '4' + base: 'i' + shift, capslock: 'I' + alt: '-' + shift+alt, capslock+alt: '\u0302' +} + +key J { + label: 'J' + number: '5' + base: 'j' + shift, capslock: 'J' + alt: '>' + shift+alt, capslock+alt: '>' +} + +key K { + label: 'K' + number: '5' + base: 'k' + shift, capslock: 'K' + alt: ';' + shift+alt, capslock+alt: '~' +} + +key L { + label: 'L' + number: '5' + base: 'l' + shift, capslock: 'L' + alt: ':' + shift+alt, capslock+alt: '`' +} + +key M { + label: 'M' + number: '6' + base: 'm' + shift, capslock: 'M' + alt: '%' + shift+alt, capslock+alt: none +} + +key N { + label: 'N' + number: '6' + base: 'n' + shift, capslock: 'N' + alt: none + shift+alt, capslock+alt: '\u0303' +} + +key O { + label: 'O' + number: '6' + base: 'o' + shift, capslock: 'O' + alt: '+' + shift+alt, capslock+alt: '+' +} + +key P { + label: 'P' + number: '7' + base: 'p' + shift, capslock: 'P' + alt: '=' + shift+alt, capslock+alt: '\u00a5' +} + +key Q { + label: 'Q' + number: '7' + base: 'q' + shift, capslock: 'Q' + alt: '|' + shift+alt, capslock+alt: '\u0300' +} + +key R { + label: 'R' + number: '7' + base: 'r' + shift, capslock: 'R' + alt: '`' + shift+alt, capslock+alt: '\u20ac' +} + +key S { + label: 'S' + number: '7' + base: 's' + shift, capslock: 'S' + alt: '\\' + shift+alt, capslock+alt: '\u00df' +} + +key T { + label: 'T' + number: '8' + base: 't' + shift, capslock: 'T' + alt: '{' + shift+alt, capslock+alt: '\u00a3' +} + +key U { + label: 'U' + number: '8' + base: 'u' + shift, capslock: 'U' + alt: '_' + shift+alt, capslock+alt: '\u0308' +} + +key V { + label: 'V' + number: '8' + base: 'v' + shift, capslock: 'V' + alt: 'v' + shift+alt, capslock+alt: 'V' +} + +key W { + label: 'W' + number: '9' + base: 'w' + shift, capslock: 'W' + alt: '~' + shift+alt, capslock+alt: '~' +} + +key X { + label: 'X' + number: '9' + base: 'x' + shift, capslock: 'X' + alt: 'x' + shift+alt, capslock+alt: '\uef00' +} + +key Y { + label: 'Y' + number: '9' + base: 'y' + shift, capslock: 'Y' + alt: '}' + shift+alt, capslock+alt: '\u00a1' +} + +key Z { + label: 'Z' + number: '9' + base: 'z' + shift, capslock: 'Z' + alt: 'z' + shift+alt, capslock+alt: 'Z' +} + +key COMMA { + label: ',' + number: ',' + base: ',' + shift: '<' + alt: ',' + shift+alt: ',' +} + +key PERIOD { + label: '.' + number: '.' + base: '.' + shift: '>' + alt: '.' + shift+alt: '\u2026' +} + +key AT { + label: '@' + number: '@' + base: '@' + shift: '@' + alt: '@' + shift+alt: '\u2022' +} + +key SLASH { + label: '/' + number: '/' + base: '/' + shift: '?' + alt: '?' + shift+alt: '?' +} + +key SPACE { + label: ' ' + number: ' ' + base: ' ' + shift: ' ' + alt: '\uef01' + shift+alt: '\uef01' +} + +key ENTER { + label: '\n' + number: '\n' + base: '\n' + shift: '\n' + alt: '\n' + shift+alt: '\n' +} + +key TAB { + label: '\t' + number: '\t' + base: '\t' + shift: '\t' + alt: '\t' + shift+alt: '\t' +} + +key 0 { + label: '0' + number: '0' + base: '0' + shift: ')' + alt: ')' + shift+alt: ')' +} + +key 1 { + label: '1' + number: '1' + base: '1' + shift: '!' + alt: '!' + shift+alt: '!' +} + +key 2 { + label: '2' + number: '2' + base: '2' + shift: '@' + alt: '@' + shift+alt: '@' +} + +key 3 { + label: '3' + number: '3' + base: '3' + shift: '#' + alt: '#' + shift+alt: '#' +} + +key 4 { + label: '4' + number: '4' + base: '4' + shift: '$' + alt: '$' + shift+alt: '$' +} + +key 5 { + label: '5' + number: '5' + base: '5' + shift: '%' + alt: '%' + shift+alt: '%' +} + +key 6 { + label: '6' + number: '6' + base: '6' + shift: '^' + alt: '^' + shift+alt: '^' +} + +key 7 { + label: '7' + number: '7' + base: '7' + shift: '&' + alt: '&' + shift+alt: '&' +} + +key 8 { + label: '8' + number: '8' + base: '8' + shift: '*' + alt: '*' + shift+alt: '*' +} + +key 9 { + label: '9' + number: '9' + base: '9' + shift: '(' + alt: '(' + shift+alt: '(' +} + +key GRAVE { + label: '`' + number: '`' + base: '`' + shift: '~' + alt: '`' + shift+alt: '~' +} + +key MINUS { + label: '-' + number: '-' + base: '-' + shift: '_' + alt: '-' + shift+alt: '_' +} + +key EQUALS { + label: '=' + number: '=' + base: '=' + shift: '+' + alt: '=' + shift+alt: '+' +} + +key LEFT_BRACKET { + label: '[' + number: '[' + base: '[' + shift: '{' + alt: '[' + shift+alt: '{' +} + +key RIGHT_BRACKET { + label: ']' + number: ']' + base: ']' + shift: '}' + alt: ']' + shift+alt: '}' +} + +key BACKSLASH { + label: '\\' + number: '\\' + base: '\\' + shift: '|' + alt: '\\' + shift+alt: '|' +} + +key SEMICOLON { + label: ';' + number: ';' + base: ';' + shift: ':' + alt: ';' + shift+alt: ':' +} + +key APOSTROPHE { + label: '\'' + number: '\'' + base: '\'' + shift: '"' + alt: '\'' + shift+alt: '"' +} + +key STAR { + label: '*' + number: '*' + base: '*' + shift: '*' + alt: '*' + shift+alt: '*' +} + +key POUND { + label: '#' + number: '#' + base: '#' + shift: '#' + alt: '#' + shift+alt: '#' +} + +key PLUS { + label: '+' + number: '+' + base: '+' + shift: '+' + alt: '+' + shift+alt: '+' +} diff --git a/usr/keylayout/AVRCP.kl b/usr/keylayout/AVRCP.kl new file mode 100644 index 0000000..736b43c --- /dev/null +++ b/usr/keylayout/AVRCP.kl @@ -0,0 +1,23 @@ +# Copyright (C) 2010 The Android 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. + +# Key layout used for Bluetooth AVRCP support. + +key 200 MEDIA_PLAY WAKE +key 201 MEDIA_PAUSE WAKE +key 166 MEDIA_STOP WAKE +key 163 MEDIA_NEXT WAKE +key 165 MEDIA_PREVIOUS WAKE +key 168 MEDIA_REWIND WAKE +key 208 MEDIA_FAST_FORWARD WAKE diff --git a/usr/keylayout/Generic.kl b/usr/keylayout/Generic.kl new file mode 100644 index 0000000..bc31305 --- /dev/null +++ b/usr/keylayout/Generic.kl @@ -0,0 +1,422 @@ +# Copyright (C) 2010 The Android 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. + +# +# Generic key layout file for full alphabetic US English PC style external keyboards. +# +# This file is intentionally very generic and is intended to support a broad rang of keyboards. +# Do not edit the generic key layout to support a specific keyboard; instead, create +# a new key layout file with the required keyboard configuration. +# + +key 1 ESCAPE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 12 MINUS +key 13 EQUALS +key 14 DEL +key 15 TAB +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 28 ENTER +key 29 CTRL_LEFT +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 41 GRAVE +key 42 SHIFT_LEFT +key 43 BACKSLASH +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 54 SHIFT_RIGHT +key 55 NUMPAD_MULTIPLY +key 56 ALT_LEFT +key 57 SPACE +key 58 CAPS_LOCK +key 59 F1 +key 60 F2 +key 61 F3 +key 62 F4 +key 63 F5 +key 64 F6 +key 65 F7 +key 66 F8 +key 67 F9 +key 68 F10 +key 69 NUM_LOCK +key 70 SCROLL_LOCK +key 71 NUMPAD_7 +key 72 NUMPAD_8 +key 73 NUMPAD_9 +key 74 NUMPAD_SUBTRACT +key 75 NUMPAD_4 +key 76 NUMPAD_5 +key 77 NUMPAD_6 +key 78 NUMPAD_ADD +key 79 NUMPAD_1 +key 80 NUMPAD_2 +key 81 NUMPAD_3 +key 82 NUMPAD_0 +key 83 NUMPAD_DOT +# key 84 (undefined) +# key 85 "KEY_ZENKAKUHANKAKU" +key 86 BACKSLASH +key 87 F11 +key 88 F12 +# key 89 "KEY_RO" +# key 90 "KEY_KATAKANA" +# key 91 "KEY_HIRAGANA" +# key 92 "KEY_HENKAN" +# key 93 "KEY_KATAKANAHIRAGANA" +# key 94 "KEY_MUHENKAN" +key 95 NUMPAD_COMMA +key 96 NUMPAD_ENTER +key 97 CTRL_RIGHT +key 98 NUMPAD_DIVIDE +key 99 SYSRQ +key 100 ALT_RIGHT +# key 101 "KEY_LINEFEED" +key 102 MOVE_HOME +key 103 DPAD_UP +key 104 PAGE_UP +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 107 MOVE_END +key 108 DPAD_DOWN +key 109 PAGE_DOWN +key 110 INSERT +key 111 FORWARD_DEL +# key 112 "KEY_MACRO" +key 113 VOLUME_MUTE +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 116 POWER WAKE +key 117 NUMPAD_EQUALS +# key 118 "KEY_KPPLUSMINUS" +key 119 BREAK +# key 120 (undefined) +key 121 NUMPAD_COMMA +key 122 LANG +# key 123 "KEY_HANJA" +# key 124 "KEY_YEN" +key 125 META_LEFT +key 126 META_RIGHT +key 127 MENU WAKE_DROPPED +key 128 MEDIA_STOP +# key 129 "KEY_AGAIN" +# key 130 "KEY_PROPS" +# key 131 "KEY_UNDO" +# key 132 "KEY_FRONT" +# key 133 "KEY_COPY" +# key 134 "KEY_OPEN" +# key 135 "KEY_PASTE" +# key 136 "KEY_FIND" +# key 137 "KEY_CUT" +# key 138 "KEY_HELP" +key 139 MENU WAKE_DROPPED +key 140 CALCULATOR +# key 141 "KEY_SETUP" +key 142 POWER WAKE +key 143 POWER WAKE +# key 144 "KEY_FILE" +# key 145 "KEY_SENDFILE" +# key 146 "KEY_DELETEFILE" +# key 147 "KEY_XFER" +# key 148 "KEY_PROG1" +# key 149 "KEY_PROG2" +key 150 EXPLORER +# key 151 "KEY_MSDOS" +key 152 POWER WAKE +# key 153 "KEY_DIRECTION" +# key 154 "KEY_CYCLEWINDOWS" +key 155 ENVELOPE +key 156 BOOKMARK +# key 157 "KEY_COMPUTER" +key 158 BACK WAKE_DROPPED +key 159 FORWARD +key 160 MEDIA_CLOSE +key 161 MEDIA_EJECT +key 162 MEDIA_EJECT +key 163 MEDIA_NEXT +key 164 MEDIA_PLAY_PAUSE +key 165 MEDIA_PREVIOUS +key 166 MEDIA_STOP +key 167 MEDIA_RECORD +key 168 MEDIA_REWIND +key 169 CALL +# key 170 "KEY_ISO" +key 171 MUSIC +key 172 HOME +# key 173 "KEY_REFRESH" +# key 174 "KEY_EXIT" +# key 175 "KEY_MOVE" +# key 176 "KEY_EDIT" +key 177 PAGE_UP +key 178 PAGE_DOWN +key 179 NUMPAD_LEFT_PAREN +key 180 NUMPAD_RIGHT_PAREN +# key 181 "KEY_NEW" +# key 182 "KEY_REDO" +# key 183 F13 +# key 184 F14 +# key 185 F15 +# key 186 F16 +# key 187 F17 +# key 188 F18 +# key 189 F19 +# key 190 F20 +# key 191 F21 +# key 192 F22 +# key 193 F23 +# key 194 F24 +# key 195 (undefined) +# key 196 (undefined) +# key 197 (undefined) +# key 198 (undefined) +# key 199 (undefined) +key 200 MEDIA_PLAY +key 201 MEDIA_PAUSE +# key 202 "KEY_PROG3" +# key 203 "KEY_PROG4" +# key 204 (undefined) +# key 205 "KEY_SUSPEND" +# key 206 "KEY_CLOSE" +key 207 MEDIA_PLAY +key 208 MEDIA_FAST_FORWARD +# key 209 "KEY_BASSBOOST" +# key 210 "KEY_PRINT" +# key 211 "KEY_HP" +key 212 CAMERA +key 213 MUSIC +# key 214 "KEY_QUESTION" +key 215 ENVELOPE +# key 216 "KEY_CHAT" +key 217 SEARCH +# key 218 "KEY_CONNECT" +# key 219 "KEY_FINANCE" +# key 220 "KEY_SPORT" +# key 221 "KEY_SHOP" +# key 222 "KEY_ALTERASE" +# key 223 "KEY_CANCEL" +# key 224 "KEY_BRIGHTNESSDOWN" +# key 225 "KEY_BRIGHTNESSUP" +key 226 HEADSETHOOK + +key 256 BUTTON_1 +key 257 BUTTON_2 +key 258 BUTTON_3 +key 259 BUTTON_4 +key 260 BUTTON_5 +key 261 BUTTON_6 +key 262 BUTTON_7 +key 263 BUTTON_8 +key 264 BUTTON_9 +key 265 BUTTON_10 +key 266 BUTTON_11 +key 267 BUTTON_12 +key 268 BUTTON_13 +key 269 BUTTON_14 +key 270 BUTTON_15 +key 271 BUTTON_16 + +key 288 BUTTON_1 +key 289 BUTTON_2 +key 290 BUTTON_3 +key 291 BUTTON_4 +key 292 BUTTON_5 +key 293 BUTTON_6 +key 294 BUTTON_7 +key 295 BUTTON_8 +key 296 BUTTON_9 +key 297 BUTTON_10 +key 298 BUTTON_11 +key 299 BUTTON_12 +key 300 BUTTON_13 +key 301 BUTTON_14 +key 302 BUTTON_15 +key 303 BUTTON_16 + + +key 304 BUTTON_A +key 305 BUTTON_B +key 306 BUTTON_C +key 307 BUTTON_X +key 308 BUTTON_Y +key 309 BUTTON_Z +key 310 BUTTON_L1 +key 311 BUTTON_R1 +key 312 BUTTON_L2 +key 313 BUTTON_R2 +key 314 BUTTON_SELECT +key 315 BUTTON_START +key 316 BUTTON_MODE +key 317 BUTTON_THUMBL +key 318 BUTTON_THUMBR + + +# key 352 "KEY_OK" +# key 353 "KEY_SELECT" +# key 354 "KEY_GOTO" +# key 355 "KEY_CLEAR" +# key 356 "KEY_POWER2" +# key 357 "KEY_OPTION" +# key 358 "KEY_INFO" +# key 359 "KEY_TIME" +# key 360 "KEY_VENDOR" +# key 361 "KEY_ARCHIVE" +key 362 GUIDE +# key 363 "KEY_CHANNEL" +# key 364 "KEY_FAVORITES" +# key 365 "KEY_EPG" +key 366 DVR +# key 367 "KEY_MHP" +# key 368 "KEY_LANGUAGE" +# key 369 "KEY_TITLE" +# key 370 "KEY_SUBTITLE" +# key 371 "KEY_ANGLE" +# key 372 "KEY_ZOOM" +# key 373 "KEY_MODE" +# key 374 "KEY_KEYBOARD" +# key 375 "KEY_SCREEN" +# key 376 "KEY_PC" +key 377 TV +# key 378 "KEY_TV2" +# key 379 "KEY_VCR" +# key 380 "KEY_VCR2" +# key 381 "KEY_SAT" +# key 382 "KEY_SAT2" +# key 383 "KEY_CD" +# key 384 "KEY_TAPE" +# key 385 "KEY_RADIO" +# key 386 "KEY_TUNER" +# key 387 "KEY_PLAYER" +# key 388 "KEY_TEXT" +# key 389 "KEY_DVD" +# key 390 "KEY_AUX" +# key 391 "KEY_MP3" +# key 392 "KEY_AUDIO" +# key 393 "KEY_VIDEO" +# key 394 "KEY_DIRECTORY" +# key 395 "KEY_LIST" +# key 396 "KEY_MEMO" +key 397 CALENDAR +# key 398 "KEY_RED" +# key 399 "KEY_GREEN" +# key 400 "KEY_YELLOW" +# key 401 "KEY_BLUE" +key 402 CHANNEL_UP +key 403 CHANNEL_DOWN +# key 404 "KEY_FIRST" +# key 405 "KEY_LAST" +# key 406 "KEY_AB" +# key 407 "KEY_NEXT" +# key 408 "KEY_RESTART" +# key 409 "KEY_SLOW" +# key 410 "KEY_SHUFFLE" +# key 411 "KEY_BREAK" +# key 412 "KEY_PREVIOUS" +# key 413 "KEY_DIGITS" +# key 414 "KEY_TEEN" +# key 415 "KEY_TWEN" + +key 429 CONTACTS + +# key 448 "KEY_DEL_EOL" +# key 449 "KEY_DEL_EOS" +# key 450 "KEY_INS_LINE" +# key 451 "KEY_DEL_LINE" + + +key 464 FUNCTION +key 465 ESCAPE FUNCTION +key 466 F1 FUNCTION +key 467 F2 FUNCTION +key 468 F3 FUNCTION +key 469 F4 FUNCTION +key 470 F5 FUNCTION +key 471 F6 FUNCTION +key 472 F7 FUNCTION +key 473 F8 FUNCTION +key 474 F9 FUNCTION +key 475 F10 FUNCTION +key 476 F11 FUNCTION +key 477 F12 FUNCTION +key 478 1 FUNCTION +key 479 2 FUNCTION +key 480 D FUNCTION +key 481 E FUNCTION +key 482 F FUNCTION +key 483 S FUNCTION +key 484 B FUNCTION + + +# key 497 KEY_BRL_DOT1 +# key 498 KEY_BRL_DOT2 +# key 499 KEY_BRL_DOT3 +# key 500 KEY_BRL_DOT4 +# key 501 KEY_BRL_DOT5 +# key 502 KEY_BRL_DOT6 +# key 503 KEY_BRL_DOT7 +# key 504 KEY_BRL_DOT8 + + +# Joystick and game controller axes. +# Axes that are not mapped will be assigned generic axis numbers by the input subsystem. +axis 0x00 X +axis 0x01 Y +axis 0x02 Z +axis 0x03 RX +axis 0x04 RY +axis 0x05 RZ +axis 0x06 THROTTLE +axis 0x07 RUDDER +axis 0x08 WHEEL +axis 0x09 GAS +axis 0x0a BRAKE +axis 0x10 HAT_X +axis 0x11 HAT_Y diff --git a/usr/keylayout/Vendor_045e_Product_028e.kl b/usr/keylayout/Vendor_045e_Product_028e.kl new file mode 100644 index 0000000..99f046a --- /dev/null +++ b/usr/keylayout/Vendor_045e_Product_028e.kl @@ -0,0 +1,46 @@ +# Copyright (C) 2011 The Android 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. + +# +# XBox 360 USB Controller +# + +key 304 BUTTON_A +key 305 BUTTON_B +key 307 BUTTON_X +key 308 BUTTON_Y +key 310 BUTTON_L1 +key 311 BUTTON_R1 +key 314 BUTTON_SELECT +key 315 BUTTON_START +key 316 BUTTON_MODE +key 317 BUTTON_THUMBL +key 318 BUTTON_THUMBR + +# Left and right stick. +# The reported value for flat is 128 out of a range from -32767 to 32768, which is absurd. +# This confuses applications that rely on the flat value because the joystick actually +# settles in a flat range of +/- 4096 or so. +axis 0x00 X flat 4096 +axis 0x01 Y flat 4096 +axis 0x03 Z flat 4096 +axis 0x04 RZ flat 4096 + +# Triggers. +axis 0x02 LTRIGGER +axis 0x05 RTRIGGER + +# Hat. +axis 0x10 HAT_X +axis 0x11 HAT_Y diff --git a/usr/keylayout/Vendor_046d_Product_c216.kl b/usr/keylayout/Vendor_046d_Product_c216.kl new file mode 100644 index 0000000..6743323 --- /dev/null +++ b/usr/keylayout/Vendor_046d_Product_c216.kl @@ -0,0 +1,37 @@ +# Copyright (C) 2011 The Android 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. + +# +# Logitech Dual Action Controller +# + +key 0x120 BUTTON_A +key 0x123 BUTTON_B +key 0x121 BUTTON_X +key 0x122 BUTTON_Y +key 0x124 BUTTON_L1 +key 0x125 BUTTON_R1 +key 0x126 BUTTON_L2 +key 0x127 BUTTON_R2 +key 0x128 BUTTON_SELECT +key 0x129 BUTTON_START +key 0x12a BUTTON_THUMBL +key 0x12b BUTTON_THUMBR + +axis 0x00 X +axis 0x01 Y +axis 0x02 Z +axis 0x05 RZ +axis 0x10 HAT_X +axis 0x11 HAT_Y diff --git a/usr/keylayout/Vendor_046d_Product_c294.kl b/usr/keylayout/Vendor_046d_Product_c294.kl new file mode 100644 index 0000000..5492f49 --- /dev/null +++ b/usr/keylayout/Vendor_046d_Product_c294.kl @@ -0,0 +1,53 @@ +# Copyright (C) 2011 The Android 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. + +# +# Logitech G25 Racing Wheel (in Compatibility Mode) +# + +# 4 way buttons above hat +key 0x121 BUTTON_A +key 0x123 BUTTON_B +key 0x120 BUTTON_X +key 0x122 BUTTON_Y + +# Row of buttons under hat +key 0x12b BUTTON_1 +key 0x128 BUTTON_2 +key 0x129 BUTTON_3 +key 0x12a BUTTON_4 + +# Gear shift positions +# 0x12a top-left gear (aliased as BUTTON_4) +# 0x12b bottom-left gear (aliased as BUTTON_1) + +# Buttons on wheel +key 0x127 BUTTON_L1 +key 0x126 BUTTON_R1 + +# Toggles under wheel +key 0x125 BUTTON_L2 +key 0x124 BUTTON_R2 + +# Hat +axis 0x10 HAT_X +axis 0x11 HAT_Y + +# Steering Wheel +axis 0x00 WHEEL + +# Accelerator / Brake +# 00..7e : accelerator +# 80..ff : brake +axis 0x01 split 0x7f GAS BRAKE diff --git a/usr/keylayout/Vendor_046d_Product_c299.kl b/usr/keylayout/Vendor_046d_Product_c299.kl new file mode 100644 index 0000000..d42963d --- /dev/null +++ b/usr/keylayout/Vendor_046d_Product_c299.kl @@ -0,0 +1,62 @@ +# Copyright (C) 2011 The Android 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. + +# +# Logitech G25 Racing Wheel (in Native Mode) +# + +# 4 way buttons above hat +key 0x121 BUTTON_A +key 0x123 BUTTON_B +key 0x120 BUTTON_X +key 0x122 BUTTON_Y + +# Row of buttons under hat +key 0x12b BUTTON_1 +key 0x128 BUTTON_2 +key 0x129 BUTTON_3 +key 0x12a BUTTON_4 + +# Gear shift positions +key 0x12c BUTTON_5 +key 0x12d BUTTON_6 +key 0x12e BUTTON_7 +key 0x12f BUTTON_8 +key 0x2d0 BUTTON_9 +key 0x2d1 BUTTON_10 +key 0x2d2 BUTTON_11 + +# Buttons on wheel +key 0x127 BUTTON_L1 +key 0x126 BUTTON_R1 + +# Toggles under wheel +key 0x125 BUTTON_L2 +key 0x124 BUTTON_R2 + +# Hat +axis 0x10 HAT_X +axis 0x11 HAT_Y + +# Steering Wheel +axis 0x00 WHEEL + +# Clutch +axis 0x01 invert GENERIC_1 + +# Accelerator +axis 0x02 invert GAS + +# Brake +axis 0x05 invert BRAKE diff --git a/usr/keylayout/Vendor_046d_Product_c532.kl b/usr/keylayout/Vendor_046d_Product_c532.kl new file mode 100644 index 0000000..741c2e1 --- /dev/null +++ b/usr/keylayout/Vendor_046d_Product_c532.kl @@ -0,0 +1,133 @@ +# Copyright (C) 2010 The Android 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. + +# +# Logitech Revue Wireless keyboard +# +# Notes: +# - The GRAVE key is emulated by the keyboard. +# ALT + LEFT_BRACKET produces GRAVE. +# ALT + RIGHT_BRACKET produces SHIFT + GRAVE. +# - FORWARD_DEL is produced by fn + BACKSPACE +# - PAGE_UP / PAGE_DOWN is produced by fn + CHANNEL_UP / CHANNEL_DOWN +# - The AVR / STB / TV power and input buttons seem to be non-functional +# as well as several of the other fn buttons and the PIP button? + +key 1 ESCAPE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 12 MINUS +key 13 EQUALS +key 14 DEL +key 15 TAB +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 28 ENTER +key 29 CTRL_LEFT +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 41 GRAVE +key 42 SHIFT_LEFT +key 43 BACKSLASH +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 54 SHIFT_RIGHT +key 56 ALT_RIGHT +key 57 SPACE +key 58 CAPS_LOCK +key 59 F1 +key 60 F2 +key 61 F3 +key 62 F4 +key 63 F5 +key 64 F6 +key 65 F7 +key 66 F8 +key 67 F9 +key 68 F10 +key 87 F11 +key 88 F12 +key 96 DPAD_CENTER +key 97 CTRL_RIGHT +key 102 MOVE_HOME +key 103 DPAD_UP +key 104 PAGE_UP +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 107 MOVE_END +key 108 DPAD_DOWN +key 109 PAGE_DOWN +key 110 NUMPAD_ENTER +key 111 FORWARD_DEL +key 113 VOLUME_MUTE +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 119 MEDIA_PAUSE +key 125 SEARCH +key 127 MENU +key 156 BOOKMARK +key 158 BACK +key 163 MEDIA_NEXT +key 165 MEDIA_PREVIOUS +key 166 MEDIA_STOP +key 167 MEDIA_RECORD +key 168 MEDIA_REWIND +key 172 HOME +key 207 MEDIA_PLAY +key 208 MEDIA_FAST_FORWARD +# key 288 left mouse button +# key 289 right mouse button (fn + button) +key 362 GUIDE +key 366 DVR +key 377 TV +key 402 CHANNEL_UP +key 403 CHANNEL_DOWN +key 418 ZOOM_IN +key 419 ZOOM_OUT + diff --git a/usr/keylayout/Vendor_04e8_Product_7021.kl b/usr/keylayout/Vendor_04e8_Product_7021.kl new file mode 100644 index 0000000..4eddce0 --- /dev/null +++ b/usr/keylayout/Vendor_04e8_Product_7021.kl @@ -0,0 +1,393 @@ +# Copyright (C) 2010 The Android 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. + +# +# Generic key layout file for full alphabetic US English PC style external keyboards. +# +# This file is intentionally very generic and is intended to support a broad rang of keyboards. +# Do not edit the generic key layout to support a specific keyboard; instead, create +# a new key layout file with the required keyboard configuration. +# + +key 1 BACK +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 12 MINUS +key 13 EQUALS +key 14 DEL +key 15 TAB +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 28 ENTER +key 29 CTRL_LEFT +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 41 GRAVE +key 42 SHIFT_LEFT +key 43 BACKSLASH +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 54 SHIFT_RIGHT +key 55 NUMPAD_MULTIPLY +key 56 ALT_LEFT +key 57 SPACE +key 58 CAPS_LOCK +key 59 F1 +key 60 F2 +key 61 F3 +key 62 F4 +key 63 F5 +key 64 F6 +key 65 F7 +key 66 F8 +key 67 F9 +key 68 F10 +key 69 NUM_LOCK +key 70 SCROLL_LOCK +key 71 NUMPAD_7 +key 72 NUMPAD_8 +key 73 NUMPAD_9 +key 74 NUMPAD_SUBTRACT +key 75 NUMPAD_4 +key 76 NUMPAD_5 +key 77 NUMPAD_6 +key 78 NUMPAD_ADD +key 79 NUMPAD_1 +key 80 NUMPAD_2 +key 81 NUMPAD_3 +key 82 NUMPAD_0 +key 83 NUMPAD_DOT +# key 84 (undefined) +# key 85 "KEY_ZENKAKUHANKAKU" +key 86 BACKSLASH +key 87 F11 +key 88 F12 +# key 89 "KEY_RO" +# key 90 "KEY_KATAKANA" +# key 91 "KEY_HIRAGANA" +# key 92 "KEY_HENKAN" +# key 93 "KEY_KATAKANAHIRAGANA" +# key 94 "KEY_MUHENKAN" +key 95 NUMPAD_COMMA +key 96 NUMPAD_ENTER +key 97 CTRL_RIGHT +key 98 NUMPAD_DIVIDE +key 99 SYSRQ +key 100 ALT_GR +# key 101 "KEY_LINEFEED" +key 102 MOVE_HOME +key 103 DPAD_UP +key 104 PAGE_UP +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 107 MOVE_END +key 108 DPAD_DOWN +key 109 PAGE_DOWN +key 110 INSERT +key 111 FORWARD_DEL +# key 112 "KEY_MACRO" +key 113 MUTE +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 116 POWER WAKE +key 117 NUMPAD_EQUALS +# key 118 "KEY_KPPLUSMINUS" +key 119 BREAK +# key 120 (undefined) +key 121 NUMPAD_COMMA +# key 122 "KEY_HANGEUL" +# key 123 "KEY_HANJA" +# key 124 "KEY_YEN" +key 125 META_LEFT +key 126 META_RIGHT +key 127 MENU WAKE_DROPPED +key 128 MEDIA_STOP +# key 129 "KEY_AGAIN" +# key 130 "KEY_PROPS" +# key 131 "KEY_UNDO" +# key 132 "KEY_FRONT" +# key 133 "KEY_COPY" +# key 134 "KEY_OPEN" +# key 135 "KEY_PASTE" +# key 136 "KEY_FIND" +# key 137 "KEY_CUT" +# key 138 "KEY_HELP" +key 139 MENU WAKE_DROPPED +# key 140 "KEY_CALC" +# key 141 "KEY_SETUP" +# key 142 "KEY_SLEEP" +# key 143 "KEY_WAKEUP" +# key 144 "KEY_FILE" +# key 145 "KEY_SENDFILE" +# key 146 "KEY_DELETEFILE" +# key 147 "KEY_XFER" +# key 148 "KEY_PROG1" +# key 149 "KEY_PROG2" +key 150 EXPLORER +# key 151 "KEY_MSDOS" +# key 152 "KEY_COFFEE" +key 152 POWER WAKE +# key 153 "KEY_DIRECTION" +# key 154 "KEY_CYCLEWINDOWS" +key 155 EMAIL +key 156 BOOKMARK +# key 157 "KEY_COMPUTER" +key 158 BACK WAKE_DROPPED +key 159 FORWARD +key 160 MEDIA_CLOSE +key 161 MEDIA_EJECT +key 162 MEDIA_EJECT +key 163 MEDIA_NEXT +key 164 MEDIA_PLAY_PAUSE +key 165 MEDIA_PREVIOUS +key 166 MEDIA_STOP +key 167 MEDIA_RECORD +key 168 MEDIA_REWIND +key 169 CALL +# key 170 "KEY_ISO" +# key 171 "KEY_CONFIG" +key 172 HOME +# key 173 "KEY_REFRESH" +# key 174 "KEY_EXIT" +# key 175 "KEY_MOVE" +# key 176 "KEY_EDIT" +key 177 PAGE_UP +key 178 PAGE_DOWN +key 179 NUMPAD_LEFT_PAREN +key 180 NUMPAD_RIGHT_PAREN +# key 181 "KEY_NEW" +# key 182 "KEY_REDO" +# key 183 F13 +# key 184 F14 +# key 185 F15 +# key 186 F16 +# key 187 F17 +# key 188 F18 +# key 189 F19 +# key 190 F20 +# key 191 F21 +# key 192 F22 +# key 193 F23 +# key 194 F24 +# key 195 (undefined) +# key 196 (undefined) +# key 197 (undefined) +# key 198 (undefined) +# key 199 (undefined) +key 200 MEDIA_PLAY +key 201 MEDIA_PAUSE +# key 202 "KEY_PROG3" +# key 203 "KEY_PROG4" +# key 204 (undefined) +# key 205 "KEY_SUSPEND" +# key 206 "KEY_CLOSE" +key 207 MEDIA_PLAY +key 208 MEDIA_FAST_FORWARD +# key 209 "KEY_BASSBOOST" +# key 210 "KEY_PRINT" +# key 211 "KEY_HP" +key 212 CAMERA +# key 213 "KEY_SOUND" +# key 214 "KEY_QUESTION" +key 215 ENVELOPE +# key 216 "KEY_CHAT" +key 217 SEARCH +# key 218 "KEY_CONNECT" +# key 219 "KEY_FINANCE" +# key 220 "KEY_SPORT" +# key 221 "KEY_SHOP" +# key 222 "KEY_ALTERASE" +# key 223 "KEY_CANCEL" +key 224 BRIGHTNESS_DOWN +key 225 BRIGHTNESS_UP +key 226 HEADSETHOOK +key 227 STAR +key 228 POUND +key 229 SOFT_LEFT +key 230 SOFT_RIGHT +key 231 CALL +key 232 DPAD_CENTER +key 233 HEADSETHOOK +# key 234 "KEY_0_5" or "KEY_SAVE" +# key 235 "KEY_2_5" or "KEY_DOCUMENTS" +# key 236 "KEY_SWITCHVIDEOMODE" or "KEY_BATTERY" +# key 237 "KEY_KBDILLUMTOGGLE" +# key 238 "KEY_KBDILLUMDOWN" +# key 239 "KEY_KBDILLUMUP" +# key 240 "KEY_UNKNOWN" + + +key 304 BUTTON_A +key 305 BUTTON_B +key 306 BUTTON_C +key 307 BUTTON_X +key 308 BUTTON_Y +key 309 BUTTON_Z +key 310 BUTTON_L1 +key 311 BUTTON_R1 +key 312 BUTTON_L2 +key 313 BUTTON_R2 +key 314 BUTTON_SELECT +key 315 BUTTON_START +key 316 BUTTON_MODE +key 317 BUTTON_THUMBL +key 318 BUTTON_THUMBR + + +# key 352 "KEY_OK" +# key 353 "KEY_SELECT" +# key 354 "KEY_GOTO" +# key 355 "KEY_CLEAR" +# key 356 "KEY_POWER2" +# key 357 "KEY_OPTION" +# key 358 "KEY_INFO" +# key 359 "KEY_TIME" +# key 360 "KEY_VENDOR" +# key 361 "KEY_ARCHIVE" +key 362 GUIDE +# key 363 "KEY_CHANNEL" +# key 364 "KEY_FAVORITES" +# key 365 "KEY_EPG" +key 366 DVR +# key 367 "KEY_MHP" +# key 368 "KEY_LANGUAGE" +key 368 LANG +# key 369 "KEY_TITLE" +# key 370 "KEY_SUBTITLE" +# key 371 "KEY_ANGLE" +# key 372 "KEY_ZOOM" +# key 373 "KEY_MODE" +# key 374 "KEY_KEYBOARD" +# key 375 "KEY_SCREEN" +# key 376 "KEY_PC" +key 377 TV +# key 378 "KEY_TV2" +# key 379 "KEY_VCR" +# key 380 "KEY_VCR2" +# key 381 "KEY_SAT" +# key 382 "KEY_SAT2" +# key 383 "KEY_CD" +# key 384 "KEY_TAPE" +# key 385 "KEY_RADIO" +# key 386 "KEY_TUNER" +# key 387 "KEY_PLAYER" +# key 388 "KEY_TEXT" +# key 389 "KEY_DVD" +# key 390 "KEY_AUX" +# key 391 "KEY_MP3" +# key 392 "KEY_AUDIO" +# key 393 "KEY_VIDEO" +# key 394 "KEY_DIRECTORY" +# key 395 "KEY_LIST" +# key 396 "KEY_MEMO" +# key 397 "KEY_CALENDAR" +# key 398 "KEY_RED" +# key 399 "KEY_GREEN" +# key 400 "KEY_YELLOW" +# key 401 "KEY_BLUE" +key 402 CHANNEL_UP +key 403 CHANNEL_DOWN +# key 404 "KEY_FIRST" +# key 405 "KEY_LAST" +# key 406 "KEY_AB" +# key 407 "KEY_NEXT" +# key 408 "KEY_RESTART" +# key 409 "KEY_SLOW" +# key 410 "KEY_SHUFFLE" +# key 411 "KEY_BREAK" +# key 412 "KEY_PREVIOUS" +# key 413 "KEY_DIGITS" +# key 414 "KEY_TEEN" +# key 415 "KEY_TWEN" + + +# key 448 "KEY_DEL_EOL" +# key 449 "KEY_DEL_EOS" +# key 450 "KEY_INS_LINE" +# key 451 "KEY_DEL_LINE" + + +key 464 FUNCTION +key 465 ESCAPE FUNCTION +key 466 F1 FUNCTION +key 467 F2 FUNCTION +key 468 F3 FUNCTION +key 469 F4 FUNCTION +key 470 F5 FUNCTION +key 471 F6 FUNCTION +key 472 F7 FUNCTION +key 473 F8 FUNCTION +key 474 F9 FUNCTION +key 475 F10 FUNCTION +key 476 F11 FUNCTION +key 477 F12 FUNCTION +key 478 1 FUNCTION +key 479 2 FUNCTION +key 480 D FUNCTION +key 481 E FUNCTION +key 482 F FUNCTION +key 483 S FUNCTION +key 484 B FUNCTION + + +# key 497 KEY_BRL_DOT1 +# key 498 KEY_BRL_DOT2 +# key 499 KEY_BRL_DOT3 +# key 500 KEY_BRL_DOT4 +# key 501 KEY_BRL_DOT5 +# key 502 KEY_BRL_DOT6 +# key 503 KEY_BRL_DOT7 +# key 504 KEY_BRL_DOT8 + + +key 704 RECENTAPPS +key 705 APPLICATION +key 706 SIP_ON_OFF +key 707 VOICESEARCH +key 708 QPANEL_ON_OFF \ No newline at end of file diff --git a/usr/keylayout/Vendor_054c_Product_0268.kl b/usr/keylayout/Vendor_054c_Product_0268.kl new file mode 100644 index 0000000..f8ac6a3 --- /dev/null +++ b/usr/keylayout/Vendor_054c_Product_0268.kl @@ -0,0 +1,76 @@ +# Copyright (C) 2011 The Android 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. + +# +# Sony Playstation(R)3 Controller +# + +key 0x124 DPAD_UP +key 0x125 DPAD_RIGHT +key 0x126 DPAD_DOWN +key 0x127 DPAD_LEFT + +key 0x120 BUTTON_SELECT +key 0x123 BUTTON_START +key 0x12f BUTTON_A +key 0x12c BUTTON_B +key 0x12e BUTTON_X +key 0x12d BUTTON_Y +key 0x12a BUTTON_L1 +key 0x12b BUTTON_R1 +key 0x128 BUTTON_L2 +key 0x129 BUTTON_R2 +key 0x121 BUTTON_THUMBL +key 0x122 BUTTON_THUMBR + +# PS key +key 0x2d0 BUTTON_1 + +# Left Analog Stick +axis 0x00 X +axis 0x01 Y + +# Right Analog Stick +axis 0x02 Z +axis 0x05 RZ + +# DPAD +# axis 0x2c -HAT_Y +# axis 0x2d +HAT_X +# axis 0x2e +HAT_Y +# axis 0x2f -HAT_X + +# L2 trigger +axis 0x30 LTRIGGER + +# R2 trigger +axis 0x31 RTRIGGER + +# L1 trigger +# axis 0x32 + +# R1 trigger +# axis 0x33 + +# Triangle +# axis 0x34 + +# Circle +# axis 0x35 + +# Cross +# axis 0x36 + +# Square +# axis 0x37 diff --git a/usr/keylayout/Vendor_05ac_Product_0239.kl b/usr/keylayout/Vendor_05ac_Product_0239.kl new file mode 100644 index 0000000..6bd3753 --- /dev/null +++ b/usr/keylayout/Vendor_05ac_Product_0239.kl @@ -0,0 +1,119 @@ +# Copyright (C) 2010 The Android 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. + +# +# Apple Wireless Keyboard +# +# Notes: +# - Keys such as PAGE_UP and FORWARD_DEL are produced using the +# function key. +# - Special function keys for brightness control, etc. are not +# implemented here. + +key 1 ESCAPE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 12 MINUS +key 13 EQUALS +key 14 DEL +key 15 TAB +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 28 ENTER +key 29 CTRL_LEFT +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 41 GRAVE +key 42 SHIFT_LEFT +key 43 BACKSLASH +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 54 SHIFT_RIGHT +key 56 ALT_LEFT +key 57 SPACE +key 58 CAPS_LOCK +key 59 F1 +key 60 F2 +key 61 F3 +key 62 F4 +key 63 F5 +key 64 F6 +key 65 F7 +key 66 F8 +key 67 F9 +key 68 F10 +key 87 F11 +key 88 F12 +key 100 ALT_RIGHT +key 102 MOVE_HOME +key 103 DPAD_UP +key 104 PAGE_UP +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 107 MOVE_END +key 108 DPAD_DOWN +key 109 PAGE_DOWN +key 110 NUMPAD_ENTER +key 111 FORWARD_DEL +key 113 VOLUME_MUTE +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 120 APP_SWITCH +key 125 META_LEFT +key 126 META_RIGHT +key 161 MEDIA_EJECT +key 163 MEDIA_NEXT +key 164 MEDIA_PLAY_PAUSE +key 165 MEDIA_PREVIOUS +# key 204 show gadgets +# key 224 reduce brightness +# key 225 increase brightness +# key 229 blank special function on F5 +# key 230 blank special function on F6 +key 464 FUNCTION diff --git a/usr/keylayout/Vendor_22b8_Product_093d.kl b/usr/keylayout/Vendor_22b8_Product_093d.kl new file mode 100644 index 0000000..2749c5b --- /dev/null +++ b/usr/keylayout/Vendor_22b8_Product_093d.kl @@ -0,0 +1,105 @@ +# Copyright (C) 2010 The Android 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. + +# +# Motorola Bluetooth Wireless Keyboard. +# + +key 1 BACK +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 12 MINUS +key 13 EQUALS +key 14 DEL +key 15 TAB +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 28 ENTER +key 29 CTRL_LEFT +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 41 GRAVE +key 42 SHIFT_LEFT +key 43 BACKSLASH +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 54 SHIFT_RIGHT +key 56 ALT_LEFT +key 57 SPACE +key 58 CAPS_LOCK +key 59 F1 +key 60 F2 +key 61 F3 +key 62 F4 +key 63 F5 +key 64 F6 +key 65 F7 +key 66 F8 +key 67 F9 +key 68 F10 +key 87 F11 +key 88 F12 +key 97 CTRL_RIGHT +key 102 HOME +key 103 DPAD_UP +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 107 MOVE_END +key 108 DPAD_DOWN +key 111 FORWARD_DEL +key 113 VOLUME_MUTE +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 125 MENU +key 127 SEARCH +key 163 MEDIA_NEXT +key 164 MEDIA_PLAY_PAUSE +key 165 MEDIA_PREVIOUS +key 166 MEDIA_STOP +# key 226 tbd reserved key diff --git a/usr/keylayout/gpio-keys.kl b/usr/keylayout/gpio-keys.kl new file mode 100644 index 0000000..b7abd0b --- /dev/null +++ b/usr/keylayout/gpio-keys.kl @@ -0,0 +1,11 @@ +key 115 VOLUME_UP WAKE +key 114 VOLUME_DOWN WAKE +key 102 HOME WAKE +key 107 ENDCALL +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 103 DPAD_UP +key 108 DPAD_DOWN +key 232 DPAD_CENTER +key 116 POWER WAKE +key 212 CAMERA WAKE diff --git a/usr/keylayout/max8997-muic.kl b/usr/keylayout/max8997-muic.kl new file mode 100644 index 0000000..3357004 --- /dev/null +++ b/usr/keylayout/max8997-muic.kl @@ -0,0 +1,6 @@ +key 115 VOLUME_UP WAKE +key 114 VOLUME_DOWN WAKE +key 164 MEDIA_PLAY_PAUSE WAKE +key 163 MEDIA_NEXT WAKE +key 165 MEDIA_PREVIOUS WAKE +key 226 HEADSETHOOK WAKE diff --git a/usr/keylayout/melfas-touchkey.kl b/usr/keylayout/melfas-touchkey.kl new file mode 100644 index 0000000..aeb9f12 --- /dev/null +++ b/usr/keylayout/melfas-touchkey.kl @@ -0,0 +1,3 @@ +key 158 BACK WAKE +key 139 MENU WAKE + diff --git a/usr/keylayout/qwerty.kl b/usr/keylayout/qwerty.kl new file mode 100644 index 0000000..f1caacd --- /dev/null +++ b/usr/keylayout/qwerty.kl @@ -0,0 +1,112 @@ +# Copyright (C) 2010 The Android 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. + +# +# Emulator keyboard layout #1. +# +# This file is no longer used as the platform's default keyboard layout. +# Refer to Generic.kl instead. +# + +key 399 GRAVE +key 2 1 +key 3 2 +key 4 3 +key 5 4 +key 6 5 +key 7 6 +key 8 7 +key 9 8 +key 10 9 +key 11 0 +key 158 BACK WAKE_DROPPED +key 230 SOFT_RIGHT WAKE +key 60 SOFT_RIGHT WAKE +key 107 ENDCALL WAKE_DROPPED +key 62 ENDCALL WAKE_DROPPED +key 229 MENU WAKE_DROPPED +key 139 MENU WAKE_DROPPED +key 59 MENU WAKE_DROPPED +key 127 SEARCH WAKE_DROPPED +key 217 SEARCH WAKE_DROPPED +key 228 POUND +key 227 STAR +key 231 CALL WAKE_DROPPED +key 61 CALL WAKE_DROPPED +key 232 DPAD_CENTER WAKE_DROPPED +key 108 DPAD_DOWN WAKE_DROPPED +key 103 DPAD_UP WAKE_DROPPED +key 102 HOME WAKE +key 105 DPAD_LEFT WAKE_DROPPED +key 106 DPAD_RIGHT WAKE_DROPPED +key 115 VOLUME_UP WAKE +key 114 VOLUME_DOWN WAKE +key 116 POWER WAKE +key 212 CAMERA + +key 16 Q +key 17 W +key 18 E +key 19 R +key 20 T +key 21 Y +key 22 U +key 23 I +key 24 O +key 25 P +key 26 LEFT_BRACKET +key 27 RIGHT_BRACKET +key 43 BACKSLASH + +key 30 A +key 31 S +key 32 D +key 33 F +key 34 G +key 35 H +key 36 J +key 37 K +key 38 L +key 39 SEMICOLON +key 40 APOSTROPHE +key 14 DEL + +key 44 Z +key 45 X +key 46 C +key 47 V +key 48 B +key 49 N +key 50 M +key 51 COMMA +key 52 PERIOD +key 53 SLASH +key 28 ENTER + +key 56 ALT_LEFT +key 100 ALT_RIGHT +key 42 SHIFT_LEFT +key 54 SHIFT_RIGHT +key 15 TAB +key 57 SPACE +key 150 EXPLORER +key 155 ENVELOPE + +key 12 MINUS +key 13 EQUALS +key 215 AT + +# On an AT keyboard: ESC, F10 +key 1 BACK WAKE_DROPPED +key 68 MENU WAKE_DROPPED diff --git a/usr/keylayout/samsung-keypad.kl b/usr/keylayout/samsung-keypad.kl new file mode 100644 index 0000000..36fad0e --- /dev/null +++ b/usr/keylayout/samsung-keypad.kl @@ -0,0 +1,10 @@ +key 2 DPAD_UP WAKE_DROPPED +key 3 DPAD_CENTER WAKE_DROPPED +key 4 DPAD_DOWN WAKE_DROPPED +key 5 DPAD_RIGHT WAKE_DROPPED +key 6 DPAD_LEFT WAKE_DROPPED +key 18 VOLUME_DOWN WAKE +key 30 SEARCH WAKE_DROPPED +key 32 MENU WAKE_DROPPED +key 46 VOLUME_UP WAKE +key 48 BACK WAKE_DROPPED diff --git a/usr/keylayout/sec_key.kl b/usr/keylayout/sec_key.kl new file mode 100644 index 0000000..b7abd0b --- /dev/null +++ b/usr/keylayout/sec_key.kl @@ -0,0 +1,11 @@ +key 115 VOLUME_UP WAKE +key 114 VOLUME_DOWN WAKE +key 102 HOME WAKE +key 107 ENDCALL +key 105 DPAD_LEFT +key 106 DPAD_RIGHT +key 103 DPAD_UP +key 108 DPAD_DOWN +key 232 DPAD_CENTER +key 116 POWER WAKE +key 212 CAMERA WAKE diff --git a/usr/keylayout/sec_touchkey.kl b/usr/keylayout/sec_touchkey.kl new file mode 100644 index 0000000..aeb9f12 --- /dev/null +++ b/usr/keylayout/sec_touchkey.kl @@ -0,0 +1,3 @@ +key 158 BACK WAKE +key 139 MENU WAKE + diff --git a/usr/keylayout/sii9234_rcp.kl b/usr/keylayout/sii9234_rcp.kl new file mode 100644 index 0000000..ae6c6a2 --- /dev/null +++ b/usr/keylayout/sii9234_rcp.kl @@ -0,0 +1,28 @@ +key 1 ENTER WAKE_DROPPED +key 2 DPAD_UP WAKE_DROPPED +key 3 DPAD_DOWN WAKE_DROPPED +key 4 DPAD_LEFT WAKE_DROPPED +key 5 DPAD_RIGHT WAKE_DROPPED +key 10 MENU WAKE_DROPPED +key 14 BACK WAKE_DROPPED + +key 33 0 +key 34 1 +key 35 2 +key 36 3 +key 37 4 +key 38 5 +key 39 6 +key 40 7 +key 41 8 +key 42 9 + +key 45 DEL + +key 69 MEDIA_PLAY_PAUSE WAKE +key 70 MEDIA_STOP WAKE +key 71 MEDIA_PLAY_PAUSE WAKE +key 73 MEDIA_REWIND WAKE +key 74 MEDIA_FAST_FORWARD WAKE +key 76 MEDIA_NEXT WAKE +key 77 MEDIA_PREVIOUS WAKE diff --git a/vibrator/tspdrv.c b/vibrator/tspdrv.c deleted file mode 100755 index 0928240..0000000 --- a/vibrator/tspdrv.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2011 CyanogenMod Project - * Copyright (C) 2011 Daniel Hillenbrand - * - * 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. - */ - -#include -#include -#include -#include - -#define LOG_NDEBUG 0 -#define LOG_TAG "tspdrv" -#include - -#include "tspdrv.h" - -int vibrator_exists() -{ - int fd; - -#ifdef QEMU_HARDWARE - if (qemu_check()) { - return 1; - } -#endif - - fd = open(THE_DEVICE, O_RDWR); - if(fd < 0) - return 0; - close(fd); - return 1; -} - -int sendit(int timeout_ms) -{ - int nwr, ret, fd, tspd, tspret, actuators; - char value[20]; - - tspd = open(TSPDRV_DEVICE, O_RDWR); - if(tspd < 0) { - LOGE("failed on opening /dev/tspdrv\n"); - } else { - LOGV("opened device /dev/tspdrv\n"); - } - - /* send tspdrv magic number */ - tspret = ioctl(tspd, TSPDRV_MAGIC_NUMBER); - if(tspret != 0) { - LOGE("TSPDRV_MAGIC_NUMBER error\n"); - } else { - LOGV("TSPDRV_MAGIC_NUMBER success\n"); - } - - /* get number of actuators */ - actuators = ioctl(tspd, TSPDRV_GET_NUM_ACTUATORS); - if(actuators < 1) { - LOGE("TSPDRV_GET_NUM_ACTUATORS error, no actuators available\n"); - } else { - LOGV("TSPDRV_GET_NUM_ACTUATORS success, actuators = %d\n", actuators); - - if(timeout_ms > 0) { - /* enable tspdrv amp */ - tspret = ioctl(tspd, TSPDRV_ENABLE_AMP, actuators); - if(tspret != 0) { - LOGE("TSPDRV_ENABLE_AMP error\n"); - } else { - LOGV("TSPDRV_ENABLE_AMP success\n"); - } - } - } - - fd = open(THE_DEVICE, O_RDWR); - if(fd < 0) - return errno; - - LOGV("timeout_ms: %d\n", timeout_ms); - nwr = sprintf(value, "%d\n", timeout_ms); - ret = write(fd, value, nwr); - - if(timeout_ms == 0) { - /* stop tspdrv kernel timer */ - tspret = ioctl(tspd, TSPDRV_STOP_KERNEL_TIMER); - if(tspret != 0) { - LOGE("TSPDRV_STOP_KERNEL_TIMER error\n"); - } else { - LOGV("TSPDRV_STOP_KERNEL_TIMER success\n"); - } - - /* disable tspdrv amp */ - if(actuators >= 1) { - tspret = ioctl(tspd, TSPDRV_DISABLE_AMP, actuators); - if(tspret != 0) { - LOGE("TSPDRV_DISABLE_AMP error\n"); - } else { - LOGV("TSPDRV_DISABLE_AMP success\n"); - } - } - } - - close(tspd); - close(fd); - - return (ret == nwr) ? 0 : -1; -} diff --git a/vibrator/tspdrv.h b/vibrator/tspdrv.h deleted file mode 100755 index d9bfa79..0000000 --- a/vibrator/tspdrv.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2011 CyanogenMod Project - * Copyright (C) 2011 Daniel Hillenbrand - * - * 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. - */ - -#ifndef __TSPDRV_H -#define __TSPDRV_H __FILE__ - -#define THE_DEVICE "/sys/class/timed_output/vibrator/enable" -#define TSPDRV_DEVICE "/dev/tspdrv" - -#define TSPDRV_MAGIC_NUMBER 0x494D4D52 -#define TSPDRV_STOP_KERNEL_TIMER _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 1) -#define TSPDRV_ENABLE_AMP _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 3) -#define TSPDRV_DISABLE_AMP _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 4) -#define TSPDRV_GET_NUM_ACTUATORS _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 5) - -#endif /* __TSPDRV_H */ diff --git a/zImage b/zImage new file mode 100755 index 0000000..c653ca7 Binary files /dev/null and b/zImage differ -- cgit v1.1