title: Wake lock continually throws an exception on Nexus 5
body: <p>We recently got a Nexus 5 to use as a test device. It's running Android 4.4.2. The problem is that it continually spews the following exception as a warning every 2 to 4 seconds:</p>
  
  <pre><code>01-02 22:33:33.482      751-894/? W/Binder﹕ Caught a RuntimeException from the binder stub implementation.
  java.lang.IllegalArgumentException: Wake lock not active
          at com.android.server.power.PowerManagerService.updateWakeLockWorkSourceInternal(PowerManagerService.java:794)
          at com.android.server.power.PowerManagerService.updateWakeLockWorkSource(PowerManagerService.java:780)
          at com.android.server.power.PowerManagerService.updateWakeLockUids(PowerManagerService.java:761)
          at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:103)
          at android.os.Binder.execTransact(Binder.java:404)
          at dalvik.system.NativeStart.run(Native Method)
  </code></pre>
  
  <p>No other phones, that we've tested display the same warning (including a Nexus 4 running 4.4.2)</p>
  
  <p>We are using the WAKE_LOCK permission
  </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  </code></pre>
  
  <p>for Google Cloud Messenger</p>
  
  <p>I've also made sure that this is happening in our app. The warning stay after filtering logcat by package name. It also stops as soon as you exit the app.</p>
  
  <p>The main problem this causes is that Android Studio lags after a while so I need to clear logcat. Also runtime exception aren't something I want to just let lie either. Any ideas why this is happening?</p>
  
  <p><strong>[Edit]</strong><br>
  Here's the place where It's being used in our code. It's just the GcmBroadcastReceiver from Google
  </p>
  
  <pre><code>public class GcmBroadcastReceiver extends WakefulBroadcastReceiver
  {
      public void onReceive(Context context, Intent intent)
      {
          // Explicitly specify that GcmIntentService will handle the intent.
          ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName());
  
          // Start the service, keeping the device awake while it is launching.
          startWakefulService(context, (intent.setComponent(comp)));
          setResultCode(Activity.RESULT_OK);
      }
  }
  </code></pre>