Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Replace static service resolve callback with Java abstraction #9097

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

austinh0
Copy link
Contributor

@austinh0 austinh0 commented Aug 17, 2021

Problem

When Android resolves a service, we call the static handleServiceResolve on ChipDeviceController.java.

  • Static methods like this are hard to test
  • chip mDNS stack has no dependency on ChipDeviceController, so it doesn't make sense to have this method in ChipDeviceController.java

Change overview

  • Move mDNS related classes to chip.devicecontroller.mdns package
  • Move ChipDeviceController.handleServiceResolve to ChipMdnsCallback / ChipMdnsCallbackImpl, with its own -JNI.cpp file
  • Require ChipMdnsCallback instance in ChipDeviceController constructor
  • HaveServiceResolver provide ChipMdnsCallback as a parameter in resolve(). This removes the need for a static accessor.

Testing

  • Verify that updating device address still works

@austinh0 austinh0 changed the title [Android] Replace static callback with Java abstraction for MdnsImpl [Android] Replace static service resolve callback with Java abstraction Aug 17, 2021
@austinh0 austinh0 force-pushed the devicecontroller-interface branch from 31aa5e5 to 259c4fe Compare August 18, 2021 00:02
@austinh0 austinh0 force-pushed the devicecontroller-interface branch from 259c4fe to e29b5f0 Compare August 18, 2021 03:20
@github-actions
Copy link

Size increase report for "esp32-example-build" from 303c02c

File Section File VM
chip-bridge-app.elf .flash.text -48 -48
chip-lock-app.elf .flash.text -68 -68
chip-shell.elf .flash.text -8 -8
chip-temperature-measurement-app.elf .flash.text 56 56
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-bridge-app.elf and ./pull_artifact/chip-bridge-app.elf:

sections,vmsize,filesize
[Unmapped],0,48
.flash.text,-48,-48

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize
[Unmapped],0,68
.flash.text,-68,-68

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
[Unmapped],0,8
.flash.text,-8,-8

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
.flash.text,56,56
[Unmapped],0,-56

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize


@andy31415 andy31415 merged commit f168d88 into project-chip:master Aug 20, 2021
sharadb-amazon pushed a commit to sharadb-amazon/connectedhomeip that referenced this pull request Aug 23, 2021
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
@austinh0 austinh0 mentioned this pull request Sep 23, 2021
xylophone21 added a commit to xylophone21/connectedhomeip that referenced this pull request Sep 29, 2021
xylophone21 added a commit to xylophone21/connectedhomeip that referenced this pull request Sep 30, 2021
andy31415 pushed a commit that referenced this pull request Sep 30, 2021
* added android platform impl and CHIPTest to run ul-test on it

* add clangd index file and compile_commands.json to .gitignore

* use platform/android in src/controller instead of impl themselves

* basic run and debug with new control

* use inject driver mode as old controller as Andrei Litvin suggestion

* fix ci build

* fix ci build

* fixed restyled-io

* fixed restyled-io

* fixed Doxygen ci

* fixed review code style issues

* move AndroidChipPlatform singleton down to the app layer

* move dependencies in the constructor for AndroidChipPlatform

* using val than var

* update gradle version in CHIPTest and fix runtime errors

* fixed restyled-io

* remove commented out code

* fixed restyled-io

* update license to 2021

* fixed review code style issues

* fix ci build

* rename load to loadJni and add a comment describing the purpose.

* fixed review code style issues

* separate ble callback and Connection

* Recovery PR #9097

* fix merge issue

* fix merge issue

* fixed restyled-io

* fixed restyled-io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants