/*
 * ********************************************************************************************************************
 *  <p/>
 *  BACKENDLESS.COM CONFIDENTIAL
 *  <p/>
 *  ********************************************************************************************************************
 *  <p/>
 *  Copyright 2012 BACKENDLESS.COM. All Rights Reserved.
 *  <p/>
 *  NOTICE: All information contained herein is, and remains the property of Backendless.com and its suppliers,
 *  if any. The intellectual and technical concepts contained herein are proprietary to Backendless.com and its
 *  suppliers and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret
 *  or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden
 *  unless prior written permission is obtained from Backendless.com.
 *  <p/>
 *  ********************************************************************************************************************
 */

package com.backendless.push;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import com.backendless.Backendless;

import java.util.HashMap;
import java.util.Map;

public class BackendlessBroadcastReceiver extends BroadcastReceiver implements PushReceiverCallback
{
  private static final String TAG = BackendlessBroadcastReceiver.class.getSimpleName();
  private static final String EXTRA_WAKE_LOCK_ID = "com.backendless.wakelockid";
  private static final Map<Integer, PowerManager.WakeLock> activeWakeLocks = new HashMap<>();
  public static final String EXTRA_MESSAGE_ID = "com.backendless.messageid";

  private static int mNextId = 1;

  public BackendlessBroadcastReceiver()
  {
  }

  public Class<? extends BackendlessPushService> getServiceClass()
  {
    return BackendlessPushService.class;
  }

  /**
   * @deprecated Extend {@link BackendlessPushService} instead.
   */
  @Deprecated
  public void onRegistered( Context context, String registrationId )
  {
  }

  /**
   * @deprecated Extend {@link BackendlessPushService} instead.
   */
  @Deprecated
  public void onUnregistered( Context context, Boolean unregistered )
  {
  }

  /**
   * @deprecated Extend {@link BackendlessPushService} instead.
   */
  @Deprecated
  public boolean onMessage( Context context, Intent intent )
  {
    return true;
  }

  /**
   * @deprecated Extend {@link BackendlessPushService} instead.
   */
  @Deprecated
  public void onError( Context context, String message )
  {
    throw new RuntimeException( message );
  }

  @Override
  public final void onReceive( Context context, Intent intent )
  {
    if( !Backendless.isInitialized() )
      Backendless.initApplicationFromProperties( context );

    BackendlessPushService.enqueueWork( context, getServiceClass(), intent );
  }
}

@@ -1096,46 +1096,8 @@
 er;%0A
-import android.content.ComponentName;%0A
 impo
@@ -1166,596 +1166,139 @@
 ort 
-android.os.PowerManager;%0Aimport com.backendless.Backendless;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class BackendlessBroadcastReceiver extends BroadcastReceiver implements PushReceiverCallback%0A%7B%0A  private static final String TAG = BackendlessBroadcastReceiver.class.getSimpleName();%0A  private static final String EXTRA_WAKE_LOCK_ID = %22com.backendless.wakelockid%22;%0A  private static final Map%3CInteger, PowerManager.WakeLock%3E activeWakeLocks = new HashMap%3C%3E();%0A  public static final String EXTRA_MESSAGE_ID = %22com.backendless.messageid%22;%0A%0A  private static int mNextId = 1;%0A
+com.backendless.Backendless;%0A%0Apublic class BackendlessBroadcastReceiver extends BroadcastReceiver implements PushReceiverCallback%0A%7B
 %0A  p

Remove unnecessary fields.