Skip to content

Commit 5ba54f8

Browse files
committed
Fix CI
1 parent 3fe362b commit 5ba54f8

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

play-services-base/core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.content.Context;
1212
import android.content.ContextWrapper;
1313
import android.content.Intent;
14+
import android.graphics.drawable.Icon;
1415
import android.net.Uri;
1516
import android.os.PowerManager;
1617
import android.provider.Settings;
@@ -41,7 +42,6 @@ public ComponentName startService(Intent service) {
4142
return super.startService(service);
4243
}
4344

44-
@RequiresApi(23)
4545
private boolean isIgnoringBatteryOptimizations() {
4646
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
4747
return powerManager.isIgnoringBatteryOptimizations(getPackageName());
@@ -130,8 +130,17 @@ private static Notification buildForegroundNotification(Context context, String
130130
);
131131

132132
// Notification actions
133-
Action batteryAction = new Action.Builder(R.drawable.ic_battery_action, context.getString(R.string.foreground_action_battery_optimization), batteryPendingIntent).build();
134-
Action notificationAction = new Action.Builder(R.drawable.ic_notification_action, context.getString(R.string.foreground_action_notification_settings), notificationCategoryPendingIntent).build();
133+
Action batteryAction = new Action.Builder(
134+
Icon.createWithResource(context, R.drawable.ic_battery_action),
135+
context.getString(R.string.foreground_action_battery_optimization),
136+
batteryPendingIntent
137+
).build();
138+
139+
Action notificationAction = new Action.Builder(
140+
Icon.createWithResource(context, R.drawable.ic_notification_action),
141+
context.getString(R.string.foreground_action_notification_settings),
142+
notificationCategoryPendingIntent
143+
).build();
135144

136145
Log.d(TAG, notifyTitle + " // " + firstLine + " // " + secondLine);
137146

@@ -143,7 +152,7 @@ private static Notification buildForegroundNotification(Context context, String
143152
.setStyle(new Notification.BigTextStyle().bigText(firstLine + "\n" + secondLine))
144153
.setPriority(Notification.PRIORITY_HIGH)
145154
.setShowWhen(false)
146-
.setFullScreenIntent(notificationCategoryPendingIntent, true)
155+
.setContentIntent(notificationCategoryPendingIntent)
147156
.setContentIntent(mainSettingsPendingIntent)
148157
.addAction(batteryAction)
149158
.addAction(notificationAction)

0 commit comments

Comments
 (0)