Buggy code:
public class C2DMService extends IntentService { private static final int INIT_REREGISTER_DELAY = 3000 ; private static final int MAX_REREGISTER_DELAY = 3600000 ; private static final int REFRESH_ID_TIMEOUT = ( ( 24 * 60 ) * 60 ) * 1000 ; private static final String GSF_PACKAGE = "com.google.android.gsf" ; private static final String ACTION_C2DM_REGISTER = "com.google.android.c2dm.intent.REGISTER" ; private static final String ACTION_C2DM_UNREGISTER = "com.google.android.c2dm.intent.UNREGISTER" ; private static final String ACTION_C2DM_REGISTERED = "com.google.android.c2dm.intent.REGISTRATION" ; private static final String ACTION_C2DM_RECEIVE = "com.google.android.c2dm.intent.RECEIVE" ; private static final String ACTION_RETRY_REGISTER = "net.anei.cadpage.RETRY_REGISTER" ; private static final String ACTION_REFRESH_ID = "net.anei.cadpage.REFRESH_ID" ; private static final String GCM_PROJECT_ID = "1027194726673" ; private static WakeLock sWakeLock ; private static final Random RANDOM = new Random ( ) ; private static GoogleCloudMessaging gcm = null ; public C2DMService ( ) { } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { } @ Override protected void onHandleIntent ( Intent intent ) { } private void handleRegistration ( final Intent intent ) { } private void handleMessage ( final Intent intent ) { } private void sendAutoAck ( Intent intent , String vendorCode ) { } private void processContent ( Intent intent , String content , long timestamp ) { } @ Override public void onDestroy ( ) { } static void runIntentInService ( Context context , Intent intent ) { } private static void holdPowerLock ( Context context ) { } public static void sendResponseMsg ( Context context , String ackReq , String ackURL , String type , String vendorCode ) { } private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat ( "MM//dd//yyyy" ) ; public static boolean register ( Context context ) { } public static boolean register ( Context context , boolean auto ) { } public static boolean unregister ( Context context ) { } private static boolean startRegisterRequest ( Context context , int reqCode , boolean auto ) { } private static boolean startRegisterRequest ( Context context , int reqCode , int delayMS ) { } private static boolean isNewGCMActive ( Context context ) { } private static void registrationSuccess ( String regId ) { } private static void registrationCancelled ( ) { } private static void registrationFailure ( String error ) { } private static synchronized GoogleCloudMessaging getGCM ( ) { } private static String retryRegistration ( String error ) { } private void retryRegisterRequest ( Intent intent ) { } private static void resetRefreshIDTimer ( Context context , String eventType ) { long curTime = System . currentTimeMillis ( ) ; ManagePreferences . setLastGcmEventType ( eventType ) ; ManagePreferences . setLastGcmEventTime ( curTime ) ; Log . v ( ( ( "Scheduling<seq2seq4repair_space>refresh<seq2seq4repair_space>event<seq2seq4repair_space>in<seq2seq4repair_space>" + ( C2DMService . REFRESH_ID_TIMEOUT ) ) + "<seq2seq4repair_space>msecs" ) ) ; AlarmManager myAM = ( ( AlarmManager ) ( context . getSystemService ( ALARM_SERVICE ) ) ) ; Intent refreshIntent = new Intent ( context , C2DMRetryReceiver . class ) ; refreshIntent . setAction ( C2DMService . ACTION_REFRESH_ID ) ; <START_BUG> PendingIntent refreshPendingIntent = PendingIntent . getBroadcast ( context , 0 , refreshIntent , FLAG_CANCEL_CURRENT ) ; <END_BUG> long triggerTime = curTime + ( C2DMService . REFRESH_ID_TIMEOUT ) ; myAM . set ( RTC_WAKEUP , triggerTime , refreshPendingIntent ) ; } public static void emailRegistrationId ( Context context ) { } }

Fix:
PendingIntent refreshPendingIntent = PendingIntent . getBroadcast ( context , 0 , refreshIntent , FLAG_UPDATE_CURRENT ) ;