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

Remove usage of GetDevice() API in Android controller #10612

Merged
merged 5 commits into from
Oct 18, 2021

Conversation

pan-apple
Copy link
Contributor

Problem

Android Controller code needs update to remove usage of GetDevice() API.

Change overview

Testing

Run existing CI tests to ensure that the controller behavior is intact.

@github-actions
Copy link

github-actions bot commented Oct 18, 2021

PR #10612: Size comparison from dc93d27 to 92a703c

12 builds
platform target config section dc93d27 92a703c change % change
efr32 lighting-app BRD4161A .bss 118036 118036 0 0.0
.data 1800 1800 0 0.0
.text 782724 782724 0 0.0
lock-app BRD4161A .bss 115892 115892 0 0.0
.data 1760 1760 0 0.0
.text 761868 761868 0 0.0
window-app BRD4161A .bss 116212 116212 0 0.0
.data 1764 1764 0 0.0
.text 762792 762792 0 0.0
lighting-app BRD4161A+rpc .bss 131364 131364 0 0.0
.data 1852 1852 0 0.0
.text 762468 762468 0 0.0
k32w lock-app k32w061+debug .bss 69052 69052 0 0.0
.data 1864 1864 0 0.0
.text 515320 515320 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 357300 357300 0 0.0
lighting-app k32w061+se05x+release .bss 78576 78576 0 0.0
.data 1900 1900 0 0.0
.text 614088 614088 0 0.0
p6 lock-app default .bss 68216 68216 0 0.0
.data 2416 2416 0 0.0
.heap 962712 962712 0 0.0
.text 1126424 1126424 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 996 996 0 0.0
.text 486400 486400 0 0.0
lock-app qpg6100+debug .bss 52488 52488 0 0.0
.data 952 952 0 0.0
.text 462496 462496 0 0.0
persistent-storage-app qpg6100+debug .bss 17778 17778 0 0.0
.data 280 280 0 0.0
.text 102704 102704 0 0.0
telink lighting-app tlsr9518adk80d bss 71000 71000 0 0.0
noinit 33216 33216 0 0.0
text 458218 458218 0 0.0
10 builds
platform target config section dc93d27 92a703c change % change
linux all-clusters-app debug .bss 52176 52176 0 0.0
.data 978 978 0 0.0
.data.rel.ro 58688 58688 0 0.0
.dynamic 592 592 0 0.0
.got 4072 4072 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 135957 135957 0 0.0
.text 1326946 1326946 0 0.0
chip-tool debug .bss 17552 17552 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 84896 84896 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 416 416 0 0.0
.rodata 176928 176928 0 0.0
.text 2458165 2458165 0 0.0
ota-provider-app debug .bss 37472 37472 0 0.0
.data 752 752 0 0.0
.data.rel.ro 23176 23176 0 0.0
.dynamic 592 592 0 0.0
.got 4008 4008 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 109832 109832 0 0.0
.text 1010210 1010210 0 0.0
ota-requestor-app debug .bss 205728 205728 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 128328 128328 0 0.0
.text 1129522 1129522 0 0.0
shell debug .bss 16072 16072 0 0.0
.data 242 242 0 0.0
.data.rel.ro 35120 35120 0 0.0
.dynamic 592 592 0 0.0
.got 3496 3496 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 71855 71855 0 0.0
.text 569746 569746 0 0.0
tv-app debug .bss 216400 216400 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 55872 55872 0 0.0
.dynamic 592 592 0 0.0
.got 4400 4400 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 151848 151848 0 0.0
.text 1463698 1463698 0 0.0
bridge-app debug+rpc .bss 52912 52912 0 0.0
.data 976 976 0 0.0
.data.rel.ro 25784 25784 0 0.0
.dynamic 592 592 0 0.0
.got 3944 3944 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110452 110452 0 0.0
.text 1051717 1051717 0 0.0
lighting-app debug+rpc .bss 42232 42232 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 52496 52496 0 0.0
.dynamic 608 608 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127665 127665 0 0.0
.text 1253122 1253122 0 0.0
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172164 172164 0 0.0
.data 5464 5464 0 0.0
.heap 858816 858816 0 0.0
.text 1219736 1219736 0 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171084 171084 0 0.0
.data 5432 5432 0 0.0
.heap 859928 859928 0 0.0
.text 1197632 1197632 0 0.0
2 builds
platform target config section dc93d27 92a703c change % change
esp32 all-clusters-app c3devkit .dram0.bss 60296 60296 0 0.0
.dram0.data 16192 16192 0 0.0
.flash.rodata 198784 198784 0 0.0
.flash.text 870186 870186 0 0.0
.iram0.text 57330 57330 0 0.0
m5stack .dram0.bss 62792 62792 0 0.0
.dram0.data 32084 32084 0 0.0
.flash.rodata 207216 207216 0 0.0
.flash.text 900547 900639 92 0.0
.iram0.text 125115 125115 0 0.0

@pan-apple
Copy link
Contributor Author

@austinh0 , could you also please review this PR, as this is updating Android controller code.

@github-actions
Copy link

github-actions bot commented Oct 18, 2021

PR #10612: Size comparison from 9b0afc4 to cbe8747

8 builds
platform target config section 9b0afc4 cbe8747 change % change
k32w lock-app k32w061+debug .bss 69052 69052 0 0.0
.data 1864 1864 0 0.0
.text 515320 515320 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 357300 357300 0 0.0
lighting-app k32w061+se05x+release .bss 78576 78576 0 0.0
.data 1900 1900 0 0.0
.text 614088 614088 0 0.0
p6 lock-app default .bss 68216 68216 0 0.0
.data 2416 2416 0 0.0
.heap 962712 962712 0 0.0
.text 1126424 1126424 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 996 996 0 0.0
.text 486400 486400 0 0.0
lock-app qpg6100+debug .bss 52488 52488 0 0.0
.data 952 952 0 0.0
.text 462496 462496 0 0.0
persistent-storage-app qpg6100+debug .bss 17778 17778 0 0.0
.data 280 280 0 0.0
.text 102704 102704 0 0.0
telink lighting-app tlsr9518adk80d bss 71000 71000 0 0.0
noinit 33216 33216 0 0.0
text 458218 458218 0 0.0
26 builds
platform target config section 9b0afc4 cbe8747 change % change
efr32 lighting-app BRD4161A .bss 118036 118036 0 0.0
.data 1800 1800 0 0.0
.text 782724 782724 0 0.0
lock-app BRD4161A .bss 115892 115892 0 0.0
.data 1760 1760 0 0.0
.text 761868 761868 0 0.0
window-app BRD4161A .bss 116212 116212 0 0.0
.data 1764 1764 0 0.0
.text 762792 762792 0 0.0
lighting-app BRD4161A+rpc .bss 131364 131364 0 0.0
.data 1852 1852 0 0.0
.text 762468 762468 0 0.0
esp32 all-clusters-app c3devkit .dram0.bss 60296 60296 0 0.0
.dram0.data 16192 16192 0 0.0
.flash.rodata 198784 198784 0 0.0
.flash.text 870186 870186 0 0.0
.iram0.text 57330 57330 0 0.0
m5stack .dram0.bss 62792 62792 0 0.0
.dram0.data 32084 32084 0 0.0
.flash.rodata 207216 207216 0 0.0
.flash.text 900547 900639 92 0.0
.iram0.text 125115 125115 0 0.0
linux all-clusters-app debug .bss 52176 52176 0 0.0
.data 978 978 0 0.0
.data.rel.ro 58688 58688 0 0.0
.dynamic 592 592 0 0.0
.got 4072 4072 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 135957 135957 0 0.0
.text 1327474 1327474 0 0.0
chip-tool debug .bss 17552 17552 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 84896 84896 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 416 416 0 0.0
.rodata 176928 176928 0 0.0
.text 2458309 2458309 0 0.0
ota-provider-app debug .bss 37472 37472 0 0.0
.data 752 752 0 0.0
.data.rel.ro 23176 23176 0 0.0
.dynamic 592 592 0 0.0
.got 4008 4008 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 109832 109832 0 0.0
.text 1010322 1010322 0 0.0
ota-requestor-app debug .bss 205728 205728 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 128328 128328 0 0.0
.text 1129634 1129634 0 0.0
shell debug .bss 16072 16072 0 0.0
.data 242 242 0 0.0
.data.rel.ro 35120 35120 0 0.0
.dynamic 592 592 0 0.0
.got 3496 3496 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 71855 71855 0 0.0
.text 569858 569858 0 0.0
tv-app debug .bss 216400 216400 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 55872 55872 0 0.0
.dynamic 592 592 0 0.0
.got 4400 4400 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 151848 151848 0 0.0
.text 1464210 1464210 0 0.0
bridge-app debug+rpc .bss 52912 52912 0 0.0
.data 976 976 0 0.0
.data.rel.ro 25784 25784 0 0.0
.dynamic 592 592 0 0.0
.got 3944 3944 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110452 110452 0 0.0
.text 1052229 1052229 0 0.0
lighting-app debug+rpc .bss 42232 42232 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 52496 52496 0 0.0
.dynamic 608 608 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127665 127665 0 0.0
.text 1253634 1253634 0 0.0
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172164 172164 0 0.0
.data 5464 5464 0 0.0
.heap 858816 858816 0 0.0
.text 1219736 1219736 0 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171084 171084 0 0.0
.data 5432 5432 0 0.0
.heap 859928 859928 0 0.0
.text 1197632 1197632 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 bss 112332 112332 0 0.0
rodata 97688 97688 0 0.0
text 577560 577560 0 0.0
lock-app nrf52840dk_nrf52840 bss 111348 111348 0 0.0
rodata 94028 94028 0 0.0
text 559060 559060 0 0.0
pigweed-app nrf52840dk_nrf52840 bss 51772 51772 0 0.0
rodata 45772 45772 0 0.0
text 339392 339392 0 0.0
pump-app nrf52840dk_nrf52840 bss 111416 111416 0 0.0
rodata 95008 95008 0 0.0
text 562216 562216 0 0.0
pump-controller-app nrf52840dk_nrf52840 bss 111356 111356 0 0.0
rodata 94088 94088 0 0.0
text 558852 558852 0 0.0
shell nrf52840dk_nrf52840 bss 107316 107316 0 0.0
rodata 71640 71640 0 0.0
text 519032 519032 0 0.0
lighting-app nrf52840dk_nrf52840+rpc bss 108572 108572 0 0.0
rodata 88480 88480 0 0.0
text 550764 550764 0 0.0
nrf5340dk_nrf5340_cpuapp bss 113704 113704 0 0.0
rodata 92932 92932 0 0.0
text 507020 507020 0 0.0
lock-app nrf5340dk_nrf5340_cpuapp bss 112720 112720 0 0.0
rodata 89284 89284 0 0.0
text 488516 488516 0 0.0
shell nrf5340dk_nrf5340_cpuapp bss 108300 108300 0 0.0
rodata 66284 66284 0 0.0
text 439632 439632 0 0.0

@austinh0
Copy link
Contributor

Can you patch in this commit to fix the CI?

austinh0@0be80e7

@pan-apple
Copy link
Contributor Author

Can you patch in this commit to fix the CI?

austinh0@0be80e7

Just saw this message. I have pushed a commit similar to what you mentioned in your comment. I'll pull in your commit as well to take care of the rest.

@todo
Copy link

todo bot commented Oct 18, 2021

(#8443): This method could benefit from a ChipDevice abstraction to hide the pointer

* <p>TODO(#8443): This method could benefit from a ChipDevice abstraction to hide the pointer
* passing.
*/
public void getConnectedDevicePointer(long nodeId, GetConnectedDeviceCallback callback) {
GetConnectedDeviceCallbackJni jniCallback = new GetConnectedDeviceCallbackJni(callback);
getConnectedDevicePointer(deviceControllerPtr, nodeId, jniCallback.getCallbackHandle());


This comment was generated by todo based on a TODO comment in 8d0e838 in #10612. cc @pan-apple.

@pan-apple pan-apple changed the title Reduce usage of GetDevice() API in Android controller Remove usage of GetDevice() API in Android controller Oct 18, 2021
@github-actions
Copy link

github-actions bot commented Oct 18, 2021

PR #10612: Size comparison from 9b0afc4 to 8d0e838

8 builds
platform target config section 9b0afc4 8d0e838 change % change
k32w lock-app k32w061+debug .bss 69052 69052 0 0.0
.data 1864 1864 0 0.0
.text 515320 515352 32 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 357300 357332 32 0.0
lighting-app k32w061+se05x+release .bss 78576 78576 0 0.0
.data 1900 1900 0 0.0
.text 614088 614136 48 0.0
p6 lock-app default .bss 68216 68216 0 0.0
.data 2416 2416 0 0.0
.heap 962712 962712 0 0.0
.text 1126424 1126472 48 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 996 996 0 0.0
.text 486400 486448 48 0.0
lock-app qpg6100+debug .bss 52488 52488 0 0.0
.data 952 952 0 0.0
.text 462496 462520 24 0.0
persistent-storage-app qpg6100+debug .bss 17778 17778 0 0.0
.data 280 280 0 0.0
.text 102704 102704 0 0.0
telink lighting-app tlsr9518adk80d bss 71000 71000 0 0.0
noinit 33216 33216 0 0.0
text 458218 458220 2 0.0

Increases above 1.0% from 9b0afc4 to 8d0e838:

platform target config section 9b0afc4 8d0e838 change % change
linux all-clusters-app debug .text 1327474 1344930 17456 1.3
chip-tool debug .data.rel.ro 84896 86192 1296 1.5
.text 2458309 2859461 401152 16.3
14 builds
platform target config section 9b0afc4 8d0e838 change % change
efr32 lighting-app BRD4161A .bss 118036 118036 0 0.0
.data 1800 1800 0 0.0
.text 782724 782788 64 0.0
lock-app BRD4161A .bss 115892 115892 0 0.0
.data 1760 1760 0 0.0
.text 761868 761932 64 0.0
window-app BRD4161A .bss 116212 116212 0 0.0
.data 1764 1764 0 0.0
.text 762792 762840 48 0.0
lighting-app BRD4161A+rpc .bss 131364 131364 0 0.0
.data 1852 1852 0 0.0
.text 762468 762532 64 0.0
linux all-clusters-app debug .bss 52176 52176 0 0.0
.data 978 978 0 0.0
.data.rel.ro 58688 58688 0 0.0
.dynamic 592 592 0 0.0
.got 4072 4072 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 135957 136149 192 0.1
.text 1327474 1344930 17456 1.3
chip-tool debug .bss 17552 17552 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 84896 86192 1296 1.5
.dynamic 592 592 0 0.0
.got 4336 4344 8 0.2
.init 27 27 0 0.0
.init_array 416 416 0 0.0
.rodata 176928 178476 1548 0.9
.text 2458309 2859461 401152 16.3
ota-provider-app debug .bss 37472 37472 0 0.0
.data 752 752 0 0.0
.data.rel.ro 23176 23176 0 0.0
.dynamic 592 592 0 0.0
.got 4008 4008 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 109832 109832 0 0.0
.text 1010322 1010354 32 0.0
ota-requestor-app debug .bss 205728 205728 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 128328 128328 0 0.0
.text 1129634 1129666 32 0.0
shell debug .bss 16072 16072 0 0.0
.data 242 242 0 0.0
.data.rel.ro 35120 35120 0 0.0
.dynamic 592 592 0 0.0
.got 3496 3496 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 71855 71855 0 0.0
.text 569858 569858 0 0.0
tv-app debug .bss 216400 216400 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 55872 55872 0 0.0
.dynamic 592 592 0 0.0
.got 4400 4400 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 151848 151848 0 0.0
.text 1464210 1464242 32 0.0
bridge-app debug+rpc .bss 52912 52912 0 0.0
.data 976 976 0 0.0
.data.rel.ro 25784 25784 0 0.0
.dynamic 592 592 0 0.0
.got 3944 3944 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110452 110452 0 0.0
.text 1052229 1052389 160 0.0
lighting-app debug+rpc .bss 42232 42232 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 52496 52496 0 0.0
.dynamic 608 608 0 0.0
.got 4104 4104 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127665 127665 0 0.0
.text 1253634 1253666 32 0.0
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172164 172164 0 0.0
.data 5464 5464 0 0.0
.heap 858816 858816 0 0.0
.text 1219736 1219800 64 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171084 171084 0 0.0
.data 5432 5432 0 0.0
.heap 859928 859928 0 0.0
.text 1197632 1197632 0 0.0
2 builds
platform target config section 9b0afc4 8d0e838 change % change
esp32 all-clusters-app c3devkit .dram0.bss 60296 60296 0 0.0
.dram0.data 16192 16192 0 0.0
.flash.rodata 198784 198896 112 0.1
.flash.text 870186 872534 2348 0.3
.iram0.text 57330 57330 0 0.0
m5stack .dram0.bss 62792 62792 0 0.0
.dram0.data 32084 32084 0 0.0
.flash.rodata 207216 207320 104 0.1
.flash.text 900547 902723 2176 0.2
.iram0.text 125115 125115 0 0.0
10 builds
platform target config section 9b0afc4 8d0e838 change % change
nrfconnect lighting-app nrf52840dk_nrf52840 bss 112332 112332 0 0.0
rodata 97688 97688 0 0.0
text 577560 577568 8 0.0
lock-app nrf52840dk_nrf52840 bss 111348 111348 0 0.0
rodata 94028 94028 0 0.0
text 559060 559068 8 0.0
pigweed-app nrf52840dk_nrf52840 bss 51772 51772 0 0.0
rodata 45772 45772 0 0.0
text 339392 339392 0 0.0
pump-app nrf52840dk_nrf52840 bss 111416 111416 0 0.0
rodata 95008 95008 0 0.0
text 562216 562224 8 0.0
pump-controller-app nrf52840dk_nrf52840 bss 111356 111356 0 0.0
rodata 94088 94088 0 0.0
text 558852 558860 8 0.0
shell nrf52840dk_nrf52840 bss 107316 107316 0 0.0
rodata 71640 71640 0 0.0
text 519032 519032 0 0.0
lighting-app nrf52840dk_nrf52840+rpc bss 108572 108572 0 0.0
rodata 88480 88480 0 0.0
text 550764 550772 8 0.0
nrf5340dk_nrf5340_cpuapp bss 113704 113704 0 0.0
rodata 92932 92932 0 0.0
text 507020 507032 12 0.0
lock-app nrf5340dk_nrf5340_cpuapp bss 112720 112720 0 0.0
rodata 89284 89284 0 0.0
text 488516 488528 12 0.0
shell nrf5340dk_nrf5340_cpuapp bss 108300 108300 0 0.0
rodata 66284 66284 0 0.0
text 439632 439632 0 0.0

@pan-apple pan-apple merged commit 05c3a35 into project-chip:master Oct 18, 2021
@pan-apple pan-apple deleted the android-controller branch October 18, 2021 22:23
JasonLiuZhuoCheng pushed a commit to JasonLiuZhuoCheng/connectedhomeip that referenced this pull request Oct 19, 2021
…0612)

* Reduce usage of GetDevice() API in Android controller

* Set PeerId correctly

* remove remaining use of GetDevice(), GetCHIPDevice() and getDevicePointer()

* add suspend

* more build fixes
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.

4 participants