package com.kickstarter.libs.gcm;

import android.content.Intent;

import com.google.android.gms.iid.InstanceIDListenerService;

import timber.log.Timber;

/**
 * Handle the creation, rotation, and updating of registration tokens.
 */
public class TokenListenerService extends InstanceIDListenerService {
  /**
   * Called if InstanceID token is updated. This may occur if the security of
   * the previous token had been compromised. This call is initiated by the
   * InstanceID provider.
   */
  @Override
  public void onTokenRefresh() {
    // Fetch updated Instance ID token and notify our app's server of any changes (if applicable).
    Timber.d("Token refreshed, creating new RegistrationService intent");
    final Intent intent = new Intent(this, RegistrationService.class);
    startService(intent);
  }
}

@@ -153,87 +153,8 @@
 r;%0A%0A
-/**%0A * Handle the creation, rotation, and updating of registration tokens.%0A */%0A
 publ
@@ -240,16 +240,20 @@
 lled if 
+the 
 Instance
@@ -282,19 +282,19 @@
 his 
-may
+can
  occur i
 f th
@@ -293,71 +293,265 @@
 ur i
-f the security of%0A   * the previous token had been compromised.
+n a variety of scenarios - the%0A   * InstanceID service might periodically request that we refresh a token every 6 months, or%0A   * it could force a refresh if a token is invalidated (e.g. security issues, device information%0A   * is no longer valid.%0A   *%0A   *
  Thi
@@ -564,13 +564,13 @@
  is 
-initi
+gener
 ated
@@ -572,29 +572,24 @@
 rated by the
-%0A   *
  InstanceID 
@@ -592,16 +592,31 @@
 eID 
-provider
+service, not by the app
 .%0A  

Clarify role of token listener service