mirror of
https://github.com/adolfintel/OpenPods.git
synced 2026-09-14 14:56:11 -04:00
Improved charging indicator. Added support for dark theme. Added proper support for RTL. Added Hebrew translation. Merged changes from https://github.com/Domi04151309/OpenPods/tree/general-improvements.
33 lines
939 B
Java
33 lines
939 B
Java
package com.dosse.airpods;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
|
|
/**
|
|
* A simple starter class that starts the service when the device is booted, or after an update
|
|
*/
|
|
public class Starter extends BroadcastReceiver {
|
|
|
|
@SuppressLint("UnsafeProtectedBroadcastReceiver")
|
|
@Override
|
|
public void onReceive (Context context, Intent intent) {
|
|
startPodsService(context);
|
|
}
|
|
|
|
public static void startPodsService (Context context) {
|
|
context.startService(new Intent(context, PodsService.class));
|
|
}
|
|
|
|
public static void restartPodsService (Context context) {
|
|
context.stopService(new Intent(context, PodsService.class));
|
|
try {
|
|
Thread.sleep(500);
|
|
} catch (Throwable ignored) {
|
|
}
|
|
context.startService(new Intent(context, PodsService.class));
|
|
}
|
|
|
|
}
|