Skip to content

Instantly share code, notes, and snippets.

@rutvik95
Forked from pawitp/bootable_recovery.patch
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rutvik95/970e264b24b7e1a5ab21 to your computer and use it in GitHub Desktop.
Save rutvik95/970e264b24b7e1a5ab21 to your computer and use it in GitHub Desktop.
From 555aacee004a90a907bf32d10a2fb1ac22bbc6f2 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 {
--
1.9.3 (Apple Git-50)
From 576c8a8c1b7f9e5da676c33b97875a259de3a405 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 8b8950c..0f1892f 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -361,6 +361,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;
}
--
1.9.3 (Apple Git-50)
From f89b2e8a660ca9f6b37da19ebf3bac292d1b56ef 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 095054b..e3c9aea 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1688,6 +1688,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 0f1892f..0de016c 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -886,6 +886,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);
--
1.9.3 (Apple Git-50)
From 58c300b78fdeff4e87f49cd93583197b4abd7a76 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 e3c9aea..aca88f8 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -3382,6 +3382,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));
--
1.9.3 (Apple Git-50)
From a36bedcd02ab0adcbd33ceafd60ead4948d6e62f 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 aca88f8..4c4a215 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1691,13 +1691,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
--
1.9.3 (Apple Git-50)
From 70e741c41626324e4c22ea0203ac60922e795ace 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 2b883cc..c6654b2 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2244,6 +2244,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"
--
1.9.3 (Apple Git-50)
From ac0bdd1edc36c22f9b5b3ffcd02bce96fec05d7a 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 c6654b2..e87bd8b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2246,8 +2246,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,
--
1.9.3 (Apple Git-50)
From 9e353667cc3a684be4a730f5d5dd82a2e13a702d 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 4c4a215..f9d8d5f 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -781,7 +781,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 0de016c..6430ae2 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2287,7 +2287,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;
--
1.9.3 (Apple Git-50)
From 426f63be1158c5c319b994f50f7ce2265e51eab2 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(
--
1.9.3 (Apple Git-50)
From 2d8abcceadc02b7aced5399623dfbbe3e7ee9fb8 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 f9d8d5f..b9f151a 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2560,7 +2560,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;
@@ -2576,7 +2582,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)) {
@@ -2658,7 +2664,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)) {
@@ -2786,7 +2792,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)) {
@@ -2901,7 +2907,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)) {
@@ -2968,7 +2974,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)) {
--
1.9.3 (Apple Git-50)
From 9b929bd6adac99317547339b202a079d16683e41 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 | 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 a225539..e8a7aba 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 */
--
1.9.3 (Apple Git-50)
From 05b7ea9335070c61bbb19154f631b08b68646861 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 8376e7c..a1decec 100644
--- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
+++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
@@ -1040,7 +1040,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.3 (Apple Git-50)
From 727a6efc4e281bed9cf20969a6e99cc75f374825 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 9ce2725..b2bc461 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -240,6 +240,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;
@@ -1134,6 +1135,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;
@@ -1634,7 +1640,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 {
mButtonsLight.setBrightness(buttonBrightness);
--
1.9.3 (Apple Git-50)
From 1e1978aec5ff3d4203a1c2c24b22f162c5fe2fee 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;
--
1.9.3 (Apple Git-50)
From a483196aff5f095052cca7f28a207150b78f8f17 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
--
1.9.3 (Apple Git-50)
From 0e356617a33dc37e541207c9c15c14d7367e46b2 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 3997d77..2d74b89 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3730,6 +3730,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();
--
1.9.3 (Apple Git-50)
From 22758b3e025c564d8a231446b90132cdd50296fa 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 59787bf..73d35e8 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -768,7 +768,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) {
--
1.9.3 (Apple Git-50)
From 0cf774bc3f53692737baefca4a00a5c32a685478 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)",
--
1.9.3 (Apple Git-50)
From 78762af7e45286c38732666bea4e7645f64f6daa 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);
--
1.9.3 (Apple Git-50)
From 46e3eebd3e35a199ffe8268e42fad8081cf82182 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;
--
1.9.3 (Apple Git-50)
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
--
1.9.3 (Apple Git-50)
From 60b17cbf5efd61bcb9b02a586a10c611f507869f 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 680b117..a50af7f 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1566,7 +1566,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 bb08242..1fb6bf7 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;
--
1.9.3 (Apple Git-50)
From 831ac59e22029b0924dc459e48d90020cbe0bc68 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 a50af7f..f2c5d96 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1555,7 +1555,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 1fb6bf7..3b88b4e 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);
--
1.9.3 (Apple Git-50)
From d53cd555cc89cae35619eac0f7519c17767d4b0e 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/SimSettings.java | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index dea58f1..349557b 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -165,19 +165,13 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
for (int i = 0; i < mNumSlots; ++i) {
final SubInfoRecord sir = findRecordBySlotId(i);
simCards.addPreference(new SimPreference(getActivity(), sir, i));
- if (mNumSlots > 1) {
- mSimEnablers.add(i, new MultiSimEnablerPreference(
- getActivity(), sir, mHandler, i));
- simEnablers.addPreference(mSimEnablers.get(i));
- } else {
- removePreference(SIM_ENABLER_CATEGORY);
- }
// Do not display deactivated subInfo in preference list
if ((sir != null) && (sir.mStatus == SubscriptionManager.ACTIVE)) {
mNumSims++;
mAvailableSubInfos.add(sir);
}
}
+ removePreference(SIM_ENABLER_CATEGORY);
}
private void updateAllOptions() {
--
1.9.3 (Apple Git-50)
From f334a6d825df5e18f3475a0c8a84cc43d3e406bb 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
--
1.9.3 (Apple Git-50)
From 5aa1a04b0e86262f0b71715027e1dd0dbf0447e1 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);
--
1.9.3 (Apple Git-50)
From 834198b8aaecbe6afa5817610c50579b3739cb42 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 23 Dec 2014 22:15:37 +0700
Subject: [PATCH 1/4] Telephony: fix 'up' navigation for SelectSubscription
The 'up' command should be passed down to the activity in the tab
Change-Id: I70d5e4d5cb2d44f62cca481337f108d122726e14
---
src/com/android/phone/msim/MSimCallFeaturesSubSetting.java | 6 +-----
src/com/android/phone/msim/SelectSubscription.java | 9 +++++++++
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/com/android/phone/msim/MSimCallFeaturesSubSetting.java b/src/com/android/phone/msim/MSimCallFeaturesSubSetting.java
index 49d9eaa..bf6fbd9 100644
--- a/src/com/android/phone/msim/MSimCallFeaturesSubSetting.java
+++ b/src/com/android/phone/msim/MSimCallFeaturesSubSetting.java
@@ -1991,11 +1991,7 @@ public class MSimCallFeaturesSubSetting extends PreferenceActivity
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled()
- Intent intent = new Intent();
- intent.setClassName(UP_ACTIVITY_PACKAGE, UP_ACTIVITY_CLASS);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- finish();
+ CallFeaturesSetting.goUpToTopLevelSetting(this);
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/src/com/android/phone/msim/SelectSubscription.java b/src/com/android/phone/msim/SelectSubscription.java
index 0d43437..bb82fc1 100644
--- a/src/com/android/phone/msim/SelectSubscription.java
+++ b/src/com/android/phone/msim/SelectSubscription.java
@@ -29,6 +29,7 @@
package com.android.phone.msim;
+import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
@@ -36,6 +37,7 @@ import android.telephony.SubInfoRecord;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
+import android.view.MenuItem;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
@@ -102,6 +104,13 @@ public class SelectSubscription extends TabActivity {
}
@Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ String tabTag = getTabHost().getCurrentTabTag();
+ Activity activity = getLocalActivityManager().getActivity(tabTag);
+ return activity.onOptionsItemSelected(item);
+ }
+
+ @Override
protected void onResume() {
super.onResume();
}
--
1.9.3 (Apple Git-50)
From cca9ca5c73c32b0d2f4b0e6fe9af4134900e5ebe Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sun, 23 Nov 2014 15:57:20 +0700
Subject: [PATCH 2/4] Telephony: MSim: enable preferred mode button for all
phones
HACK to allow changing network mode on multi-SIM
Change-Id: I79cd6dfb1653c9c1ef14b8965c9af2bd0f5792cb
---
res/values/strings.xml | 10 ++++++++
res/xml/msim_network_sub_setting.xml | 4 ++--
.../phone/msim/MSimMobileNetworkSubSettings.java | 27 +++++++---------------
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dbd4d60..43c3aa9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -384,6 +384,16 @@
<!-- Mobile network settings, summary for preferred network mode LTE / WCDMA[CHAR LIMIT=100] -->
<string name="preferred_network_mode_lte_wcdma_summary">Preferred network mode: LTE / WCDMA</string>
+ <string-array name="preferred_network_mode_choices_2" translatable="false">
+ <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="preferred_network_mode_values_2" translatable="false">
+ <item>"2"</item>
+ <item>"1"</item>
+ <item>"0"</item>
+ </string-array>
<string-array name="preferred_network_mode_choices">
<item>LTE / WCDMA</item>
diff --git a/res/xml/msim_network_sub_setting.xml b/res/xml/msim_network_sub_setting.xml
index 0f4698e..5af5725 100644
--- a/res/xml/msim_network_sub_setting.xml
+++ b/res/xml/msim_network_sub_setting.xml
@@ -40,8 +40,8 @@
android:key="preferred_network_mode_key"
android:title="@string/preferred_network_mode_title"
android:summary="@string/preferred_network_mode_summary"
- android:entries="@array/preferred_network_mode_choices_cm"
- android:entryValues="@array/preferred_network_mode_values"
+ android:entries="@array/preferred_network_mode_choices_2"
+ android:entryValues="@array/preferred_network_mode_values_2"
android:dialogTitle="@string/preferred_network_mode_dialogtitle" />
</PreferenceScreen>
diff --git a/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java b/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java
index 4bd2656..f34c30b 100644
--- a/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java
+++ b/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java
@@ -212,32 +212,21 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity
mUPLMNPref.getIntent().putExtra(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getPhoneId());
}
- boolean isLteOnCdma = mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
- if (getResources().getBoolean(R.bool.world_phone) == true) {
- // set the listener for the mButtonPreferredNetworkMode list preference so we can issue
- // change Preferred Network Mode.
- mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
+ // set the listener for the mButtonPreferredNetworkMode list preference so we can issue
+ // change Preferred Network Mode.
+ mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
- //Get the networkMode from Settings.System and displays it
- int settingsNetworkMode = getPreferredNetworkMode();
- mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
+ //Get the networkMode from Settings.System and displays it
+ int settingsNetworkMode = getPreferredNetworkMode();
+ mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
+
+ if (getResources().getBoolean(R.bool.world_phone) == true) {
mCdmaOptions = new CdmaOptions(this, prefSet, mPhone);
mGsmUmtsOptions = new GsmUmtsOptions(this, prefSet, mPhone.getPhoneId());
} else {
- if (!isLteOnCdma) {
- prefSet.removePreference(mButtonPreferredNetworkMode);
- }
int phoneType = mPhone.getPhoneType();
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
mCdmaOptions = new CdmaOptions(this, prefSet, mPhone);
- if (isLteOnCdma) {
- mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
-
- int settingsNetworkMode = getPreferredNetworkMode();
- mButtonPreferredNetworkMode.setValue(
- Integer.toString(settingsNetworkMode));
- }
-
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
mGsmUmtsOptions = new GsmUmtsOptions(this, prefSet, mPhone.getPhoneId());
} else {
--
1.9.3 (Apple Git-50)
From 0787d2689b8b89c984856329ddaf6507ddacb275 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 3/4] 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 b130ff6..13737f6 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -2226,10 +2226,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.3 (Apple Git-50)
From b7d9a3e417e7d26053d011073d972b41d075eb7a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Thu, 15 Jan 2015 20:42:47 +0700
Subject: [PATCH 4/4] Telephony: remove Video Call settings
Change-Id: I2504a889ea657f6e22babdbe150813bcaf4a6ce9
---
res/xml/call_feature_setting_msim.xml | 39 -----------------------------------
1 file changed, 39 deletions(-)
diff --git a/res/xml/call_feature_setting_msim.xml b/res/xml/call_feature_setting_msim.xml
index 1ba6a10..5a13683 100644
--- a/res/xml/call_feature_setting_msim.xml
+++ b/res/xml/call_feature_setting_msim.xml
@@ -72,43 +72,4 @@
android:summary="@string/dtmf_tones_summary"
android:entries="@array/dtmf_tone_entries"
android:entryValues="@array/dtmf_tone_values"/>
-
- <SwitchPreference
- android:key="button_enable_video_calling"
- android:title="@string/enable_video_calling_title"
- android:persistent="true"
- android:defaultValue="true" />
-
- <!-- Add videocall settings menu -->
- <PreferenceCategory
- android:key="button_videocall_settings_key"
- android:title="@string/videocall_settings"
- android:persistent="false" />
- <PreferenceScreen
- android:key="videocall_setting_fb_key"
- android:title="@string/vt_fallback_setting" >
- <intent
- android:action="android.intent.action.MAIN"
- android:targetClass="com.borqs.videocall.FallBackSetting"
- android:targetPackage="com.borqs.videocall" />
- </PreferenceScreen>
- <PreferenceScreen
- android:key="videocall_setting_fw_key"
- android:title="@string/vt_forward_setting"
- android:persistent="false" >
- <intent
- android:action="android.intent.action.MAIN"
- android:targetClass="com.borqs.videocall.VTCallForwardOptions"
- android:targetPackage="com.borqs.videocall" />
- </PreferenceScreen>
- <PreferenceScreen
- android:key="vt_imageplacer"
- android:persistent="false"
- android:summary="@string/vt_imagereplace_setting_sum"
- android:title="@string/vt_imagereplace_setting" >
- <intent
- android:action="android.intent.action.MAIN"
- android:targetClass="com.borqs.videocall.VTImageReplaceSetting"
- android:targetPackage="com.borqs.videocall" />
- </PreferenceScreen>
</PreferenceScreen>
--
1.9.3 (Apple Git-50)
From 73b9cc87994bb053b65c68751020806ea51ecfd1 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;
+}
--
1.9.3 (Apple Git-50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment