Skip to content

Commit f0e61e6

Browse files
authored
Remove offensive terms (#1973)
1 parent bfdb796 commit f0e61e6

File tree

3 files changed

+33
-38
lines changed

3 files changed

+33
-38
lines changed

auth/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ allowedCountries.add("+1");
418418
allowedCountries.add("gr");
419419

420420
IdpConfig phoneConfigWithAllowedCountries = new IdpConfig.PhoneBuilder()
421-
.setWhitelistedCountries(allowedCountries)
421+
.setAllowedCountries(allowedCountries)
422422
.build();
423423
```
424424
All countries with the country code +1 will be present in the selector as well as Greece ('gr').
@@ -433,7 +433,7 @@ blockedCountries.add("+1");
433433
blockedCountries.add("gr");
434434

435435
IdpConfig phoneConfigWithBlockedCountries = new IdpConfig.PhoneBuilder()
436-
.setBlacklistedCountries(blockedCountries)
436+
.setBlockedCountries(blockedCountries)
437437
.build();
438438
```
439439

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@
3434
import com.firebase.ui.auth.util.data.ProviderUtils;
3535
import com.google.android.gms.auth.api.credentials.Credential;
3636
import com.google.android.gms.auth.api.credentials.CredentialRequest;
37-
import com.google.android.gms.auth.api.credentials.CredentialRequestResponse;
3837
import com.google.android.gms.auth.api.credentials.CredentialsClient;
3938
import com.google.android.gms.auth.api.signin.GoogleSignIn;
4039
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
4140
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
42-
import com.google.android.gms.common.ConnectionResult;
43-
import com.google.android.gms.common.GoogleApiAvailability;
4441
import com.google.android.gms.common.api.ApiException;
4542
import com.google.android.gms.common.api.CommonStatusCodes;
46-
import com.google.android.gms.common.api.GoogleApi;
4743
import com.google.android.gms.common.api.Scope;
48-
import com.google.android.gms.tasks.Continuation;
4944
import com.google.android.gms.tasks.Task;
5045
import com.google.android.gms.tasks.Tasks;
5146
import com.google.firebase.FirebaseApp;
@@ -845,7 +840,7 @@ public PhoneBuilder setDefaultCountryIso(@NonNull String iso) {
845840
* Sets the country codes available in the country code selector for phone
846841
* authentication. Takes as input a List of both country isos and codes.
847842
* This is not to be called with
848-
* {@link #setBlacklistedCountries(List)}.
843+
* {@link #setBlockedCountries(List)}.
849844
* If both are called, an exception will be thrown.
850845
* <p>
851846
* Inputting an e-164 country code (e.g. '+1') will include all countries with
@@ -860,7 +855,7 @@ public PhoneBuilder setDefaultCountryIso(@NonNull String iso) {
860855
* @throws IllegalArgumentException if an empty allowlist is provided.
861856
* @throws NullPointerException if a null allowlist is provided.
862857
*/
863-
public PhoneBuilder setWhitelistedCountries(
858+
public PhoneBuilder setAllowedCountries(
864859
@NonNull List<String> countries) {
865860
if (getParams().containsKey(ExtraConstants.BLOCKLISTED_COUNTRIES)) {
866861
throw new IllegalStateException(
@@ -882,7 +877,7 @@ public PhoneBuilder setWhitelistedCountries(
882877
* Sets the countries to be removed from the country code selector for phone
883878
* authentication. Takes as input a List of both country isos and codes.
884879
* This is not to be called with
885-
* {@link #setWhitelistedCountries(List)}.
880+
* {@link #setAllowedCountries(List)}.
886881
* If both are called, an exception will be thrown.
887882
* <p>
888883
* Inputting an e-164 country code (e.g. '+1') will include all countries with
@@ -897,7 +892,7 @@ public PhoneBuilder setWhitelistedCountries(
897892
* @throws IllegalArgumentException if an empty blocklist is provided.
898893
* @throws NullPointerException if a null blocklist is provided.
899894
*/
900-
public PhoneBuilder setBlacklistedCountries(
895+
public PhoneBuilder setBlockedCountries(
901896
@NonNull List<String> countries) {
902897
if (getParams().containsKey(ExtraConstants.ALLOWLISTED_COUNTRIES)) {
903898
throw new IllegalStateException(
@@ -906,7 +901,7 @@ public PhoneBuilder setBlacklistedCountries(
906901
}
907902

908903
String message = "Invalid argument: Only non-%s blocklists are valid. " +
909-
"To specify no blacklist, do not call this method.";
904+
"To specify no blocklist, do not call this method.";
910905
Preconditions.checkNotNull(countries, String.format(message, "null"));
911906
Preconditions.checkArgument(!countries.isEmpty(), String.format
912907
(message, "empty"));

auth/src/test/java/com/firebase/ui/auth/AuthUITest.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -155,115 +155,115 @@ public void testCreatingStartIntent_withOnlyAnonymousProvider_expectIllegalState
155155
}
156156

157157
@Test(expected = IllegalArgumentException.class)
158-
public void testPhoneBuilder_withBlacklistedDefaultNumberCode_expectIllegalArgumentException() {
158+
public void testPhoneBuilder_withBlockedDefaultNumberCode_expectIllegalArgumentException() {
159159
new IdpConfig.PhoneBuilder()
160160
.setDefaultNumber("+1123456789")
161-
.setBlacklistedCountries(Arrays.asList("+1"))
161+
.setBlockedCountries(Arrays.asList("+1"))
162162
.build();
163163
}
164164

165165
@Test(expected = IllegalArgumentException.class)
166-
public void testPhoneBuilder_withBlacklistedDefaultIso_expectIllegalArgumentException() {
166+
public void testPhoneBuilder_withBlockedDefaultIso_expectIllegalArgumentException() {
167167
new IdpConfig.PhoneBuilder()
168168
.setDefaultNumber("us", "123456789")
169-
.setBlacklistedCountries(Arrays.asList("us"))
169+
.setBlockedCountries(Arrays.asList("us"))
170170
.build();
171171
}
172172

173173
@Test
174-
public void testPhoneBuilder_withWhitelistedDefaultIso_expectSuccess() {
174+
public void testPhoneBuilder_withAllowedDefaultIso_expectSuccess() {
175175
new IdpConfig.PhoneBuilder()
176176
.setDefaultNumber("us", "123456789")
177-
.setWhitelistedCountries(Arrays.asList("us"))
177+
.setAllowedCountries(Arrays.asList("us"))
178178
.build();
179179
}
180180

181181
@Test
182-
public void testPhoneBuilder_withWhitelistedDefaultNumberCode_expectSuccess() {
182+
public void testPhoneBuilder_withAllowedDefaultNumberCode_expectSuccess() {
183183
new IdpConfig.PhoneBuilder()
184184
.setDefaultNumber("+1123456789")
185-
.setWhitelistedCountries(Arrays.asList("+1"))
185+
.setAllowedCountries(Arrays.asList("+1"))
186186
.build();
187187
}
188188

189189
@Test(expected = IllegalArgumentException.class)
190-
public void testPhoneBuilder_whiteInvalidDefaultNumberCode_expectIllegalArgumentException() {
190+
public void testPhoneBuilder_withInvalidDefaultNumberCode_expectIllegalArgumentException() {
191191
new IdpConfig.PhoneBuilder()
192192
.setDefaultNumber("+1123456789")
193-
.setWhitelistedCountries(Arrays.asList("gr"))
193+
.setAllowedCountries(Arrays.asList("gr"))
194194
.build();
195195
}
196196

197197
@Test
198198
public void testPhoneBuilder_withValidDefaultNumberCode_expectSuccess() {
199199
new IdpConfig.PhoneBuilder()
200200
.setDefaultNumber("+1123456789")
201-
.setWhitelistedCountries(Arrays.asList("ca"))
201+
.setAllowedCountries(Arrays.asList("ca"))
202202
.build();
203203
}
204204

205205
@Test
206-
public void testPhoneBuilder_withBlacklistedCountryWithSameCountryCode_expectSuccess() {
206+
public void testPhoneBuilder_withBlockedCountryWithSameCountryCode_expectSuccess() {
207207
new IdpConfig.PhoneBuilder()
208208
.setDefaultNumber("+1123456789")
209-
.setBlacklistedCountries(Arrays.asList("ca"))
209+
.setBlockedCountries(Arrays.asList("ca"))
210210
.build();
211211
}
212212

213213
@Test(expected = IllegalArgumentException.class)
214214
public void testPhoneBuilder_withInvalidDefaultIso_expectIllegalArgumentException() {
215215
new IdpConfig.PhoneBuilder()
216216
.setDefaultNumber("us", "123456789")
217-
.setWhitelistedCountries(Arrays.asList("ca"))
217+
.setAllowedCountries(Arrays.asList("ca"))
218218
.build();
219219
}
220220

221221
@Test
222222
public void testPhoneBuilder_withValidDefaultIso_expectSucess() {
223223
new IdpConfig.PhoneBuilder()
224224
.setDefaultNumber("us", "123456789")
225-
.setBlacklistedCountries(Arrays.asList("ca"))
225+
.setBlockedCountries(Arrays.asList("ca"))
226226
.build();
227227
}
228228

229229
@Test(expected = IllegalStateException.class)
230230
public void
231-
testPhoneBuilder_setBothBlacklistedAndWhitelistedCountries_expectIllegalStateException() {
231+
testPhoneBuilder_setBothBlockedAndAllowedCountries_expectIllegalStateException() {
232232
List<String> countries = Arrays.asList("ca");
233233
new IdpConfig.PhoneBuilder()
234-
.setBlacklistedCountries(countries)
235-
.setWhitelistedCountries(countries)
234+
.setBlockedCountries(countries)
235+
.setAllowedCountries(countries)
236236
.build();
237237
}
238238

239239
@Test(expected = IllegalArgumentException.class)
240240
public void
241-
testPhoneBuilder_passEmptyListForWhitelistedCountries_expectIllegalArgumentException() {
241+
testPhoneBuilder_passEmptyListForAllowedCountries_expectIllegalArgumentException() {
242242
new IdpConfig.PhoneBuilder()
243-
.setWhitelistedCountries(new ArrayList<String>())
243+
.setAllowedCountries(new ArrayList<String>())
244244
.build();
245245
}
246246

247247
@Test(expected = NullPointerException.class)
248-
public void testPhoneBuilder_passNullForWhitelistedCountries_expectNullPointerException() {
248+
public void testPhoneBuilder_passNullForAllowedCountries_expectNullPointerException() {
249249
new IdpConfig.PhoneBuilder()
250-
.setWhitelistedCountries(null)
250+
.setAllowedCountries(null)
251251
.build();
252252
}
253253

254254

255255
@Test(expected = IllegalArgumentException.class)
256256
public void
257-
testPhoneBuilder_passEmptyListForBlacklistedCountries_expectIllegalArgumentException() {
257+
testPhoneBuilder_passEmptyListForBlockedCountries_expectIllegalArgumentException() {
258258
new IdpConfig.PhoneBuilder()
259-
.setBlacklistedCountries(new ArrayList<String>())
259+
.setBlockedCountries(new ArrayList<String>())
260260
.build();
261261
}
262262

263263
@Test(expected = NullPointerException.class)
264-
public void testPhoneBuilder_passNullForBlacklistedCountries_expectNullPointerException() {
264+
public void testPhoneBuilder_passNullForBlockedCountries_expectNullPointerException() {
265265
new IdpConfig.PhoneBuilder()
266-
.setBlacklistedCountries(null)
266+
.setBlockedCountries(null)
267267
.build();
268268
}
269269

0 commit comments

Comments
 (0)