title: Application keeps device on (partial wake lock)
body: <p>I have use service for collect fixes from network plocation provider. I have not use wacklock, but my app whatever locks device. </p>
  
  <p>I have seen it in Battery Histor for GB, for example:
  Screen ON: 2 minutes;
  Running: 5 minutes;
  Partial wake lock by my app: 10 minutes.</p>
  
  <p>It should be? I need collect location data only when device awake.</p>
  
  <p>This is my sercive:</p>
  
  <p>package com.myapp.service;</p>
  
  <pre><code> import com.myapp.App;
   import android.app.Service;
   import android.content.Context;
   import android.content.Intent;
   import android.location.Location;
   import android.location.LocationListener;
   import android.location.LocationManager;
   import android.location.LocationProvider;
   import android.os.IBinder;
  
   public class LocationMonitor extends Service
   {
  /**********************
   * PUBLIC CONSTANTS
   **********************/
  public static final String ACTION_START = "StartService"; // start action
  public static final String ACTION_STOP = "StopService"; // stop action
  
  /**********************
   * PRIVATE CONSTANTS
   **********************/
  private static final long MINIMUM_DISTANCE_CHANGE = 10; // in Meters
  private static final long MINIMUM_TIME_BETWEEN_UPDATES = 300 * 1000; // in Milliseconds
  
  /**********************
   * PRIVATE VARIBLES
   **********************/
  private LocationManager sLocationManager; // location manager
  
  /**********************
   * SERVICE LIFECYCLE
   **********************/
  @Override
  public void onCreate()
  {
      super.onCreate();
      startService();
  }
  
  @Override
  public IBinder onBind(Intent intent) 
  {
      return null;
  }
  
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) 
  {
      if (intent != null)
      {
          if (intent.getAction().equals(ACTION_STOP))
          {
              stopService();
              return START_NOT_STICKY;
          }
      }
      return START_STICKY;
  }
  
  private void startService()
  {
      sLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
      sLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 
          MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE_CHANGE, sNetworkLocationListener);
  }
  
  private void stopService()
  {
      sLocationManager.removeUpdates(sNetworkLocationListener);
      stopSelf();
  }
  
  /**********************
   * LOCATION LISTENERS
   **********************/
  private LocationListener sNetworkLocationListener = new LocationListener() 
  {
      @Override
      public void onLocationChanged(Location location) 
      {
          // store location in db
      }
  
      @Override
      public void onProviderDisabled(String provider) {}
  
      @Override
      public void onProviderEnabled(String provider) {}
  
      @Override
      public void onStatusChanged(String provider, int status, Bundle extras) {}
  };
  
  /**********************
   * STATIC METHODS
   **********************/
  
  public static void startService(Context context)
  {
      Intent newIntent = getServiceIntent(context);
      newIntent.setAction(ACTION_START);
      context.startService(newIntent);
  }
  
  public static void stopService(Context context)
  {
      Intent newIntent = getServiceIntent(context);
      newIntent.setAction(ACTION_STOP);
      context.startService(newIntent);
  }
   }
  </code></pre>