From daa23d87bfc3a84396f5c88de8c3650ce93bd663 Mon Sep 17 00:00:00 2001 From: Oizaro <45825534+Oizaro@users.noreply.github.com> Date: Sun, 23 Aug 2020 22:45:39 +0200 Subject: [PATCH] Fix --- .../org/microg/gms/common/ForegroundServiceContext.java | 6 +++--- .../src/main/java/org/microg/gms/gcm/McsService.java | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java index 649818f1..bb97cc2e 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java +++ b/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java @@ -70,7 +70,7 @@ public class ForegroundServiceContext extends ContextWrapper { @RequiresApi(api = Build.VERSION_CODES.O) private static Notification buildForegroundNotification(Context context) { - NotificationChannel channel = new NotificationChannel("foreground-service", Resources.getSystem().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN); + NotificationChannel channel = new NotificationChannel("foreground-service", context.getResources().getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_MIN); channel.setShowBadge(false); channel.setLockscreenVisibility(0); channel.setVibrationPattern(new long[0]); @@ -82,8 +82,8 @@ public class ForegroundServiceContext extends ContextWrapper { return new Notification.Builder(context, channel.getId()) .setOngoing(true) .setContentIntent(pendingIntent) - .setContentTitle(Resources.getSystem().getString(R.string.notification_service_title)) - .setContentText(Resources.getSystem().getString(R.string.notification_service_content)) + .setContentTitle(context.getResources().getString(R.string.notification_service_title)) + .setContentText(context.getResources().getString(R.string.notification_service_content)) .setSmallIcon(R.drawable.ic_foreground_notification) .build(); } diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java index 238c1c55..c18a3e56 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java @@ -43,6 +43,7 @@ import android.util.Log; import androidx.annotation.RequiresApi; import androidx.legacy.content.WakefulBroadcastReceiver; +import com.mgoogle.android.gms.R; import com.squareup.wire.Message; import org.microg.gms.checkin.LastCheckinInfo; @@ -320,13 +321,13 @@ public class McsService extends Service implements Handler.Callback { @RequiresApi(api = Build.VERSION_CODES.O) private Notification buildForegroundNotification() { - NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", NotificationManager.IMPORTANCE_LOW); + NotificationChannel channel = new NotificationChannel("foreground-service", getString(R.string.notification_service_name), NotificationManager.IMPORTANCE_LOW); channel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); channel.setShowBadge(false); getSystemService(NotificationManager.class).createNotificationChannel(channel); return new Notification.Builder(this, channel.getId()) .setOngoing(true) - .setContentTitle("Running in background") + .setContentTitle(this.getResources().getString(R.string.notification_service_title)) .setSmallIcon(android.R.drawable.stat_notify_sync) .build(); }