Skip to content

Commit 8b16303

Browse files
committed
Add java doc to AndroidTools.hasForegroundServiceTypePermission
1 parent 5a3ff07 commit 8b16303

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,13 @@ public static boolean checkPermission(Context applicationContext, String permiss
433433
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(applicationContext, permission);
434434
}
435435

436+
/**
437+
* A helper method used for Android 14 or greater to check if app has necessary permissions
438+
* to enter the foreground.
439+
* @param context context used to check permissions.
440+
* @return true if app has permission to enter foreground or if Android version < 14
441+
*/
436442
public static boolean hasForegroundServiceTypePermission(Context context) {
437-
// if Build is less than Android 14, we don't need either permission to enter the
438-
// foreground.
439443
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
440444
return true;
441445
}

0 commit comments

Comments
 (0)