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

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

Merge "leaudio: Remove not needed API" am: ff655555

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

Change-Id: I2eebc5155cdf3c2064565ff7aeeb2ef44dcf2707
parents 9e88a537 ff655555
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
@@ -219,49 +219,12 @@ static jboolean disconnectLeAudioNative(JNIEnv* env, jobject object,
  return JNI_TRUE;
}

static void groupStreamNative(JNIEnv* env, jobject object, jint group_id,
                              jint content_type) {
  LOG(INFO) << __func__;

  if (!sLeAudioClientInterface) {
    LOG(ERROR) << __func__ << ": Failed to get the Bluetooth LeAudio Interface";
    return;
  }

  sLeAudioClientInterface->GroupStream(group_id, content_type);
}

static void groupSuspendNative(JNIEnv* env, jobject object, jint group_id) {
  LOG(INFO) << __func__;

  if (!sLeAudioClientInterface) {
    LOG(ERROR) << __func__ << ": Failed to get the Bluetooth LeAudio Interface";
    return;
  }

  sLeAudioClientInterface->GroupSuspend(group_id);
}

static void groupStopNative(JNIEnv* env, jobject object, jint group_id) {
  LOG(INFO) << __func__;

  if (!sLeAudioClientInterface) {
    LOG(ERROR) << __func__ << ": Failed to get the Bluetooth LeAudio Interface";
    return;
  }

  sLeAudioClientInterface->GroupStop(group_id);
}

static JNINativeMethod sMethods[] = {
    {"classInitNative", "()V", (void*)classInitNative},
    {"initNative", "()V", (void*)initNative},
    {"cleanupNative", "()V", (void*)cleanupNative},
    {"connectLeAudioNative", "([B)Z", (void*)connectLeAudioNative},
    {"disconnectLeAudioNative", "([B)Z", (void*)disconnectLeAudioNative},
    {"groupStreamNative", "(II)V", (void*)groupStreamNative},
    {"groupSuspendNative", "(I)V", (void*)groupSuspendNative},
    {"groupStopNative", "(I)V", (void*)groupStopNative},
};

int register_com_android_bluetooth_le_audio(JNIEnv* env) {
+0 −29
Original line number Diff line number Diff line
@@ -192,39 +192,10 @@ public class LeAudioNativeInterface {
        return disconnectLeAudioNative(getByteAddress(device));
    }

    /**
     * Enable content streaming.
     * @param groupId group identifier
     * @param contentType type of content to stream
     */
    public void groupStream(int groupId, int contentType) {
        groupStreamNative(groupId, contentType);
    }

    /**
     * Suspend content streaming.
     * @param groupId  group identifier
     */
    public void groupSuspend(int groupId) {
        groupSuspendNative(groupId);
    }

    /**
     * Stop all content streaming.
     * @param groupId  group identifier
     * TODO: Maybe we should use also pass the content type argument
     */
    public void groupStop(int groupId) {
        groupStopNative(groupId);
    }

    // Native methods that call into the JNI interface
    private static native void classInitNative();
    private native void initNative();
    private native void cleanupNative();
    private native boolean connectLeAudioNative(byte[] address);
    private native boolean disconnectLeAudioNative(byte[] address);
    private native void groupStreamNative(int groupId, int contentType);
    private native void groupSuspendNative(int groupId);
    private native void groupStopNative(int groupId);
}