mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Bug 1335110 - Catch security exceptions while getting a GCM token to fail gracefully r=eoger
Exception handling upstream is already in place, and will ensure that we degrade gracefully. Push won't work, but we won't crash either. MozReview-Commit-ID: EfDNoJu46zg --HG-- extra : rebase_source : fab5546108b8da29b3b2e3c8ee02e6459e6fc6dc
This commit is contained in:
parent
96f846e8fb
commit
bbd1d078dd
@ -84,7 +84,13 @@ public class GcmTokenClient {
|
||||
Log.i(LOG_TAG, "Cached GCM token does not exist; requesting new token with sender ID: " + senderID);
|
||||
|
||||
final InstanceID instanceID = InstanceID.getInstance(context);
|
||||
try {
|
||||
token = instanceID.getToken(senderID, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
|
||||
} catch (SecurityException e) {
|
||||
// Degrade gracefully (see upstream exception handling) if we couldn't get the token.
|
||||
// See Bug 1335110.
|
||||
throw new IOException("Could not get token due to a security exception", e);
|
||||
}
|
||||
timestamp = System.currentTimeMillis();
|
||||
|
||||
if (debug) {
|
||||
|
Loading…
Reference in New Issue
Block a user