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

Commit be7267b0 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

Merge changes I455a3fd5,Ie076c1e2,I95c7d996,Id879b427 am: 3778a392 am: ea596a01 am: da127482

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1382661

Change-Id: I75e309cf0e3f13d0fc08b8f9253ac5a9df33b956
parents 2fe92c88 da127482
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -172,10 +172,10 @@ static jmethodID method_setVolume;


static void classInitNative(JNIEnv* env, jclass clazz) {
static void classInitNative(JNIEnv* env, jclass clazz) {
  method_getCurrentSongInfo = env->GetMethodID(
  method_getCurrentSongInfo = env->GetMethodID(
      clazz, "getCurrentSongInfo", "()Lcom/android/bluetooth/avrcp/Metadata;");
      clazz, "getCurrentSongInfo", "()Lcom/android/bluetooth/audio_util/Metadata;");


  method_getPlaybackStatus = env->GetMethodID(
  method_getPlaybackStatus = env->GetMethodID(
      clazz, "getPlayStatus", "()Lcom/android/bluetooth/avrcp/PlayStatus;");
      clazz, "getPlayStatus", "()Lcom/android/bluetooth/audio_util/PlayStatus;");


  method_sendMediaKeyEvent =
  method_sendMediaKeyEvent =
      env->GetMethodID(clazz, "sendMediaKeyEvent", "(IZ)V");
      env->GetMethodID(clazz, "sendMediaKeyEvent", "(IZ)V");
@@ -676,9 +676,9 @@ static void getFolderItemsResponseNative(JNIEnv* env, jobject object,
      env->GetObjectClass(env->CallObjectMethod(list, method_get, 0));
      env->GetObjectClass(env->CallObjectMethod(list, method_get, 0));
  jfieldID field_isFolder = env->GetFieldID(class_listItem, "isFolder", "Z");
  jfieldID field_isFolder = env->GetFieldID(class_listItem, "isFolder", "Z");
  jfieldID field_folder = env->GetFieldID(
  jfieldID field_folder = env->GetFieldID(
      class_listItem, "folder", "Lcom/android/bluetooth/avrcp/Folder;");
      class_listItem, "folder", "Lcom/android/bluetooth/audio_util/Folder;");
  jfieldID field_song = env->GetFieldID(
  jfieldID field_song = env->GetFieldID(
      class_listItem, "song", "Lcom/android/bluetooth/avrcp/Metadata;");
      class_listItem, "song", "Lcom/android/bluetooth/audio_util/Metadata;");


  std::vector<ListItem> ret_list;
  std::vector<ListItem> ret_list;
  for (jsize i = 0; i < list_size; i++) {
  for (jsize i = 0; i < list_size; i++) {
+10 −10
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.bluetooth.avrcp;
package com.android.bluetooth.audio_util;


import android.util.Log;
import android.util.Log;


@@ -23,8 +23,8 @@ import com.android.bluetooth.Utils;
import com.google.common.collect.EvictingQueue;
import com.google.common.collect.EvictingQueue;




// This class is to store logs for Avrcp for given size.
// This class is to store logs for Audio for given size.
public class AvrcpEventLogger {
public class BTAudioEventLogger {
    private final String mTitle;
    private final String mTitle;
    private final EvictingQueue<Event> mEvents;
    private final EvictingQueue<Event> mEvents;


@@ -44,34 +44,34 @@ public class AvrcpEventLogger {
        }
        }
    }
    }


    AvrcpEventLogger(int size, String title) {
    public BTAudioEventLogger(int size, String title) {
        mEvents = EvictingQueue.create(size);
        mEvents = EvictingQueue.create(size);
        mTitle = title;
        mTitle = title;
    }
    }


    synchronized void add(String msg) {
    public synchronized void add(String msg) {
        Event event = new Event(msg);
        Event event = new Event(msg);
        mEvents.add(event);
        mEvents.add(event);
    }
    }


    synchronized void logv(String tag, String msg) {
    public synchronized void logv(String tag, String msg) {
        add(msg);
        add(msg);
        Log.v(tag, msg);
        Log.v(tag, msg);
    }
    }


    synchronized void logd(String tag, String msg) {
    public synchronized void logd(String tag, String msg) {
        logd(true, tag, msg);
        logd(true, tag, msg);
    }
    }


    synchronized void logd(boolean debug, String tag, String msg) {
    public synchronized void logd(boolean debug, String tag, String msg) {
        add(msg);
        add(msg);
        if (debug) {
        if (debug) {
            Log.d(tag, msg);
            Log.d(tag, msg);
        }
        }
    }
    }


    synchronized void dump(StringBuilder sb) {
    public synchronized void dump(StringBuilder sb) {
        sb.append("Avrcp ").append(mTitle).append(":\n");
        sb.append("BTAudio ").append(mTitle).append(":\n");
        for (Event event : mEvents) {
        for (Event event : mEvents) {
            sb.append("  ").append(event.toString()).append("\n");
            sb.append("  ").append(event.toString()).append("\n");
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.bluetooth.avrcp;
package com.android.bluetooth.audio_util;


import android.content.Context;
import android.content.Context;
import android.content.pm.ResolveInfo;
import android.content.pm.ResolveInfo;
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.bluetooth.avrcp;
package com.android.bluetooth.audio_util;


import android.annotation.Nullable;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.ComponentName;
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.bluetooth.avrcp;
package com.android.bluetooth.audio_util;


import android.media.session.MediaSession;
import android.media.session.MediaSession;
import android.os.Looper;
import android.os.Looper;
Loading