-
Notifications
You must be signed in to change notification settings - Fork 369
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 privacy consent context null #772
Conversation
* Some workflow reorganization * ActivityLifecycleListener registered right after appContext set
* Added LOCATION permissions in manifest * Testing functionality around LocationGMS prompt * Testing session time tracking
* setRequiresUserPrivacyConsent needed to be called first
* Time should be set after the privacy consent is given
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.
Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @jkasten2 and @mikechoch)
OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java, line 518 at r1 (raw file):
} // Before setting appContext store the previous state for future use
Omit comment, since the use is explained well a few lines below when it is read.
OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java, line 879 at r1 (raw file):
} public static boolean userProvidedPrivacyConsent() {
Unfortunately we can't rename this method to hasUserProvidedPrivacyConsent
right now since it is a public method.
OneSignalSDK/unittest/src/main/AndroidManifest.xml, line 5 at r1 (raw file):
package="com.onesignal.example"> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Since this will be applied globally this could cause other tests to fail. We might need to do this dynamically only in the tests we need if so with the Robolectric API.
* Overall Manifest.xml should not have Location permission * New Manifest file is set using config and has Location permissions
@mikechoch Changes look good now expect it seems there is a race condition with the new tests since they are failing on travis.
This looks to be on line |
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.
Reviewed 1 of 5 files at r1, 1 of 4 files at r2.
Reviewable status: 1 of 5 files reviewed, all discussions resolved (waiting on @jkasten2)
* In some cases, the unit tests fail with a NullPointerException * This helps prevent using currentUserState when it is null
* This was found while fixing the privacy consent required true issue
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.
Reviewed 1 of 5 files at r1, 2 of 4 files at r2, 2 of 2 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
This change is