Skip to content

Merge FIS Android SDK into master branch #1048

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

Merged
merged 121 commits into from
Dec 10, 2019
Merged

Merge FIS Android SDK into master branch #1048

merged 121 commits into from
Dec 10, 2019

Conversation

diwu-arete
Copy link
Contributor

No description provided.

diwu-arete and others added 30 commits June 12, 2019 17:49
…oid SDK (#514)

* Add Firebase Segmentation SDK and some skeleton code in Firebase Android SDK

* Add Firebase Segmentation SDK and some skeleton code in Firebase Android SDK

* Address comments #1

* Address comments #1

* Address comments #2
…sts for it. (#524)

* Add type arguments in StorageTaskManager (#517)

* Output artifact list during local publishing. (#515)

This effort replaces #494.

* Implement Firebase segmentation SDK device local cache

* fix functions (#523)

* fix functions

* update minsdk version

* remove idea

* Set test type to release only in CI. (#522)

* Set test type to release only in CI.

This fixes Android Studio issue, where it is impossible to run
integration tests in debug mode.

Additionally move build type configuration to FirebaseLibraryPlugin to
avoid projects.all configuration in gradle.

* Add comment back.

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Minor fix to error message to match the admin sdk. (#525)

* Minor fix to error message to match the admin sdk.

In particular, it *is* allowed to have slashes, etc in field paths.

* Added clean task to smoke tests. (#527)

This change allows the smoke tests to clean all build variants created
by the infrastructure.

* Update deps to post-androidx gms versions. (#526)

* Update deps to post-androidx gms versions.

Additionally configure sources.jar for SDKs.

* Update functions-ktx deps

* Fix versions.

* unbump fiam version in fiamui-app

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Copy firebase-firestore-ktx dependencies on firestore into its own subfolder (#528)

* Wrap shared pref commit in a async task.

* Address comments

* Bump firestore version for release (#530)

Additionally fix pom filter to exclude multidex from deps.

* Google format fix
* Implement Firebase segmentation SDK device local cache

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Wrap shared pref commit in a async task.

* Address comments

* Google format fix

* Replace some deprecated code.
* Implement Firebase segmentation SDK device local cache

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Wrap shared pref commit in a async task.

* Address comments

* Google format fix

* Replace some deprecated code.

* Package refactor

* nit

* nit
cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
ankitaj224 and others added 13 commits September 18, 2019 15:27
* Enabling FIS network call timeout.

* Addressing Di's comments
* Simplifying FirebaseInstallations class by adding listeners.

* Addressing ciaran's comments to return same token if multiple getAuthToken()
calls are triggered simultaneously.

* Cleaning doRegistration method.

* Fixing FISClient to correctly parse expiration timestamp. (#848)

* Updating getAuthToken to return creation timestamp (#884)

* Propagating the exceptions to the clients. (#856)
* Fixing FISClient to correctly parse expiration timestamp. (#848)

* Updating getAuthToken to return creation timestamp (#884)

* Propagating the exceptions to the clients. (#856)

* Extract FID from FIS createInstallation response (#888)

* Addressing Rayo's comment: Rename PersistedFidEntry to (#899)

* Implementing retry once for FIS Client. (#895)

* Simplifying FirebaseInstallations class by adding listeners. (#847)

* Fixing FISClient to correctly parse expiration timestamp. (#848)

* Updating getAuthToken to return creation timestamp (#884)

* Propagating the exceptions to the clients. (#856)
 1. Mark PersistedInstallationEntry status UNREGISTERED incase of 500 errors
2. Store detailed 4xx server exceptions in the local storage. In the
succeeding getId calls,return these exceptions to the clients
* Add FisError to the persisted installation entry. (#931)
1 line change on comment
* getAuthToken error handling for 401 & 404 response code:
- Clear the local storage & throw an exception to call
getId() resulting in recreation of fid
* add tests

* update api

* installations
* Switch from using SharedPreferences to a flat file

* Fixes for multi-process access

 - switch from shared prefs to a flat file
 - protect generate Fid for cross-process and cross-thread accesses
 - make doRegistration only read the prefs once at the beginning and
   clean up the flow
 - pass the forceRefresh flag into doRegistration rather than
   storing it in a global

* revert the name of the FID prefs write call

* fix formatting issues

* Fix the cross process locking

The check if a new FID was needed was not in the critical region.

* some small changes from the review

* fix the java format and update the api file
@diwu-arete diwu-arete requested a review from vkryachko December 10, 2019 01:40
@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #1048 into master will decrease coverage by 0.84%.
The diff coverage is 11.13%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1048      +/-   ##
============================================
- Coverage     58.39%   57.55%   -0.85%     
- Complexity     6196     6212      +16     
============================================
  Files           622      637      +15     
  Lines         30731    31279     +548     
  Branches       4246     4299      +53     
============================================
+ Hits          17945    18002      +57     
- Misses        11358    11846     +488     
- Partials       1428     1431       +3
Impacted Files Coverage Δ Complexity Δ
...gle/firebase/installations/remote/TokenResult.java 0% <0%> (ø) 0 <0> (?)
...irebase/installations/InstallationTokenResult.java 0% <0%> (ø) 0 <0> (?)
...nstallations/local/PersistedInstallationEntry.java 0% <0%> (ø) 0 <0> (?)
...m/google/firebase/installations/GetIdListener.java 0% <0%> (ø) 0 <0> (?)
...ase/installations/remote/InstallationResponse.java 0% <0%> (ø) 0 <0> (?)
.../installations/FirebaseInstallationsException.java 0% <0%> (ø) 0 <0> (?)
...m/google/firebase/installations/AwaitListener.java 0% <0%> (ø) 0 <0> (?)
...e/firebase/installations/GetAuthTokenListener.java 0% <0%> (ø) 0 <0> (?)
.../installations/FirebaseInstallationsRegistrar.java 100% <100%> (ø) 3 <3> (?)
.../firebase/installations/FirebaseInstallations.java 12.02% <12.02%> (ø) 4 <4> (?)
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c72014...2840a51. Read the comment docs.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-installations:
error: Added interface com.google.firebase.installations.FirebaseInstallationsApi to class class com.google.firebase.installations.FirebaseInstallations [AddedInterface]
error: Method com.google.firebase.installations.FirebaseInstallations.delete has changed return type from Task to com.google.android.gms.tasks.Task<java.lang.Void> [ChangedType]
error: Method com.google.firebase.installations.FirebaseInstallations.getId has changed return type from Task to com.google.android.gms.tasks.Task<java.lang.String> [ChangedType]
error: Removed method com.google.firebase.installations.FirebaseInstallations.getInstance(FirebaseApp) [RemovedMethod]
error: Added method com.google.firebase.installations.FirebaseInstallations.getInstance(com.google.firebase.FirebaseApp) [AddedMethod]
error: Method com.google.firebase.installations.FirebaseInstallations.getToken has changed return type from Task to com.google.android.gms.tasks.Task<com.google.firebase.installations.InstallationTokenResult> [ChangedType]
error: Removed constructor com.google.firebase.installations.local.PersistedInstallation(FirebaseApp) [RemovedMethod]
error: Added constructor com.google.firebase.installations.local.PersistedInstallation(com.google.firebase.FirebaseApp) [AddedMethod]
error: Removed constructor com.google.firebase.installations.remote.FirebaseInstallationServiceClient(Context,UserAgentPublisher,HeartBeatInfo) [RemovedMethod]
error: Added constructor com.google.firebase.installations.remote.FirebaseInstallationServiceClient(android.content.Context,com.google.firebase.platforminfo.UserAgentPublisher,com.google.firebase.heartbeatinfo.HeartBeatInfo) [AddedMethod]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation added thrown exception java.io.IOException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.deleteFirebaseInstallation added thrown exception com.google.firebase.FirebaseException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.deleteFirebaseInstallation added thrown exception java.io.IOException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.generateAuthToken added thrown exception java.io.IOException [ChangedThrows]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@vkryachko
Copy link
Member

/test api-information

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-installations:
error: Added interface com.google.firebase.installations.FirebaseInstallationsApi to class class com.google.firebase.installations.FirebaseInstallations [AddedInterface]
error: Method com.google.firebase.installations.FirebaseInstallations.delete has changed return type from Task to com.google.android.gms.tasks.Task<java.lang.Void> [ChangedType]
error: Method com.google.firebase.installations.FirebaseInstallations.getId has changed return type from Task to com.google.android.gms.tasks.Task<java.lang.String> [ChangedType]
error: Removed method com.google.firebase.installations.FirebaseInstallations.getInstance(FirebaseApp) [RemovedMethod]
error: Added method com.google.firebase.installations.FirebaseInstallations.getInstance(com.google.firebase.FirebaseApp) [AddedMethod]
error: Method com.google.firebase.installations.FirebaseInstallations.getToken has changed return type from Task to com.google.android.gms.tasks.Task<com.google.firebase.installations.InstallationTokenResult> [ChangedType]
error: Removed constructor com.google.firebase.installations.local.PersistedInstallation(FirebaseApp) [RemovedMethod]
error: Added constructor com.google.firebase.installations.local.PersistedInstallation(com.google.firebase.FirebaseApp) [AddedMethod]
error: Removed constructor com.google.firebase.installations.remote.FirebaseInstallationServiceClient(Context,UserAgentPublisher,HeartBeatInfo) [RemovedMethod]
error: Added constructor com.google.firebase.installations.remote.FirebaseInstallationServiceClient(android.content.Context,com.google.firebase.platforminfo.UserAgentPublisher,com.google.firebase.heartbeatinfo.HeartBeatInfo) [AddedMethod]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation added thrown exception java.io.IOException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.deleteFirebaseInstallation added thrown exception com.google.firebase.FirebaseException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.deleteFirebaseInstallation added thrown exception java.io.IOException [ChangedThrows]
error: Method com.google.firebase.installations.remote.FirebaseInstallationServiceClient.generateAuthToken added thrown exception java.io.IOException [ChangedThrows]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@diwu-arete diwu-arete merged commit b7a52c8 into master Dec 10, 2019
@firebase firebase locked and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants