Skip to content

Commit

Permalink
Merge tag 'android-7.1.2_r5' into android-7.1
Browse files Browse the repository at this point in the history
Android 7.1.2 Release 5 (N2G47J)

Change-Id: I3be6bdeac3f61342c7c301c71ce0bb7a113d36da
  • Loading branch information
darkobas committed Apr 9, 2017
2 parents fe12fa0 + a3e136b commit 15bb2ee
Show file tree
Hide file tree
Showing 19 changed files with 250 additions and 53 deletions.
65 changes: 23 additions & 42 deletions apns-full-conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,10 @@
type="mms"
/>

<apn carrier="Px MMS"
<apn carrier="Proximus MMS"
mcc="206"
mnc="01"
apn="EVENT.PROXIMUS.BE"
apn="event.proximus.be"
user="mms"
password="mms"
authtype="1"
Expand All @@ -753,17 +753,17 @@
type="mms"
/>

<apn carrier="Px Internet"
<apn carrier="Proximus Internet"
mcc="206"
mnc="01"
apn=""
type="ia"
/>

<apn carrier="Px Internet"
<apn carrier="Proximus Internet"
mcc="206"
mnc="01"
apn="INTERNET.PROXIMUS.BE"
apn="internet.proximus.be"
type="default,supl"
/>

Expand All @@ -772,7 +772,7 @@
mnc="01"
apn="telenetwap.be"
type="default,supl"
mvno_match_data="2060188"
mvno_match_data="20601889"
mvno_type="imsi"
/>

Expand All @@ -784,7 +784,7 @@
mmsproxy="195.130.149.100"
mmsport="80"
type="mms"
mvno_match_data="2060188"
mvno_match_data="20601889"
mvno_type="imsi"
/>

Expand Down Expand Up @@ -1008,7 +1008,6 @@
apn="orange"
user="orange"
password="orange"
authtype="1"
type="default,supl"
/>

Expand All @@ -1021,27 +1020,25 @@
mmsc="http://mms.orange.fr"
mmsproxy="192.168.10.200"
mmsport="8080"
authtype="1"
type="mms"
/>

<apn carrier="Orange Entreprise"
<apn carrier="Orange Entreprises"
mcc="208"
mnc="01"
apn="orange-mib"
proxy="172.16.2.8"
port="8000"
user="orange"
password="orange"
authtype="2"
type="default"
type="default,supl"
/>

<apn carrier="Orange Internet"
mcc="208"
mnc="01"
apn="orange.fr"
authtype="0"
authtype="1"
user="orange"
password="orange"
type="dun"
Expand Down Expand Up @@ -1163,7 +1160,7 @@
mmsc="http://mms1"
mmsproxy="10.151.0.1"
mmsport="8080"
type="default,mms,supl"
type="default,hipri,mms"
/>

<apn carrier="SFR option Modem"
Expand Down Expand Up @@ -9407,7 +9404,7 @@
type="mms"
protocol="IPV6"
roaming_protocol="IPV6"
bearer_bitmask="18"
bearer="18"
/>

<apn carrier="T-Mobile IMS"
Expand All @@ -9426,7 +9423,7 @@
type="ims"
protocol="IPV6"
roaming_protocol="IPV6"
bearer_bitmask="18"
bearer="18"
/>

<apn carrier="Project Fi - T"
Expand Down Expand Up @@ -24651,29 +24648,15 @@
type="mms"
/>

<apn carrier="Mozaic Mob"
mcc="427"
mnc="01"
apn="gprs.qtel"
user="gprs"
password="gprs"
authtype="1"
proxy="10.23.8.3"
port="8080"
type="default,supl"
/>

<apn carrier="Qtel MMS"
mcc="427"
mnc="01"
apn="mms.qtel"
user="10"
password="11"
authtype="1"
mmsproxy="10.23.8.3"
mmsport="8080"
mmsc="http://mmsr.qtelmms.qa"
type="mms"
<apn carrier="Ooredoo data"
mcc="427"
mnc="01"
apn="data"
mmsproxy="10.23.8.3"
mmsport="8080"
mmsc="http://mmsr.ooredoomms.qa"
type="default,supl,mms"
authtype="1"
/>

<apn carrier="Voda internet"
Expand Down Expand Up @@ -24815,12 +24798,10 @@
type="mms"
/>

<apn carrier="Irancell-GPRS"
<apn carrier="Irancell-Internet"
mcc="432"
mnc="35"
apn="mtnirancell"
proxy="10.131.26.138"
port="8080"
type="default,supl"
/>

Expand Down
10 changes: 7 additions & 3 deletions camera/QCamera2/HAL3/QCamera3HWI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "QCamera3Channel.h"
#include "QCamera3PostProc.h"
#include "QCamera3VendorTags.h"
#include "cam_cond.h"

using namespace android;

Expand Down Expand Up @@ -364,7 +365,8 @@ QCamera3HardwareInterface::QCamera3HardwareInterface(uint32_t cameraId,
// TODO: hardcode for now until mctl add support for min_num_pp_bufs
//TBD - To see if this hardcoding is needed. Check by printing if this is filled by mctl to 3
gCamCapability[cameraId]->min_num_pp_bufs = 3;
pthread_cond_init(&mRequestCond, NULL);

PTHREAD_COND_INIT(&mRequestCond);
mPendingLiveRequest = 0;
mCurrentRequestId = -1;
pthread_mutex_init(&mMutex, NULL);
Expand Down Expand Up @@ -3826,7 +3828,7 @@ int QCamera3HardwareInterface::processCaptureRequest(
// Added a timed condition wait
struct timespec ts;
uint8_t isValidTimeout = 1;
rc = clock_gettime(CLOCK_REALTIME, &ts);
rc = clock_gettime(CLOCK_MONOTONIC, &ts);
if (rc < 0) {
isValidTimeout = 0;
ALOGE("%s: Error reading the real time clock!!", __func__);
Expand Down Expand Up @@ -9486,7 +9488,9 @@ int32_t QCamera3HardwareInterface::stopAllChannels()
for (List<stream_info_t *>::iterator it = mStreamInfo.begin();
it != mStreamInfo.end(); it++) {
QCamera3Channel *channel = (QCamera3Channel *)(*it)->stream->priv;
channel->stop();
if (channel != nullptr) {
channel->stop();
}
(*it)->status = INVALID;
}

Expand Down
34 changes: 34 additions & 0 deletions camera/QCamera2/stack/common/cam_cond.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef CAM_COND_H
#define CAM_COND_H

#define PTHREAD_COND_INIT(cond) \
({ \
int rc = 0; \
pthread_condattr_t cond_attr; \
rc = pthread_condattr_init(&cond_attr); \
if (rc == 0) { \
rc = pthread_condattr_setclock(&cond_attr, CLOCK_MONOTONIC); \
if (rc == 0) { \
rc = pthread_cond_init(cond, &cond_attr); \
} \
} \
rc; \
})

#endif // CAM_COND_H
28 changes: 27 additions & 1 deletion camera/QCamera2/stack/common/cam_semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
#ifndef __QCAMERA_SEMAPHORE_H__
#define __QCAMERA_SEMAPHORE_H__

// System dependencies
#include <pthread.h>
#include <errno.h>
#include "cam_cond.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -48,7 +53,7 @@ typedef struct {
static inline void cam_sem_init(cam_semaphore_t *s, int n)
{
pthread_mutex_init(&(s->mutex), NULL);
pthread_cond_init(&(s->cond), NULL);
PTHREAD_COND_INIT(&(s->cond));
s->val = n;
}

Expand All @@ -71,6 +76,27 @@ static inline int cam_sem_wait(cam_semaphore_t *s)
return rc;
}

static inline int cam_sem_timedwait(cam_semaphore_t *s, const struct timespec *abs_timeout)
{
int rc = 0;
pthread_mutex_lock(&(s->mutex));
while (s->val == 0 && rc != ETIMEDOUT)
rc = pthread_cond_timedwait(&(s->cond), &(s->mutex), abs_timeout);

if (s->val > 0)
s->val--;

pthread_mutex_unlock(&(s->mutex));

/* sem_timedwait returns -1 for failure case, and failure code is in errno
*/
if (rc != 0) {
errno = rc;
rc = -1;
}
return rc;
}

static inline void cam_sem_destroy(cam_semaphore_t *s)
{
pthread_mutex_destroy(&(s->mutex));
Expand Down
2 changes: 2 additions & 0 deletions camera/QCamera2/stack/mm-camera-interface/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ LOCAL_CFLAGS += -D_ANDROID_
LOCAL_COPY_HEADERS_TO := mm-camera-interface
LOCAL_COPY_HEADERS += ../common/cam_intf.h
LOCAL_COPY_HEADERS += ../common/cam_types.h
LOCAL_COPY_HEADERS += ../common/cam_cond.h
LOCAL_COPY_HEADERS += ../common/cam_semaphore.h

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/inc \
Expand Down
5 changes: 3 additions & 2 deletions camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "mm_camera_sock.h"
#include "mm_camera_interface.h"
#include "mm_camera.h"
#include "cam_cond.h"

#define SET_PARM_BIT32(parm, parm_arr) \
(parm_arr[parm/32] |= (1<<(parm%32)))
Expand Down Expand Up @@ -340,7 +341,7 @@ int32_t mm_camera_open(mm_camera_obj_t *my_obj)

pthread_mutex_init(&my_obj->cb_lock, NULL);
pthread_mutex_init(&my_obj->evt_lock, NULL);
pthread_cond_init(&my_obj->evt_cond, NULL);
PTHREAD_COND_INIT(&my_obj->evt_cond);

CDBG("%s : Launch evt Thread in Cam Open",__func__);
snprintf(my_obj->evt_thread.threadName, THREAD_NAME_SIZE, "CAM_Dispatch");
Expand Down Expand Up @@ -1713,7 +1714,7 @@ void mm_camera_util_wait_for_event(mm_camera_obj_t *my_obj,

pthread_mutex_lock(&my_obj->evt_lock);
while (!(my_obj->evt_rcvd.server_event_type & evt_mask)) {
clock_gettime(CLOCK_REALTIME, &ts);
clock_gettime(CLOCK_MONOTONIC, &ts);
ts.tv_sec += WAIT_TIMEOUT;
rc = pthread_cond_timedwait(&my_obj->evt_cond, &my_obj->evt_lock, &ts);
if (rc == ETIMEDOUT) {
Expand Down
16 changes: 16 additions & 0 deletions camera/QCamera2/stack/mm-camera-test/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,19 @@ LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)

LOCAL_MODULE:= libmm-qcamera
include $(BUILD_SHARED_LIBRARY)

# Build cam_semaphore_tests
include $(CLEAR_VARS)

LOCAL_SRC_FILES := src/cam_semaphore_tests.cpp

LOCAL_C_INCLUDES += $(LOCAL_PATH)/../common

LOCAL_CFLAGS := -Wall -Wextra -Werror

LOCAL_MODULE := cam_semaphore_tests
LOCAL_MODULE_TAGS := tests

include $(BUILD_NATIVE_TEST)

LOCAL_PATH := $(OLD_LOCAL_PATH)
Loading

0 comments on commit 15bb2ee

Please sign in to comment.