Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bebd9e5 authored by Brint E. Kriebel's avatar Brint E. Kriebel
Browse files

Merge branch 'cm-11.0' into stable/cm-11.0

parents 4f63bf99 d4ab3f4d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
@@ -76,7 +77,7 @@
            android:exported="true"
            android:process="@string/process">
            <path-permission
                    android:path="/btopp"
                    android:pathPrefix="/btopp"
                    android:permission="android.permission.ACCESS_BLUETOOTH_SHARE" />
        </provider>
        <service
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ static void btavrcp_remote_features_callback(bt_bdaddr_t* bd_addr, btrc_remote_f
    sCallbackEnv->SetByteArrayRegion(addr, 0, sizeof(bt_bdaddr_t), (jbyte*) bd_addr);
    sCallbackEnv->CallVoidMethod(mCallbacksObj, method_getRcFeatures, addr, (jint)features);
    checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__);
    sCallbackEnv->DeleteLocalRef(addr);
}

static void btavrcp_get_play_status_callback() {
+7 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static const btsock_interface_t *sBluetoothSocketInterface = NULL;
static const btmce_interface_t *sBluetoothMceInterface = NULL;
static JNIEnv *callbackEnv = NULL;

static jobject sJniCallbacksObj;
static jobject sJniCallbacksObj = NULL;
static jfieldID sJniCallbacksField;


@@ -89,9 +89,11 @@ static void adapter_state_change_callback(bt_state_t status) {
       return;
    }
    ALOGV("%s: Status is: %d", __FUNCTION__, status);

    if(sJniCallbacksObj) {
       callbackEnv->CallVoidMethod(sJniCallbacksObj, method_stateChangeCallback, (jint)status);

    } else {
       ALOGE("JNI ERROR : JNI reference already cleaned : adapter_state_change_callback", __FUNCTION__);
    }
    checkAndClearExceptionFromCallback(callbackEnv, __FUNCTION__);
}

@@ -656,6 +658,7 @@ static bool cleanupNative(JNIEnv *env, jobject obj) {
    ALOGI("%s: return from cleanup",__FUNCTION__);

    env->DeleteGlobalRef(sJniCallbacksObj);
    sJniCallbacksObj = NULL;
    return JNI_TRUE;
}

+23 −13
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static jmethodID method_onGetDescriptor;
static jmethodID method_onGetIncludedService;
static jmethodID method_onRegisterForNotifications;
static jmethodID method_onReadRemoteRssi;
static jmethodID method_onClientListen;
static jmethodID method_onAdvertiseCallback;

/**
 * Server callback methods
@@ -423,11 +423,10 @@ void btgattc_remote_rssi_cb(int client_if,bt_bdaddr_t* bda, int rssi, int status
    checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__);
}

void btgattc_listen_cb(int status, int client_if)
void btgattc_advertise_cb(int status, int client_if)
{
    CHECK_CALLBACK_ENV
    sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onClientListen
        , status, client_if);
    sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onAdvertiseCallback, status, client_if);
    checkAndClearExceptionFromCallback(sCallbackEnv, __FUNCTION__);
}

@@ -449,7 +448,7 @@ static const btgatt_client_callbacks_t sGattClientCallbacks = {
    btgattc_write_descriptor_cb,
    btgattc_execute_write_cb,
    btgattc_remote_rssi_cb,
    btgattc_listen_cb
    btgattc_advertise_cb
};


@@ -680,7 +679,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) {
    method_onAttributeRead= env->GetMethodID(clazz, "onAttributeRead", "(Ljava/lang/String;IIIIZ)V");
    method_onAttributeWrite= env->GetMethodID(clazz, "onAttributeWrite", "(Ljava/lang/String;IIIIIZZ[B)V");
    method_onExecuteWrite= env->GetMethodID(clazz, "onExecuteWrite", "(Ljava/lang/String;III)V");
    method_onClientListen = env->GetMethodID(clazz, "onClientListen", "(II)V");
    method_onAdvertiseCallback = env->GetMethodID(clazz, "onAdvertiseCallback", "(II)V");

    info("classInitNative: Success!");
}
@@ -1058,7 +1057,7 @@ static void gattClientReadRemoteRssiNative(JNIEnv* env, jobject object, jint cli
    sGattIf->client->read_remote_rssi(clientif, &bda);
}

static void gattClientListenNative(JNIEnv *env, jobject object,
static void gattAdvertiseNative(JNIEnv *env, jobject object,
        jint client_if, jboolean start)
{
    if (!sGattIf) return;
@@ -1066,17 +1065,28 @@ static void gattClientListenNative(JNIEnv *env, jobject object,
}

static void gattSetAdvDataNative(JNIEnv *env, jobject object, jint client_if, jboolean setScanRsp,
        jboolean inclName, jboolean inclTxPower, jint minInterval, jint maxInterval, jint appearance,
        jbyteArray manufacturerData)
        jboolean inclName, jboolean inclTxPower, jint minInterval, jint maxInterval,
        jint appearance, jbyteArray manufacturerData, jbyteArray serviceData,
        jbyteArray serviceUuid)
{
    if (!sGattIf) return;
    jbyte* arr_data = env->GetByteArrayElements(manufacturerData, 0);
    jbyte* arr_data = env->GetByteArrayElements(manufacturerData, NULL);
    uint16_t arr_len = (uint16_t) env->GetArrayLength(manufacturerData);

    jbyte* service_data = env->GetByteArrayElements(serviceData, NULL);
    uint16_t service_data_len = (uint16_t) env->GetArrayLength(serviceData);

    jbyte* service_uuid = env->GetByteArrayElements(serviceUuid, NULL);
    uint16_t service_uuid_len = (uint16_t) env->GetArrayLength(serviceUuid);

    sGattIf->client->set_adv_data(client_if, setScanRsp, inclName, inclTxPower,
        minInterval, maxInterval, appearance, arr_len, (char*)arr_data);
        minInterval, maxInterval, appearance, arr_len, (char*)arr_data,
        service_data_len, (char*)service_data, service_uuid_len,
        (char*)service_uuid);

    env->ReleaseByteArrayElements(manufacturerData, arr_data, JNI_ABORT);
    env->ReleaseByteArrayElements(serviceData, service_data, JNI_ABORT);
    env->ReleaseByteArrayElements(serviceUuid, service_uuid, JNI_ABORT);
}


@@ -1292,7 +1302,7 @@ static JNINativeMethod sMethods[] = {
    {"gattClientExecuteWriteNative", "(IZ)V", (void *) gattClientExecuteWriteNative},
    {"gattClientRegisterForNotificationsNative", "(ILjava/lang/String;IIJJIJJZ)V", (void *) gattClientRegisterForNotificationsNative},
    {"gattClientReadRemoteRssiNative", "(ILjava/lang/String;)V", (void *) gattClientReadRemoteRssiNative},
    {"gattClientListenNative", "(IZ)V", (void *) gattClientListenNative},
    {"gattAdvertiseNative", "(IZ)V", (void *) gattAdvertiseNative},

    {"gattServerRegisterAppNative", "(JJ)V", (void *) gattServerRegisterAppNative},
    {"gattServerUnregisterAppNative", "(I)V", (void *) gattServerUnregisterAppNative},
@@ -1309,7 +1319,7 @@ static JNINativeMethod sMethods[] = {
    {"gattServerSendNotificationNative", "(III[B)V", (void *) gattServerSendNotificationNative},
    {"gattServerSendResponseNative", "(IIIIII[BI)V", (void *) gattServerSendResponseNative},

    {"gattSetAdvDataNative", "(IZZZIII[B)V", (void *) gattSetAdvDataNative},
    {"gattSetAdvDataNative", "(IZZZIII[B[B[B)V", (void *) gattSetAdvDataNative},
    {"gattTestNative", "(IJJLjava/lang/String;IIIII)V", (void *) gattTestNative},
};

+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.net-->
<!--
     Copyright (C) 2014 The CyanogenMod 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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string name="empty_file_notification_sent">مشاركة البلوتوث: رفض ملف عن بعد طول صفري <xliff:g id="file"> %1$s </xliff:g></string>
  <string name="format_progress_text">%1$d%%</string>
</resources>
Loading