mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-15 03:54:54 +00:00
Pass json settings as an argument
This commit is contained in:
parent
a5e60b235d
commit
f2016a7c33
@ -155,7 +155,7 @@ public class ForegroundService extends Service {
|
||||
.setTicker(settings.optString("ticker", ""))
|
||||
.setOngoing(true)
|
||||
.setPriority(Notification.PRIORITY_MIN)
|
||||
.setSmallIcon(getIconResId());
|
||||
.setSmallIcon(getIconResId(settings));
|
||||
|
||||
if (bigText || text.contains("\n")) {
|
||||
notification.setStyle(
|
||||
@ -196,9 +196,10 @@ public class ForegroundService extends Service {
|
||||
|
||||
/**
|
||||
* Retrieves the resource ID of the app icon.
|
||||
*
|
||||
* @param settings A JSON dict containing the icon name.
|
||||
*/
|
||||
private int getIconResId() {
|
||||
JSONObject settings = BackgroundMode.getSettings();
|
||||
private int getIconResId(JSONObject settings) {
|
||||
Context context = getApplicationContext();
|
||||
Resources res = context.getResources();
|
||||
String pkgName = context.getPackageName();
|
||||
|
Loading…
Reference in New Issue
Block a user