Skip to content

Commit e698150

Browse files
deakjahnDev-hwang
authored andcommitted
Fix FLAG_STOP_WITH_TASK bitmask check
1 parent 6316689 commit e698150

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/src/main/kotlin/com/pravera/flutter_foreground_task/utils/ForegroundServiceUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ForegroundServiceUtils {
1717
val pm = context.packageManager
1818
val cName = ComponentName(context, ForegroundService::class.java)
1919
val flags = pm.getServiceInfo(cName, PackageManager.GET_META_DATA).flags
20-
(flags and ServiceInfo.FLAG_STOP_WITH_TASK) == 1
20+
(flags and ServiceInfo.FLAG_STOP_WITH_TASK) != 0
2121
} catch (e: NameNotFoundException) {
2222
Log.e(TAG, "isSetStopWithTaskFlag >> The service component cannot be found on the system.")
2323
true
@@ -27,4 +27,4 @@ class ForegroundServiceUtils {
2727
}
2828
}
2929
}
30-
}
30+
}

0 commit comments

Comments
 (0)