Bug P3
Status Update
Comments
sm...@google.com <sm...@google.com>
am...@google.com <am...@google.com> #2
Thanks for filling this, HiltViewModelFactory wraps around a SavedStateViewModelFactory which is also the default one for non Hilt injected Fragments and Activities, it seems there is some key conflicts, I'll investigate and comer back with more info soon, thanks for the sample app!
st...@google.com <st...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d76172ec45a778efe5f46b6ad1a50ae24241d14d
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Jun 16 14:50:23 2020
Avoid SavedStateHandle key conflict in HiltViewModelFactory.
When delegating to the SavedStateViewModelFactory to create
ViewModels that are not Hilt injected, the factory will attempt
to retrieve a SavedStateHandler using a controller with the same
key as the SavedStateHandle passed into the abstract create() method
of AbstractSavedStateViewModelFactory for which the
HiltViewModelFactory implements. Therefore causing a key conflict.
In this change we avoid the key conflict collision by prefixing the
before delegating to SavedStateViewModelFactory. Since ViewModels
will be either create by one or the other factory, it is safe to
mangle the key. Meanwhile, even though the key is also used to
add a tag to the ViewModel for cleanup, the tag is only added
if the key used is not present. When SavedStateViewModelFactory
tags the ViewModel and then a second time in once
AbstractSavedStateViewModelFactory#create() returns, the tag
is not overridden (lucky us).
This fixes a bug when mixing vanilla ViewModels and Hilt injected
ones.
Bug: 158737069
Test: ViewModelApp Integration Tests
Change-Id: I86ae254c2f26795c900317d42041319fd279e545
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M hilt/hilt-lifecycle-viewmodel/src/main/java/androidx/hilt/lifecycle/HiltViewModelFactory.java
M hilt/integration-tests/viewmodelapp/build.gradle
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/ActivityInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/BaseActivityInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/BaseFragmentInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/Bindings.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/FragmentInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/MyViewModels.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/TestRunner.kt
A hilt/integration-tests/viewmodelapp/src/debug/AndroidManifest.xml
https://android-review.googlesource.com/1339862
Branch: androidx-master-dev
commit d76172ec45a778efe5f46b6ad1a50ae24241d14d
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Tue Jun 16 14:50:23 2020
Avoid SavedStateHandle key conflict in HiltViewModelFactory.
When delegating to the SavedStateViewModelFactory to create
ViewModels that are not Hilt injected, the factory will attempt
to retrieve a SavedStateHandler using a controller with the same
key as the SavedStateHandle passed into the abstract create() method
of AbstractSavedStateViewModelFactory for which the
HiltViewModelFactory implements. Therefore causing a key conflict.
In this change we avoid the key conflict collision by prefixing the
before delegating to SavedStateViewModelFactory. Since ViewModels
will be either create by one or the other factory, it is safe to
mangle the key. Meanwhile, even though the key is also used to
add a tag to the ViewModel for cleanup, the tag is only added
if the key used is not present. When SavedStateViewModelFactory
tags the ViewModel and then a second time in once
AbstractSavedStateViewModelFactory#create() returns, the tag
is not overridden (lucky us).
This fixes a bug when mixing vanilla ViewModels and Hilt injected
ones.
Bug: 158737069
Test: ViewModelApp Integration Tests
Change-Id: I86ae254c2f26795c900317d42041319fd279e545
M buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
M hilt/hilt-lifecycle-viewmodel/src/main/java/androidx/hilt/lifecycle/HiltViewModelFactory.java
M hilt/integration-tests/viewmodelapp/build.gradle
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/ActivityInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/BaseActivityInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/BaseFragmentInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/Bindings.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/FragmentInjectionTest.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/MyViewModels.kt
A hilt/integration-tests/viewmodelapp/src/androidTest/java/androidx/hilt/integration/viewmodelapp/TestRunner.kt
A hilt/integration-tests/viewmodelapp/src/debug/AndroidManifest.xml
jp...@gmail.com <jp...@gmail.com> #4
A fix for this will be available in alpha02
jp...@gmail.com <jp...@gmail.com> #5
In addition, I read your suggestion issue.
jp...@gmail.com <jp...@gmail.com> #6
I tried the command and result below
```
rpi3:/ # wpa_cli -gwlan0 IFNAME=wlan0 scan
Using interface 'wlan0'
OK
rpi3:/ # wpa_cli -gwlan0 IFNAME=wlan0 scan_result
Using interface 'wlan0'
bssid / frequency / signal level / flags / said
[showed eleven near WiFi AP in this section]
```
rpi3:/ #
```
rpi3:/ # wpa_cli -gwlan0 IFNAME=wlan0 scan
Using interface 'wlan0'
OK
rpi3:/ # wpa_cli -gwlan0 IFNAME=wlan0 scan_result
Using interface 'wlan0'
bssid / frequency / signal level / flags / said
[showed eleven near WiFi AP in this section]
```
rpi3:/ #
jp...@gmail.com <jp...@gmail.com> #7
I found place where RaPi3 not reboot in my home.
The result of spa_cli scan command is below.
(MAC and AP name is masked. Do you need that information ?)
===============Rebooting enviroment==========================================
Using interface 'wlan0'
bssid / frequency / signal level / flags / ssid
xx:xx:xx:xx:xx:xx 2462 -23 [WPA2-PSK-CCMP][ESS] OWN AP
xx:xx:xx:xx:xx:xx 2462 -71 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -73 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -70 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -80 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -76 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -83 [WEP][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2447 -77 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -79 [WPA-PSK-CCMP][ESS] Neighbor AP
===============Not rebooting enviroment==========================================
bssid / frequency / signal level / flags / ssid
xx:xx:xx:xx:xx:xx 2462 -44 [WPA2-PSK-CCMP][ESS] OWN AP
xx:xx:xx:xx:xx:xx 2437 -55 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -70 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -75 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -73 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -78 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -71 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -86 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -80 [WEP][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -75 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -77 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -84 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
I live in residence area thus nothing free wifi spot that use Hotspot2, I think.
But I think issuehttps://issuetracker.google.com/issues/79378529 is same result.
And, My Wifi is not only using 2.5G but also 5G.
It is very strange. If you have other point of view, I can do verification my enviroment in line with your request.
The result of spa_cli scan command is below.
(MAC and AP name is masked. Do you need that information ?)
===============Rebooting enviroment==========================================
Using interface 'wlan0'
bssid / frequency / signal level / flags / ssid
xx:xx:xx:xx:xx:xx 2462 -23 [WPA2-PSK-CCMP][ESS] OWN AP
xx:xx:xx:xx:xx:xx 2462 -71 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -73 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -70 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -80 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -76 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -83 [WEP][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2447 -77 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -79 [WPA-PSK-CCMP][ESS] Neighbor AP
===============Not rebooting enviroment==========================================
bssid / frequency / signal level / flags / ssid
xx:xx:xx:xx:xx:xx 2462 -44 [WPA2-PSK-CCMP][ESS] OWN AP
xx:xx:xx:xx:xx:xx 2437 -55 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -70 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -75 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -73 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -78 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -71 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -86 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2412 -80 [WEP][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2462 -75 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2452 -77 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
xx:xx:xx:xx:xx:xx 2437 -84 [WPA2-PSK-CCMP][WPS][ESS] Neighbor AP
I live in residence area thus nothing free wifi spot that use Hotspot2, I think.
But I think issue
And, My Wifi is not only using 2.5G but also 5G.
It is very strange. If you have other point of view, I can do verification my enviroment in line with your request.
ga...@gmail.com <ga...@gmail.com> #8
I was a part of the other ticket linked. While it no longer reboots at our office where development is happening, we discovered this happens at the local brewery where we took our product. I will go back there this week to see if I can get you any logs/tombstones
sr...@google.com <sr...@google.com>
ha...@google.com <ha...@google.com> #9
Hi jp...@gmail.com,
Sorry I could not see your full email address. I just be able to comment this thread. I am not sure are you still having this problem with the recent build of android things? At my side there are several versions of the android
things operating system which are much newer than 1.0.1. I am not sure what is the latest android things operating system at your side.
if you keep seeing this problem in the recent builds, could you please run the following command:
adb shell getprop|grep incremental
to get the build id a number of around 7 digits so that I will try to reproduce your bug on my side.
Sorry I could not see your full email address. I just be able to comment this thread. I am not sure are you still having this problem with the recent build of android things? At my side there are several versions of the android
things operating system which are much newer than 1.0.1. I am not sure what is the latest android things operating system at your side.
if you keep seeing this problem in the recent builds, could you please run the following command:
adb shell getprop|grep incremental
to get the build id a number of around 7 digits so that I will try to reproduce your bug on my side.
jp...@gmail.com <jp...@gmail.com> #10
Yes I updated 1.0.5 but don't stop rebooting yet. but When off WiFi stop rebooting. In addition this problem happened only in my home. In other place is not happened.
I run the recommend command. build number is below.
[ro.build.version.incremental]: [5014699]
I run the recommend command. build number is below.
[ro.build.version.incremental]: [5014699]
ha...@google.com <ha...@google.com> #11
Hi,
I am using the same build with yours [5014699] and 1.0.5. I can freely set my device to any wifi. So I could not reproduce the bug. Since you could reliably reproduce the bug at your home, that is a good approach to solve the problem. Although it may be difficult however, I recommend you to do
adb bugreport
of the before reboot and after reboot stage on your device and trying to capture as much bugreport
information as possible.
then please upload your bug report files here.
Our TPM Amit or developer will help you to sovle this problem.
I am using the same build with yours [5014699] and 1.0.5. I can freely set my device to any wifi. So I could not reproduce the bug. Since you could reliably reproduce the bug at your home, that is a good approach to solve the problem. Although it may be difficult however, I recommend you to do
adb bugreport
of the before reboot and after reboot stage on your device and trying to capture as much bugreport
information as possible.
then please upload your bug report files here.
Our TPM Amit or developer will help you to sovle this problem.
Description
This is not a support forum. Please report only developer bugs or issues related to the
Android Things platform.
Please include the following information with your report:
- Hardware/SoM platform
Raspberry Pi 3 B
- Android Things OS version
1.0.1 (I using setup utility tool 1.0.21 on OS X Elcapitan)
- Full logcat output from the device
The logcat snippet is below.
```
6-25 13:20:42.758 1080 1108 I com.google.android.gms.unstable: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
06-25 13:20:42.759 1080 1108 I swiftshader: precache at /vendor/etc/sw-vertex-com.google.android.gms.unstable.dir
06-25 13:20:42.760 1080 1108 I swiftshader: precache at /vendor/etc/sw-pixel-com.google.android.gms.unstable.dir
06-25 13:20:42.760 1080 1108 I swiftshader: precache at /vendor/etc/sw-setup-com.google.android.gms.unstable.dir
06-25 13:20:42.763 1080 1108 I swiftshader: precache at /vendor/etc/sw-vertex-com.google.android.gms.unstable.dir
06-25 13:20:42.763 1080 1108 I swiftshader: precache at /vendor/etc/sw-pixel-com.google.android.gms.unstable.dir
06-25 13:20:42.764 1080 1108 I swiftshader: precache at /vendor/etc/sw-setup-com.google.android.gms.unstable.dir
06-25 13:20:44.236 1080 1108 I com.google.android.gms.unstable: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
06-25 13:20:44.238 1080 1108 I swiftshader: precache at /vendor/etc/sw-vertex-com.google.android.gms.unstable.dir
06-25 13:20:44.238 1080 1108 I swiftshader: precache at /vendor/etc/sw-pixel-com.google.android.gms.unstable.dir
06-25 13:20:44.239 1080 1108 I swiftshader: precache at /vendor/etc/sw-setup-com.google.android.gms.unstable.dir
06-25 13:20:44.241 1080 1108 I swiftshader: precache at /vendor/etc/sw-vertex-com.google.android.gms.unstable.dir
06-25 13:20:44.242 1080 1108 I swiftshader: precache at /vendor/etc/sw-pixel-com.google.android.gms.unstable.dir
06-25 13:20:44.242 1080 1108 I swiftshader: precache at /vendor/etc/sw-setup-com.google.android.gms.unstable.dir
06-25 13:20:44.606 298 1022 D WificondControl: Scan result ready event
```
--------------------------------------------
STEPS TO REPRODUCE:
1. Setup Android things using "setup utility tool".
2. After that, Start runnig Android things on Raspberry Pi 3 with 3A power supply.
3. After to started, I was setting the wifi with below command.
```
adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid <own SSID> -e passphrase <password>
```
OBSERVED RESULTS:
After wifi setting, in suddenly, Android things rebooting repeatedly. I observed logcat when the rebooting. Always final log message is ```D WificondControl: Scan result ready event ```
If ignore wifi setting, the system is not rebooting suddenly. In this case Look like system is stable.
In the first time, I thinked lack of current of power supply of RaPi 3. However it did not change situation After using 3A power supply.
EXPECTED RESULT:
I expected to do not reboot repeatedly after setting wifi.
--------------------------------------------