Closed minghsikang closed 4 weeks ago
The logic is still trying to access build_info
right? What's the difference?
The logic is still trying to access
build_info
right? What's the difference?
The difference is that we can only use build_info when the device is detectable. Otherwise, the build_info is None.
Here is the context: when I tried to init android device, is_rootable could raise exception if the device is not found.
return not self.is_bootloader and self.build_info['debuggable'] == '1'
That's why it is not in bootloader but still trying to access build_info
Hence, I come up with two solutions
not is_bootloader
to is_adb_detectable
to make sure we won't access build_info when it is None. (current change)WDYT?
when I tried to init android device, is_rootable could raise exception if the device is not found.
Are you meaning you are initializing an AndroidDevice
object while there is no corresponding Android device?
We assume each AndroidDevice
object corresponds to one Android device. What are you going to do if there's no Android device?
Are you meaning you are initializing an
AndroidDevice
object while there is no corresponding Android device?
Partially correct. There is the android device, but it is not detectable by adb or fastboot (even not in rom recovery mode and need ftdi commands to bring it back).
We assume each
AndroidDevice
object corresponds to one Android device. What are you going to do if there's no Android device?
We will use some other recover scripts/tools to bring it back to fastboot or android and then use Android device.
Are you meaning you are initializing an
AndroidDevice
object while there is no corresponding Android device?Partially correct. There is the android device, but it is not detectable by adb or fastboot (even not in rom recovery mode and need ftdi commands to bring it back).
We assume each
AndroidDevice
object corresponds to one Android device. What are you going to do if there's no Android device?We will use some other recover scripts/tools to bring it back to fastboot or android and then use Android device.
I see.
I think in Mobly repo this change makes sense to prevent using a None as a dict.
But for your usage, sounds like it would make more sense to first recover the device and then initialize AndroidDevice
object?
But for your usage, sounds like it would make more sense to first recover the device and then initialize
AndroidDevice
object?
Totally agree.
It seems need your help to resolve the comment.
The logic now is trying to use build_info when it is not in bootloader, but if the device isn't detectable in neither adb nor fastboot, the exception occurs.
This change is![Reviewable](https://reviewable.io/review_button.svg)