diff --git a/BoardConfig.mk b/BoardConfig.mk index 421ae95..11a9b39 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -35,23 +35,19 @@ BOARD_WPA_SUPPLICANT_DRIVER := CUSTOM BOARD_WPA_SUPPLICANT_PRIVATE_LIB := libWifiApi BOARD_WLAN_DEVICE := wl1251 BOARD_WLAN_TI_STA_DK_ROOT := system/wlan/ti/sta_dk_4_0_4_32 -WIFI_DRIVER_MODULE_PATH := /system/lib/modules/wlan.ko +WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/wlan.ko" WIFI_DRIVER_MODULE_ARG := "" -WIFI_DRIVER_MODULE_NAME := wlan -WIFI_FIRMWARE_LOADER := wlan_loader +WIFI_DRIVER_MODULE_NAME := "wlan" +WIFI_FIRMWARE_LOADER := "wlan_loader" TARGET_PROVIDES_INIT_RC := false -BOARD_KERNEL_CMDLINE := no_console_suspend=1 console=null +BOARD_KERNEL_CMDLINE := no_console_suspend=1 BOARD_KERNEL_BASE := 0x02E00000 +BOARD_KERNEL_PAGESIZE := 2048 BOARD_USES_GENERIC_AUDIO := false -# Use HTC USB Function Switch to enable tethering via USB -# BOARD_USE_HTC_USB_FUNCTION_SWITCH := true - -BOARD_USE_USB_MASS_STORAGE_SWITCH := true - BOARD_HAVE_BLUETOOTH := true BOARD_AVOID_DRAW_TEXTURE_EXTENSION := true @@ -77,11 +73,11 @@ BOARD_GLOBAL_CFLAGS += -DHAVE_FM_RADIO BOARD_USES_QCOM_HARDWARE := true BOARD_USES_QCOM_GPS := true BOARD_USES_QCOM_LIBS := true - BOARD_USES_GPSSHIM := true - BOARD_GPS_LIBRARIES := libgps librpc +BOARD_USE_NEW_LIBRIL_HTC := true + TARGET_LIBAGL_USE_GRALLOC_COPYBITS := true BOARD_NO_RGBX_8888 := true @@ -109,4 +105,4 @@ BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0a520000 BOARD_FLASH_BLOCK_SIZE := 131072 # Add LUNFILE configuration to the system -BOARD_UMS_LUNFILE := "/sys/devices/platform/usb_mass_storage/lun0/file" +# BOARD_UMS_LUNFILE := "/sys/devices/platform/usb_mass_storage/lun0/file" diff --git a/KernelModules.mk b/KernelModules.mk index 612a8c7..2fe444f 100644 --- a/KernelModules.mk +++ b/KernelModules.mk @@ -1,29 +1,3 @@ # Kernel Modules TO BE COPIED PRODUCT_COPY_FILES += \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.alias.bin:system/lib/modules/2.6.29.6-Kalim/modules.alias.bin \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.symbols.bin:system/lib/modules/2.6.29.6-Kalim/modules.symbols.bin \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.dep.bin:system/lib/modules/2.6.29.6-Kalim/modules.dep.bin \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko:system/lib/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko:system/lib/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko:system/lib/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ccwmap:system/lib/modules/2.6.29.6-Kalim/modules.ccwmap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.seriomap:system/lib/modules/2.6.29.6-Kalim/modules.seriomap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.pcimap:system/lib/modules/2.6.29.6-Kalim/modules.pcimap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ofmap:system/lib/modules/2.6.29.6-Kalim/modules.ofmap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.isapnpmap:system/lib/modules/2.6.29.6-Kalim/modules.isapnpmap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.dep:system/lib/modules/2.6.29.6-Kalim/modules.dep \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.inputmap:system/lib/modules/2.6.29.6-Kalim/modules.inputmap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.softdep:system/lib/modules/2.6.29.6-Kalim/modules.softdep \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.ieee1394map:system/lib/modules/2.6.29.6-Kalim/modules.ieee1394map \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.alias:system/lib/modules/2.6.29.6-Kalim/modules.alias \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.symbols:system/lib/modules/2.6.29.6-Kalim/modules.symbols \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.usbmap:system/lib/modules/2.6.29.6-Kalim/modules.usbmap \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.devname:system/lib/modules/2.6.29.6-Kalim/modules.devname \ - device/htc/click/custom/modules/2.6.29.6-Kalim/modules.order:system/lib/modules/2.6.29.6-Kalim/modules.order \ device/htc/click/custom/modules/wlan.ko:system/lib/modules/wlan.ko diff --git a/click.mk b/click.mk index 65a5200..f282a4c 100644 --- a/click.mk +++ b/click.mk @@ -30,10 +30,8 @@ PRODUCT_PACKAGES += \ libOmxCore \ libmm-omxcore \ libOmxVidEnc \ - libcamera \ librpc \ dhcpcd.conf \ - rzscontrol \ com.android.future.usb.accessory \ dexpreopt @@ -79,7 +77,6 @@ PRODUCT_COPY_FILES += \ device/htc/click/custom/keychars/bahamas-keypad.kcm.bin:system/usr/keychars/bahamas-keypad.kcm.bin \ device/htc/click/custom/keychars/qwerty.kcm.bin:system/usr/keychars/qwerty.kcm.bin \ device/htc/click/custom/keychars/qwerty2.kcm.bin:system/usr/keychars/qwerty2.kcm.bin \ - device/htc/click/custom/keylayout/AVRCP.kl:system/usr/keylayout/AVRCP.kl \ device/htc/click/custom/keylayout/bahamas-keypad.kl:system/usr/keylayout/bahamas-keypad.kl \ device/htc/click/custom/keylayout/h2w_headset.kl:system/usr/keylayout/h2w_headset.kl \ device/htc/click/custom/keylayout/qwerty.kl:system/usr/keylayout/qwerty.kl @@ -90,7 +87,8 @@ PRODUCT_COPY_FILES += \ # precompiled files for /system/bin PRODUCT_COPY_FILES += \ - device/htc/click/custom/calibrate_screen:system/bin/calibrate_screen + device/htc/click/custom/calibrate_screen:system/bin/calibrate_screen \ + device/htc/click/custom/klogtail:system/xbin/klogtail # media configuration xml file PRODUCT_COPY_FILES += \ diff --git a/custom/kernel b/custom/kernel old mode 100644 new mode 100755 index 0b142e8..c7ec75f Binary files a/custom/kernel and b/custom/kernel differ diff --git a/custom/keylayout/AVRCP.kl b/custom/keylayout/AVRCP.kl deleted file mode 100644 index d0eba10..0000000 --- a/custom/keylayout/AVRCP.kl +++ /dev/null @@ -1,6 +0,0 @@ -key 164 MEDIA_PLAY_PAUSE WAKE -key 128 MEDIA_STOP WAKE -key 163 MEDIA_NEXT WAKE -key 165 MEDIA_PREVIOUS WAKE -key 168 MEDIA_REWIND WAKE -key 159 MEDIA_FAST_FORWARD WAKE diff --git a/custom/klogtail b/custom/klogtail new file mode 100644 index 0000000..d0d0ee3 Binary files /dev/null and b/custom/klogtail differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko b/custom/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko deleted file mode 100644 index 3662774..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/drivers/hid/hid-dummy.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko b/custom/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko deleted file mode 100644 index e12ff03..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/drivers/net/wireless/tiwlan1251/wlan.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko b/custom/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko deleted file mode 100644 index d371d20..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/drivers/staging/ramzswap/ramzswap.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko b/custom/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko deleted file mode 100644 index 6317c32..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/fs/aufs/aufs.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko b/custom/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko deleted file mode 100644 index f42687e..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/fs/cifs/cifs.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko b/custom/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko deleted file mode 100644 index 5094032..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/fs/ext4/ext4.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko b/custom/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko deleted file mode 100644 index a29b3a1..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/fs/jbd2/jbd2.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko b/custom/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko deleted file mode 100644 index 66c4a32..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/fs/nls/nls_utf8.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko b/custom/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko deleted file mode 100644 index 9def1e7..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/kernel/net/netfilter/xt_TCPMSS.ko and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/modules.alias b/custom/modules/2.6.29.6-Kalim/modules.alias deleted file mode 100644 index 35dccc1..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.alias +++ /dev/null @@ -1,4 +0,0 @@ -# Aliases extracted from modules themselves. -alias sdio:c07v*d* wlan -alias ip6t_TCPMSS xt_TCPMSS -alias ipt_TCPMSS xt_TCPMSS diff --git a/custom/modules/2.6.29.6-Kalim/modules.alias.bin b/custom/modules/2.6.29.6-Kalim/modules.alias.bin deleted file mode 100644 index f4b4fde..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/modules.alias.bin and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/modules.ccwmap b/custom/modules/2.6.29.6-Kalim/modules.ccwmap deleted file mode 100644 index 7dac036..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.ccwmap +++ /dev/null @@ -1 +0,0 @@ -# ccw module match_flags cu_type cu_model dev_type dev_model diff --git a/custom/modules/2.6.29.6-Kalim/modules.dep b/custom/modules/2.6.29.6-Kalim/modules.dep deleted file mode 100644 index 4ed758f..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.dep +++ /dev/null @@ -1,9 +0,0 @@ -kernel/fs/nls/nls_utf8.ko: -kernel/fs/ext4/ext4.ko: kernel/fs/jbd2/jbd2.ko -kernel/fs/jbd2/jbd2.ko: -kernel/fs/cifs/cifs.ko: -kernel/fs/aufs/aufs.ko: -kernel/drivers/net/wireless/tiwlan1251/wlan.ko: -kernel/drivers/hid/hid-dummy.ko: -kernel/drivers/staging/ramzswap/ramzswap.ko: -kernel/net/netfilter/xt_TCPMSS.ko: diff --git a/custom/modules/2.6.29.6-Kalim/modules.dep.bin b/custom/modules/2.6.29.6-Kalim/modules.dep.bin deleted file mode 100644 index 776a123..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/modules.dep.bin and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/modules.devname b/custom/modules/2.6.29.6-Kalim/modules.devname deleted file mode 100644 index 58f6d6d..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.devname +++ /dev/null @@ -1 +0,0 @@ -# Device nodes to trigger on-demand module loading. diff --git a/custom/modules/2.6.29.6-Kalim/modules.ieee1394map b/custom/modules/2.6.29.6-Kalim/modules.ieee1394map deleted file mode 100644 index d111b94..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.ieee1394map +++ /dev/null @@ -1 +0,0 @@ -# ieee1394 module match_flags vendor_id model_id specifier_id version diff --git a/custom/modules/2.6.29.6-Kalim/modules.inputmap b/custom/modules/2.6.29.6-Kalim/modules.inputmap deleted file mode 100644 index 5a9ead2..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.inputmap +++ /dev/null @@ -1 +0,0 @@ -# module matchBits bustype vendor product version evBits keyBits relBits absBits mscBits ledBits sndBits ffBits [swBits] driver_info diff --git a/custom/modules/2.6.29.6-Kalim/modules.isapnpmap b/custom/modules/2.6.29.6-Kalim/modules.isapnpmap deleted file mode 100644 index c0d397e..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.isapnpmap +++ /dev/null @@ -1 +0,0 @@ -# isapnp module cardvendor carddevice driver_data vendor function ... diff --git a/custom/modules/2.6.29.6-Kalim/modules.ofmap b/custom/modules/2.6.29.6-Kalim/modules.ofmap deleted file mode 100644 index 1f389ca..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.ofmap +++ /dev/null @@ -1 +0,0 @@ -# of module name type compatible diff --git a/custom/modules/2.6.29.6-Kalim/modules.order b/custom/modules/2.6.29.6-Kalim/modules.order deleted file mode 100644 index d895871..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.order +++ /dev/null @@ -1,9 +0,0 @@ -kernel/fs/nls/nls_utf8.ko -kernel/fs/ext4/ext4.ko -kernel/fs/jbd2/jbd2.ko -kernel/fs/cifs/cifs.ko -kernel/fs/aufs/aufs.ko -kernel/drivers/net/wireless/tiwlan1251/wlan.ko -kernel/drivers/hid/hid-dummy.ko -kernel/drivers/staging/ramzswap/ramzswap.ko -kernel/net/netfilter/xt_TCPMSS.ko diff --git a/custom/modules/2.6.29.6-Kalim/modules.pcimap b/custom/modules/2.6.29.6-Kalim/modules.pcimap deleted file mode 100644 index 3fd01ca..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.pcimap +++ /dev/null @@ -1 +0,0 @@ -# pci module vendor device subvendor subdevice class class_mask driver_data diff --git a/custom/modules/2.6.29.6-Kalim/modules.seriomap b/custom/modules/2.6.29.6-Kalim/modules.seriomap deleted file mode 100644 index 407dc20..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.seriomap +++ /dev/null @@ -1 +0,0 @@ -# serio module type extra id proto diff --git a/custom/modules/2.6.29.6-Kalim/modules.softdep b/custom/modules/2.6.29.6-Kalim/modules.softdep deleted file mode 100644 index 3cc0512..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.softdep +++ /dev/null @@ -1,2 +0,0 @@ -# Soft dependencies extracted from modules themselves. -# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe. diff --git a/custom/modules/2.6.29.6-Kalim/modules.symbols b/custom/modules/2.6.29.6-Kalim/modules.symbols deleted file mode 100644 index af5dfd3..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.symbols +++ /dev/null @@ -1,41 +0,0 @@ -# Aliases for symbols, used by symbol_request(). -alias symbol:jbd2_journal_try_to_free_buffers jbd2 -alias symbol:jbd2_journal_start_commit jbd2 -alias symbol:jbd2_journal_load jbd2 -alias symbol:jbd2_journal_flush jbd2 -alias symbol:jbd2_journal_init_dev jbd2 -alias symbol:jbd2_journal_update_format jbd2 -alias symbol:jbd2_journal_blocks_per_page jbd2 -alias symbol:jbd2_journal_restart jbd2 -alias symbol:jbd2_journal_destroy jbd2 -alias symbol:jbd2_journal_get_undo_access jbd2 -alias symbol:jbd2_journal_init_jbd_inode jbd2 -alias symbol:jbd2_journal_abort jbd2 -alias symbol:jbd2_journal_unlock_updates jbd2 -alias symbol:jbd2_journal_wipe jbd2 -alias symbol:jbd2_journal_set_features jbd2 -alias symbol:jbd2_journal_lock_updates jbd2 -alias symbol:jbd2_journal_clear_features jbd2 -alias symbol:jbd2_journal_get_create_access jbd2 -alias symbol:jbd2_journal_init_inode jbd2 -alias symbol:jbd2_journal_release_buffer jbd2 -alias symbol:jbd2_journal_forget jbd2 -alias symbol:jbd2_journal_start jbd2 -alias symbol:jbd2_journal_force_commit_nested jbd2 -alias symbol:jbd2_journal_check_used_features jbd2 -alias symbol:jbd2_journal_set_triggers jbd2 -alias symbol:jbd2_journal_check_available_features jbd2 -alias symbol:jbd2_journal_stop jbd2 -alias symbol:jbd2_journal_extend jbd2 -alias symbol:jbd2_journal_ack_err jbd2 -alias symbol:jbd2_journal_begin_ordered_truncate jbd2 -alias symbol:jbd2_journal_file_inode jbd2 -alias symbol:jbd2_journal_errno jbd2 -alias symbol:jbd2_log_wait_commit jbd2 -alias symbol:jbd2_journal_clear_err jbd2 -alias symbol:jbd2_journal_release_jbd_inode jbd2 -alias symbol:jbd2_journal_revoke jbd2 -alias symbol:jbd2_journal_get_write_access jbd2 -alias symbol:jbd2_journal_invalidatepage jbd2 -alias symbol:jbd2_journal_dirty_metadata jbd2 -alias symbol:jbd2_journal_force_commit jbd2 diff --git a/custom/modules/2.6.29.6-Kalim/modules.symbols.bin b/custom/modules/2.6.29.6-Kalim/modules.symbols.bin deleted file mode 100644 index c60e73f..0000000 Binary files a/custom/modules/2.6.29.6-Kalim/modules.symbols.bin and /dev/null differ diff --git a/custom/modules/2.6.29.6-Kalim/modules.usbmap b/custom/modules/2.6.29.6-Kalim/modules.usbmap deleted file mode 100644 index 50eb1c8..0000000 --- a/custom/modules/2.6.29.6-Kalim/modules.usbmap +++ /dev/null @@ -1 +0,0 @@ -# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info diff --git a/custom/modules/wlan.ko b/custom/modules/wlan.ko index e12ff03..b827a4f 100644 Binary files a/custom/modules/wlan.ko and b/custom/modules/wlan.ko differ diff --git a/custom/sysctl.conf b/custom/sysctl.conf index 5f85e2d..630b456 100644 --- a/custom/sysctl.conf +++ b/custom/sysctl.conf @@ -1,8 +1,16 @@ -# Scheduler-Tuning +# Tweak kernel scheduler kernel.sched_latency_ns = 600000 kernel.sched_min_granularity_ns = 400000 +kernel.sched_wakeup_granularity_ns = 400000 + +# Tweak kernel VM management vm.dirty_ratio = 90 -vm.dirty_background_ratio = 70 -vm.vfs_cache_pressure = 5 +vm.dirty_background_ratio = 5 +vm.vfs_cache_pressure = 10 vm.oom_kill_allocating_task = 1 -vm.min_free_kbytes = 4096 \ No newline at end of file +vm.min_free_kbytes = 4096 +vm.swappiness = 50 + +# Misc tweaks for battery life +vm.dirty_writeback_centisecs = 1000 +vm.dirty_expire_centisecs = 500 diff --git a/init.bahamas.rc b/init.bahamas.rc index 300b9c9..26a860c 100644 --- a/init.bahamas.rc +++ b/init.bahamas.rc @@ -20,6 +20,9 @@ on boot mkdir /data/misc/dhcp 0770 dhcp dhcp chown dhcp dhcp /data/misc/dhcp + chown radio system /sys/module/gpio_event/parameters/phone_call_status + chmod 0664 /sys/module/gpio_event/parameters/phone_call_status + # write screen calibration write /sys/class/input/input1/calibration_points 837,864,166,859,507,503,844,142,167,142 @@ -27,7 +30,8 @@ on boot chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state chmod 0660 /sys/class/rfkill/rfkill0/state - chown system system /dev/ttyHSUSB0 + chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs_ti.0/serial_lock_cpu + chmod 0660 /sys/devices/platform/msm_serial_hs_ti.0/serial_lock_cpu # Permissions for Liblights. chown system system /sys/class/leds/green/brightness @@ -41,9 +45,6 @@ on boot mkdir /cache/tmp 0666 system system mount tmpfs tmpfs /cache/tmp - # Revise su permisions to ensure all users can use it - chmod 06755 /system/xbin/su - # revise fb0 permission for copybit chmod 0666 /dev/graphics/fb0 @@ -54,11 +55,6 @@ on boot # Set idle_sleep_mode permissions to radio chown radio radio /sys/module/pm/parameters/idle_sleep_mode - # for disabling IPv6 over mobile network. - write /proc/sys/net/ipv6/conf/rmnet0/disable_ipv6 1 - write /proc/sys/net/ipv6/conf/rmnet1/disable_ipv6 1 - write /proc/sys/net/ipv6/conf/rmnet2/disable_ipv6 1 - # performance tweaks for flash write /sys/block/mtdblock3/bdi/read_ahead_kb 4 write /sys/block/mtdblock4/bdi/read_ahead_kb 4 @@ -75,7 +71,7 @@ on boot chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor # compass/accelerometer daemon -service akm8973 /system/bin/akm8973 +service akmd /system/bin/akmd user compass group compass misc input diff --git a/libcamera/Android.mk b/libcamera/Android.mk index e5771d3..fe3d95b 100644 --- a/libcamera/Android.mk +++ b/libcamera/Android.mk @@ -15,7 +15,7 @@ LOCAL_MODULE_TAGS:=optional LOCAL_SRC_FILES:= QualcommCameraHardware.cpp exifwriter.c jdatadst.cpp jpegConvert.cpp -LOCAL_CFLAGS:= -DDLOPEN_LIBMMCAMERA=$(DLOPEN_LIBMMCAMERA) -O2 +LOCAL_CFLAGS:= -DDLOPEN_LIBMMCAMERA=$(DLOPEN_LIBMMCAMERA) LOCAL_C_INCLUDES+= \ vendor/qcom/proprietary/mm-camera/common \ diff --git a/libcamera/QualcommCameraHardware.cpp b/libcamera/QualcommCameraHardware.cpp index 6198158..f6def53 100644 --- a/libcamera/QualcommCameraHardware.cpp +++ b/libcamera/QualcommCameraHardware.cpp @@ -14,7 +14,7 @@ ** limitations under the License. */ // NOTE: Version number of the lib -#define REVISION_C "CM.7.1.0.14." +#define REVISION_C "CM.7.1.0.15." // #define LOG_NDEBUG 0 #define LOG_TAG "QualcommCameraHardware" @@ -229,7 +229,7 @@ static Mutex singleton_lock; static bool singleton_releasing; static Condition singleton_wait; -static void receive_camframe_callback(struct msm_frame_t *frame); +static void receive_camframe_callback(struct msm_frame *frame); static int camerafd; static int fd_frame; @@ -237,7 +237,7 @@ static int32_t mMaxZoom = -1; static int32_t prevzoom = 0; static int ZOOM_STEP; static bool zoomSupported = false; -struct msm_frame_t *frameA; +struct msm_frame *frameA; bool bFramePresent; pthread_t w_thread; pthread_t jpegThread; @@ -291,7 +291,7 @@ static bool native_get_maxzoom(int camfd, void *pZm) { LOGV("native_get_maxzoom E"); - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; int32_t *pZoom = (int32_t *)pZm; ctrlCmd.type = CAMERA_GET_PARM_MAXZOOM; @@ -489,13 +489,13 @@ status_t QualcommCameraHardware::dump(int fd, bool QualcommCameraHardware::reg_unreg_buf(int camfd, int width, int height, - msm_frame_t *frame, - msm_pmem_t pmem_type, + msm_frame *frame, + msm_pmem pmem_type, unsigned char unregister, unsigned char active) { uint32_t y_size; - struct msm_pmem_info_t pmemBuf; + struct msm_pmem_info pmemBuf; uint32_t ioctl_cmd; int ioctlRetVal; @@ -524,7 +524,7 @@ bool QualcommCameraHardware::reg_unreg_buf(int camfd, void QualcommCameraHardware::native_register_preview_bufs( int camfd, void *pDim, - struct msm_frame_t *frame, + struct msm_frame *frame, unsigned char active) { cam_ctrl_dimension_t *dimension = (cam_ctrl_dimension_t *)pDim; @@ -541,7 +541,7 @@ void QualcommCameraHardware::native_register_preview_bufs( void QualcommCameraHardware::native_unregister_preview_bufs( int camfd, void *pDim, - struct msm_frame_t *frame) + struct msm_frame *frame) { cam_ctrl_dimension_t *dimension = (cam_ctrl_dimension_t *)pDim; @@ -568,7 +568,7 @@ static bool native_cancel_afmode(int camfd, int af_fd) static bool native_start_preview(int camfd) { - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.type = CAMERA_START_PREVIEW; @@ -588,7 +588,7 @@ static bool native_start_preview(int camfd) static bool native_get_picture(int camfd, common_crop_t *crop) { LOGV("native_get_picture E"); - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.length = sizeof(common_crop_t); @@ -621,7 +621,7 @@ static bool native_get_picture(int camfd, common_crop_t *crop) static bool native_stop_preview(int camfd) { - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.type = CAMERA_STOP_PREVIEW; ctrlCmd.length = 0; @@ -638,7 +638,7 @@ static bool native_stop_preview(int camfd) static bool native_start_snapshot(int camfd) { - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.type = CAMERA_START_SNAPSHOT; @@ -656,7 +656,7 @@ static bool native_start_snapshot(int camfd) static bool native_stop_snapshot(int camfd) { - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.type = CAMERA_STOP_SNAPSHOT; @@ -735,7 +735,7 @@ bool QualcommCameraHardware::native_set_parm( cam_ctrl_type type, uint16_t length, void *value) { int rc = true; - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; ctrlCmd.timeout_ms = 5000; ctrlCmd.type = (uint16_t)type; @@ -764,7 +764,7 @@ static void *cam_frame_click(void *data) { LOGV("Entering cam_frame_click"); - frameA = (msm_frame_t *)data; + frameA = (msm_frame *)data; struct sigaction act; @@ -1269,7 +1269,7 @@ void QualcommCameraHardware::release() } int rc; - struct msm_ctrl_cmd_t ctrlCmd; + struct msm_ctrl_cmd ctrlCmd; if (mCameraRunning) { if (mMsgEnabled & CAMERA_MSG_VIDEO_FRAME) { @@ -1735,7 +1735,7 @@ sp QualcommCameraHardware::getInstance() } // passes the Addresses to CameraService to getPreviewHeap -void QualcommCameraHardware::receivePreviewFrame(struct msm_frame_t *frame) +void QualcommCameraHardware::receivePreviewFrame(struct msm_frame *frame) { if ( LOG_PREVIEW ) LOGV("receivePreviewFrame E"); @@ -2110,13 +2110,13 @@ static bool register_buf(int camfd, int pmempreviewfd, uint32_t offset, uint8_t *buf, - msm_pmem_t pmem_type, + msm_pmem pmem_type, bool active, bool register_buffer = true); QualcommCameraHardware::PmemPool::PmemPool(const char *pmem_pool, int camera_control_fd, - msm_pmem_t pmem_type, + msm_pmem pmem_type, int buffer_size, int num_buffers, int frame_size, @@ -2242,11 +2242,11 @@ static bool register_buf(int camfd, int pmempreviewfd, uint32_t offset, uint8_t *buf, - msm_pmem_t pmem_type, + msm_pmem pmem_type, bool active, bool register_buffer) { - struct msm_pmem_info_t pmemBuf; + struct msm_pmem_info pmemBuf; pmemBuf.type = pmem_type; pmemBuf.fd = pmempreviewfd; @@ -2359,7 +2359,7 @@ status_t QualcommCameraHardware::MemPool::dump(int fd, const Vector& a return NO_ERROR; } -static void receive_camframe_callback(struct msm_frame_t *frame) +static void receive_camframe_callback(struct msm_frame *frame) { if ( LOG_PREVIEW ) LOGV("receive_camframe_callback E"); diff --git a/libcamera/QualcommCameraHardware.h b/libcamera/QualcommCameraHardware.h index 988ab82..cd4982a 100644 --- a/libcamera/QualcommCameraHardware.h +++ b/libcamera/QualcommCameraHardware.h @@ -33,7 +33,7 @@ extern "C" { #define CAM_CTRL_SUCCESS 1 -#define REVISION_H "3" +#define REVISION_H "4" #define CAMERA_SET_PARM_DIMENSION 1 #define CAMERA_SET_PARM_ZOOM 2 @@ -237,19 +237,19 @@ public: bool reg_unreg_buf(int camfd, int width, int height, - msm_frame_t *frame, - msm_pmem_t pmem_type, + msm_frame *frame, + msm_pmem pmem_type, unsigned char unregister, unsigned char active); void native_register_preview_bufs(int camfd, void *pDim, - struct msm_frame_t *frame, + struct msm_frame *frame, unsigned char active); void native_unregister_preview_bufs(int camfd, void *pDim, - struct msm_frame_t *frame); + struct msm_frame *frame); - void receivePreviewFrame(struct msm_frame_t *frame); + void receivePreviewFrame(struct msm_frame *frame); void receiveJpegPicture(void); void receiveJpegPictureFragment(uint8_t *buf, uint32_t size); void notifyShutter(); @@ -331,13 +331,13 @@ private: struct PmemPool : public MemPool { PmemPool(const char *pmem_pool, int control_camera_fd, - msm_pmem_t pmem_type, + msm_pmem pmem_type, int buffer_size, int num_buffers, int frame_size, int frame_offset, const char *name); virtual ~PmemPool(); int mFd; - msm_pmem_t mPmemType; + msm_pmem mPmemType; int mCameraControlFd; uint32_t mAlignedSize; struct pmem_region mSize; @@ -435,7 +435,7 @@ private: common_crop_t mCrop; - struct msm_frame_t frames[kPreviewBufferCount]; + struct msm_frame frames[kPreviewBufferCount]; bool mInPreviewCallback; bool mCameraRecording; int32_t mCurZoom; diff --git a/libcamera/msm_camera.h b/libcamera/msm_camera.h index 4f37888..eb99596 100644 --- a/libcamera/msm_camera.h +++ b/libcamera/msm_camera.h @@ -24,70 +24,70 @@ #define MSM_CAM_IOCTL_MAGIC 'm' #define MSM_CAM_IOCTL_GET_SENSOR_INFO \ - _IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info_t *) + _IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info *) #define MSM_CAM_IOCTL_REGISTER_PMEM \ - _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info *) #define MSM_CAM_IOCTL_UNREGISTER_PMEM \ _IOW(MSM_CAM_IOCTL_MAGIC, 3, unsigned) #define MSM_CAM_IOCTL_CTRL_COMMAND \ - _IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd *) #define MSM_CAM_IOCTL_CONFIG_VFE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd *) #define MSM_CAM_IOCTL_GET_STATS \ - _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl_t *) + _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl *) #define MSM_CAM_IOCTL_GETFRAME \ - _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame_t *) + _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame *) #define MSM_CAM_IOCTL_ENABLE_VFE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd *) #define MSM_CAM_IOCTL_CTRL_CMD_DONE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd *) #define MSM_CAM_IOCTL_CONFIG_CMD \ - _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd *) #define MSM_CAM_IOCTL_DISABLE_VFE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd *) #define MSM_CAM_IOCTL_PAD_REG_RESET2 \ - _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd *) #define MSM_CAM_IOCTL_VFE_APPS_RESET \ - _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd *) #define MSM_CAM_IOCTL_RELEASE_FRAMEE_BUFFER \ - _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd *) #define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER \ - _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf *) #define MSM_CAM_IOCTL_AXI_CONFIG \ - _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd *) #define MSM_CAM_IOCTL_GET_PICTURE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd *) #define MSM_CAM_IOCTL_SET_CROP \ - _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info *) #define MSM_CAM_IOCTL_PICT_PP \ _IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *) #define MSM_CAM_IOCTL_PICT_PP_DONE \ - _IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status *) #define MSM_CAM_IOCTL_SENSOR_IO_CFG \ - _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data *) #define MSM_CAM_IOCTL_FLASH_LED_CFG \ - _IOW(MSM_CAM_IOCTL_MAGIC, 22, enum msm_camera_led_state_t *) + _IOW(MSM_CAM_IOCTL_MAGIC, 22, enum msm_camera_led_state *) #define MAX_SENSOR_NUM 3 #define MAX_SENSOR_NAME 32 @@ -95,7 +95,7 @@ /***************************************************** * enum *****************************************************/ -enum msm_camera_update_t { +enum msm_camera_update { MSM_CAM_CTRL_CMD_DONE, MSM_CAM_SENSOR_VFE_CMD, }; @@ -112,7 +112,7 @@ enum msm_camera_update_t { * 1. control command: control command(from control thread), * control status (from config thread); */ -struct msm_ctrl_cmd_t { +struct msm_ctrl_cmd { int timeout_ms; uint16_t type; uint16_t length; @@ -120,14 +120,14 @@ struct msm_ctrl_cmd_t { uint16_t status; }; -struct msm_vfe_evt_msg_t { +struct msm_vfe_evt_msg { unsigned short type; /* 1 == event (RPC), 0 == message (adsp) */ unsigned short msg_id; unsigned int len; /* size in, number of bytes out */ unsigned char *data; }; -enum msm_camera_resp_t { +enum msm_camera_resp { MSM_CAM_RESP_CTRL, MSM_CAM_RESP_STAT_EVT_MSG, MSM_CAM_RESP_V4L2, @@ -140,15 +140,15 @@ struct msm_stats_event_ctrl { /* 0 - ctrl_cmd from control thread, * 1 - stats/event kernel, * 2 - V4L control or read request */ - enum msm_camera_resp_t resptype; + enum msm_camera_resp resptype; int timeout_ms; - struct msm_ctrl_cmd_t ctrl_cmd; + struct msm_ctrl_cmd ctrl_cmd; /* struct vfe_event_t stats_event; */ - struct msm_vfe_evt_msg_t stats_event; + struct msm_vfe_evt_msg stats_event; }; /* 2. config command: config command(from config thread); */ -struct msm_camera_cfg_cmd_t { +struct msm_camera_cfg_cmd { /* what to config: * 1 - sensor config, 2 - vfe config */ uint16_t cfg_type; @@ -160,7 +160,7 @@ struct msm_camera_cfg_cmd_t { void *value; }; -enum cfg_cmd_type_t { +enum cfg_cmd_type { CMD_GENERAL, CMD_AXI_CFG_OUT1, CMD_AXI_CFG_SNAP_O1_AND_O2, @@ -183,18 +183,18 @@ enum cfg_cmd_type_t { }; /* vfe config command: config command(from config thread)*/ -struct msm_vfe_cfg_cmd_t { - enum cfg_cmd_type_t cmd_type; +struct msm_vfe_cfg_cmd { + enum cfg_cmd_type cmd_type; uint16_t length; void *value; }; -struct camera_enable_cmd_t { +struct camera_enable_cmd { char *name; uint16_t length; }; -enum msm_pmem_t { +enum msm_pmem { MSM_PMEM_OUTPUT1, MSM_PMEM_OUTPUT2, MSM_PMEM_OUTPUT1_OUTPUT2, @@ -207,7 +207,7 @@ enum msm_pmem_t { MSM_PMEM_MAX }; -enum msm_camera_out_frame_t { +enum msm_camera_out_frame { FRAME_PREVIEW_OUTPUT1, FRAME_PREVIEW_OUTPUT2, FRAME_SNAPSHOT, @@ -216,8 +216,8 @@ enum msm_camera_out_frame_t { FRAME_MAX }; -struct msm_pmem_info_t { - enum msm_pmem_t type; +struct msm_pmem_info { + enum msm_pmem type; int fd; void *vaddr; uint32_t y_off; @@ -225,7 +225,7 @@ struct msm_pmem_info_t { uint8_t active; }; -struct outputCfg_t { +struct outputCfg { uint32_t height; uint32_t width; @@ -233,7 +233,7 @@ struct outputCfg_t { uint32_t window_height_lastline; }; -enum vfeoutput_mode_t { +enum vfeoutput_mode { OUTPUT_1, OUTPUT_2, OUTPUT_1_AND_2, @@ -249,7 +249,7 @@ enum msm_frame_path { MSM_FRAME_ENC, }; -struct msm_frame_t { +struct msm_frame { enum msm_frame_path path; unsigned long buffer; uint32_t y_off; @@ -266,13 +266,13 @@ enum stat_type { STAT_MAX, }; -struct msm_stats_buf_t { +struct msm_stats_buf { enum stat_type type; unsigned long buffer; int fd; }; -enum msm_v4l2_ctrl_t { +enum msm_v4l2_ctrl { MSM_V4L2_VID_CAP_TYPE, MSM_V4L2_STREAM_ON, MSM_V4L2_STREAM_OFF, @@ -285,23 +285,23 @@ enum msm_v4l2_ctrl_t { MSM_V4L2_MAX }; -struct crop_info_t { +struct crop_info { void *info; int len; }; -struct msm_postproc_t { +struct msm_postproc { int ftnum; - struct msm_frame_t fthumnail; + struct msm_frame fthumnail; int fmnum; - struct msm_frame_t fmain; + struct msm_frame fmain; }; -struct msm_snapshot_pp_status_t { +struct msm_snapshot_pp_status { void *status; }; -enum sensor_cfg_t { +enum sensor_cfg { CFG_SET_MODE, CFG_SET_EFFECT, CFG_START, @@ -335,24 +335,24 @@ enum sensor_cfg_t { CFG_MAX }; -enum sensor_move_focus_t { +enum sensor_move_focus { MOVE_NEAR, MOVE_FAR }; -enum sensor_mode_t { +enum sensor_mode { SENSOR_PREVIEW_MODE, SENSOR_SNAPSHOT_MODE, SENSOR_RAW_SNAPSHOT_MODE }; -enum sensor_resolution_t { +enum sensor_resolution { SENSOR_QTR_SIZE, SENSOR_FULL_SIZE, SENSOR_INVALID_SIZE, }; -enum camera_effect_t { +enum camera_effect { CAMERA_EFFECT_MIN_MINUS_1, CAMERA_EFFECT_OFF = 1, /* This list must match aeecamera.h */ CAMERA_EFFECT_MONO, @@ -381,7 +381,7 @@ struct exp_gain_cfg { struct focus_cfg { int32_t steps; - enum sensor_move_focus_t dir; + enum sensor_move_focus dir; }; struct fps_cfg { @@ -390,16 +390,16 @@ struct fps_cfg { uint32_t pict_fps_div; }; -enum msm_camera_led_state_t { +enum msm_camera_led_state { MSM_LED_OFF, MSM_LED_LOW, MSM_LED_HIGH }; -struct sensor_cfg_data_t { - enum sensor_cfg_t cfgtype; - enum sensor_mode_t mode; - enum sensor_resolution_t rs; +struct sensor_cfg_data { + enum sensor_cfg cfgtype; + enum sensor_mode mode; + enum sensor_resolution rs; union { int8_t effect; @@ -417,7 +417,7 @@ struct sensor_cfg_data_t { } cfg; }; -enum sensor_get_info_t { +enum sensor_get_info { GET_NAME, GET_PREVIEW_LINE_PER_FRAME, GET_PREVIEW_PIXELS_PER_LINE, @@ -427,7 +427,7 @@ enum sensor_get_info_t { GET_SNAPSHOT_MAX_EP_LINE_CNT, }; -struct msm_camsensor_info_t { +struct msm_camsensor_info { char name[MAX_SENSOR_NAME]; int8_t flash_enabled; }; diff --git a/libcopybit/Android.mk b/libcopybit/Android.mk index 85b9b19..f8a8f18 100644 --- a/libcopybit/Android.mk +++ b/libcopybit/Android.mk @@ -23,7 +23,7 @@ LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw LOCAL_SHARED_LIBRARIES := liblog LOCAL_SRC_FILES := copybit.cpp -LOCAL_MODULE := copybit.bahamas +LOCAL_MODULE := copybit.$(TARGET_BOOTLOADER_BOARD_NAME) LOCAL_C_INCLUDES += hardware/msm7k/libgralloc LOCAL_CFLAGS += -DCOPYBIT_MSM7K=1 include $(BUILD_SHARED_LIBRARY) diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp index 6eeae24..8a09d29 100644 --- a/libcopybit/copybit.cpp +++ b/libcopybit/copybit.cpp @@ -41,7 +41,7 @@ /******************************************************************************/ #if defined(COPYBIT_MSM7K) -#define MAX_SCALE_FACTOR (3) +#define MAX_SCALE_FACTOR (4) #define MAX_DIMENSION (4096) #elif defined(COPYBIT_QSD8K) #define MAX_SCALE_FACTOR (8) @@ -131,27 +131,18 @@ static int get_format(int format) { } /** convert from copybit image to mdp image structure */ -static void set_image(struct mdp_img *img, const struct copybit_image_t *rhs) +static void set_image(struct mdp_img *img, const struct copybit_image_t *rhs) { private_handle_t* hnd = (private_handle_t*)rhs->handle; + if(hnd == NULL){ + LOGE("copybit: Invalid handle"); + return; + } img->width = rhs->w; img->height = rhs->h; img->format = get_format(rhs->format); img->offset = hnd->offset; -#if defined(COPYBIT_MSM7K) - if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_GPU) { - img->offset += hnd->map_offset; - img->memory_id = hnd->gpu_fd; - if (img->format == MDP_RGBA_8888) { - // msm7201A GPU only supports BGRA_8888 destinations - img->format = MDP_BGRA_8888; - } - } else { - img->memory_id = hnd->fd; - } -#else img->memory_id = hnd->fd; -#endif } /** setup rectangles */ static void set_rects(struct copybit_context_t *dev, @@ -194,14 +185,17 @@ static void set_rects(struct copybit_context_t *dev, } /** setup mdp request */ -static void set_infos(struct copybit_context_t *dev, struct mdp_blit_req *req) { +static void set_infos(struct copybit_context_t *dev, struct mdp_blit_req *req, int flags) { req->alpha = dev->mAlpha; req->transp_mask = MDP_TRANSP_NOP; - req->flags = dev->mFlags | MDP_BLEND_FG_PREMULT; + req->flags = dev->mFlags | flags; +#if defined(COPYBIT_QSD8K) + req->flags |= MDP_BLEND_FG_PREMULT; +#endif } /** copy the bits */ -static int msm_copybit(struct copybit_context_t *dev, void const *list) +static int msm_copybit(struct copybit_context_t *dev, void const *list) { int err = ioctl(dev->mFD, MSMFB_BLIT, (struct mdp_blit_req_list const*)list); @@ -245,7 +239,7 @@ static int msm_copybit(struct copybit_context_t *dev, void const *list) static int set_parameter_copybit( struct copybit_device_t *dev, int name, - int value) + int value) { struct copybit_context_t* ctx = (struct copybit_context_t*)dev; int status = 0; @@ -308,7 +302,7 @@ static int set_parameter_copybit( } /** Get a static info value */ -static int get(struct copybit_device_t *dev, int name) +static int get(struct copybit_device_t *dev, int name) { struct copybit_context_t* ctx = (struct copybit_context_t*)dev; int value; @@ -342,7 +336,7 @@ static int stretch_copybit( struct copybit_image_t const *src, struct copybit_rect_t const *dst_rect, struct copybit_rect_t const *src_rect, - struct copybit_region_t const *region) + struct copybit_region_t const *region) { struct copybit_context_t* ctx = (struct copybit_context_t*)dev; int status = 0; @@ -383,7 +377,9 @@ static int stretch_copybit( while ((status == 0) && region->next(region, &clip)) { intersect(&clip, &bounds, &clip); mdp_blit_req* req = &list.req[list.count]; - set_infos(ctx, req); + int flags = 0; + + set_infos(ctx, req, flags); set_image(&req->dst, dst); set_image(&req->src, src); set_rects(ctx, req, dst_rect, src_rect, &clip); @@ -413,7 +409,7 @@ static int blit_copybit( struct copybit_device_t *dev, struct copybit_image_t const *dst, struct copybit_image_t const *src, - struct copybit_region_t const *region) + struct copybit_region_t const *region) { struct copybit_rect_t dr = { 0, 0, dst->w, dst->h }; struct copybit_rect_t sr = { 0, 0, src->w, src->h }; @@ -423,7 +419,7 @@ static int blit_copybit( /*****************************************************************************/ /** Close the copybit device */ -static int close_copybit(struct hw_device_t *dev) +static int close_copybit(struct hw_device_t *dev) { struct copybit_context_t* ctx = (struct copybit_context_t*)dev; if (ctx) { diff --git a/libgralloc/Android.mk b/libgralloc/Android.mk index 7cae2a3..797c849 100644 --- a/libgralloc/Android.mk +++ b/libgralloc/Android.mk @@ -29,6 +29,6 @@ LOCAL_SRC_FILES := \ framebuffer.cpp \ mapper.cpp -LOCAL_MODULE := gralloc.bahamas +LOCAL_MODULE := gralloc.$(TARGET_BOOTLOADER_BOARD_NAME) LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" include $(BUILD_SHARED_LIBRARY) diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp index b45d18c..24205fa 100644 --- a/libgralloc/framebuffer.cpp +++ b/libgralloc/framebuffer.cpp @@ -34,7 +34,7 @@ #include #include -#include "linux/msm_mdp.h" +#include #include "gralloc_priv.h" #include "gr.h" @@ -372,6 +372,9 @@ int fb_device_open(hw_module_t const* module, const char* name, *device = &dev->device.common; } + + // Close the gralloc module + gralloc_close(gralloc_device); } return status; } diff --git a/liblights/Android.mk b/liblights/Android.mk index 083e217..515d7c9 100644 --- a/liblights/Android.mk +++ b/liblights/Android.mk @@ -18,7 +18,7 @@ ifneq ($(TARGET_SIMULATOR),true) include $(CLEAR_VARS) -LOCAL_MODULE := lights.bahamas +LOCAL_MODULE := lights.$(TARGET_BOOTLOADER_BOARD_NAME) LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw diff --git a/liblights/lights.c b/liblights/lights.c index 5e93efe..8edca8f 100644 --- a/liblights/lights.c +++ b/liblights/lights.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 The Android Open Source Project + * Copyright (C) 2010 Diogo Ferreira * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ * limitations under the License. */ - -// #define LOG_NDEBUG 0 #define LOG_TAG "lights" #include @@ -32,257 +30,286 @@ #include -/******************************************************************************/ - +static pthread_once_t g_init = PTHREAD_ONCE_INIT; static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; -static struct light_state_t g_notification = {0,0,0,0,0}; -static struct light_state_t g_battery = {0,0,0,0,0}; +static struct light_state_t g_notification; +static struct light_state_t g_battery; +static int g_backlight = 255; -char const*const GREEN_LED_FILE - = "/sys/class/leds/green/brightness"; +char const*const AMBER_LED_FILE = "/sys/class/leds/amber/brightness"; +char const*const GREEN_LED_FILE = "/sys/class/leds/green/brightness"; -char const*const AMBER_LED_FILE - = "/sys/class/leds/amber/brightness"; +char const*const BUTTON_FILE = "/sys/class/leds/button-backlight/brightness"; -char const*const LCD_FILE - = "/sys/class/leds/lcd-backlight/brightness"; +char const*const AMBER_BLINK_FILE = "/sys/class/leds/amber/blink"; +char const*const GREEN_BLINK_FILE = "/sys/class/leds/green/blink"; -char const*const AMBER_BLINK_FILE - = "/sys/class/leds/amber/blink"; - -char const*const GREEN_BLINK_FILE - = "/sys/class/leds/green/blink"; - -char const*const BUTTON_FILE - = "/sys/class/leds/button-backlight/brightness"; +char const*const LCD_BACKLIGHT_FILE = "/sys/class/leds/lcd-backlight/brightness"; +enum { + LED_BLANK, + LED_AMBER, + LED_GREEN, + LED_BOTH, +}; /** - * device methods + * Aux method, write int to file */ +static int write_int (const char* path, int value) { + int fd; + static int already_warned = 0; -static int -write_int(char const* path, int value) -{ - int fd; - static int already_warned = 0; + fd = open(path, O_RDWR); + if (fd < 0) { + if (already_warned == 0) { + LOGE("write_int failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } - fd = open(path, O_RDWR); - if (fd >= 0) { - char buffer[20]; - int bytes = sprintf(buffer, "%d\n", value); - int amt = write(fd, buffer, bytes); - close(fd); - return amt == -1 ? -errno : 0; - } else { - if (already_warned == 0) { - LOGE("write_int failed to open %s\n", path); - already_warned = 1; - } - return -errno; - } + char buffer[20]; + int bytes = snprintf(buffer, sizeof(buffer), "%d\n",value); + int written = write (fd, buffer, bytes); + close (fd); + + return written == -1 ? -errno : 0; } -static int -is_lit(struct light_state_t const* state) -{ - return state->color & 0x00ffffff; +void init_globals (void) { + pthread_mutex_init (&g_lock, NULL); } -static int -rgb_to_brightness(struct light_state_t const* state) +static int is_lit (struct light_state_t const* state) { + return state->color & 0x00ffffff; +} + +static unsigned int rgb_to_led(struct light_state_t *state) { + unsigned int colorRGB = state->color & 0xFFFFFF; + unsigned int colorLED = LED_BLANK; + + if (colorRGB & 0xFF) + colorLED |= LED_GREEN; + else { + if ((colorRGB >> 8) & 0xFF) + colorLED |= LED_GREEN; + if ((colorRGB >> 16) & 0xFF) + colorLED |= LED_AMBER; + } + + return colorLED; +} + +static void set_speaker_light_locked (struct light_device_t *dev, + struct light_state_t *state) { + unsigned int colorRGB = state->color & 0xFFFFFF; + unsigned int colorLED = rgb_to_led(state); + + switch (state->flashMode) { + case LIGHT_FLASH_HARDWARE: + case LIGHT_FLASH_TIMED: + switch (colorLED) { + case LED_BOTH: + write_int (AMBER_BLINK_FILE, 1); + write_int (GREEN_BLINK_FILE, 1); + break; + case LED_AMBER: + if (state == &g_battery) + write_int (AMBER_BLINK_FILE, 4); + else + write_int (AMBER_BLINK_FILE, 1); + write_int (GREEN_LED_FILE, 0); + break; + case LED_GREEN: + write_int (GREEN_BLINK_FILE, 1); + write_int (AMBER_LED_FILE, 0); + break; + case LED_BLANK: + write_int (AMBER_BLINK_FILE, 0); + write_int (GREEN_BLINK_FILE, 0); + break; + default: + LOGE("set_led_state: unknown color, colorRGB=0x%08X colorLED=%d\n", + colorRGB, colorLED); + break; + } + break; + case LIGHT_FLASH_NONE: + switch (colorLED) { + case LED_BOTH: + write_int (AMBER_LED_FILE, 1); + write_int (GREEN_LED_FILE, 1); + break; + case LED_AMBER: + write_int (AMBER_LED_FILE, 1); + write_int (GREEN_LED_FILE, 0); + break; + case LED_GREEN: + write_int (AMBER_LED_FILE, 0); + write_int (GREEN_LED_FILE, 1); + break; + case LED_BLANK: + write_int (AMBER_LED_FILE, 0); + write_int (GREEN_LED_FILE, 0); + break; + default: + LOGE("set_led_state: unknown color, colorRGB=0x%08X colorLED=%d\n", + colorRGB, colorLED); + break; + } + break; + default: + LOGE("set_led_state: unknown mode, colorRGB=0x%08X flashMode=%d\n", + colorRGB, state->flashMode); + } +} + +static void set_speaker_light_locked_dual(struct light_device_t *dev, + struct light_state_t *bstate, struct light_state_t *nstate) { + unsigned int bcolorRGB = bstate->color & 0xFFFFFF; + unsigned int bcolorLED = rgb_to_led(bstate); + + switch (bcolorLED) { + case LED_BOTH: + case LED_AMBER: + write_int (AMBER_BLINK_FILE, 4); + write_int (GREEN_LED_FILE, 1); + break; + case LED_GREEN: + write_int (AMBER_BLINK_FILE, 1); + write_int (GREEN_LED_FILE, 1); + break; + case LED_BLANK: + default: + LOGE("set_led_state_dual: unexpected color, bcolorRGB=0x%08X bcolorLED=%d\n", + bcolorRGB, bcolorLED); + break; + } +} + +static void handle_speaker_battery_locked (struct light_device_t *dev) { + if (is_lit (&g_battery) && is_lit (&g_notification)) { + set_speaker_light_locked_dual(dev, &g_battery, &g_notification); + } else if (is_lit (&g_battery)) { + set_speaker_light_locked (dev, &g_battery); + } else { + set_speaker_light_locked (dev, &g_notification); + } +} + +static int set_light_buttons (struct light_device_t* dev, + struct light_state_t const* state) { + int err = 0; + int on = is_lit (state); + pthread_mutex_lock (&g_lock); + err = write_int (BUTTON_FILE, on?255:0); + pthread_mutex_unlock (&g_lock); + + return 0; +} + +static int rgb_to_brightness(struct light_state_t const* state) { int color = state->color & 0x00ffffff; return ((77*((color>>16)&0x00ff)) + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; } -static int -set_light_backlight(struct light_device_t* dev, - struct light_state_t const* state) -{ - int err = 0; - int brightness = rgb_to_brightness(state); - pthread_mutex_lock(&g_lock); - err = write_int(LCD_FILE, brightness); - pthread_mutex_unlock(&g_lock); - return err; +static int set_light_backlight(struct light_device_t* dev, + struct light_state_t const* state) { + int err = 0; + int brightness = rgb_to_brightness(state); + LOGV("%s brightness=%d color=0x%08x", + __func__,brightness, state->color); + pthread_mutex_lock(&g_lock); + g_backlight = brightness; + err = write_int(LCD_BACKLIGHT_FILE, brightness); + pthread_mutex_unlock(&g_lock); + return err; } -static int -set_light_buttons(struct light_device_t* dev, - struct light_state_t const* state) -{ - int err = 0; - int on = is_lit(state); - pthread_mutex_lock(&g_lock); - err = write_int(BUTTON_FILE, on?255:0); - pthread_mutex_unlock(&g_lock); - return err; +static int set_light_battery (struct light_device_t* dev, + struct light_state_t const* state) { + pthread_mutex_lock (&g_lock); + g_battery = *state; + handle_speaker_battery_locked(dev); + pthread_mutex_unlock (&g_lock); + + return 0; } -static int -set_speaker_light_locked(struct light_device_t* dev, - struct light_state_t const* state) -{ - int len; - int alpha, red, green, blue; - int blink, freq, pwm; - int onMS, offMS; - unsigned int colorRGB; +static int set_light_attention (struct light_device_t* dev, + struct light_state_t const* state) { + /* tattoo has no attention */ - switch (state->flashMode) { - case LIGHT_FLASH_TIMED: - blink = 1; - onMS = state->flashOnMS; - offMS = state->flashOffMS; - break; - case LIGHT_FLASH_HARDWARE: - blink = 1; - onMS = state->flashOnMS; - offMS = state->flashOffMS; - break; - case LIGHT_FLASH_NONE: - blink = 0; - onMS = 0; - offMS = 0; - break; - default: - blink = 1; - onMS = 0; - offMS = 0; - break; - } - - colorRGB = state->color; - - LOGD("set_speaker_light_locked colorRGB=%08X, onMS=%d, offMS=%d\n", - colorRGB, onMS, offMS); - - red = (colorRGB >> 16) & 0xFF; - green = (colorRGB >> 8) & 0xFF; - blue = colorRGB & 0xFF; - - if (red) { - write_int(GREEN_LED_FILE, 0); - write_int(AMBER_LED_FILE, 1); - if (blink) { - //blink must come after brightness change - write_int(AMBER_BLINK_FILE, 1); - } - } else if (green || blue) { - write_int(AMBER_LED_FILE, 0); - write_int(GREEN_LED_FILE, 1); - if (blink) { - write_int(GREEN_BLINK_FILE, 1); - } - } else { - write_int(GREEN_LED_FILE, 0); - write_int(AMBER_LED_FILE, 0); - } - - return 0; + return 0; } -static void -handle_speaker_light_locked(struct light_device_t* dev) -{ - if (is_lit(&g_battery)) { - set_speaker_light_locked(dev, &g_battery); - } else { - set_speaker_light_locked(dev, &g_notification); - } +static int set_light_notifications (struct light_device_t* dev, + struct light_state_t const* state) { + pthread_mutex_lock (&g_lock); + g_notification = *state; + handle_speaker_battery_locked (dev); + pthread_mutex_unlock (&g_lock); + return 0; } -static int -set_light_battery(struct light_device_t* dev, - struct light_state_t const* state) -{ - pthread_mutex_lock(&g_lock); - g_battery = *state; - handle_speaker_light_locked(dev); - pthread_mutex_unlock(&g_lock); - return 0; +static int close_lights (struct light_device_t *dev) { + if (dev) + free (dev); + + return 0; } -static int -set_light_notifications(struct light_device_t* dev, - struct light_state_t const* state) -{ - pthread_mutex_lock(&g_lock); - g_notification = *state; - handle_speaker_light_locked(dev); - pthread_mutex_unlock(&g_lock); - return 0; +static int open_lights (const struct hw_module_t* module, char const* name, + struct hw_device_t** device) { + int (*set_light)(struct light_device_t* dev, + struct light_state_t const* state); + + if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) { + set_light = set_light_backlight; + } + else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) { + set_light = set_light_buttons; + } + else if (0 == strcmp(LIGHT_ID_BATTERY, name)) { + set_light = set_light_battery; + } + else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) { + set_light = set_light_attention; + } + else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) { + set_light = set_light_notifications; + } + else { + return -EINVAL; + } + + pthread_once (&g_init, init_globals); + struct light_device_t *dev = malloc (sizeof (struct light_device_t)); + memset (dev,0,sizeof(*dev)); + + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = 0; + dev->common.module = (struct hw_module_t*)module; + dev->common.close = (int (*)(struct hw_device_t*))close_lights; + dev->set_light = set_light; + + *device = (struct hw_device_t*) dev; + return 0; } - -/** Close the lights device */ -static int -close_lights(struct light_device_t *dev) -{ - if (dev) { - free(dev); - } - return 0; -} - - -/******************************************************************************/ - -/** - * module methods - */ - -/** Open a new instance of a lights device using name */ -static int open_lights(const struct hw_module_t* module, char const* name, - struct hw_device_t** device) -{ - int (*set_light)(struct light_device_t* dev, - struct light_state_t const* state); - - if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) { - set_light = set_light_backlight; - } - else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) { - set_light = set_light_buttons; - } - else if (0 == strcmp(LIGHT_ID_BATTERY, name)) { - set_light = set_light_battery; - } - else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) { - set_light = set_light_notifications; - } - else { - return -EINVAL; - } - - struct light_device_t *dev = calloc(1, sizeof(struct light_device_t)); - - dev->common.tag = HARDWARE_DEVICE_TAG; - dev->common.version = 0; - dev->common.module = (struct hw_module_t*)module; - dev->common.close = (int (*)(struct hw_device_t*))close_lights; - dev->set_light = set_light; - - *device = (struct hw_device_t*)dev; - return 0; -} - - static struct hw_module_methods_t lights_module_methods = { - .open = open_lights, + .open = open_lights, }; -/* - * The lights Module - */ const struct hw_module_t HAL_MODULE_INFO_SYM = { - .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, - .id = LIGHTS_HARDWARE_MODULE_ID, - .name = "Tattoo lights module", - .author = "CyanogenMod", - .methods = &lights_module_methods, + .tag = HARDWARE_MODULE_TAG, + .version_major = 2, + .version_minor = 0, + .id = LIGHTS_HARDWARE_MODULE_ID, + .name = "Tattoo lights module", + .author = "Diogo Ferreira ", + .methods = &lights_module_methods, }; diff --git a/libsensors/Android.mk b/libsensors/Android.mk index 46952a0..6ee7208 100644 --- a/libsensors/Android.mk +++ b/libsensors/Android.mk @@ -21,7 +21,7 @@ ifneq ($(TARGET_SIMULATOR),true) # hw/..so include $(CLEAR_VARS) -LOCAL_MODULE := sensors.bahamas +LOCAL_MODULE := sensors.$(TARGET_BOOTLOADER_BOARD_NAME) LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 1c4eb2a..14f3b0c 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -24,12 +24,12 @@ alpha compositing functionality in hardware. If set, the window manager will disable alpha trasformation in animations where not strictly needed. --> - false + true - false + true @@ -55,22 +55,6 @@ "usb0" - - - "rmnet\\d" - "ppp\\d" - "tiwlan\\d" - - - - - "rmnet\\d" - "tiwlan\\d" - - false @@ -96,9 +80,9 @@ false - 37 + 0 - 30 + 40 diff --git a/overlay/packages/apps/CMParts/res/values/config.xml b/overlay/packages/apps/CMParts/res/values/config.xml new file mode 100644 index 0000000..b5036a7 --- /dev/null +++ b/overlay/packages/apps/CMParts/res/values/config.xml @@ -0,0 +1,23 @@ + + + + true + + + false + + + false + + + false + + + true + + + false + + + true + diff --git a/overlay/packages/apps/Phone/res/values/config.xml b/overlay/packages/apps/Phone/res/values/config.xml index 2d302d6..0f522ce 100644 --- a/overlay/packages/apps/Phone/res/values/config.xml +++ b/overlay/packages/apps/Phone/res/values/config.xml @@ -48,7 +48,7 @@ specific properties of the device, perhaps by detecting the presence of a proximity sensor and/or hard SEND/END keys. (If so, we wouldn't need this flag at all.) --> - false + true