Skip to content

Instantly share code, notes, and snippets.

@pawitp
Last active March 23, 2016 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pawitp/c8a4b32ecd838146192b to your computer and use it in GitHub Desktop.
Save pawitp/c8a4b32ecd838146192b to your computer and use it in GitHub Desktop.
A700 Lollipop patches
From a04ed65643f6c704caf28f25e19e6ec7d17ab327 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 10 Jan 2015 21:08:35 +0700
Subject: [PATCH] WIP: a700: Lollipop bring up
Change-Id: Ia62e57b1751c73cf882267e3786dbb90122d759f
---
bluetooth/bdroid_buildcfg.h | 7 ++++---
cm.mk | 3 ---
prebuilt/ramdisk/init.acer.usb.rc | 36 ++++++++++++++++++------------------
3 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h
index e500030..ffd20cb 100644
--- a/bluetooth/bdroid_buildcfg.h
+++ b/bluetooth/bdroid_buildcfg.h
@@ -27,8 +27,9 @@
#define BTIF_HF_SERVICES (BTA_HSP_SERVICE_MASK)
#define BTIF_HF_SERVICE_NAMES { BTIF_HSAG_SERVICE_NAME, NULL }
-#define BLE_INCLUDED FALSE
-#define BTA_GATT_INCLUDED FALSE
-#define SMP_INCLUDED FALSE
+// TODO: Disabling these causes compile error
+// #define BLE_INCLUDED FALSE
+// #define BTA_GATT_INCLUDED FALSE
+// #define SMP_INCLUDED FALSE
#endif
diff --git a/cm.mk b/cm.mk
index ef9b07f..8b54f91 100644
--- a/cm.mk
+++ b/cm.mk
@@ -1,6 +1,3 @@
-## Specify phone tech before including full_phone
-$(call inherit-product, vendor/cm/config/gsm.mk)
-
# Release name
PRODUCT_RELEASE_NAME := A700
diff --git a/prebuilt/ramdisk/init.acer.usb.rc b/prebuilt/ramdisk/init.acer.usb.rc
index d39cc0c..ccf8f36 100755
--- a/prebuilt/ramdisk/init.acer.usb.rc
+++ b/prebuilt/ramdisk/init.acer.usb.rc
@@ -1,6 +1,6 @@
on boot
# Set USB manufacturer and product name
- write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
+ write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct "Acer Iconia Tab A700"
write /sys/class/android_usb/android0/f_rndis/wceis 1
@@ -9,57 +9,57 @@ on property:sys.usb.config=none
stop adbd
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/bDeviceClass 0
- setprop sys.usb.state $sys.usb.config
+ 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 0502
write /sys/class/android_usb/android0/idProduct 3376
- write /sys/class/android_usb/android0/functions $sys.usb.config
- write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 0502
write /sys/class/android_usb/android0/idProduct 3378
- write /sys/class/android_usb/android0/functions $sys.usb.config
- write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
# USB accessory configuration
on property:sys.usb.config=accessory
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18d1
write /sys/class/android_usb/android0/idProduct 2d00
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
# USB accessory configuration, with adb
on property:sys.usb.config=accessory,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18d1
write /sys/class/android_usb/android0/idProduct 2d01
- write /sys/class/android_usb/android0/functions $sys.usb.config
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
# USB rndis configuration (Using A701 id)
on property:sys.usb.config=rndis
@@ -90,23 +90,23 @@ on property:sys.usb.config=ptp
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 0502
write /sys/class/android_usb/android0/idProduct 3396
- write /sys/class/android_usb/android0/functions $sys.usb.config
- write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state $sys.usb.config
+ 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 0502
write /sys/class/android_usb/android0/idProduct 3395
- write /sys/class/android_usb/android0/functions $sys.usb.config
- write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
write /sys/class/android_usb/android0/bDeviceClass 0
write /sys/class/android_usb/android0/bDeviceSubClass 0
write /sys/class/android_usb/android0/bDeviceProtocol 0
write /sys/class/android_usb/android0/enable 1
start adbd
- setprop sys.usb.state $sys.usb.config
+ setprop sys.usb.state ${sys.usb.config}
--
1.9.3 (Apple Git-50)
From 164df9077ea4f61198051a1601fffb43950f423a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 10 Jan 2015 21:10:26 +0700
Subject: [PATCH] WIP: t30-common: Lollipop bring up
Change-Id: I3af72158c88d8f3b21770b6ff2b39021a45aa8eb
---
BoardConfigCommon.mk | 27 +++++++++++--
device_base.mk | 13 +++++-
.../frameworks/base/core/res/res/values/config.xml | 9 ++++-
.../packages/apps/Settings/res/values/config.xml | 5 ++-
prebuilt/etc/media_codecs.xml | 47 ++--------------------
prebuilt/ramdisk/fstab.acer | 4 +-
prebuilt/usr/keylayout/gpio-keys.kl | 14 +++----
releasetools.py | 19 ++++++---
sepolicy/app.te | 1 -
sepolicy/bootanim.te | 1 +
sepolicy/device.te | 1 -
sepolicy/file_contexts | 11 ++---
sepolicy/lmkd.te | 3 ++
sepolicy/mediaserver.te | 2 +-
sepolicy/rild.te | 5 +++
sepolicy/surfaceflinger.te | 12 +++++-
sepolicy/system.te | 3 --
sepolicy/system_app.te | 1 +
sepolicy/system_server.te | 5 +++
sepolicy/ueventd.te | 2 +
sepolicy/zygote.te | 1 -
21 files changed, 110 insertions(+), 76 deletions(-)
create mode 100644 sepolicy/bootanim.te
create mode 100644 sepolicy/lmkd.te
create mode 100644 sepolicy/rild.te
delete mode 100644 sepolicy/system.te
create mode 100644 sepolicy/system_app.te
create mode 100644 sepolicy/system_server.te
create mode 100644 sepolicy/ueventd.te
delete mode 100644 sepolicy/zygote.te
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 72b209e..fc7a5d8 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -10,7 +10,7 @@ TARGET_CPU_VARIANT := cortex-a9
TARGET_NO_BOOTLOADER := true
-BOARD_KERNEL_CMDLINE :=
+BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048
@@ -19,11 +19,19 @@ TARGET_USERIMAGES_USE_EXT4 := true
BOARD_BOOTIMAGE_PARTITION_SIZE := 8388608
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 6291456
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 629145600
+BOARD_CACHEIMAGE_PARTITION_SIZE := 1283457024
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_USERDATAIMAGE_PARTITION_SIZE := 29905387520
BOARD_FLASH_BLOCK_SIZE := 4096
TARGET_RECOVERY_FSTAB := device/acer/t30-common/prebuilt/ramdisk/fstab.acer
+# Include an expanded selection of fonts
+# TODO: check available system space
+# EXTENDED_FONT_FOOTPRINT := true
+
+MALLOC_IMPL := dlmalloc
+
# Wifi related defines
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
WPA_SUPPLICANT_VERSION := VER_0_8_X
@@ -66,6 +74,12 @@ TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := true
# Sensors
COMMON_GLOBAL_CFLAGS += -DNEEDS_VECTORIMPL_SYMBOLS
+# OMX
+# ADD_LEGACY_SET_POSITION_SYMBOL: libnvwinsys.so
+# ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS: libnvwinsys.so
+# ADD_LEGACY_MEMORY_DEALER_CONSTRUCTOR_SYMBOL: libnvomxadaptor.so
+COMMON_GLOBAL_CFLAGS += -DADD_LEGACY_SET_POSITION_SYMBOL -DADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS -DADD_LEGACY_MEMORY_DEALER_CONSTRUCTOR_SYMBOL
+
BOARD_HAS_NO_SELECT_BUTTON := true
# Use this flag if the board has a ext4 partition larger than 2gb
BOARD_HAS_LARGE_FILESYSTEM := true
@@ -82,6 +96,9 @@ BOARD_HARDWARE_CLASS := device/acer/t30-common/cmhw/
TARGET_RELEASETOOLS_EXTENSIONS := device/acer/t30-common
+# Compat
+TARGET_USES_LOGD := false
+
BOARD_SEPOLICY_DIRS += \
device/acer/t30-common/sepolicy
@@ -89,10 +106,14 @@ BOARD_SEPOLICY_UNION += \
file_contexts \
genfs_contexts \
app.te \
+ bootanim.te \
device.te \
drmserver.te \
file.te \
+ lmkd.te \
mediaserver.te \
+ rild.te \
surfaceflinger.te \
- system.te \
- zygote.te
+ system_app.te \
+ system_server.te \
+ ueventd.te
diff --git a/device_base.mk b/device_base.mk
index 2aad655..229aa25 100644
--- a/device_base.mk
+++ b/device_base.mk
@@ -4,7 +4,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
$(call inherit-product, device/common/gps/gps_us_supl.mk)
PRODUCT_AAPT_CONFIG := normal large xlarge hdpi
-PRODUCT_AAPT_PREF_CONFIG := xlarge hdpi
+PRODUCT_AAPT_PREF_CONFIG := hdpi
DEVICE_PACKAGE_OVERLAYS += device/acer/t30-common/overlay
@@ -90,8 +90,19 @@ PRODUCT_COPY_FILES += \
# media config xml file
PRODUCT_COPY_FILES += \
+ frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
+ frameworks/av/media/libstagefright/data/media_codecs_ffmpeg.xml:system/etc/media_codecs_ffmpeg.xml \
device/acer/t30-common/prebuilt/etc/media_profiles.xml:system/etc/media_profiles.xml \
device/acer/t30-common/prebuilt/etc/media_codecs.xml:system/etc/media_codecs.xml
+# Wi-Fi
+PRODUCT_PACKAGES += \
+ dhcpcd.conf \
+ hostapd \
+ wpa_supplicant \
+ wpa_supplicant.conf
+
WIFI_BAND := 802_11_BG
$(call inherit-product-if-exists, hardware/broadcom/wlan/bcmdhd/firmware/bcm4330/device-bcm.mk)
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index f415b55..3edd6d5 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -198,6 +198,9 @@
<!-- Maximum number of supported users -->
<integer name="config_multiuserMaximumUsers">8</integer>
+ <!-- Whether Multiuser UI should be shown -->
+ <bool name="config_enableMultiUserUI">true</bool>
+
<!-- reference volume index for music stream to limit headphone volume and display warning -->
<integer name="config_safe_media_volume_index">6</integer>
@@ -213,9 +216,10 @@
8 - Assistant (search)
16 - App switch
32 - Camera
+ 64 - Volume rocker
For example, a device with Home, Back and Menu keys would set this
config to 7. -->
- <integer name="config_deviceHardwareKeys">0</integer>
+ <integer name="config_deviceHardwareKeys">64</integer>
<!-- Maximum wallpaper width for devices with very high-res screen (1920x1200)
the wallpaper width suggestion by the launcher may be too large for
@@ -227,4 +231,7 @@
<!-- SD card is hot-pluggable on this device -->
<bool name="config_batterySdCardAccessibility">true</bool>
+
+ <!-- TODO: There's a bug causing the ColorFade animation not to work with our GPU -->
+ <bool name="config_animateScreenLights">true</bool>
</resources>
diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml
index 906ed29..297c07b 100644
--- a/overlay/packages/apps/Settings/res/values/config.xml
+++ b/overlay/packages/apps/Settings/res/values/config.xml
@@ -17,7 +17,7 @@
<resources xmlns:xliff="urnasis:names:tc:xliff:document:1.2 ">
<!-- Show Expanded Desktop preference -->
- <bool name="config_show_expandedDesktop">true</bool>
+ <!-- <bool name="config_show_expandedDesktop">true</bool> -->
<!-- Whether the device support custom performance profiles. Leave empty when
the device do not support it. -->
@@ -26,4 +26,7 @@
<!-- When config_perf_profile_prop = true, then this value MUST be one of the
values listed in cm_arrays for perf_profile_values -->
<string name="config_perf_profile_default_entry" translatable="false">1</string>
+
+ <!-- Whether to show a preference item for mobile plan -->
+ <bool name="config_show_mobile_plan">false</bool>
</resources>
\ No newline at end of file
diff --git a/prebuilt/etc/media_codecs.xml b/prebuilt/etc/media_codecs.xml
index 91fd8ab..fc75450 100644
--- a/prebuilt/etc/media_codecs.xml
+++ b/prebuilt/etc/media_codecs.xml
@@ -76,60 +76,21 @@ Only the three quirks included above are recognized at this point:
-->
<MediaCodecs>
+ <Include href="media_codecs_google_audio.xml" />
+ <Include href="media_codecs_google_telephony.xml" />
<Decoders>
<MediaCodec name="OMX.Nvidia.mp4.decode" type="video/mp4v-es" />
<MediaCodec name="OMX.Nvidia.h263.decode" type="video/3gpp" />
<MediaCodec name="OMX.Nvidia.h264.decode" type="video/avc" />
<MediaCodec name="OMX.Nvidia.mpeg2v.decode" type="video/mpeg2" />
<MediaCodec name="OMX.Nvidia.mp2.decoder" type="audio/mpeg-L2" />
-
- <MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />
- <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
- <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
- <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
- <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
- <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
- <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
- <MediaCodec name="OMX.google.gsm.decoder" type="audio/gsm" />
-
- <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
- <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
- <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
- <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" />
- <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" />
-
- <!-- ffmpeg audio codecs -->
- <MediaCodec name="OMX.ffmpeg.ra.decoder" type="audio/vnd.rn-realaudio" />
- <MediaCodec name="OMX.ffmpeg.flac.decoder" type="audio/flac" />
- <MediaCodec name="OMX.ffmpeg.mp2.decoder" type="audio/mpeg-L2" />
- <MediaCodec name="OMX.ffmpeg.ac3.decoder" type="audio/ac3" />
- <MediaCodec name="OMX.ffmpeg.ape.decoder" type="audio/x-ape" />
- <MediaCodec name="OMX.ffmpeg.dts.decoder" type="audio/vnd.dts" />
- <MediaCodec name="OMX.ffmpeg.atrial.decoder" type="audio/ffmpeg" />
-
- <!-- ffmpeg video codecs -->
- <MediaCodec name="OMX.ffmpeg.mpeg2v.decoder" type="video/mpeg2" />
- <MediaCodec name="OMX.ffmpeg.h263.decoder" type="video/3gpp" />
- <MediaCodec name="OMX.ffmpeg.mpeg4.decoder" type="video/mp4v-es" />
- <MediaCodec name="OMX.ffmpeg.wmv.decoder" type="video/x-ms-wmv" />
- <MediaCodec name="OMX.ffmpeg.rv.decoder" type="video/vnd.rn-realvideo" />
- <MediaCodec name="OMX.ffmpeg.h264.decoder" type="video/avc" />
- <MediaCodec name="OMX.ffmpeg.vc1.decoder" type="video/vc1" />
- <MediaCodec name="OMX.ffmpeg.flv1.decoder" type="video/x-flv" />
- <MediaCodec name="OMX.ffmpeg.divx.decoder" type="video/divx" />
- <MediaCodec name="OMX.ffmpeg.hevc.decoder" type="video/hevc" />
- <MediaCodec name="OMX.ffmpeg.vtrial.decoder" type="video/ffmpeg" />
</Decoders>
<Encoders>
<MediaCodec name="OMX.Nvidia.mp4.encoder" type="video/mp4v-es" />
<MediaCodec name="OMX.Nvidia.h263.encoder" type="video/3gpp" />
<MediaCodec name="OMX.Nvidia.h264.encoder" type="video/avc" />
-
- <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
- <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
- <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
- <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />
- <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" />
</Encoders>
+ <Include href="media_codecs_google_video.xml" />
+ <Include href="media_codecs_ffmpeg.xml" />
</MediaCodecs>
diff --git a/prebuilt/ramdisk/fstab.acer b/prebuilt/ramdisk/fstab.acer
index 5bad0ba..2e84677 100644
--- a/prebuilt/ramdisk/fstab.acer
+++ b/prebuilt/ramdisk/fstab.acer
@@ -15,5 +15,7 @@
/dev/block/platform/sdhci-tegra.3/by-name/USP /staging emmc defaults defaults
# Vold
-/devices/platform/sdhci-tegra.0/mmc_host/mmc2 auto auto defaults voldmanaged=sdcard1:auto
+# noemulatedsd is supposed to be used to indicated that there's no emulatedsd
+# but we do have one and it's kind of abused here to mark the storage for app2sd
+/devices/platform/sdhci-tegra.0/mmc_host/mmc2 auto auto defaults voldmanaged=sdcard1:auto,noemulatedsd
/devices/platform/tegra-ehci auto auto defaults voldmanaged=usb0:auto
diff --git a/prebuilt/usr/keylayout/gpio-keys.kl b/prebuilt/usr/keylayout/gpio-keys.kl
index 378f460..1ee4999 100755
--- a/prebuilt/usr/keylayout/gpio-keys.kl
+++ b/prebuilt/usr/keylayout/gpio-keys.kl
@@ -1,7 +1,7 @@
-key 136 SEARCH WAKE_DROPPED
-key 139 MENU WAKE
-key 102 HOME WAKE
-key 158 BACK WAKE_DROPPED
-key 116 POWER WAKE
-key 115 VOLUME_UP WAKE_DROPPED
-key 114 VOLUME_DOWN WAKE_DROPPED
+key 136 SEARCH
+key 139 MENU
+key 102 HOME
+key 158 BACK
+key 116 POWER
+key 115 VOLUME_UP
+key 114 VOLUME_DOWN
diff --git a/releasetools.py b/releasetools.py
index 12bbef3..8093eb1 100644
--- a/releasetools.py
+++ b/releasetools.py
@@ -15,10 +15,13 @@
import common
+# TODO: update for lollipop
GSM_FILES = (
- "/system/app/CellBroadcastReceiver.apk",
- "/system/app/Stk.apk",
- "/system/app/WhisperPush.apk",
+ "/system/priv-app/CellBroadcastReceiver",
+ "/system/priv-app/Mms",
+ "/system/priv-app/MmsService",
+ "/system/app/Stk",
+ "/system/app/WhisperPush", # TOOD: Check
"/system/bin/rild",
"/system/etc/acer_ril.db",
"/system/etc/apns-conf.xml",
@@ -28,12 +31,18 @@ GSM_FILES = (
"/system/etc/spn-conf.xml",
"/system/lib/libcurve25519.so",
"/system/lib/libhuawei-ril.so",
- "/system/priv-app/Mms.apk",
)
def FullOTA_InstallEnd(info):
# Remove GSM-specific files on wifi-only device
info.script.AppendExtra("if getprop(\"ro.boot.carrier\") == \"wifi-only\" then")
info.script.Print("Removing GSM-specific files...")
- info.script.DeleteFiles(GSM_FILES);
+ # TODO: We need to mount /system first
+ DeleteFilesRecursive(info, GSM_FILES);
info.script.AppendExtra("endif;")
+
+def DeleteFilesRecursive(info, file_list):
+ """Delete all files in file_list."""
+ if not file_list: return
+ cmd = "delete_recursive(" + ",\0".join(['"%s"' % (i,) for i in file_list]) + ");"
+ info.script.AppendExtra(info.script._WordWrap(cmd))
diff --git a/sepolicy/app.te b/sepolicy/app.te
index 9e0cd43..9d9b5b6 100644
--- a/sepolicy/app.te
+++ b/sepolicy/app.te
@@ -1,2 +1 @@
allow appdomain sysfs_devices_system_cpu:dir r_dir_perms;
-allow appdomain { nvhost_writable_device }:chr_file rw_file_perms;
diff --git a/sepolicy/bootanim.te b/sepolicy/bootanim.te
new file mode 100644
index 0000000..6097a7a
--- /dev/null
+++ b/sepolicy/bootanim.te
@@ -0,0 +1 @@
+allow bootanim self:process execmem;
diff --git a/sepolicy/device.te b/sepolicy/device.te
index b6a1b82..c9bea44 100644
--- a/sepolicy/device.te
+++ b/sepolicy/device.te
@@ -1,3 +1,2 @@
type knv_device, dev_type;
type nvhost_device, dev_type;
-type nvhost_writable_device, dev_type, mlstrustedobject;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 1c5bfe2..1040057 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -1,15 +1,16 @@
-/dev/accelirq u:object_r:accelerometer_device:s0
+/dev/accelirq u:object_r:sensors_device:s0
/dev/audience_a1026 u:object_r:audio_device:s0
/dev/knvmap u:object_r:knv_device:s0
-/dev/tegra-throughput u:object_r:nv_device:s0
+/dev/tegra-throughput u:object_r:gpu_device:s0
/dev/ov.* u:object_r:camera_device:s0
/dev/tegra_camera u:object_r:camera_device:s0
/dev/video0 u:object_r:camera_device:s0
/dev/video1 u:object_r:camera_device:s0
/dev/nvhost.* u:object_r:nvhost_device:s0
-/dev/nvhost-ctrl u:object_r:nvhost_writable_device:s0
-/dev/nvhost-gr2d u:object_r:nvhost_writable_device:s0
-/dev/nvhost-gr3d u:object_r:nvhost_writable_device:s0
+/dev/nvhost-ctrl u:object_r:gpu_device:s0
+/dev/nvhost-gr2d u:object_r:gpu_device:s0
+/dev/nvhost-gr3d u:object_r:gpu_device:s0
+/dev/nvmap u:object_r:gpu_device:s0
/dev/ttyHS1 u:object_r:gps_device:s0
/dev/ttyHS2 u:object_r:hci_attach_dev:s0
/dev/ttyHS3 u:object_r:video_device:s0
diff --git a/sepolicy/lmkd.te b/sepolicy/lmkd.te
new file mode 100644
index 0000000..cddec31
--- /dev/null
+++ b/sepolicy/lmkd.te
@@ -0,0 +1,3 @@
+# Kernel bug for Linux < 3.3: sysfs inodes can lose their security context
+# and revert to the base sysfs type.
+allow lmkd sysfs:file write;
diff --git a/sepolicy/mediaserver.te b/sepolicy/mediaserver.te
index 91484bb..0a1fefc 100644
--- a/sepolicy/mediaserver.te
+++ b/sepolicy/mediaserver.te
@@ -1 +1 @@
-allow mediaserver { nvhost_writable_device nvhost_device }:chr_file rw_file_perms;
+allow mediaserver { gpu_device nvhost_device }:chr_file rw_file_perms;
diff --git a/sepolicy/rild.te b/sepolicy/rild.te
new file mode 100644
index 0000000..49db1db
--- /dev/null
+++ b/sepolicy/rild.te
@@ -0,0 +1,5 @@
+allow rild self:process execmem;
+
+# Kernel bug for Linux < 3.3: sysfs inodes can lose their security context
+# and revert to the base sysfs type.
+allow rild sysfs:file write;
diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te
index de3d2c1..ffc1eab 100644
--- a/sepolicy/surfaceflinger.te
+++ b/sepolicy/surfaceflinger.te
@@ -1,3 +1,11 @@
-allow surfaceflinger { knv_device nvhost_writable_device tee_device }:chr_file rw_file_perms;
-allow surfaceflinger { sysfs_devices_system_cpu sysfs_devices_tegradc }:file w_file_perms;
+allow surfaceflinger { knv_device }:chr_file rw_file_perms;
+allow surfaceflinger { sysfs_devices_system_cpu sysfs_devices_tegradc }:file rw_file_perms;
+allow surfaceflinger sysfs_devices_tegradc:dir r_dir_perms;
+allow surfaceflinger sysfs_devices_tegradc:lnk_file { open getattr read };
allow surfaceflinger sysfs_devices_system_cpu:dir w_dir_perms;
+
+# Kernel bug for Linux < 3.3: sysfs inodes can lose their security context
+# and revert to the base sysfs type.
+allow surfaceflinger sysfs:file write;
+
+allow surfaceflinger self:process execmem;
diff --git a/sepolicy/system.te b/sepolicy/system.te
deleted file mode 100644
index c5c025d..0000000
--- a/sepolicy/system.te
+++ /dev/null
@@ -1,3 +0,0 @@
-allow { system system_app } { knv_device nvhost_writable_device }:chr_file rw_file_perms;
-allow system sysfs_devices_system_cpu:file w_file_perms;
-allow system sysfs_devices_system_cpu:dir r_dir_perms;
diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te
new file mode 100644
index 0000000..5d72dcb
--- /dev/null
+++ b/sepolicy/system_app.te
@@ -0,0 +1 @@
+allow system_app knv_device:chr_file rw_file_perms;
diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te
new file mode 100644
index 0000000..2f336b4
--- /dev/null
+++ b/sepolicy/system_server.te
@@ -0,0 +1,5 @@
+allow system_server { knv_device }:chr_file rw_file_perms;
+
+# Access .gps.interface.pipe.to_gpsd.
+allow system_server gps_data_file:dir search;
+allow system_server gps_data_file:fifo_file { setattr rw_file_perms };
diff --git a/sepolicy/ueventd.te b/sepolicy/ueventd.te
new file mode 100644
index 0000000..ab3cf70
--- /dev/null
+++ b/sepolicy/ueventd.te
@@ -0,0 +1,2 @@
+allow ueventd sysfs_devices_tegradc:dir r_dir_perms;
+allow ueventd sysfs_devices_tegradc:file rw_file_perms;
diff --git a/sepolicy/zygote.te b/sepolicy/zygote.te
deleted file mode 100644
index 07389ff..0000000
--- a/sepolicy/zygote.te
+++ /dev/null
@@ -1 +0,0 @@
-allow zygote sysfs_devices_system_cpu:dir r_dir_perms;
--
1.9.3 (Apple Git-50)
From 74ac74a003e534b83a00d7804b83b8c2293fc32e Mon Sep 17 00:00:00 2001
From: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Mon, 4 Nov 2013 02:36:01 +0000
Subject: [PATCH 1/2] framework: Allow specifying max wallpaper width
For some devices with very high-res screen (1920x1200), the wallpaper
width suggested by the launcher may be too large for the GPU and so
we need to limit it. (2048 for the above mentioned screen)
We don't need to limit the height since that's the height of the
screen.
Change-Id: I5b25bd931db0b2610e260921f28b92d8b0966aa6
---
core/res/res/values/config.xml | 5 +++++
core/res/res/values/symbols.xml | 1 +
.../java/com/android/server/wallpaper/WallpaperManagerService.java | 6 ++++++
3 files changed, 12 insertions(+)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 53b2f95..bfe3b74 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2096,6 +2096,11 @@
<!-- Boolean to enable stk functionality on Samsung phones -->
<bool name="config_samsung_stk">false</bool>
+ <!-- Maximum wallpaper width for devices with very high-res screen (1920x1200)
+ the wallpaper width suggestion by the launcher may be too large for
+ the GPU to handle. -->
+ <integer name="config_wallpaperMaxWidth">-1</integer>
+
<!-- Defines the system property to set for performance profile xe: sys.cpu.modes. Leave it
blank if the device do not support performance profiles -->
<string name="config_perf_profile_prop" translatable="false"></string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index d8307ec..0044edd 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2218,6 +2218,7 @@
<java-symbol type="integer" name="config_backKillTimeout" />
<java-symbol type="bool" name="config_show_cmIMESwitcher"/>
<java-symbol type="bool" name="config_samsung_stk" />
+ <java-symbol type="integer" name="config_wallpaperMaxWidth" />
<!-- Notification and battery light -->
<java-symbol type="bool" name="config_intrusiveNotificationLed" />
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index f3fffa8..2bd1951 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -789,6 +789,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
width = Math.max(width, displaySize.x);
height = Math.max(height, displaySize.y);
+ int maxWidth = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_wallpaperMaxWidth);
+ if (maxWidth != -1 && width > maxWidth) {
+ width = maxWidth;
+ }
+
if (width != wallpaper.width || height != wallpaper.height) {
wallpaper.width = width;
wallpaper.height = height;
--
1.9.3 (Apple Git-50)
From 0f5c5a0dd6b51fc6008707c3e703686e850c8258 Mon Sep 17 00:00:00 2001
From: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Mon, 4 Nov 2013 02:48:55 +0000
Subject: [PATCH 2/2] Add support for HW Rotation Lock
Forward ported from jellybean
[pawitp: forward ported to Lollipop]
Change-Id: I75fb9fa33541eb6acedd62a67e74977b36768390
---
.../com/android/internal/view/RotationPolicy.java | 4 +-
core/res/res/values/config.xml | 3 +
core/res/res/values/strings.xml | 4 +
core/res/res/values/symbols.xml | 5 +
.../com/android/server/RotationSwitchObserver.java | 163 +++++++++++++++++++++
services/java/com/android/server/SystemServer.java | 20 +++
6 files changed, 198 insertions(+), 1 deletion(-)
create mode 100644 services/core/java/com/android/server/RotationSwitchObserver.java
diff --git a/core/java/com/android/internal/view/RotationPolicy.java b/core/java/com/android/internal/view/RotationPolicy.java
index b479cb1..084f853 100644
--- a/core/java/com/android/internal/view/RotationPolicy.java
+++ b/core/java/com/android/internal/view/RotationPolicy.java
@@ -93,7 +93,9 @@ public final class RotationPolicy {
return isRotationSupported(context) &&
Settings.System.getIntForUser(context.getContentResolver(),
Settings.System.HIDE_ROTATION_LOCK_TOGGLE_FOR_ACCESSIBILITY, 0,
- UserHandle.USER_CURRENT) == 0;
+ UserHandle.USER_CURRENT) == 0 &&
+ !context.getResources().getBoolean(com.android
+ .internal.R.bool.config_hasRotationLockSwitch);
}
/**
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index bfe3b74..804e4d3 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2117,4 +2117,7 @@
<string-array name="config_auto_perf_activities" translatable="false">
</string-array>
+ <!-- Device has a h/w rotation lock switch -->
+ <bool name="config_hasRotationLockSwitch">false</bool>
+
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 1faa51a..211b3df 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4889,4 +4889,8 @@
<!-- Zen mode condition: no exit criteria. [CHAR LIMIT=NONE] -->
<string name="zen_mode_forever">Indefinitely</string>
+
+ <!-- Hardware Rotation lock string -->
+ <string name="toast_rotation_unlocked">Display rotation unlocked</string>
+ <string name="toast_rotation_locked">Display rotation locked</string>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 0044edd..8d52a9b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2253,4 +2253,9 @@
<!-- Array of default activities with custom power management -->
<java-symbol type="array" name="config_auto_perf_activities" />
+
+ <!-- HW rotation lock -->
+ <java-symbol type="bool" name="config_hasRotationLockSwitch" />
+ <java-symbol type="string" name="toast_rotation_unlocked" />
+ <java-symbol type="string" name="toast_rotation_locked" />
</resources>
diff --git a/services/core/java/com/android/server/RotationSwitchObserver.java b/services/core/java/com/android/server/RotationSwitchObserver.java
new file mode 100644
index 0000000..a191433
--- /dev/null
+++ b/services/core/java/com/android/server/RotationSwitchObserver.java
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ *
+ */
+
+package com.android.server;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Message;
+import android.os.SystemClock;
+import android.os.UEventObserver;
+import android.provider.Settings;
+import android.util.Log;
+import android.util.Slog;
+
+import android.widget.Toast;
+import android.view.IWindowManager;
+import android.os.ServiceManager;
+import android.os.RemoteException;
+import android.os.AsyncTask;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+/**
+ * <p>RotationLockObserver monitors for rotation lock switch state
+ */
+class RotationSwitchObserver extends UEventObserver {
+ private static final String TAG = RotationSwitchObserver.class
+ .getSimpleName();
+ private static final boolean LOG = true;
+
+ private static final String LOCK_UEVENT_MATCH =
+ "DEVPATH=/devices/virtual/switch/rotationlock";
+ private static final String LOCK_STATE_PATH =
+ "/sys/class/switch/rotationlock/state";
+
+ private static final int MSG_LOCK_STATE = 0;
+
+ private int mLockState;
+ private int mPreviousLockState;
+
+ private boolean mSystemReady;
+
+ private final Context mContext;
+
+ private boolean mAutoRotation;
+
+ public RotationSwitchObserver(Context context) {
+ mContext = context;
+ init(); // set initial status
+
+ startObserving(LOCK_UEVENT_MATCH);
+ }
+
+ @Override
+ public void onUEvent(UEventObserver.UEvent event) {
+ if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ Slog.v(TAG, "Switch UEVENT: " + event.toString());
+ }
+
+ synchronized (this) {
+ try {
+ int newState = Integer.parseInt(event.get("SWITCH_STATE"));
+ if (newState != mLockState) {
+ mPreviousLockState = mLockState;
+ mLockState = newState;
+ if (mSystemReady) {
+ update();
+ }
+ }
+ } catch (NumberFormatException e) {
+ Slog.e(TAG, "Could not parse switch state from event "
+ + event);
+ }
+ }
+ }
+
+ private final void init() {
+ char[] buffer = new char[1024];
+
+ try {
+ FileReader file = new FileReader(LOCK_STATE_PATH);
+ int len = file.read(buffer, 0, 1024);
+ file.close();
+ mPreviousLockState = mLockState =
+ Integer.valueOf((new String(buffer, 0, len)).trim());
+ } catch (FileNotFoundException e) {
+ Slog.w(TAG, "This kernel does not have rotation switch support");
+ } catch (NumberFormatException e) {
+ Slog.e(TAG, "" , e);
+ } catch (IOException e) {
+ Slog.e(TAG, "" , e);
+ }
+ }
+
+ void systemReady() {
+ synchronized (this) {
+ mSystemReady = true;
+ }
+ }
+
+ private final void update() {
+ mHandler.sendEmptyMessage(MSG_LOCK_STATE);
+ }
+
+ private final Handler mHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_LOCK_STATE:
+ synchronized (this) {
+ boolean autoRotate = mLockState == 0;
+ int toastId = autoRotate
+ ? com.android.internal.R.string.toast_rotation_unlocked
+ : com.android.internal.R.string.toast_rotation_locked;
+
+ setAutoRotation(autoRotate);
+
+ Toast.makeText(mContext, mContext.getString(toastId),
+ Toast.LENGTH_SHORT).show();
+ break;
+ }
+ }
+ }
+ };
+
+ private void setAutoRotation(final boolean autorotate) {
+ mAutoRotation = autorotate;
+ AsyncTask.execute(new Runnable() {
+ public void run() {
+ try {
+ IWindowManager wm = IWindowManager.Stub.asInterface(
+ ServiceManager
+ .getService(Context.WINDOW_SERVICE));
+ if (autorotate) {
+ wm.thawRotation();
+ } else {
+ wm.freezeRotation(-1);
+ }
+ } catch (RemoteException exc) {
+ Log.w(TAG, "Unable to save auto-rotate setting");
+ }
+ }
+ });
+ }
+}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 2ca2f75..24362bf 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -423,6 +423,7 @@ public final class SystemServer {
NsdService serviceDiscovery= null;
WindowManagerService wm = null;
BluetoothManagerService bluetooth = null;
+ RotationSwitchObserver rotateSwitch = null;
UsbService usb = null;
SerialService serial = null;
NetworkTimeUpdateService networkTimeUpdater = null;
@@ -534,6 +535,9 @@ public final class SystemServer {
Slog.e("System", "************ Failure starting core service", e);
}
+ boolean hasRotationLock = context.getResources().getBoolean(com.android
+ .internal.R.bool.config_hasRotationLockSwitch);
+
StatusBarManagerService statusBar = null;
INotificationManager notification = null;
InputMethodManagerService imm = null;
@@ -853,6 +857,16 @@ public final class SystemServer {
}
}
+ try {
+ if (hasRotationLock) {
+ Slog.i(TAG, "Rotation Switch Observer");
+ // Listen for switch changes
+ rotateSwitch = new RotationSwitchObserver(context);
+ }
+ } catch (Throwable e) {
+ reportWtf("starting RotationSwitchObserver", e);
+ }
+
if (!disableNonCoreServices) {
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST)
|| mPackageManager.hasSystemFeature(
@@ -1146,6 +1160,7 @@ public final class SystemServer {
final NetworkPolicyManagerService networkPolicyF = networkPolicy;
final ConnectivityService connectivityF = connectivity;
final NetworkScoreService networkScoreF = networkScore;
+ final RotationSwitchObserver rotateSwitchF = rotateSwitch;
final WallpaperManagerService wallpaperF = wallpaper;
final InputMethodManagerService immF = imm;
final LocationManagerService locationF = location;
@@ -1222,6 +1237,11 @@ public final class SystemServer {
} catch (Throwable e) {
reportWtf("Notifying AudioService running", e);
}
+ try {
+ if (rotateSwitchF != null) rotateSwitchF.systemReady();
+ } catch (Throwable e) {
+ reportWtf("making Rotation Switch Service ready", e);
+ }
Watchdog.getInstance().start();
// It is now okay to let the various system services start their
--
1.9.3 (Apple Git-50)
From 0380d0ab1ee841fe045308b66ea0e8a784dada92 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 10 Jan 2015 19:17:56 +0700
Subject: [PATCH 1/2] SurfaceFlingerClient: add legacy symbols
- Guarded by ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
- Required by libnvwinsys.so on Acer A700
- Includes previous work by Ricardo Cerqueira
Change-Id: I28a6fdd0a597f6943361a9ab9689c6974b199125
---
include/gui/SurfaceComposerClient.h | 8 ++++++
libs/gui/SurfaceComposerClient.cpp | 52 +++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 0d19f07..928c842 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -77,6 +77,10 @@ public:
static status_t getDisplayInfo(const sp<IBinder>& display,
DisplayInfo* info);
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+ static status_t getDisplayInfo(int32_t displayId, DisplayInfo* info);
+#endif
+
// Get the index of the current active configuration (relative to the list
// returned by getDisplayInfo)
static int getActiveConfig(const sp<IBinder>& display);
@@ -123,6 +127,10 @@ public:
//! Close a composer transaction on all active SurfaceComposerClients.
static void closeGlobalTransaction(bool synchronous = false);
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+ static int setOrientation(int32_t dpy, int orientation, uint32_t flags);
+#endif
+
//! Flag the currently open transaction as an animation transaction.
static void setAnimationTransaction();
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 6ec4f23..8990cb7 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -430,6 +430,17 @@ void Composer::setDisplayProjection(const sp<IBinder>& token,
mForceSynchronous = true; // TODO: do we actually still need this?
}
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+status_t Composer::setOrientation(int orientation) {
+ sp<ISurfaceComposer> sm(ComposerService::getComposerService());
+ sp<IBinder> token(sm->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
+ DisplayState& s(getDisplayStateLocked(token));
+ s.orientation = orientation;
+ mForceSynchronous = true; // TODO: do we actually still need this?
+ return NO_ERROR;
+}
+#endif
+
void Composer::setDisplaySize(const sp<IBinder>& token, uint32_t width, uint32_t height) {
Mutex::Autolock _l(mLock);
DisplayState& s(getDisplayStateLocked(token));
@@ -486,6 +497,32 @@ void SurfaceComposerClient::dispose() {
mStatus = NO_INIT;
}
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+/* Create ICS/MR0-compatible constructors */
+extern "C" sp<SurfaceControl> _ZN7android21SurfaceComposerClient13createSurfaceERKNS_7String8Ejjij(
+ const String8& name,
+ uint32_t w,
+ uint32_t h,
+ PixelFormat format,
+ uint32_t flags);
+extern "C" sp<SurfaceControl> _ZN7android21SurfaceComposerClient13createSurfaceEijjij(
+ uint32_t display,
+ uint32_t w,
+ uint32_t h,
+ PixelFormat format,
+ uint32_t flags)
+{
+ String8 name;
+ const size_t SIZE = 128;
+ char buffer[SIZE];
+ snprintf(buffer, SIZE, "<pid_%d>", getpid());
+ name.append(buffer);
+
+ return _ZN7android21SurfaceComposerClient13createSurfaceERKNS_7String8Ejjij(name,
+ w, h, format, flags);
+}
+#endif
+
sp<SurfaceControl> SurfaceComposerClient::createSurface(
const String8& name,
uint32_t w,
@@ -613,6 +650,13 @@ status_t SurfaceComposerClient::setMatrix(const sp<IBinder>& id, float dsdx, flo
return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);
}
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+status_t SurfaceComposerClient::setOrientation(int32_t dpy, int orientation, uint32_t flags)
+{
+ return Composer::getInstance().setOrientation(orientation);
+}
+#endif
+
// ----------------------------------------------------------------------------
void SurfaceComposerClient::setDisplaySurface(const sp<IBinder>& token,
@@ -664,6 +708,14 @@ status_t SurfaceComposerClient::getDisplayInfo(const sp<IBinder>& display,
return NO_ERROR;
}
+#ifdef ADD_LEGACY_SURFACE_COMPOSER_CLIENT_SYMBOLS
+status_t SurfaceComposerClient::getDisplayInfo(
+ int32_t displayId, DisplayInfo* info)
+{
+ return getDisplayInfo(getBuiltInDisplay(displayId), info);
+}
+#endif
+
int SurfaceComposerClient::getActiveConfig(const sp<IBinder>& display) {
return ComposerService::getComposerService()->getActiveConfig(display);
}
--
1.9.3 (Apple Git-50)
From c3d504be99990a86f4de148c9fcddebfa4326d3b Mon Sep 17 00:00:00 2001
From: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date: Wed, 7 Aug 2013 00:08:44 +0100
Subject: [PATCH 2/2] hax: Add back the SURFACE_SKIP_FIRST_DEQUEUE legacy EGL
workaround
Set BOARD_EGL_SKIP_FIRST_DEQUEUE to use
Change-Id: I46257a7e9e6b6e093a5cb92eaaaef4bdd0435a12
---
include/gui/Surface.h | 4 ++++
libs/gui/Android.mk | 4 ++++
libs/gui/Surface.cpp | 23 ++++++++++++++++++-----
3 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/include/gui/Surface.h b/include/gui/Surface.h
index 9d21c49..911bf9e 100644
--- a/include/gui/Surface.h
+++ b/include/gui/Surface.h
@@ -310,6 +310,10 @@ private:
// must be accessed from lock/unlock thread only
Region mDirtyRegion;
+
+#ifdef SURFACE_SKIP_FIRST_DEQUEUE
+ bool mDequeuedOnce;
+#endif
};
}; // namespace android
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index b3a3c71..53dd0b3 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -55,6 +55,10 @@ ifeq ($(BOARD_USE_MHEAP_SCREENSHOT),true)
LOCAL_CFLAGS += -DUSE_MHEAP_SCREENSHOT
endif
+ifeq ($(BOARD_EGL_SKIP_FIRST_DEQUEUE),true)
+ LOCAL_CFLAGS += -DSURFACE_SKIP_FIRST_DEQUEUE
+endif
+
LOCAL_MODULE:= libgui
ifeq ($(TARGET_BOARD_PLATFORM), tegra)
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 2a0f2cf..4b9bb0d 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -87,6 +87,9 @@ Surface::Surface(
mConnectedToCpu = false;
mProducerControlledByApp = controlledByApp;
mSwapIntervalZero = false;
+#ifdef SURFACE_SKIP_FIRST_DEQUEUE
+ mDequeuedOnce = false;
+#endif
}
Surface::~Surface() {
@@ -276,6 +279,9 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer, int* fenceFd) {
}
*buffer = gbuf.get();
+#ifdef SURFACE_SKIP_FIRST_DEQUEUE
+ if (!mDequeuedOnce) mDequeuedOnce = true;
+#endif
return OK;
}
@@ -387,12 +393,19 @@ int Surface::query(int what, int* value) const {
}
break;
case NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER: {
- sp<ISurfaceComposer> composer(
- ComposerService::getComposerService());
- if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
- *value = 1;
- } else {
+#ifdef SURFACE_SKIP_FIRST_DEQUEUE
+ if (!mDequeuedOnce) {
*value = 0;
+ } else
+#endif
+ {
+ sp<ISurfaceComposer> composer(
+ ComposerService::getComposerService());
+ if (composer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
+ *value = 1;
+ } else {
+ *value = 0;
+ }
}
return NO_ERROR;
}
--
1.9.3 (Apple Git-50)
The kernel has been updated and pushed to branch cm-12.0 of https://github.com/CyanogenMod/android_kernel_acer_t30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment