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

Commit 2fb23517 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Uprev libchrome to r576279 (1/multiple)

This patch brings the latest and greatest features of libchrome to
android. It contains ~2600 patches.
Reason for uprev: libbluetooth want to use some of the most recent
features avaliable.

Test: libchrome_test
Change-Id: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768
Merged-In: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768
parent d93c32ac
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@
#include <stdlib.h>

#include <base/bind.h>
#include <base/location.h>
#include <base/message_loop/message_loop.h>
#include <base/tracked_objects.h>
#include <hardware/bluetooth.h>

#include "bt_types.h"
@@ -175,7 +175,7 @@ typedef struct {
 ******************************************************************************/

extern bt_status_t do_in_jni_thread(base::OnceClosure task);
extern bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
extern bt_status_t do_in_jni_thread(const base::Location& from_here,
                                    base::OnceClosure task);
extern bool is_on_jni_thread();
extern base::MessageLoop* get_jni_message_loop();
@@ -184,11 +184,11 @@ extern base::MessageLoop* get_jni_message_loop();
 * thread
 */
template <typename R, typename... Args>
base::Callback<R(Args...)> jni_thread_wrapper(
    const tracked_objects::Location& from_here, base::Callback<R(Args...)> cb) {
base::Callback<R(Args...)> jni_thread_wrapper(const base::Location& from_here,
                                              base::Callback<R(Args...)> cb) {
  return base::Bind(
      [](const tracked_objects::Location& from_here,
         base::Callback<R(Args...)> cb, Args... args) {
      [](const base::Location& from_here, base::Callback<R(Args...)> cb,
         Args... args) {
        do_in_jni_thread(from_here,
                         base::Bind(cb, std::forward<Args>(args)...));
      },
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ bt_status_t btif_transfer_context(tBTIF_CBACK* p_cback, uint16_t event,
 * This function posts a task into the btif message loop, that executes it in
 * the JNI message loop.
 **/
bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
bt_status_t do_in_jni_thread(const base::Location& from_here,
                             base::OnceClosure task) {
  if (!jni_thread.DoInThread(from_here, std::move(task))) {
    LOG(ERROR) << __func__ << ": Post task to task runner failed!";
+5 −4
Original line number Diff line number Diff line
@@ -37,11 +37,12 @@ using bluetooth::hearing_aid::HearingAidInterface;

// template specialization
template <>
base::Callback<void()> jni_thread_wrapper(
    const tracked_objects::Location& from_here, base::Callback<void()> cb) {
base::Callback<void()> jni_thread_wrapper(const base::Location& from_here,
                                          base::Callback<void()> cb) {
  return base::Bind(
      [](const tracked_objects::Location& from_here,
         base::Callback<void()> cb) { do_in_jni_thread(from_here, cb); },
      [](const base::Location& from_here, base::Callback<void()> cb) {
        do_in_jni_thread(from_here, cb);
      },
      from_here, std::move(cb));
}

+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "btif_profile_queue.h"

#include <base/bind.h>
#include <base/callback.h>
#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <string.h>
+5 −3
Original line number Diff line number Diff line
@@ -15,12 +15,14 @@
 *  limitations under the License.
 *
 ******************************************************************************/
#include "btif/include/btif_profile_queue.h"

#include <gtest/gtest.h>

#include <base/bind.h>
#include <base/callback.h>
#include <base/location.h>

#include "base/location.h"
#include "btif/include/btif_profile_queue.h"
#include "stack_manager.h"
#include "types/raw_address.h"

@@ -33,7 +35,7 @@ bool get_stack_is_running(void) { return sStackRunning; }
static stack_manager_t sStackManager = {nullptr, nullptr, nullptr, nullptr,
                                        get_stack_is_running};
const stack_manager_t* stack_manager_get_interface() { return &sStackManager; }
bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
bt_status_t do_in_jni_thread(const base::Location& from_here,
                             base::OnceClosure task) {
  std::move(task).Run();
  return BT_STATUS_SUCCESS;
Loading