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

Commit 2e807440 authored by More Kuo's avatar More Kuo
Browse files

Rename for updating BluetoothA2dp API naming

- Rename setBufferMillis to setBufferLengthMillis

Bug: 179814567
Test: Build
Change-Id: I4012c66e4eb571b7f75dee0db1fd0f20d32601d9
parent 8496b3a4
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1262,8 +1262,8 @@ static jbyteArray obfuscateAddressNative(JNIEnv* env, jobject obj,
  return output_bytes;
}

static jboolean setBufferMillisNative(JNIEnv* env, jobject obj, jint codec,
                                      jint size) {
static jboolean setBufferLengthMillisNative(JNIEnv* env, jobject obj,
                                            jint codec, jint size) {
  ALOGV("%s", __func__);

  if (!sBluetoothInterface) return JNI_FALSE;
@@ -1398,7 +1398,8 @@ static JNINativeMethod sMethods[] = {
    {"interopDatabaseClearNative", "()V", (void*)interopDatabaseClearNative},
    {"interopDatabaseAddNative", "(I[BI)V", (void*)interopDatabaseAddNative},
    {"obfuscateAddressNative", "([B)[B", (void*)obfuscateAddressNative},
    {"setBufferMillisNative", "(II)Z", (void*)setBufferMillisNative},
    {"setBufferLengthMillisNative", "(II)Z",
     (void*)setBufferLengthMillisNative},
    {"getMetricIdNative", "([B)I", (void*)getMetricIdNative},
    {"connectSocketNative", "([BI[BIII)I", (void*)connectSocketNative},
    {"createSocketChannelNative", "(ILjava/lang/String;[BIII)I",
+4 −4
Original line number Diff line number Diff line
@@ -906,10 +906,10 @@ public class A2dpService extends ProfileService {
     * @param value buffer millis
     * @return true if the settings is successful, false otherwise
     */
    public boolean setBufferMillis(int codec, int value) {
    public boolean setBufferLengthMillis(int codec, int value) {
        enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED,
                "Need BLUETOOTH_PRIVILEGED permission");
        return mAdapterService.setBufferMillis(codec, value);
        return mAdapterService.setBufferLengthMillis(codec, value);
    }

    // Handle messages from native (JNI) to Java
@@ -1441,12 +1441,12 @@ public class A2dpService extends ProfileService {
            return service.getBufferConstraints();
        }

        public boolean setBufferMillis(int codec, int value) {
        public boolean setBufferLengthMillis(int codec, int value) {
            A2dpService service = getService();
            if (service == null) {
                return false;
            }
            return service.setBufferMillis(codec, value);
            return service.setBufferLengthMillis(codec, value);
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -555,8 +555,8 @@ class AdapterProperties {
     * @param codec the codecs to set
     * @param size the size to set
     */
    boolean setBufferMillis(int codec, int value) {
        return mService.setBufferMillisNative(codec, value);
    boolean setBufferLengthMillis(int codec, int value) {
        return mService.setBufferLengthMillisNative(codec, value);
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -3272,8 +3272,8 @@ public class AdapterService extends Service {
     * @param value buffer millis
     * @return true if the settings is successful, false otherwise
     */
    public boolean setBufferMillis(int codec, int value) {
        return mAdapterProperties.setBufferMillis(codec, value);
    public boolean setBufferLengthMillis(int codec, int value) {
        return mAdapterProperties.setBufferLengthMillis(codec, value);
    }

    /**
@@ -3369,7 +3369,7 @@ public class AdapterService extends Service {

    private native byte[] obfuscateAddressNative(byte[] address);

    native boolean setBufferMillisNative(int codec, int value);
    native boolean setBufferLengthMillisNative(int codec, int value);

    private native int getMetricIdNative(byte[] address);