Skip to content

Instantly share code, notes, and snippets.

@pawitp
Last active August 18, 2020 19:09
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save pawitp/cba169c87dba57eea8ef to your computer and use it in GitHub Desktop.
Save pawitp/cba169c87dba57eea8ef to your computer and use it in GitHub Desktop.
Compatibility patches for I9082 (CM12)
From b04637db515edbe6ab6006391e223b25712f7a8e 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 189fa57..7f997fa 100644
--- a/uncrypt/uncrypt.c
+++ b/uncrypt/uncrypt.c
@@ -410,7 +410,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.2 (Apple Git-55)
From aacaf1bb3679bd0de6c82a952334d6679f00aba2 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 5d255e4..5b84627 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -372,6 +372,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.2 (Apple Git-55)
From 3dff91d1327ea328ddcd967a3d9432786695f7fc 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 | 13 +++++++++++++
media/libstagefright/OMXCodec.cpp | 12 ++++++++++++
2 files changed, 25 insertions(+)
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 02bb7c4..3e945ce 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1694,6 +1694,19 @@ 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
+
CHECK_EQ(getPortFormat(kPortIndexInput, inputFormat), (status_t)OK);
CHECK_EQ(getPortFormat(kPortIndexOutput, outputFormat), (status_t)OK);
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 5b84627..e9b52bb 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -914,6 +914,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.2 (Apple Git-55)
From 466a2e77e547c3be26be0b5339b5963a498e0bd9 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 3e945ce..271c790 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -3388,6 +3388,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.2 (Apple Git-55)
From 65a1ec9800a0e90fbef01e69784640f41aaf46b4 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 271c790..b65dd0c 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1697,13 +1697,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.2 (Apple Git-55)
From cd144785beba3fc8fbbed55877bdbdca9ba7f626 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 0b2943c..fa3fbf1 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2248,6 +2248,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.2 (Apple Git-55)
From c3512ea44f06c667a1dda218726b18027d4e7b58 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 fa3fbf1..f4c6a2a 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2250,8 +2250,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.2 (Apple Git-55)
From 17071cbba07190b405bc1c6684852423b5cf5a8a 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 b65dd0c..ce1c1cc 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -787,7 +787,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 e9b52bb..ba96ce5 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2325,7 +2325,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.2 (Apple Git-55)
From 45fb4ec21a6f02abfbeed4ed34fadd382b891d17 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 3e70956..d600573 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 8c22255..eaa20c9 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -733,9 +733,16 @@ status_t OMXNodeInstance::createInputSurface(
CHECK(oerr == OMX_ErrorNone);
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
ALOGE("createInputSurface requires COLOR_FormatSurface "
"(AndroidOpaque) color format");
return INVALID_OPERATION;
+#ifdef CAPRI_HWC
+ }
+#endif
}
GraphicBufferSource* bufferSource = new GraphicBufferSource(
--
2.3.2 (Apple Git-55)
From 906b861985f0d7c910b6e33038f72a29b3d715d8 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 ce1c1cc..9b6874c 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2566,7 +2566,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;
@@ -2582,7 +2588,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)) {
@@ -2664,7 +2670,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)) {
@@ -2792,7 +2798,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)) {
@@ -2907,7 +2913,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)) {
@@ -2974,7 +2980,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.2 (Apple Git-55)
From 533bfae6de2467de204570c09045c359ddbd2e1d 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/6] TelephonyManager: set properties in Broadcom-style as
expected by RIL
For i9082
Change-Id: I475fdd164b3316720387fefb14a3e12fbc262b39
---
.../java/android/telephony/TelephonyManager.java | 69 +++++++---------------
1 file changed, 20 insertions(+), 49 deletions(-)
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 5a2527c4..c4d3c00 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2801,44 +2801,16 @@ public class TelephonyManager {
* @hide
*/
public static void setTelephonyProperty(String property, long subId, String value) {
- String propVal = "";
- String p[] = null;
- String prop = SystemProperties.get(property);
int phoneId = SubscriptionManager.getPhoneId(subId);
- if (value == null) {
- value = "";
- }
-
- if (prop != null) {
- p = prop.split(",");
- }
-
- if (phoneId < 0) 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];
- }
- }
-
- // TODO: workaround for QC
- if (property.length() > SystemProperties.PROP_NAME_MAX || propVal.length() > SystemProperties.PROP_VALUE_MAX) {
- Rlog.d(TAG, "setTelephonyProperty length too long:" + property + ", " + propVal);
+ if (phoneId < 0) {
return;
+ } else if (phoneId > 0) {
+ property += "_" + phoneId;
}
- Rlog.d(TAG, "setTelephonyProperty property=" + property + " propVal=" + propVal);
- SystemProperties.set(property, propVal);
+ Rlog.d(TAG, "setTelephonyProperty property=" + property + " propVal=" + value);
+ SystemProperties.set(property, value);
}
/**
@@ -2929,16 +2901,16 @@ public class TelephonyManager {
* @hide
*/
public static String getTelephonyProperty(String property, long subId, String defaultVal) {
- String propVal = null;
int phoneId = SubscriptionManager.getPhoneId(subId);
- 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 (phoneId < 0) {
+ return defaultVal;
+ } else if (phoneId > 0) {
+ property += "_" + phoneId;
}
- return propVal == null ? defaultVal : propVal;
+
+ String propVal = SystemProperties.get(property);
+ return propVal.isEmpty() ? defaultVal : propVal;
}
/**
@@ -2947,15 +2919,14 @@ public class TelephonyManager {
* @hide
*/
public static int getTelephonyProperty(String property, int slotId, int defaultVal) {
- String propVal = null;
- String prop = SystemProperties.get(property);
- if ((prop != null) && (prop.length() > 0)) {
- String values[] = prop.split(",");
- if ((slotId >= 0) && (slotId < values.length) && (values[slotId] != null)) {
- propVal = values[slotId];
- }
+ if (slotId < 0) {
+ return defaultVal;
+ } else if (slotId > 0) {
+ property += "_" + slotId;
}
- return propVal == null ? defaultVal : Integer.parseInt(propVal);
+
+ String propVal = SystemProperties.get(property);
+ return propVal.isEmpty() ? defaultVal : Integer.parseInt(propVal);
}
/** @hide */
--
2.3.2 (Apple Git-55)
From 37a4b061f8d10a0016bce32771dde32d342a8f64 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/6] 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 03540e1..a4555e3 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:
--
2.3.2 (Apple Git-55)
From 84eb51cde90aeeff8abc488d628d0ce0c9aa4679 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/6] 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 60a61ce..a5246b2 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -241,6 +241,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;
@@ -1135,6 +1136,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;
@@ -1635,7 +1641,7 @@ public final class PowerManagerService extends SystemService
}
mKeyboardLight.setBrightness(mKeyboardVisible ? keyboardBrightness : 0);
- if (mButtonTimeout != 0 && now > mLastUserActivityTime + mButtonTimeout) {
+ if (mButtonTimeout != 0 && now > mLastButtonActivityTime + mButtonTimeout) {
mButtonsLight.setBrightness(0);
} else {
// The proximity sensor during a call may indicate positive,
--
2.3.2 (Apple Git-55)
From 7bef9d2ea3e57bf8cade1ee3a83b0fe661d4c3df Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Fri, 6 Feb 2015 18:20:12 +0700
Subject: [PATCH 4/6] Revert "Remove pointless notification drawer network info
label in MSIM mode."
It's not completely pointless. There's no way to check the name of
the 2 networks without going back to the lock screen.
This reverts commit 20576fe8b2fb68fc9d25e19ebcceeee78f08590c.
Change-Id: I502de09208d6b7ce5969d605db26b069fbb29f5b
---
.../res/layout/msim_status_bar_expanded.xml | 6 ++++
.../systemui/statusbar/phone/PhoneStatusBar.java | 39 +++++++++++++++++-----
.../policy/MSimNetworkControllerImpl.java | 24 ++++++++++---
3 files changed, 56 insertions(+), 13 deletions(-)
diff --git a/packages/SystemUI/res/layout/msim_status_bar_expanded.xml b/packages/SystemUI/res/layout/msim_status_bar_expanded.xml
index ad8b71f..b7e9a8b 100644
--- a/packages/SystemUI/res/layout/msim_status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/msim_status_bar_expanded.xml
@@ -29,6 +29,12 @@
android:background="@android:color/transparent"
>
+ <include
+ layout="@layout/subs_label"
+ android:layout_height="@dimen/carrier_label_height"
+ android:layout_width="match_parent"
+ android:layout_gravity="bottom"
+ />
<include
layout="@layout/carrier_label"
android:layout_height="@dimen/carrier_label_height"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 03ab437..a1635d4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -349,6 +349,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
// carrier/wifi label
private TextView mCarrierLabel;
+ private TextView mSubsLabel;
private boolean mCarrierLabelVisible = false;
private int mCarrierLabelHeight;
private int mStatusBarHeaderHeight;
@@ -1140,10 +1141,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mMSimNetworkController.addEmergencyLabelView(mHeader);
mCarrierLabel = (TextView)mStatusBarWindowContent.findViewById(R.id.carrier_label);
+ mSubsLabel = (TextView)mStatusBarWindowContent.findViewById(R.id.subs_label);
mShowCarrierInPanel = (mCarrierLabel != null);
if (DEBUG) Log.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" +
- mShowCarrierInPanel);
+ mShowCarrierInPanel + "operator label=" + mSubsLabel);
if (mShowCarrierInPanel) {
mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);
@@ -1154,6 +1156,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
} else {
mMSimNetworkController.addCombinedLabelView(mCarrierLabel);
}
+ mSubsLabel.setVisibility(View.VISIBLE);
+ mMSimNetworkController.addSubsLabelView(mSubsLabel);
// set up the dynamic hide/show of the label
//mPile.setOnSizeChangedListener(new OnSizeChangedListener() {
// @Override
@@ -2041,14 +2045,30 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
final boolean emergencyCallsShownElsewhere = mContext.getResources().getBoolean(
R.bool.config_showEmergencyCallLabelOnly);
- final NetworkControllerImpl networkController = isMSim()
- ? mMSimNetworkController : mNetworkController;
- final boolean makeVisible =
- !(emergencyCallsShownElsewhere && networkController.isEmergencyOnly())
- && mStackScroller.getHeight() < (mNotificationPanel.getHeight()
- - mCarrierLabelHeight - mStatusBarHeaderHeight)
- && mStackScroller.getVisibility() == View.VISIBLE
- && mState != StatusBarState.KEYGUARD;
+ final boolean makeVisible ;
+ if (isMSim()) {
+ makeVisible =
+ !(emergencyCallsShownElsewhere && mMSimNetworkController.isEmergencyOnly())
+ && mStackScroller.getHeight() < (mNotificationPanel.getHeight()
+ - mCarrierLabelHeight - mStatusBarHeaderHeight)
+ && mStackScroller.getVisibility() == View.VISIBLE
+ && mState != StatusBarState.KEYGUARD;
+
+ if (mState == StatusBarState.KEYGUARD) {
+ // The subs are already displayed on the top bar
+ mSubsLabel.setVisibility(View.INVISIBLE);
+ } else {
+ mSubsLabel.setVisibility(View.VISIBLE);
+ }
+ } else {
+ makeVisible =
+ !(emergencyCallsShownElsewhere && mNetworkController.isEmergencyOnly())
+ && mStackScroller.getHeight() < (mNotificationPanel.getHeight()
+ - mCarrierLabelHeight - mStatusBarHeaderHeight)
+ && mStackScroller.getVisibility() == View.VISIBLE
+ && mState != StatusBarState.KEYGUARD;
+ }
+
if (force || mCarrierLabelVisible != makeVisible) {
mCarrierLabelVisible = makeVisible;
@@ -3815,6 +3835,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
instantCollapseNotificationPanel();
if (mMSimNetworkController != null) {
+ mMSimNetworkController.clearSubsLabelView();
mMSimNetworkController.removeAllSignalClusters();
} else if (mNetworkController != null) {
mNetworkController.removeAllSignalClusters();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
index 7ecba4e..333daab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
@@ -106,6 +106,7 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
int mPhoneCount = 0;
private SparseLongArray mPhoneIdSubIdMapping;
ArrayList<MSimSignalCluster> mSimSignalClusters = new ArrayList<MSimSignalCluster>();
+ ArrayList<TextView> mSubsLabelViews = new ArrayList<TextView>();
public interface MSimSignalCluster {
void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon,
@@ -459,6 +460,14 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
}
}
+ public void addSubsLabelView(TextView v) {
+ mSubsLabelViews.add(v);
+ }
+
+ public void clearSubsLabelView() {
+ mSubsLabelViews.clear();
+ }
+
private void updateCarrierText(int sub) {
int textResId = 0;
if (mAirplaneMode) {
@@ -508,10 +517,17 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
carrierName = carrierName + " " + mCarrierTextSub[i];
}
- for (int i = 0; i < mMobileLabelViews.size(); i++) {
- TextView v = mMobileLabelViews.get(i);
- v.setText(carrierName);
- v.setVisibility(View.VISIBLE);
+ if (mContext.getResources().getBoolean(R.bool.config_showDataConnectionView)) {
+ for (int i = 0; i < mSubsLabelViews.size(); i++) {
+ TextView v = mSubsLabelViews.get(i);
+ v.setText(carrierName);
+ }
+ } else {
+ for (int i = 0; i < mMobileLabelViews.size(); i++) {
+ TextView v = mMobileLabelViews.get(i);
+ v.setText(carrierName);
+ v.setVisibility(View.VISIBLE);
+ }
}
}
--
2.3.2 (Apple Git-55)
From f01671158d0370124340d760bcb2c5ecf1ca5775 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 7 Feb 2015 22:52:44 +0700
Subject: [PATCH 5/6] Revert "Msim: Use SIM display name"
IMO, not a good idea. Default is "SIM 1" and "SIM 2". There are
also roaming cases.
This reverts commit 5220513d5a76689f723b2f3e8a412ec3251b0168.
Change-Id: I00a5c6982cd8b45652da293071206f39a65c8830
---
.../statusbar/policy/MSimNetworkControllerImpl.java | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
index 333daab..9a7ebdd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MSimNetworkControllerImpl.java
@@ -40,7 +40,6 @@ import android.telephony.SubInfoRecord;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Slog;
-import android.util.SparseLongArray;
import android.view.View;
import android.widget.TextView;
@@ -54,6 +53,7 @@ import com.android.systemui.R;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.HashMap;
public class MSimNetworkControllerImpl extends NetworkControllerImpl {
// debug
@@ -104,7 +104,7 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
String[] mSpn;
String[] mPlmn;
int mPhoneCount = 0;
- private SparseLongArray mPhoneIdSubIdMapping;
+ private HashMap<Long, Integer> mSubIdPhoneIdMap;
ArrayList<MSimSignalCluster> mSimSignalClusters = new ArrayList<MSimSignalCluster>();
ArrayList<TextView> mSubsLabelViews = new ArrayList<TextView>();
@@ -231,7 +231,7 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
protected void registerPhoneStateListener(Context context) {
// telephony
mPhone = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
- mPhoneIdSubIdMapping = new SparseLongArray();
+ mSubIdPhoneIdMap = new HashMap<Long, Integer>();
mPhoneCount = TelephonyManager.getDefault().getPhoneCount();
Slog.d(TAG, "registerPhoneStateListener: " + mPhoneCount);
mMSimPhoneStateListener = new PhoneStateListener[mPhoneCount];
@@ -242,8 +242,9 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
Slog.d(TAG, "registerPhoneStateListener subId: " + subId);
Slog.d(TAG, "registerPhoneStateListener slotId: " + i);
if (subId > 0) {
- mPhoneIdSubIdMapping.put(i, subId);
- mMSimPhoneStateListener[i] = getPhoneStateListener(subId, i);
+ mSubIdPhoneIdMap.put(subId, i);
+ mMSimPhoneStateListener[i] = getPhoneStateListener(subId,
+ i);
mPhone.listen(mMSimPhoneStateListener[i],
PhoneStateListener.LISTEN_SERVICE_STATE
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
@@ -972,15 +973,6 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
+ " showPlmn=" + showPlmn + " plmn=" + plmn);
}
try {
- if (mPhoneIdSubIdMapping.indexOfKey(phoneId) >= 0) {
- long sub = mPhoneIdSubIdMapping.get(phoneId);
- SubInfoRecord sir = SubscriptionManager.getSubInfoForSubscriber(sub);
- if (sir != null) {
- mMSimNetworkName[phoneId] = sir.displayName;
- return;
- }
- }
-
StringBuilder str = new StringBuilder();
boolean something = false;
if (showPlmn && plmn != null) {
--
2.3.2 (Apple Git-55)
From 3d2a3eb2110b178d050d4df0054fffdf1b5272d7 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 2 May 2015 13:01:35 +0700
Subject: [PATCH 6/6] camera2: relax JPEG timeout
Causes image not to be taken when taking a picture using the back
camera with flash right after taking a picture using the front
camera.
This patches the value in 5.1 (e3c0434d9741c78ef0405de3e9f4d16b6a8ef360)
Change-Id: Ib15d4bfb3d7d19c47a274d7ce086008780b8fac3
---
core/java/android/hardware/camera2/legacy/RequestThreadManager.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
index 35deb71..2c73148 100644
--- a/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
+++ b/core/java/android/hardware/camera2/legacy/RequestThreadManager.java
@@ -82,8 +82,8 @@ public class RequestThreadManager {
private static final int MAX_IN_FLIGHT_REQUESTS = 2;
private static final int PREVIEW_FRAME_TIMEOUT = 1000; // ms
- private static final int JPEG_FRAME_TIMEOUT = 3000; // ms (same as CTS for API2)
- private static final int REQUEST_COMPLETE_TIMEOUT = 3000; // ms (same as JPEG timeout)
+ private static final int JPEG_FRAME_TIMEOUT = 4000; // ms (same as CTS for API2)
+ private static final int REQUEST_COMPLETE_TIMEOUT = JPEG_FRAME_TIMEOUT; // ms (same as JPEG timeout)
private static final float ASPECT_RATIO_TOLERANCE = 0.01f;
private boolean mPreviewRunning = false;
--
2.3.2 (Apple Git-55)
From 32c5173f5a8d02dc8a19a926947343f2a151f95b 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.2 (Apple Git-55)
From 7e7af3417e3c46b59511e646457b33ac11d99ccf 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 1dbb06f..8b36a54 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -875,6 +875,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;
@@ -1287,6 +1293,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.2 (Apple Git-55)
From b37367fc25cf863f3a3a8173293d1d448ff96640 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 1c4180f..7249308 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3720,6 +3720,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.2 (Apple Git-55)
From e07b59d2016aaac718d553a9b867775f1287dbfb 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(SE_MHEAP_SCREENSHOT) && !defined(CAPRI_HWC)
int format = 0;
producer->query(NATIVE_WINDOW_FORMAT,&format);
if (format == PIXEL_FORMAT_RGBA_8888) {
--
2.3.2 (Apple Git-55)
From 1aaa0f017c9b990713dc8b3daef2bd68ac5ea067 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 f152b65..3b2fd0a 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -199,7 +199,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.2 (Apple Git-55)
From c66703529191849ea019c8254298c9eedd1347e6 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 5c70922..f4888ee 100644
--- a/src/java/com/android/internal/telephony/PhoneBase.java
+++ b/src/java/com/android/internal/telephony/PhoneBase.java
@@ -205,6 +205,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;
@@ -421,6 +422,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);
@@ -1771,6 +1777,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);
}
@@ -2039,6 +2057,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.2 (Apple Git-55)
From 05046dab4c7cb100e53c8c3852d492e5676f83cc 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 8775282..5e96097 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -299,7 +299,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.2 (Apple Git-55)
From 1f88692550a23032072587b485a8ec09531a749b 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.2 (Apple Git-55)
From 8de24853a1c178c060b24fffccc65031bdecd78a 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 | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index be08322..fab95fd 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1583,7 +1583,7 @@ public class CameraActivity extends Activity
mCurrentModule.onPreviewVisibilityChanged(visibility);
}
- private void updatePreviewRendering(int visibility) {
+ /* package */ 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 7544e8b..a8f165a 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1895,6 +1895,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 b16a63f..74c7c0b 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -997,6 +997,8 @@ public class VideoModule extends CameraModule
mCameraDevice.setZoomChangeListener(null);
mCameraDevice.setErrorCallback(null, null);
mActivity.getCameraProvider().releaseCamera(mCameraDevice.getCameraId());
+ mActivity.updatePreviewRendering(ModuleController.VISIBILITY_HIDDEN);
+
mCameraDevice = null;
mPreviewing = false;
mSnapshotInProgress = false;
--
2.3.2 (Apple Git-55)
From 3a59ada3dbb37df92bcbe18cdbc6b8a1a2ae8c50 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 fab95fd..7c16e1d 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1572,7 +1572,7 @@ public class CameraActivity extends Activity
* 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 a8f165a..1f01750 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2003,6 +2003,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 74c7c0b..11e9ded 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -951,6 +951,7 @@ public class VideoModule extends CameraModule
}
});
mPreviewing = true;
+ mActivity.updatePreviewVisibility();
} catch (Throwable ex) {
closeCamera();
throw new RuntimeException("startPreview failed", ex);
--
2.3.2 (Apple Git-55)
From 1f578594f4735513c071c3cd107370340f28207d 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 29ba045..dba4632 100644
--- a/src/com/android/settings/sim/MultiSimEnablerPreference.java
+++ b/src/com/android/settings/sim/MultiSimEnablerPreference.java
@@ -199,7 +199,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.2 (Apple Git-55)
From 65bc4683dbc5db2aa5a11162305f7f8c313fce1a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 1 Feb 2015 15:26:48 +0700
Subject: [PATCH 1/2] Revert "DynamicGrid: tuning the icon size for some
device"
This reverts commit edbea0af1226978b06d7f877ae435797d31419af.
---
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 779a5a6..1494311 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -87,15 +87,15 @@ public class DynamicGrid {
(useLargeIcons ? 58 : 46), fourByFourDefaultLayout,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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, R.xml.default_workspace_5x5_no_all_apps));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
--
2.3.2 (Apple Git-55)
From 55256e98b72f0ac7c92b5e5aa3da8602ed4411df Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 1 Feb 2015 15:26:50 +0700
Subject: [PATCH 2/2] Revert "Update Larger icons setting for better usability"
This reverts commit 5c7529006f3ed78d934fed2861cebd3654695108.
---
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 1494311..d2a5ff7 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,47 +67,47 @@ 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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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,
R.xml.default_workspace_4x4_no_all_apps));
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, R.xml.default_workspace_5x5_no_all_apps));
// 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, R.xml.default_workspace_5x6_no_all_apps));
// 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, R.xml.default_workspace_5x6_no_all_apps));
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, R.xml.default_workspace_4x4_no_all_apps));
mMinWidth = dpiFromPx(minWidthPx, dm);
mMinHeight = dpiFromPx(minHeightPx, dm);
--
2.3.2 (Apple Git-55)
From 76b154b80e3014f9be0e82a19594cf319d7d82a5 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 1902a95..0508bde 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -2236,10 +2236,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();
}
}
--
2.3.2 (Apple Git-55)
From 313d3f336d07df9e7e18587bcb4b40be75b6804b 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 bbb5616..a4afd2f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -605,12 +605,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 89ab092..bf8cacd 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -993,7 +993,7 @@ public class MobileNetworkSettings extends PreferenceActivity
case Phone.NT_MODE_WCDMA_ONLY:
mButtonEnabledNetworks.setValue(
Integer.toString(Phone.NT_MODE_WCDMA_ONLY));
- mButtonEnabledNetworks.setSummary(R.string.network_wcdma_only);
+ mButtonEnabledNetworks.setSummary(R.string.preferred_network_mode_wcdma_only_choice);
break;
case Phone.NT_MODE_GSM_UMTS:
mButtonEnabledNetworks.setValue(
@@ -1003,12 +1003,12 @@ public class MobileNetworkSettings extends PreferenceActivity
case Phone.NT_MODE_WCDMA_PREF:
mButtonEnabledNetworks.setValue(
Integer.toString(Phone.NT_MODE_WCDMA_PREF));
- mButtonEnabledNetworks.setSummary(R.string.network_wcdma_pref);
+ mButtonEnabledNetworks.setSummary(R.string.preferred_network_mode_gsm_wcdma_preferred_choice);
break;
case Phone.NT_MODE_GSM_ONLY:
mButtonEnabledNetworks.setValue(
Integer.toString(Phone.NT_MODE_GSM_ONLY));
- mButtonEnabledNetworks.setSummary(R.string.network_gsm_only);
+ mButtonEnabledNetworks.setSummary(R.string.preferred_network_mode_gsm_only_choice);
break;
case Phone.NT_MODE_LTE_GSM_WCDMA:
mButtonEnabledNetworks.setValue(
--
2.3.2 (Apple Git-55)
From f4d5328cc79ebaa9ad29ab32887de2d07d3dadf0 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.2 (Apple Git-55)
@k2wl
Copy link

k2wl commented Nov 16, 2014

thanks.

@andixlm
Copy link

andixlm commented Nov 20, 2014

Thanks

@ZIM555
Copy link

ZIM555 commented Nov 21, 2014

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment