Skip to content
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

Merged
merged 9 commits into from
Jun 12, 2019
Merged

Conversation

mikechoch
Copy link
Contributor

@mikechoch mikechoch commented Jun 6, 2019

This change is Reviewable

* Some workflow reorganization
* ActivityLifecycleListener registered right after appContext set
* Added LOCATION permissions in manifest
* Testing functionality around LocationGMS prompt
* Testing session time tracking
@mikechoch mikechoch requested a review from jkasten2 June 6, 2019 21:31
* setRequiresUserPrivacyConsent needed to be called first
* Time should be set after the privacy consent is given
Copy link
Member

@jkasten2 jkasten2 left a 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 mikechoch requested a review from jkasten2 June 7, 2019 21:56
@jkasten2
Copy link
Member

jkasten2 commented Jun 7, 2019

@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 UserStateSynchronizer.java:442 we were looking at before.

Copy link
Member

@jkasten2 jkasten2 left a 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
@mikechoch mikechoch requested a review from jkasten2 June 10, 2019 22:06
Copy link
Member

@jkasten2 jkasten2 left a 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: :shipit: complete! all files reviewed, all discussions resolved

@mikechoch mikechoch merged commit 8a95ce9 into master Jun 12, 2019
@Jeasmine Jeasmine deleted the fix_privacy_consent_context_null branch May 12, 2020 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants