title: GCM not receiving messages on android 4.0.4 device
body: <p>I'm trying to get GCM working on a device with android 4.0.4. 
  First of all, sending from the device to the server to another device is no problem, it's the receiving part that won't work. Second, I'm also working with a device with android 5 and on that phone it all works fine. I think it might have something to do with the device, but I'm not sure (MEDION p4013). It's android 4.0.4 so you don't need a google account to make it work, but to be sure I also activated an account on the phone but still no result. </p>
  
  <p>here is my manifest: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH" /&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS"/&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/&gt;
  
  &lt;permission android:name="com.example.tom.stapp3.permission.C2D_MESSAGE"
      android:protectionLevel="signature"/&gt;
  &lt;uses-permission android:name="com.example.tom.stapp3.permission.C2D_MESSAGE"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme"
      android:name=".application.StApp"&gt;
  
      &lt;receiver android:name=".gcm.GCMBroadCastReceiver"
          android:permission="com.google.android.c2dm.permission.SEND"&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE"/&gt;
              &lt;category android:name="com.example.tom.stapp3"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;service android:name=".gcm.GCMMessageHandler"/&gt;
      &lt;meta-data android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version"/&gt;
  
      &lt;service
          android:name=".service.ShimmerService"
          android:enabled="true"&gt;
      &lt;/service&gt;
  
      &lt;activity
          android:name=".activity.FragmentViewer"
          android:label="Stapp 3" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.ProfileView"
          android:label="@string/title_activity_profile_view"&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.LeaderboardView"
          android:label="@string/title_activity_leaderboard_view"
          android:launchMode="singleTop"&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".activity.StrangerView"
          android:label="@string/title_activity_stranger_view"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.tom.stapp3.activity.LeaderboardView" /&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.ConnectionView"
          android:label="@string/title_activity_connection_view" &gt;
      &lt;/activity&gt;
  
      &lt;activity
          android:name=".activity.QuestList"
          android:label="@string/title_activity_quest_view" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.SoloQuestDescription"
          android:label="@string/title_activity_quest_description" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.GraphView"
          android:configChanges="orientation|screenSize"
          android:label="@string/title_activity_graph"&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=".activity.GCMTestActivity"
          android:label="@string/title_activity_internet__connection" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>the broadcast receiver: </p>
  
  <pre><code>        @Override
          public void onReceive(Context context, Intent intent) {
              ComponentName comp = new ComponentName(context.getPackageName(), GCMMessageHandler.class.getName());
              Log.d("received", "message");
              startWakefulService(context, intent.setComponent(comp));
              setResultCode(Activity.RESULT_OK);
          }
  </code></pre>
  
  <p>and the handler:</p>
  
  <pre><code>private Handler handler;
  
  public GCMMessageHandler() {
      super("GCMMessageHandler");
  }
  
  @Override
  public void onCreate() {
      super.onCreate();
      handler = new Handler();
  }
  
  @Override
  protected void onHandleIntent(Intent intent) {
      Bundle extras = intent.getExtras();
      GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
      String messageType = gcm.getMessageType(intent);
      final int challengeId = Integer.parseInt(extras.getString("challenge_id"));
      final String message = extras.getString("message");
      handler.post(new Runnable() {
          @Override
          public void run() {
              if(challengeId == -1) {
                  Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
              } else {
                  //TODO implementatie
              }
          }
      });
      GCMBroadCastReceiver.completeWakefulIntent(intent);
  }
  </code></pre>