Last active
June 22, 2017 14:05
-
-
Save aaronj1335/ca9e59e2284c53d99e373cbb760e9b60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GuardedSafetyNetClient { | |
private final SafetyNetClient client; | |
private GuardedSafetyNetClient(Context context) { | |
client = SafetyNet.getClient(context); | |
} | |
public static SafetyNetClient getClient(Context context) { | |
return new GuardedSafetyNetClient(context); | |
} | |
public Task<SafeBrowsingResponse> lookupUri(String uri, String apiKey, int... threatTypes) { | |
return GoogleApiAvailability.isGooglePlayServicesAvailable(getContext())? | |
lookupUri(uri, apiKey, threatTypes) : Tasks.forException(new WhateverException("...")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment