-
Notifications
You must be signed in to change notification settings - Fork 533
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
Dhruv2295/code refactor #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade to API 30 causes app crash when logging. The permission handling for storage seems to have changed.
@@ -240,11 +239,7 @@ protected void onCreate(final Bundle savedInstanceState) { | |||
new ViewTreeObserver.OnGlobalLayoutListener() { | |||
@Override | |||
public void onGlobalLayout() { | |||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about old Android versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App's minimum supported version is 21. This check was checking for 18.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense. Android 5.0 (API level 21) = Lollipop.
updateVehicleState(); | ||
|
||
runOnUiThread( | ||
new Runnable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use lambda previously but not here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no global converter in android studio to convert all these anonymous functions to lambdas at once.
So it's more of an iterative process, where I keep replacing them as and when I find them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've converted this and pushed another commit
LOGGER.e("Error receiving USB data"); | ||
} | ||
private final UsbSerialInterface.UsbReadCallback callback = | ||
data -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens on error, since try/catch is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an android studio recommendation that this catch block would never be called. I'll add it back. Better safer.
06957e7
to
d0c1e9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged
Migration of dependencies to androidX.
Basic code cleanup to remove redundant initialisers.