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

Commit 5922702b authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge changes I73fc9912,I7ee01d74 am: cc894359

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

Change-Id: I9cf81ed970cab5355569bb27c61939b5968ce798
parents b37d9ea7 cc894359
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -772,17 +772,7 @@ public class HapClientService extends ProfileService {
    }

    private void notifyFeaturesAvailable(BluetoothDevice device, int features) {
        if (mCallbacks != null) {
            int n = mCallbacks.beginBroadcast();
            for (int i = 0; i < n; i++) {
                try {
                    mCallbacks.getBroadcastItem(i).onHapFeaturesAvailable(device, features);
                } catch (RemoteException e) {
                    continue;
                }
            }
            mCallbacks.finishBroadcast();
        }
        Log.d(TAG, "HAP device: " + device + ", features: " + String.format("0x%04X", features));
    }

    private void notifyActivePresetChanged(BluetoothDevice device, int presetIndex,
+0 −26
Original line number Diff line number Diff line
@@ -674,25 +674,6 @@ public class HapClientTest {
                intent.getIntExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, 0x00));
    }

    /**
     * Test that native callback generates proper callback call.
     */
    @Test
    public void testStackEventOnFeaturesUpdate() {
        doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService)
                .getRemoteUuids(any(BluetoothDevice.class));

        mNativeInterface.onDeviceAvailable(getByteAddress(mDevice), 0x00);
        mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), 0x03);

        try {
            verify(mCallback, after(TIMEOUT_MS).times(1)).onHapFeaturesAvailable(eq(mDevice),
                    eq(0x03));
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Test that native callback generates proper callback call.
     */
@@ -953,13 +934,6 @@ public class HapClientTest {
        evt.valueInt1 = 0x01; // features
        mService.messageFromNative(evt);

        try {
            verify(mCallback, after(TIMEOUT_MS).times(1)).onHapFeaturesAvailable(eq(device),
                    eq(evt.valueInt1));
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }

        // Inject some initial presets
        List<BluetoothHapPresetInfo> presets =
                new ArrayList<BluetoothHapPresetInfo>(Arrays.asList(
+13 −0
Original line number Diff line number Diff line
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
+116 −0
Original line number Diff line number Diff line
<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <codeStyleSettings language="XML">
      <indentOptions>
        <option name="CONTINUATION_INDENT_SIZE" value="4" />
      </indentOptions>
      <arrangement>
        <rules>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>xmlns:android</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>xmlns:.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*:id</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*:name</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>name</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>style</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>^$</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                </AND>
              </match>
              <order>ANDROID_ATTRIBUTE_ORDER</order>
            </rule>
          </section>
          <section>
            <rule>
              <match>
                <AND>
                  <NAME>.*</NAME>
                  <XML_ATTRIBUTE />
                  <XML_NAMESPACE>.*</XML_NAMESPACE>
                </AND>
              </match>
              <order>BY_NAME</order>
            </rule>
          </section>
        </rules>
      </arrangement>
    </codeStyleSettings>
  </code_scheme>
</component>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CompilerConfiguration">
    <bytecodeTargetLevel target="11" />
  </component>
</project>
 No newline at end of file
Loading