2b43c07373
git-svn-id: https://osmand.googlecode.com/svn/trunk@3 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
22 lines
600 B
Java
22 lines
600 B
Java
package com.anvisics.battery;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
|
|
public class BatteryStatusReceiver extends BroadcastReceiver {
|
|
|
|
private final BatteryLogService service;
|
|
|
|
public BatteryStatusReceiver(BatteryLogService service){
|
|
this.service = service;
|
|
}
|
|
|
|
@Override
|
|
public void onReceive(Context context, Intent intent) {
|
|
service.receiveMessage(intent.getIntExtra("voltage", -1), intent.getIntExtra("level", -1),
|
|
intent.getIntExtra("plugged", -1), intent.getIntExtra("status", -1));
|
|
|
|
}
|
|
|
|
}
|