Skip to content

Instantly share code, notes, and snippets.

@pawitp
Last active February 22, 2016 01:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawitp/88a1d4514a0734c866c7 to your computer and use it in GitHub Desktop.
Save pawitp/88a1d4514a0734c866c7 to your computer and use it in GitHub Desktop.
Compatibility patches for I9082 on cm-12.1
From be936303368c68a2c6e096c0c56288fdba13779a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 27 Jan 2015 22:29:39 +0700
Subject: [PATCH] recovery: uncrypt: fix compatibility with CWM
CWM and other older recoveries do not support block map, so avoid
using it when possible
Change-Id: I49a04676ca5193db31c87418a5760727648745f0
---
uncrypt/uncrypt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/uncrypt/uncrypt.c b/uncrypt/uncrypt.c
index 7fb0989..6bc4f51 100644
--- a/uncrypt/uncrypt.c
+++ b/uncrypt/uncrypt.c
@@ -423,7 +423,10 @@ int main(int argc, char** argv)
// On /data we want to convert the file to a block map so that we
// can read the package without mounting the partition. On /cache
// and /sdcard we leave the file alone.
- if (strncmp(path, "/data/", 6) != 0) {
+ //
+ // HACK: ignore above: block map is only used with encryption device
+ // for compatibility with older recoveries
+ if (!encrypted || strncmp(path, "/data/", 6) != 0) {
// path does not start with "/data/"; leave it alone.
unlink(RECOVERY_COMMAND_FILE_TMP);
} else {
--
2.3.5
From 0365cf5760585f88bc093a86b176775683765475 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 28 Nov 2014 21:16:21 +0700
Subject: [PATCH 1/4] ota: custom support for i9082 xda release
Change-Id: Ib036f4291a0d8b6a636aa6bc43beaddce0f34152
---
envsetup.sh | 2 +-
tools/buildinfo.sh | 2 ++
tools/releasetools/edify_generator.py | 13 +++++++++++++
tools/releasetools/ota_from_target_files | 29 +++++++++++++++++++++++------
4 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/envsetup.sh b/envsetup.sh
index d37d3c7..0dcdec0 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -78,7 +78,7 @@ function check_product()
if (echo -n $1 | grep -q -e "^cm_") ; then
CM_BUILD=$(echo -n $1 | sed -e 's/^cm_//g')
- export BUILD_NUMBER=$((date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10)
+ export BUILD_NUMBER=`whoami`.i9082.cm-12-1.`date -u +%Y%m%d`
else
CM_BUILD=
fi
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index a549607..1eb94cc 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -61,4 +61,6 @@ echo "ro.build.characteristics=$TARGET_AAPT_CHARACTERISTICS"
echo "ro.cm.device=$CM_DEVICE"
+echo "cm.updater.uri=https://pawitp-update.appspot.com/api"
+
echo "# end build properties"
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 80cf7ce..9d31059 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -93,6 +93,19 @@ class EdifyGenerator(object):
) % (" or ".join(fp),)
self.script.append(cmd)
+ def AssertSomeDisplayId(self, *fp):
+ """Assert that the current system display id is one of *fp."""
+ if not fp:
+ raise ValueError("must specify some display ids")
+ cmd = (
+ ' ||\n '.join([('file_getprop("/system/build.prop", '
+ '"ro.build.display.id") == "%s"')
+ % i for i in fp]) +
+ ' ||\n abort("Package expects display id of %s; this '
+ 'device has " + getprop("ro.build.display.id") + ".");'
+ ) % (" or ".join(fp),)
+ self.script.append(cmd)
+
def AssertSomeThumbprint(self, *fp):
"""Assert that the current recovery build thumbprint is one of *fp."""
if not fp:
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 011fe53..4e19a17 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -130,6 +130,17 @@ OPTIONS.incremental_source = None
OPTIONS.verify = False
OPTIONS.require_verbatim = set()
OPTIONS.prohibit_verbatim = set(("system/build.prop",))
+# May have been deleted by gapps
+# Also, otasigcheck is deleted by install script, so don't bother
+OPTIONS.skip_error = set(("system/app/Provision/Provision.apk",\
+"system/app/Provision/arm/Provision.odex",\
+"system/app/QuickSearchBox/QuickSearchBox.apk",\
+"system/app/QuickSearchBox/arm/QuickSearchBox.odex",\
+"system/lib/libwebrtc_audio_preprocessing.so",\
+"system/lib/librs_jni.so",\
+"system/lib/libjni_latinime.so",\
+"system/xbin/su",\
+"system/bin/otasigcheck.sh"))
OPTIONS.patch_threshold = 0.95
OPTIONS.wipe_user_data = False
OPTIONS.omit_prereq = False
@@ -1088,6 +1099,8 @@ class FileDifference:
def EmitVerification(self, script):
so_far = 0
for tf, sf, size, patch_sha in self.patch_list:
+ if tf.name in OPTIONS.skip_error:
+ continue
if tf.name != sf.name:
script.SkipNextActionIfTargetExists("/"+tf.name, tf.sha1)
script.PatchCheck("/"+sf.name, tf.sha1, sf.sha1)
@@ -1205,16 +1218,20 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
target_fp = CalculateFingerprint(oem_props, oem_dict, OPTIONS.target_info_dict)
source_fp = CalculateFingerprint(oem_props, oem_dict, OPTIONS.source_info_dict)
- if oem_props is None:
- script.AssertSomeFingerprint(source_fp, target_fp)
- else:
- script.AssertSomeThumbprint(
- GetBuildProp("ro.build.thumbprint", OPTIONS.target_info_dict),
- GetBuildProp("ro.build.thumbprint", OPTIONS.source_info_dict))
+ # if oem_props is None:
+ # script.AssertSomeFingerprint(source_fp, target_fp)
+ # else:
+ # script.AssertSomeThumbprint(
+ # GetBuildProp("ro.build.thumbprint", OPTIONS.target_info_dict),
+ # GetBuildProp("ro.build.thumbprint", OPTIONS.source_info_dict))
metadata["pre-build"] = source_fp
metadata["post-build"] = target_fp
+ source_di = GetBuildProp("ro.build.display.id", OPTIONS.source_info_dict)
+ target_di = GetBuildProp("ro.build.display.id", OPTIONS.target_info_dict)
+ script.AssertSomeDisplayId(source_di, target_di)
+
source_boot = common.GetBootableImage(
"/tmp/boot.img", "boot.img", OPTIONS.source_tmp, "BOOT",
OPTIONS.source_info_dict)
--
2.5.4 (Apple Git-61)
From 6ef4a9fda647f4f5706977bd940a7012a043058b Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 16 Dec 2014 19:19:52 +0700
Subject: [PATCH 2/4] build: minigzip dependency for kernel
i9082 uses minigzip
Change-Id: I8c07a76eec568bce641b158d01ef8cd88b9997d4
---
core/tasks/kernel.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/tasks/kernel.mk b/core/tasks/kernel.mk
index 4283dbb..91714da 100644
--- a/core/tasks/kernel.mk
+++ b/core/tasks/kernel.mk
@@ -252,7 +252,7 @@ $(KERNEL_CONFIG): $(KERNEL_OUT_STAMP) $(KERNEL_DEFCONFIG_SRC) $(KERNEL_ADDITIONA
$(KERNEL_SRC)/scripts/kconfig/merge_config.sh -m -O $(KERNEL_OUT) $(KERNEL_OUT)/.config $(KERNEL_SRC)/arch/$(KERNEL_ARCH)/configs/$(KERNEL_ADDITIONAL_CONFIG); \
$(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) KCONFIG_ALLCONFIG=$(KERNEL_OUT)/.config alldefconfig; fi
-TARGET_KERNEL_BINARIES: $(KERNEL_OUT_STAMP) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL_STAMP)
+TARGET_KERNEL_BINARIES: $(KERNEL_OUT_STAMP) $(KERNEL_CONFIG) $(KERNEL_HEADERS_INSTALL_STAMP) $(MINIGZIP)
@echo -e ${CL_GRN}"Building Kernel"${CL_RST}
$(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(TARGET_PREBUILT_INT_KERNEL_TYPE)
$(hide) if grep -q 'CONFIG_OF=y' $(KERNEL_CONFIG) ; \
--
2.5.4 (Apple Git-61)
From 1a1d6a73c200ceefc13de74351ae30a7c0116ba0 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 20 Jun 2015 09:52:59 +0700
Subject: [PATCH 3/4] ota: make delta compatible with
HDPI_miniGAPPS-5.1.1-20150605-signed
Change-Id: Icffcd5bfe338e4babc672ec534b79cf4797f47af
---
tools/releasetools/ota_from_target_files | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 4e19a17..6bf9af5 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -136,6 +136,8 @@ OPTIONS.skip_error = set(("system/app/Provision/Provision.apk",\
"system/app/Provision/arm/Provision.odex",\
"system/app/QuickSearchBox/QuickSearchBox.apk",\
"system/app/QuickSearchBox/arm/QuickSearchBox.odex",\
+"system/priv-app/BackupRestoreConfirmation/BackupRestoreConfirmation.apk",\
+"system/priv-app/BackupRestoreConfirmation/arm/BackupRestoreConfirmation.odex",\
"system/lib/libwebrtc_audio_preprocessing.so",\
"system/lib/librs_jni.so",\
"system/lib/libjni_latinime.so",\
--
2.5.4 (Apple Git-61)
From 1bd0bc68f339c96570115bb64cbbdf43d65b5933 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 15 Nov 2015 00:42:50 -0500
Subject: [PATCH 4/4] ota: make delta compatible with capps
Change-Id: Ic2ce75a539d93a4469fd8fbac8bfa20965d8c9f1
---
tools/releasetools/ota_from_target_files | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index 6bf9af5..ec3eb9d 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -130,7 +130,7 @@ OPTIONS.incremental_source = None
OPTIONS.verify = False
OPTIONS.require_verbatim = set()
OPTIONS.prohibit_verbatim = set(("system/build.prop",))
-# May have been deleted by gapps
+# May have been deleted by gapps and capps
# Also, otasigcheck is deleted by install script, so don't bother
OPTIONS.skip_error = set(("system/app/Provision/Provision.apk",\
"system/app/Provision/arm/Provision.odex",\
@@ -142,7 +142,15 @@ OPTIONS.skip_error = set(("system/app/Provision/Provision.apk",\
"system/lib/librs_jni.so",\
"system/lib/libjni_latinime.so",\
"system/xbin/su",\
-"system/bin/otasigcheck.sh"))
+"system/bin/otasigcheck.sh",\
+"system/priv-app/AudioFX/AudioFX.apk",\
+"system/priv-app/AudioFX/arm/AudioFX.odex",\
+"system/priv-app/Dialer/Dialer.apk",\
+"system/priv-app/Dialer/arm/Dialer.odex",\
+"system/app/InCallUI/InCallUI.apk",\
+"system/app/InCallUI/arm/InCallUI.odex",\
+"system/priv-app/ThemeChooser/ThemeChooser.apk",\
+"system/priv-app/ThemeChooser/arm/ThemeChooser.odex"))
OPTIONS.patch_threshold = 0.95
OPTIONS.wipe_user_data = False
OPTIONS.omit_prereq = False
--
2.5.4 (Apple Git-61)
From 289d290349a792f397346630e85653b656c5b7ac Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 24 Apr 2013 11:37:19 +0700
Subject: [PATCH 1/9] OMXCodec: Re-implement requires-flush-before-shutdown
quirk
Support is already there, but is not in the codec quirk reading list.
Re-implement it as required by Broadcom's OMX
Change-Id: I1beac06af8118dcf0c248b631bc8e6dbbab2c1d5
---
media/libstagefright/OMXCodec.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 4c1249f..afe4b5c 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -410,6 +410,9 @@ uint32_t OMXCodec::getComponentQuirks(
if (info->hasQuirk("output-buffers-are-unreadable")) {
quirks |= kOutputBuffersAreUnreadable;
}
+ if (info->hasQuirk("requires-flush-before-shutdown")) {
+ quirks |= kRequiresFlushBeforeShutdown;
+ }
if (info->hasQuirk("requies-loaded-to-idle-after-allocation")) {
quirks |= kRequiresLoadedToIdleAfterAllocation;
}
--
2.3.5
From 4008d970a6c60170c34f7d135bdb969bc52ed6ae Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 17 Dec 2013 13:15:52 +0700
Subject: [PATCH 2/9] OMXCodec: set default input buffer size
Broadcom OMX only set the buffer size to 65536 by default which
is not enough for higher bitrate video
(This patch has been adapted for Lollipop)
Change-Id: I74372f3d821e41feb38b9bc0cca4ef56aa019493
---
media/libstagefright/ACodec.cpp | 12 ++++++++++++
media/libstagefright/OMXCodec.cpp | 12 ++++++++++++
2 files changed, 24 insertions(+)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index f5a6fbd..b780128 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1913,6 +1913,18 @@ status_t ACodec::configureCodec(
} else if (!strcmp("OMX.Nvidia.aac.decoder", mComponentName.c_str())) {
err = setMinBufferSize(kPortIndexInput, 8192); // XXX
}
+// Capri's OMX fail to set a reasonable default size from width and height
+#ifdef CAPRI_HWC
+ else if (!strncmp(mComponentName.c_str(), "OMX.BRCM.vc4.decoder.", 21)) {
+ int32_t width;
+ int32_t height;
+ if (msg->findInt32("width", &width) && msg->findInt32("height", &height)) {
+ setMinBufferSize(kPortIndexInput, (width * height * 3) / 2);
+ } else {
+ ALOGE("Failed to set min buffer size");
+ }
+ }
+#endif
mBaseOutputFormat = outputFormat;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index afe4b5c..37e8ed6 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -957,6 +957,18 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
setMinBufferSize(kPortIndexInput, (OMX_U32)maxInputSize);
}
+// Capri's OMX fail to set a reasonable default size from width and height
+#ifdef CAPRI_HWC
+ else if (!strncmp(mComponentName, "OMX.BRCM.vc4.decoder.", 21)) {
+ int32_t width;
+ int32_t height;
+ if (meta->findInt32(kKeyWidth, &width) && meta->findInt32(kKeyHeight, &height)) {
+ setMinBufferSize(kPortIndexInput, (width * height * 3) / 2);
+ } else {
+ ALOGE("Failed to set min buffer size");
+ }
+ }
+#endif
initOutputFormat(meta);
--
2.3.5
From ac2e3e93fddb3fe67063dcf4d1c7fc4ee18636f1 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 19 Nov 2014 20:33:58 +0700
Subject: [PATCH 3/9] ACodec: skip port index checking on vc4 encoder
Change-Id: I3fe742a8ec4b7f9bc0c4e5f0825fd3b88965a95e
---
media/libstagefright/ACodec.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b780128..1214eed 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -3746,6 +3746,11 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
mNode, OMX_IndexParamPortDefinition, &def, sizeof(def)),
(status_t)OK);
+#ifdef CAPRI_HWC
+ if (strncmp(mComponentName.c_str(), "OMX.BRCM.vc4.encoder.", 21) != 0)
+ // Skip checking on vc4 encoder. It will return the incorrect
+ // port index, but correct parameters.
+#endif
CHECK_EQ((int)def.eDir,
(int)(portIndex == kPortIndexOutput ? OMX_DirOutput : OMX_DirInput));
--
2.3.5
From 9c172527c152d0279713f2b0a0c84dd4ef0ad7f0 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 23 Nov 2014 17:27:20 +0700
Subject: [PATCH 4/9] ACodec: Don't trust provided width/height when setting
input buffer size
They are bogus
Change-Id: I202b291a84d2f9a8c29aa2177ba52a0465f39deb
---
media/libstagefright/ACodec.cpp | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 1214eed..7c94a75 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1916,13 +1916,9 @@ status_t ACodec::configureCodec(
// Capri's OMX fail to set a reasonable default size from width and height
#ifdef CAPRI_HWC
else if (!strncmp(mComponentName.c_str(), "OMX.BRCM.vc4.decoder.", 21)) {
- int32_t width;
- int32_t height;
- if (msg->findInt32("width", &width) && msg->findInt32("height", &height)) {
- setMinBufferSize(kPortIndexInput, (width * height * 3) / 2);
- } else {
- ALOGE("Failed to set min buffer size");
- }
+ // We cannot trust the width/height from the message
+ // so just use 1920x1080
+ setMinBufferSize(kPortIndexInput, (1920 * 1080 * 3) / 2);
}
#endif
--
2.3.5
From e54104a4cf69f3dc0ea38d99c52325d9ed1eb309 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 28 Nov 2014 21:07:59 +0700
Subject: [PATCH 5/9] AudioFlinger: i9082: HACK: disable stereo record
Stereo record causes audio to speed up x2 for some reason.
Record in mono and let AudioFlinger resample to stereo
(we only have one mic anyway)
Change-Id: I59236addc022186fa35bd3b3914f42709c2318de
---
services/audioflinger/AudioFlinger.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 25225b0..7da83ad 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2362,6 +2362,12 @@ sp<AudioFlinger::RecordThread> AudioFlinger::openInput_l(audio_module_handle_t m
audio_config_t halconfig = *config;
audio_hw_device_t *inHwHal = inHwDev->hwDevice();
audio_stream_in_t *inStream = NULL;
+
+#ifdef CAPRI_HWC
+ ALOGD("Forcing channel mask to mono on capri");
+ halconfig.channel_mask = AUDIO_CHANNEL_IN_MONO;
+#endif
+
status_t status = inHwHal->open_input_stream(inHwHal, *input, device, &halconfig,
&inStream, flags, address.string(), source);
ALOGV("openInput_l() openInputStream returned input %p, SamplingRate %d"
--
2.3.5
From 089cf6cfe45179b6ed35cce5ba3b3bdf57f5cabd Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 10 Dec 2014 17:38:10 +0700
Subject: [PATCH 6/9] AudioFlinger: i9082: HACK: force audio to 48 KHz
Let surfaceflinger do all the resampling instead of the audio HAL
Don't know if it fixes anything, but worth a try
Change-Id: I0113831464f2f64c26a9c93bba8fe6b8229b09b4
---
services/audioflinger/AudioFlinger.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 7da83ad..484acfb 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2364,8 +2364,9 @@ sp<AudioFlinger::RecordThread> AudioFlinger::openInput_l(audio_module_handle_t m
audio_stream_in_t *inStream = NULL;
#ifdef CAPRI_HWC
- ALOGD("Forcing channel mask to mono on capri");
+ ALOGD("Forcing input to mono 48K on capri");
halconfig.channel_mask = AUDIO_CHANNEL_IN_MONO;
+ halconfig.sample_rate = 48000;
#endif
status_t status = inHwHal->open_input_stream(inHwHal, *input, device, &halconfig,
--
2.3.5
From 65cd8e77080f632e56d72099fa243c5b07695a13 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 16 Dec 2014 21:12:22 +0700
Subject: [PATCH 7/9] stagefright: i9082: don't allocate too many extra buffers
Too many extra buffers (for a total of 8) causes random
video freezes and freezes on rotation
Change-Id: Idfe85f3cd77d6aa5422073857ceecec902e3ca68
---
media/libstagefright/ACodec.cpp | 4 ++++
media/libstagefright/OMXCodec.cpp | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 7c94a75..b9be274 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -844,7 +844,11 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
// This check was present in KitKat.
if (def.nBufferCountActual < def.nBufferCountMin + *minUndequeuedBuffers) {
#endif
+#ifdef CAPRI_HWC
+ for (OMX_U32 extraBuffers = 1; /* condition inside loop */; extraBuffers--) {
+#else
for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
+#endif
OMX_U32 newBufferCount =
def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers;
def.nBufferCountActual = newBufferCount;
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 37e8ed6..2fa70a8 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2377,7 +2377,11 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
// This check was present in KitKat.
if (def.nBufferCountActual < def.nBufferCountMin + minUndequeuedBufs) {
#endif
+#ifdef CAPRI_HWC
+ for (OMX_U32 extraBuffers = 1; /* condition inside loop */; extraBuffers--) {
+#else
for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
+#endif
OMX_U32 newBufferCount =
def.nBufferCountMin + minUndequeuedBufs + extraBuffers;
def.nBufferCountActual = newBufferCount;
--
2.3.5
From 9ad09fc641d31136f32aafd63d76a477e1c419f2 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 20 Dec 2014 19:09:59 +0700
Subject: [PATCH 8/9] stagefright: CAPRI_HWC: fix for screen recording
Change-Id: Ib8a677eb1ecabc30efe163faa9b209f4db966437
---
media/libstagefright/omx/GraphicBufferSource.cpp | 2 ++
media/libstagefright/omx/OMXNodeInstance.cpp | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/media/libstagefright/omx/GraphicBufferSource.cpp b/media/libstagefright/omx/GraphicBufferSource.cpp
index 44c7edc..b108077 100644
--- a/media/libstagefright/omx/GraphicBufferSource.cpp
+++ b/media/libstagefright/omx/GraphicBufferSource.cpp
@@ -269,12 +269,14 @@ void GraphicBufferSource::codecBufferEmptied(OMX_BUFFERHEADERTYPE* header) {
} else if (type == kMetadataBufferTypeGraphicBuffer) {
GraphicBuffer *buffer;
memcpy(&buffer, data + 4, sizeof(buffer));
+#ifndef CAPRI_HWC
if (buffer != codecBuffer.mGraphicBuffer.get()) {
// should never happen
ALOGE("codecBufferEmptied: buffer is %p, expected %p",
buffer, codecBuffer.mGraphicBuffer.get());
CHECK(!"codecBufferEmptied: mismatched buffer");
}
+#endif
}
}
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index e3a1bd3..07bf1b2 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -822,10 +822,17 @@ status_t OMXNodeInstance::createInputSurface(
}
if (def.format.video.eColorFormat != OMX_COLOR_FormatAndroidOpaque) {
+#ifdef CAPRI_HWC
+ // VC Encoder change OMX_COLOR_FormatAndroidOpaque to 0x7F000005
+ if (def.format.video.eColorFormat != 0x7F000005) {
+#endif
CLOGW("createInputSurface requires COLOR_FormatSurface "
"(AndroidOpaque) color format instead of %s(%#x)",
asString(def.format.video.eColorFormat), def.format.video.eColorFormat);
return INVALID_OPERATION;
+#ifdef CAPRI_HWC
+ }
+#endif
}
GraphicBufferSource* bufferSource = new GraphicBufferSource(
--
2.3.5
From 4c4eb3c3f68b3689e792f1ba8ee27850ba9b3f8c Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 21 Dec 2014 15:25:33 +0700
Subject: [PATCH 9/9] stagefright: CAPRI_HWC: fix for miracast
Our encoder does not support OMX_Video_ControlRateConstant
Change-Id: I5f98f00406a6b28c1a2a1862fbcefa2fdd9055d6
---
media/libstagefright/ACodec.cpp | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index b9be274..342887d 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2893,7 +2893,13 @@ static OMX_U32 setPFramesSpacing(int32_t iFramesInterval, int32_t frameRate) {
return ret;
}
-static OMX_VIDEO_CONTROLRATETYPE getBitrateMode(const sp<AMessage> &msg) {
+static OMX_VIDEO_CONTROLRATETYPE getBitrateMode(const sp<AMessage> &msg, const AString &name) {
+#ifdef CAPRI_HWC
+ // vc4 encoder only supports VBR
+ if (strncmp(name.c_str(), "OMX.BRCM.vc4.encoder.", 21) == 0) {
+ return OMX_Video_ControlRateVariable;
+ }
+#endif
int32_t tmp;
if (!msg->findInt32("bitrate-mode", &tmp)) {
return OMX_Video_ControlRateVariable;
@@ -2909,7 +2915,7 @@ status_t ACodec::setupMPEG4EncoderParameters(const sp<AMessage> &msg) {
return INVALID_OPERATION;
}
- OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg);
+ OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg, mComponentName);
float frameRate;
if (!msg->findFloat("frame-rate", &frameRate)) {
@@ -2991,7 +2997,7 @@ status_t ACodec::setupH263EncoderParameters(const sp<AMessage> &msg) {
return INVALID_OPERATION;
}
- OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg);
+ OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg, mComponentName);
float frameRate;
if (!msg->findFloat("frame-rate", &frameRate)) {
@@ -3119,7 +3125,7 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
return INVALID_OPERATION;
}
- OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg);
+ OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg, mComponentName);
float frameRate;
if (!msg->findFloat("frame-rate", &frameRate)) {
@@ -3234,7 +3240,7 @@ status_t ACodec::setupHEVCEncoderParameters(const sp<AMessage> &msg) {
return INVALID_OPERATION;
}
- OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg);
+ OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg, mComponentName);
float frameRate;
if (!msg->findFloat("frame-rate", &frameRate)) {
@@ -3301,7 +3307,7 @@ status_t ACodec::setupVPXEncoderParameters(const sp<AMessage> &msg) {
}
msg->findInt32("i-frame-interval", &iFrameInterval);
- OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg);
+ OMX_VIDEO_CONTROLRATETYPE bitrateMode = getBitrateMode(msg, mComponentName);
float frameRate;
if (!msg->findFloat("frame-rate", &frameRate)) {
--
2.3.5
From 52b7533338de361512d0ab7535f1b3dc1a6f3774 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 15 Nov 2014 14:50:29 +0700
Subject: [PATCH 1/3] TelephonyManager: set properties in Broadcom-style as
expected by RIL
For i9082
Change-Id: I475fdd164b3316720387fefb14a3e12fbc262b39
---
.../java/android/telephony/TelephonyManager.java | 63 +++++++---------------
1 file changed, 19 insertions(+), 44 deletions(-)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 4ee5c01..63062d2 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3017,49 +3017,19 @@ public class TelephonyManager {
* @hide
*/
public static void setTelephonyProperty(int phoneId, String property, String value) {
- String propVal = "";
- String p[] = null;
- String prop = SystemProperties.get(property);
-
- if (value == null) {
- value = "";
- }
-
- if (prop != null) {
- p = prop.split(",");
- }
-
if (!SubscriptionManager.isValidPhoneId(phoneId)) {
Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId +
- " property=" + property + " value: " + value + " prop=" + prop);
+ " property=" + property + " value: " + value);
return;
}
- for (int i = 0; i < phoneId; i++) {
- String str = "";
- if ((p != null) && (i < p.length)) {
- str = p[i];
- }
- propVal = propVal + str + ",";
- }
-
- propVal = propVal + value;
- if (p != null) {
- for (int i = phoneId + 1; i < p.length; i++) {
- propVal = propVal + "," + p[i];
- }
- }
-
- if (property.length() > SystemProperties.PROP_NAME_MAX
- || propVal.length() > SystemProperties.PROP_VALUE_MAX) {
- Rlog.d(TAG, "setTelephonyProperty: property to long phoneId=" + phoneId +
- " property=" + property + " value: " + value + " propVal=" + propVal);
- return;
+ if (phoneId > 0) {
+ property += "_" + phoneId;
}
Rlog.d(TAG, "setTelephonyProperty: success phoneId=" + phoneId +
- " property=" + property + " value: " + value + " propVal=" + propVal);
- SystemProperties.set(property, propVal);
+ " property=" + property + " value: " + value);
+ SystemProperties.set(property, value);
}
/**
@@ -3156,17 +3126,22 @@ public class TelephonyManager {
* @hide
*/
public static String getTelephonyProperty(int phoneId, String property, String defaultVal) {
- String propVal = null;
- String prop = SystemProperties.get(property);
- if ((prop != null) && (prop.length() > 0)) {
- String values[] = prop.split(",");
- if ((phoneId >= 0) && (phoneId < values.length) && (values[phoneId] != null)) {
- propVal = values[phoneId];
- }
+ if (!SubscriptionManager.isValidPhoneId(phoneId)) {
+ Rlog.d(TAG, "getTelephonyProperty: invalid phoneId=" + phoneId +
+ " property=" + property);
+ return defaultVal;
+ }
+
+ if (phoneId > 0) {
+ property += "_" + phoneId;
}
+
+ String propVal = SystemProperties.get(property);
+
Rlog.d(TAG, "getTelephonyProperty: return propVal='" + propVal + "' phoneId=" + phoneId
- + " property='" + property + "' defaultVal='" + defaultVal + "' prop=" + prop);
- return propVal == null ? defaultVal : propVal;
+ + " property='" + property + "' defaultVal='" + defaultVal);
+
+ return propVal.isEmpty() ? defaultVal : propVal;
}
/**
--
1.9.1
From 81f8e414533dfc83bc44ac704fd0c97cbaccf4da Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 15 Nov 2014 22:33:16 +0700
Subject: [PATCH 2/3] Camera: HACK: i9082: API hacks
CTS 5.0 requires the presence of an auto mode, so applications
may try to use auto without checking.
Also change ENODEV to MAX_CAMERAS_IN_USE to please the CTS
Change-Id: I929feffa4f79c69e9d7be7d1acacb3c228280bfe
---
core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java | 2 +-
core/java/android/hardware/camera2/legacy/LegacyRequestMapper.java | 2 +-
core/java/android/hardware/camera2/utils/CameraBinderDecorator.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
index 347db05..5acf583 100644
--- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
+++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
@@ -1100,7 +1100,7 @@ public class LegacyMetadataMapper {
return CONTROL_AE_ANTIBANDING_MODE_OFF;
}
case Camera.Parameters.ANTIBANDING_50HZ: {
- return CONTROL_AE_ANTIBANDING_MODE_50HZ;
+ return /* CONTROL_AE_ANTIBANDING_MODE_50HZ */ CONTROL_AE_ANTIBANDING_MODE_AUTO;
}
case Camera.Parameters.ANTIBANDING_60HZ: {
return CONTROL_AE_ANTIBANDING_MODE_60HZ;
diff --git a/core/java/android/hardware/camera2/legacy/LegacyRequestMapper.java b/core/java/android/hardware/camera2/legacy/LegacyRequestMapper.java
index 61f7b8b..f370103 100644
--- a/core/java/android/hardware/camera2/legacy/LegacyRequestMapper.java
+++ b/core/java/android/hardware/camera2/legacy/LegacyRequestMapper.java
@@ -617,7 +617,7 @@ public class LegacyRequestMapper {
return Parameters.ANTIBANDING_60HZ;
}
case CONTROL_AE_ANTIBANDING_MODE_AUTO: {
- return Parameters.ANTIBANDING_AUTO;
+ return Parameters.ANTIBANDING_50HZ /* Parameters.ANTIBANDING_AUTO */;
}
default: {
return null;
diff --git a/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java b/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java
index d461bca..a34a758 100644
--- a/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java
+++ b/core/java/android/hardware/camera2/utils/CameraBinderDecorator.java
@@ -124,7 +124,7 @@ public class CameraBinderDecorator {
case EUSERS:
throw new CameraRuntimeException(MAX_CAMERAS_IN_USE);
case ENODEV:
- throw new CameraRuntimeException(CAMERA_DISCONNECTED);
+ throw new CameraRuntimeException(/*CAMERA_DISCONNECTED*/ MAX_CAMERAS_IN_USE);
case EOPNOTSUPP:
throw new CameraRuntimeException(CAMERA_DEPRECATED_HAL);
case INVALID_OPERATION:
--
1.9.1
From 9a0b6efe16eaa2740160306bbde768758f6259d2 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 21 Dec 2014 16:23:31 +0700
Subject: [PATCH 3/3] PowerManagerService: only turn on button light when any
button is pressed
This more closely emulates stock Samsung behavior
Change-Id: I6b15c45b713bcbc290a1026805c46109060f9990
---
.../core/java/com/android/server/power/PowerManagerService.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 8105ff8..b3d2023 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -235,6 +235,7 @@ public final class PowerManagerService extends SystemService
// Timestamp of the last call to user activity.
private long mLastUserActivityTime;
private long mLastUserActivityTimeNoChangeLights;
+ private long mLastButtonActivityTime;
// Timestamp of last interactive power hint.
private long mLastInteractivePowerHintTime;
@@ -1145,6 +1146,11 @@ public final class PowerManagerService extends SystemService
return true;
}
} else {
+ if (eventTime > mLastButtonActivityTime && (event & PowerManager.USER_ACTIVITY_EVENT_BUTTON) != 0) {
+ mLastButtonActivityTime = eventTime;
+ mDirty |= DIRTY_USER_ACTIVITY;
+ }
+
if (eventTime > mLastUserActivityTime) {
mLastUserActivityTime = eventTime;
mDirty |= DIRTY_USER_ACTIVITY;
@@ -1648,7 +1654,7 @@ public final class PowerManagerService extends SystemService
mKeyboardLight.setBrightness(mKeyboardVisible ?
keyboardBrightness : 0);
if (mButtonTimeout != 0
- && now > mLastUserActivityTime + mButtonTimeout) {
+ && now > mLastButtonActivityTime + mButtonTimeout) {
mButtonsLight.setBrightness(0);
} else {
if (!mProximityPositive) {
--
1.9.1
From 9286ea92a5156e9464978fda5ff3cce78949a6e5 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Thu, 14 Nov 2013 15:19:46 +0700
Subject: [PATCH 1/5] binder: add compat symbol
Required for older Samsung libtvout
Change-Id: Ib18d2513570382432d49f302ab041230650372f2
---
libs/binder/IPCThreadState.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index dd04dcf..9ec2380 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -361,6 +361,10 @@ status_t IPCThreadState::clearLastError()
return err;
}
+extern "C" int _ZN7android14IPCThreadState13getCallingPidEv(IPCThreadState *state) {
+ return state->getCallingPid();
+}
+
int IPCThreadState::getCallingPid() const
{
return mCallingPid;
--
2.3.5
From 52672bcc7b8a858a35e3084be95417d872068285 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 19:38:17 +0700
Subject: [PATCH 2/5] binder: add compat symbols
Required for libtvservice_binder.so on I9082
Change-Id: I059e92f19e4c5a911d38faa9c4df549c75c90761
---
libs/binder/Parcel.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index e7589b1..b34ceb9 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -873,6 +873,12 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
return status;
}
+extern "C" status_t _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(void *parcel, void *val);
+
+extern "C" status_t _ZN7android6Parcel5writeERKNS_11FlattenableE(void *parcel, void *val) {
+ return _ZN7android6Parcel5writeERKNS0_26FlattenableHelperInterfaceE(parcel, val);
+}
+
status_t Parcel::write(const FlattenableHelperInterface& val)
{
status_t err;
@@ -1285,6 +1291,12 @@ status_t Parcel::readBlob(size_t len, ReadableBlob* outBlob) const
return NO_ERROR;
}
+extern "C" status_t _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(void *parcel, void *val);
+
+extern "C" status_t _ZNK7android6Parcel4readERNS_11FlattenableE(void *parcel, void *val) {
+ return _ZNK7android6Parcel4readERNS0_26FlattenableHelperInterfaceE(parcel, val);
+}
+
status_t Parcel::read(FlattenableHelperInterface& val) const
{
// size
--
2.3.5
From 1ee90ff836265e70b8dc0357e86e18502ea46230 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Mon, 16 Dec 2013 15:45:42 +0700
Subject: [PATCH 3/5] sf: CAPRI_HWC: fix rotation artifact
---
services/surfaceflinger/SurfaceFlinger.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index dfe5754..c608397 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3749,6 +3749,11 @@ status_t SurfaceFlinger::captureScreenImplLocked(
{
ATRACE_CALL();
+// Rotation artifact problems when useReadPixels is false
+#ifdef CAPRI_HWC
+ useReadPixels = true;
+#endif
+
// get screen geometry
const uint32_t hw_w = hw->getWidth();
const uint32_t hw_h = hw->getHeight();
--
2.3.5
From e6e115f462283ac2fc6a581728a5d35412d1eb21 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Mon, 15 Dec 2014 23:12:44 +0700
Subject: [PATCH 4/5] SurfaceComposerClient: don't block RGBA_8888 for
screenshot on CAPRI_HWC
Works here and required for ColorFade animation
Change-Id: Ie7d549bb63e11380d7efcab27b7e4d9f3eb2a1fe
---
libs/gui/SurfaceComposerClient.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index b6025f2..9c59ba2 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -838,7 +838,7 @@ status_t ScreenshotClient::capture(
uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
-#ifdef USE_MHEAP_SCREENSHOT
+#if defined(USE_MHEAP_SCREENSHOT) && !defined(CAPRI_HWC)
int format = 0;
producer->query(NATIVE_WINDOW_FORMAT,&format);
if (format == PIXEL_FORMAT_RGBA_8888) {
--
2.3.5
From 395931556400205a102f9db5eec1e07088017821 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 20 Dec 2014 19:09:27 +0700
Subject: [PATCH 5/5] sf: CAPRI_HWC: fix for screen recording
Change-Id: I6c7e59400eab86bc5ec0ffebbcc475fa0fa404d2
---
libs/gui/BufferQueueProducer.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 6f76019..ff6a570 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -204,7 +204,12 @@ status_t BufferQueueProducer::waitForFreeSlotThenRelock(const char* caller,
const int newUndequeuedCount =
maxBufferCount - (dequeuedCount + 1);
const int minUndequeuedCount =
+#ifdef CAPRI_HWC
+ // HACK: for some reason, we need to reduce min undequeue for screen recording
+ mCore->getMinUndequeuedBufferCountLocked(false);
+#else
mCore->getMinUndequeuedBufferCountLocked(async);
+#endif
if (newUndequeuedCount < minUndequeuedCount) {
BQ_LOGE("%s: min undequeued buffer count (%d) exceeded "
"(dequeued=%d undequeued=%d)",
--
2.3.5
From 8ca768b45b5dc49b2df99421f39cc372e5d1361b Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 31 May 2014 12:34:56 +0700
Subject: [PATCH 1/2] telephony: support for RIL that does not send
UNSOL_CALL_RING
Samsung Broadcom RIL does not send UNSOL_CALL_RING at all, so it
needs to be faked or non loop (e.g. Digital Phone) ringtones
won't work.
Change-Id: Ib7373d32777f6c42ee488972a7aa63ae8e1cd09b
---
.../com/android/internal/telephony/PhoneBase.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java
index f6ffb49..334bece 100644
--- a/src/java/com/android/internal/telephony/PhoneBase.java
+++ b/src/java/com/android/internal/telephony/PhoneBase.java
@@ -220,6 +220,7 @@ public abstract class PhoneBase extends Handler implements Phone {
boolean mDnsCheckDisabled;
public DcTrackerBase mDcTracker;
boolean mDoesRilSendMultipleCallRing;
+ boolean mDoesRilSendCallRing;
int mCallRingContinueToken;
int mCallRingDelay;
public boolean mIsTheCurrentActivePhone = true;
@@ -441,6 +442,11 @@ public abstract class PhoneBase extends Handler implements Phone {
TelephonyProperties.PROPERTY_RIL_SENDS_MULTIPLE_CALL_RING, true);
Rlog.d(LOG_TAG, "mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing);
+ // Some RIL do not even send a single RIL_UNSOL_CALL_RING
+ mDoesRilSendCallRing = SystemProperties.getBoolean(
+ "ro.telephony.call_ring", true);
+ Rlog.d(LOG_TAG, "mDoesRilSendCallRing=" + mDoesRilSendCallRing);
+
mCallRingDelay = SystemProperties.getInt(
TelephonyProperties.PROPERTY_CALL_RING_DELAY, 3000);
Rlog.d(LOG_TAG, "mCallRingDelay=" + mCallRingDelay);
@@ -1908,6 +1914,18 @@ public abstract class PhoneBase extends Handler implements Phone {
public void notifyNewRingingConnectionP(Connection cn) {
if (!mIsVoiceCapable)
return;
+
+ // Fake RIL_UNSOL_CALL_RING if the RIL doesn't send it.
+ // Note that we need the delay to prevent the request from
+ // being sent after CallTracker detects "RINGING" state, but
+ // before the correct contact-specific ringtone is queried.
+ // Otherwise, the incorrect ringtone will be used
+ if (!mDoesRilSendCallRing) {
+ int token = ++mCallRingContinueToken;
+ sendMessageDelayed(
+ obtainMessage(EVENT_CALL_RING_CONTINUE, token, 0), mCallRingDelay);
+ }
+
AsyncResult ar = new AsyncResult(null, cn, null);
mNewRingingConnectionRegistrants.notifyRegistrants(ar);
}
@@ -2340,6 +2358,7 @@ public abstract class PhoneBase extends Handler implements Phone {
pw.println(" mDnsCheckDisabled=" + mDnsCheckDisabled);
pw.println(" mDcTracker=" + mDcTracker);
pw.println(" mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing);
+ pw.println(" mDoesRilSendCallRing=" + mDoesRilSendCallRing);
pw.println(" mCallRingContinueToken=" + mCallRingContinueToken);
pw.println(" mCallRingDelay=" + mCallRingDelay);
pw.println(" mIsTheCurrentActivePhone=" + mIsTheCurrentActivePhone);
--
2.3.5
From e3bf01ab3d3f55fddf3eb52b28f80042ae3c7b12 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 15 Nov 2014 17:39:50 +0700
Subject: [PATCH 2/2] telephony: RIL: i9082: set correct rild names
Change-Id: Idf8e98ae2f36f30b84be04b7b062ca4b52cebd8a
---
src/java/com/android/internal/telephony/RIL.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
index a012244..b1bda54 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -301,7 +301,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
static final int RESPONSE_SOLICITED = 0;
static final int RESPONSE_UNSOLICITED = 1;
- static final String[] SOCKET_NAME_RIL = {"rild", "rild2", "rild3"};
+ static final String[] SOCKET_NAME_RIL = {"rild", "rild1", "rild2"};
static final int SOCKET_OPEN_RETRY_MILLIS = 4 * 1000;
--
2.3.5
From 7db8a8ad776221457e6313635e130395931df8a0 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 20:09:12 +0700
Subject: [PATCH] libbt: switch to N_BRCM_HCI line disclipline for userial
ioctl
Change-Id: I12c297c6b26fc0cb6f0a36ed8f5d04d4d36a4092
---
src/userial_vendor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index 949ec4b..be8cd0b 100644
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -196,6 +196,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
uint16_t parity;
uint8_t stop_bits;
+#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ int ldisc;
+#endif
+
vnd_userial.fd = -1;
if (!userial_to_tcio_baud(p_cfg->baud, &baud))
@@ -265,6 +269,13 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios);
#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ // TODO: check for breakage on tuna (Galaxy Nexus). It defines this,
+ // but does not contain the kernel code to support it.
+
+ // Switch to N_BRCM_HCI line disclipline for ioctl to work
+ ldisc = 25; // N_BRCM_HCI
+ ioctl(vnd_userial.fd, TIOCSETD, &ldisc);
+
userial_ioctl_init_bt_wake(vnd_userial.fd);
#endif
--
2.3.5
From ead4750e7201f3437e3a9adbebdbd5f6b6594767 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 23 Jan 2015 20:34:16 +0700
Subject: [PATCH 1/2] Camera: i9082: disable preview after stopping camera
This fixes a native crash from Broadcom's driver. However, there is
an unwanted side effect of the preview going black while the
'close application' animation is running.
Change-Id: I231233d28a1f7ac914408a7d02100a9424c2bf1c
---
src/com/android/camera/CameraActivity.java | 2 +-
src/com/android/camera/PhotoModule.java | 1 +
src/com/android/camera/VideoModule.java | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index f96d634..820ce24 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1643,7 +1643,7 @@ public class CameraActivity extends QuickActivity
mCurrentModule.onPreviewVisibilityChanged(visibility);
}
- private void updatePreviewRendering(int visibility) {
+ /* private */ void updatePreviewRendering(int visibility) {
if (visibility == ModuleController.VISIBILITY_HIDDEN) {
mCameraAppUI.pausePreviewRendering();
} else {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index b4b5ee7..52b8858 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1874,6 +1874,7 @@ public class PhotoModule
mActivity.getCameraProvider().releaseCamera(mCameraDevice.getCameraId());
mCameraDevice = null;
setCameraState(PREVIEW_STOPPED);
+ mActivity.updatePreviewRendering(ModuleController.VISIBILITY_HIDDEN);
mFocusManager.onCameraReleased();
}
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index a034a1c..f203c12 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1026,6 +1026,7 @@ public class VideoModule extends CameraModule
}
mCameraDevice.setZoomChangeListener(null);
mActivity.getCameraProvider().releaseCamera(mCameraDevice.getCameraId());
+ mActivity.updatePreviewRendering(ModuleController.VISIBILITY_HIDDEN);
mCameraDevice = null;
mPreviewing = false;
mSnapshotInProgress = false;
--
2.3.5
From 79478cabada02634258b3567b282271fc4e28b92 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 24 Jan 2015 21:59:20 +0700
Subject: [PATCH 2/2] Camera: i9082: update preview state after starting
preview
Fixes a regression in I231233d28a1f7ac914408a7d02100a9424c2bf1c
where preview freezes after switching between front and back cams
Change-Id: I036539aa602d738372f421499cf5ac8c646523ed
---
src/com/android/camera/CameraActivity.java | 2 +-
src/com/android/camera/PhotoModule.java | 1 +
src/com/android/camera/VideoModule.java | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 820ce24..fcb44bd 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1632,7 +1632,7 @@ public class CameraActivity extends QuickActivity
* Call this whenever the mode drawer or filmstrip change the visibility
* state.
*/
- private void updatePreviewVisibility() {
+ /* package */ void updatePreviewVisibility() {
if (mCurrentModule == null) {
return;
}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 52b8858..8e3f2e6 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1987,6 +1987,7 @@ public class PhotoModule
mCameraDevice.startPreviewWithCallback(new Handler(Looper.getMainLooper()),
startPreviewCallback);
}
+ mActivity.updatePreviewVisibility();
}
@Override
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index f203c12..129f39a 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -981,6 +981,7 @@ public class VideoModule extends CameraModule
}
});
mPreviewing = true;
+ mActivity.updatePreviewVisibility();
} catch (Throwable ex) {
closeCamera();
throw new RuntimeException("startPreview failed", ex);
--
2.3.5
From 2c3e7123dadfad9e363a376c5e61aac199cb605f Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 16 Nov 2014 08:55:55 +0700
Subject: [PATCH] Settings: i9082: disable manual provisioning
Does not work here
Change-Id: I1096b349ccf60b05aa261289b6bc7127beffaca5
---
src/com/android/settings/sim/MultiSimEnablerPreference.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/com/android/settings/sim/MultiSimEnablerPreference.java b/src/com/android/settings/sim/MultiSimEnablerPreference.java
index ed1424f..93344ee 100644
--- a/src/com/android/settings/sim/MultiSimEnablerPreference.java
+++ b/src/com/android/settings/sim/MultiSimEnablerPreference.java
@@ -219,7 +219,9 @@ public class MultiSimEnablerPreference extends SwitchPreference implements
super.onBindView(view);
mSwitch = (Switch) view.findViewById(com.android.internal.R.id.switchWidget);
- mSwitch.setClickable(true);
+ // Disable manual provisioning
+ mSwitch.setClickable(false);
+ mSwitch.setVisibility(View.INVISIBLE);
update();
}
--
2.3.5
From 4ba407655964868e2746dc74be087de4373ce0c9 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 3 Oct 2015 13:40:57 +0700
Subject: [PATCH 1/2] Revert "DynamicGrid: tuning the icon size for some
device"
This reverts commit edbea0af1226978b06d7f877ae435797d31419af.
Change-Id: Ib97c3cf75e8ed354fce9471cb32ce33fe688ff2b
---
src/com/android/launcher3/DynamicGrid.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 6e889de..2355c95 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -82,13 +82,13 @@ public class DynamicGrid {
296, 491.33f, 4, 4, (useLargeIcons ? 58 : 46), 13, (hasAA ? 5 : 5),
(useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Nexus 4",
- 335, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 60 : 48), fourByFourDefaultLayout));
+ 335, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 60 : 46), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Nexus 5",
- 359, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 60 : 48), fourByFourDefaultLayout));
+ 359, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 60 : 46), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Large Phone",
- 406, 694, 5, 5, (useLargeIcons ? 68 : 56), 14.4f, 5, (useLargeIcons ? 60 : 48),
+ 406, 694, 5, 5, (useLargeIcons ? 68 : 52), 14.4f, 5, (useLargeIcons ? 60 : 44),
R.xml.default_workspace_5x5));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
--
1.9.1
From b62f7265304b3d7db53b2a985c11840a1172936b Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 3 Oct 2015 13:43:40 +0700
Subject: [PATCH 2/2] Revert "Update Larger icons setting for better usability"
This reverts commit 5c7529006f3ed78d934fed2861cebd3654695108.
Change-Id: I4ecf4ef9adc347fc16c98419262bf34bc11f7090
---
src/com/android/launcher3/DynamicGrid.java | 38 +++++++++++++++---------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 2355c95..dff2b6d 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -34,7 +34,7 @@ public class DynamicGrid {
private float mMinHeight;
// This is a static that we use for the default icon size on a 4/5-inch phone
- static float DEFAULT_ICON_SIZE_DP = 66;
+ static float DEFAULT_ICON_SIZE_DP = 60;
static float DEFAULT_ICON_SIZE_PX = 0;
public static float dpiFromPx(int size, DisplayMetrics metrics){
@@ -67,40 +67,40 @@ public class DynamicGrid {
DEFAULT_ICON_SIZE_PX = pxFromDp(DEFAULT_ICON_SIZE_DP, dm);
// Our phone profiles include the bar sizes in each orientation
deviceProfiles.add(new DeviceProfile("Super Short Stubby",
- 255, 300, 2, 3, (useLargeIcons ? 58 : 46), 13, (hasAA ? 3 : 5),
- (useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
+ 255, 300, 2, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 3 : 5),
+ (useLargeIcons ? 54 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Shorter Stubby",
- 255, 400, 3, 3, (useLargeIcons ? 58 : 46), 13, (hasAA ? 3 : 5),
- (useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
+ 255, 400, 3, 3, (useLargeIcons ? 54 : 48), 13, (hasAA ? 3 : 5),
+ (useLargeIcons ? 54 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Short Stubby",
- 275, 420, 3, 4, (useLargeIcons ? 58 : 46), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
+ 275, 420, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Stubby",
- 255, 450, 3, 4, (useLargeIcons ? 58 : 46), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
+ 255, 450, 3, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Nexus S",
- 296, 491.33f, 4, 4, (useLargeIcons ? 58 : 46), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 58 : 46), fourByFourDefaultLayout));
+ 296, 491.33f, 4, 4, (useLargeIcons ? 54 : 48), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 54 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Nexus 4",
- 335, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 60 : 46), fourByFourDefaultLayout));
+ 335, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 56 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Nexus 5",
- 359, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 52), 13, (hasAA ? 5 : 5),
- (useLargeIcons ? 60 : 46), fourByFourDefaultLayout));
+ 359, 567, 4, 4, (useLargeIcons ? DEFAULT_ICON_SIZE_DP : 56), 13, (hasAA ? 5 : 5),
+ (useLargeIcons ? 56 : 48), fourByFourDefaultLayout));
deviceProfiles.add(new DeviceProfile("Large Phone",
- 406, 694, 5, 5, (useLargeIcons ? 68 : 52), 14.4f, 5, (useLargeIcons ? 60 : 44),
+ 406, 694, 5, 5, (useLargeIcons ? 64 : 56), 14.4f, 5, (useLargeIcons ? 56 : 48),
R.xml.default_workspace_5x5));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
deviceProfiles.add(new DeviceProfile("Nexus 7",
- 575, 904, 5, 6, (useLargeIcons ? 76 : 60), 14.4f, 7, (useLargeIcons ? 64 : 52),
+ 575, 904, 5, 6, (useLargeIcons ? 72 : 60), 14.4f, 7, (useLargeIcons ? 60 : 52),
R.xml.default_workspace_5x6));
// Larger tablet profiles always have system bars on the top & bottom
deviceProfiles.add(new DeviceProfile("Nexus 10",
- 727, 1207, 5, 6, (useLargeIcons ? 80 : 64), 14.4f, 7, (useLargeIcons ? 68 : 56),
+ 727, 1207, 5, 6, (useLargeIcons ? 76 : 64), 14.4f, 7, (useLargeIcons ? 64 : 56),
R.xml.default_workspace_5x6));
deviceProfiles.add(new DeviceProfile("20-inch Tablet",
- 1527, 2527, 7, 7, (useLargeIcons ? 104 : 80), 20, 7, (useLargeIcons ? 76 : 64),
+ 1527, 2527, 7, 7, (useLargeIcons ? 100 : 80), 20, 7, (useLargeIcons ? 72 : 64),
fourByFourDefaultLayout));
mMinWidth = dpiFromPx(minWidthPx, dm);
mMinHeight = dpiFromPx(minHeightPx, dm);
--
1.9.1
From d5cb82c98ea31b727e211e3aebe27d57961dcf45 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 23 Dec 2014 22:27:09 +0700
Subject: [PATCH 1/2] Telephony: HACK: fix 'up' for MSimCallFeature sub option
Change-Id: I1fcd9309d2849fbdd0ac1c903cbda4a8b1f213f5
---
src/com/android/phone/CallFeaturesSetting.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 87cc1d6..873c621 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -2349,10 +2349,13 @@ public class CallFeaturesSetting extends PreferenceActivity
* This is useful for implementing "HomeAsUp" capability for second-level Settings.
*/
public static void goUpToTopLevelSetting(Activity activity) {
- Intent intent = new Intent(activity, CallFeaturesSetting.class);
- intent.setAction(Intent.ACTION_MAIN);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- activity.startActivity(intent);
+ // HACK: See MSimMobileNetworkSubSettings#onOptionsItemSelected
+ if (!PhoneUtils.isMultiSimEnabled()) {
+ Intent intent = new Intent(activity, CallFeaturesSetting.class);
+ intent.setAction(Intent.ACTION_MAIN);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ activity.startActivity(intent);
+ }
activity.finish();
}
}
--
1.9.1
From d80082dc96fd257f1ca9bfd40884769b76270bab Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 20 Feb 2015 20:26:52 +0700
Subject: [PATCH 2/2] Telephony: HACK: enable WCDMA only setting
Samsung stock allows WCDMA only
Change-Id: If552c6439f7b6910422ec5549e54e68da798c82e
---
res/values/strings.xml | 8 +++++---
src/com/android/phone/MobileNetworkSettings.java | 6 +++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6aa2eec..f6a82d4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -609,12 +609,14 @@
</string-array>
<string-array name="enabled_networks_except_lte_choices" translatable="false">
- <item>@string/network_3G</item>
- <item>@string/network_2G</item>
+ <item>@string/preferred_network_mode_wcdma_only_choice</item>
+ <item>@string/preferred_network_mode_gsm_only_choice</item>
+ <item>@string/preferred_network_mode_gsm_wcdma_preferred_choice</item>
</string-array>
<string-array name="enabled_networks_except_lte_values" translatable="false">
- <item>"0"</item>
+ <item>"2"</item>
<item>"1"</item>
+ <item>"0"</item>
</string-array>
<string-array name="enabled_networks_except_gsm_lte_choices" translatable="false">
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 6dbd608..253ea80 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -512,11 +512,11 @@ public class MobileNetworkSettings extends PreferenceActivity
mEnabledNetworksSummaries = new SparseIntArray();
mEnabledNetworksSummaries.append(Phone.NT_MODE_WCDMA_PREF,
- R.string.network_wcdma_pref);
+ R.string.preferred_network_mode_gsm_wcdma_preferred_choice);
mEnabledNetworksSummaries.append(Phone.NT_MODE_GSM_ONLY,
- R.string.network_gsm_only);
+ R.string.preferred_network_mode_gsm_only_choice);
mEnabledNetworksSummaries.append(Phone.NT_MODE_WCDMA_ONLY,
- R.string.network_wcdma_only);
+ R.string.preferred_network_mode_wcdma_only_choice);
mEnabledNetworksSummaries.append(Phone.NT_MODE_GSM_UMTS,
R.string.network_gsm_umts);
mEnabledNetworksSummaries.append(Phone.NT_MODE_CDMA,
--
1.9.1
From 9d575270bb983608a5bf97050bc9c97c6e26aa29 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 12 Apr 2013 11:40:15 +0700
Subject: [PATCH] libnetutils: add ifc_set_mtu
Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e
---
libnetutils/ifc_utils.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index d9c50ab..2394f9d 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -704,3 +704,19 @@ ifc_configure(const char *ifname,
return 0;
}
+
+// Required for Broadcom RILD
+int ifc_set_mtu(const char *name, int mtuSz)
+{
+ struct ifreq ifr;
+ int ret;
+ ifc_init_ifr(name, &ifr);
+ ifr.ifr_mtu = mtuSz;
+
+ ret = ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr);
+ if (ret < 0) {
+ printerr("ifc_set_mtu: SIOCSIFMTU failed: %d\n", ret);
+ }
+
+ return ret;
+}
--
2.3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment