-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix TelemetryUtils.obtainApplicationState()
method.
#559
Conversation
652db43
to
4785722
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.
We need to remove GET_TASKS permission from manifest file as well
libtelemetry/src/main/java/com/mapbox/android/telemetry/TelemetryUtils.java
Show resolved
Hide resolved
Yep, done. |
if (appProcesses == null) { | ||
return NO_STATE; | ||
String state = NO_STATE; | ||
switch (AppStateUtils.getAppStateFromActivityManager(context)) { |
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 may not see full picture but couldn't we actually expose and use AppStateUtils.getAppStateFromActivityManager(context)
instead of obtainApplicationState
? This mapping here seems to be actually almost 1 to 1 (at least looking at the diff 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.
Historical reasons. :) We can expose AppStateUtils.getAppStateFromActivityManager(context)
but I would avoid removing obtainApplicationState
cause it's a breaking change.
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.
Couldn't we do something like
public static String obtainApplicationState(Context context) {
return appStateUtils.getAppStateFromActivityManager(context);
}
if I get the mapping correctly?
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.
Well, NO_STATE is an empty string, but others are one-to-one, simplified.
b5c83c7
to
a77169a
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.
Thanks @tarigo, looks good to me now 👍
Fixes #557.