Commit 52d259d
authored
FirebaseSegmentation SDK changes (#673)
* 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
* Add the state machine of updating custom installation id in the local
cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
* minor format fix
* Address comments #1
* Http client in Firebase Segmentation SDK to call backend service.
* Revert unintentional change
* Fix connected device test
* Fix connected device test
* 1. Add a few annotations to make java code Kotlin friendly
2. Some fixes for the http request format
* Fix java format
* Fix API version
* Change the segmentation API implementation to synchronous and put the
entire synchronous code block in async task.
* Fix a async getResult race issue.
* OkHttpClient -> HttpsUrlConnection
* Use gzip for compressing content and fix ourput stream memory leak risk.
* Addressed a few comments
* FirebaseSegmentation SDK
1. Clean up http client response code.
2. When updateCustomInstallationId is called, on non-retryable server errors, the SDK should clean up the local cache. Instead, for retryable errors, SDK can keep the local cache for retrying update later.1 parent 7f30aea commit 52d259d
File tree
4 files changed
+66
-17
lines changed- firebase-segmentation/src
- androidTest/java/com/google/firebase/segmentation
- main/java/com/google/firebase/segmentation
- remote
4 files changed
+66
-17
lines changedLines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
153 | 179 | | |
154 | 180 | | |
155 | 181 | | |
| |||
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
171 | 181 | | |
| 182 | + | |
172 | 183 | | |
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | | - | |
| 190 | + | |
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
| |||
204 | 215 | | |
205 | 216 | | |
206 | 217 | | |
207 | | - | |
| 218 | + | |
208 | 219 | | |
209 | 220 | | |
210 | 221 | | |
| |||
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
217 | | - | |
| 228 | + | |
218 | 229 | | |
219 | 230 | | |
220 | 231 | | |
| |||
231 | 242 | | |
232 | 243 | | |
233 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
234 | 248 | | |
235 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
236 | 252 | | |
| 253 | + | |
237 | 254 | | |
238 | 255 | | |
239 | 256 | | |
240 | 257 | | |
241 | 258 | | |
242 | 259 | | |
243 | 260 | | |
244 | | - | |
| 261 | + | |
245 | 262 | | |
246 | 263 | | |
247 | 264 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | 44 | | |
47 | 45 | | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| |||
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
| |||
0 commit comments