mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 02:49:56 +00:00
Use startForegroundService instead of startService on Android 8
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
@@ -38,4 +39,8 @@ public class ServiceUtil {
|
||||
public static PowerManager getPowerManager(Context context) {
|
||||
return (PowerManager)context.getSystemService(Context.POWER_SERVICE);
|
||||
}
|
||||
|
||||
public static AlarmManager getAlarmManager(Context context) {
|
||||
return (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user