2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-24 02:47:26 +00:00

Fix battery level not being set yet when a request arrived

This commit is contained in:
Albert Vaca Cintora 2020-03-27 15:43:55 +01:00
parent e716205a48
commit cff55ab8dd

View File

@ -85,7 +85,8 @@ public class BatteryPlugin extends Plugin {
IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED); intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
intentFilter.addAction(Intent.ACTION_BATTERY_LOW); intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
context.registerReceiver(receiver, intentFilter); Intent currentState = context.registerReceiver(receiver, intentFilter);
receiver.onReceive(context, currentState);
return true; return true;
} }