You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform/android/java/lib/src/com/crossbow/library/PermissionsUtil.kt
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ import android.os.Environment
12
12
importandroid.provider.Settings
13
13
importandroid.util.Log
14
14
importjava.util.ArrayList
15
-
importjava.util.List
15
+
importkotlin.collections.List
16
16
importandroidx.core.content.ContextCompat
17
17
18
18
/**
@@ -40,7 +40,7 @@ object PermissionsUtil {
40
40
if (name =="RECORD_AUDIO"&&ContextCompat.checkSelfPermission(
41
41
activity,
42
42
Manifest.permission.RECORD_AUDIO
43
-
) !==PackageManager.PERMISSION_GRANTED
43
+
) !=PackageManager.PERMISSION_GRANTED
44
44
) {
45
45
activity.requestPermissions(
46
46
arrayOf(Manifest.permission.RECORD_AUDIO),
@@ -51,7 +51,7 @@ object PermissionsUtil {
51
51
if (name =="CAMERA"&&ContextCompat.checkSelfPermission(
52
52
activity,
53
53
Manifest.permission.CAMERA
54
-
) !==PackageManager.PERMISSION_GRANTED
54
+
) !=PackageManager.PERMISSION_GRANTED
55
55
) {
56
56
activity.requestPermissions(
57
57
arrayOf(Manifest.permission.CAMERA),
@@ -62,7 +62,7 @@ object PermissionsUtil {
62
62
if (name =="VIBRATE"&&ContextCompat.checkSelfPermission(
63
63
activity,
64
64
Manifest.permission.VIBRATE
65
-
) !==PackageManager.PERMISSION_GRANTED
65
+
) !=PackageManager.PERMISSION_GRANTED
66
66
) {
67
67
activity.requestPermissions(
68
68
arrayOf(Manifest.permission.VIBRATE),
@@ -122,11 +122,11 @@ object PermissionsUtil {
122
122
val permissionInfo:PermissionInfo=
123
123
getPermissionInfo(activity, manifestPermission)
124
124
val protectionLevel:Int=
125
-
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.P) permissionInfo.getProtection() else permissionInfo.protectionLevel
125
+
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.P) permissionInfo.getProtection() else permissionInfo.protectionLevel// 'protectionLevel: Int' is deprecated. Deprecated in Java
126
126
if (protectionLevel ==PermissionInfo.PROTECTION_DANGEROUS&&ContextCompat.checkSelfPermission(
127
127
activity,
128
128
manifestPermission
129
-
) !==PackageManager.PERMISSION_GRANTED
129
+
) !=PackageManager.PERMISSION_GRANTED
130
130
) {
131
131
requestedPermissions.add(manifestPermission)
132
132
}
@@ -172,11 +172,11 @@ object PermissionsUtil {
172
172
val permissionInfo:PermissionInfo=
173
173
getPermissionInfo(activity, manifestPermission)
174
174
val protectionLevel:Int=
175
-
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.P) permissionInfo.getProtection() else permissionInfo.protectionLevel
175
+
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.P) permissionInfo.getProtection() else permissionInfo.protectionLevel// 'protectionLevel: Int' is deprecated. Deprecated in Java
176
176
if (protectionLevel ==PermissionInfo.PROTECTION_DANGEROUS&&ContextCompat.checkSelfPermission(
@@ -563,12 +563,12 @@ class AdMob(crossbow: Crossbow) : CrossbowPlugin(crossbow) {
563
563
564
564
privatefunloadConsentForm() {
565
565
UserMessagingPlatform.loadConsentForm(
566
-
aActivity,
566
+
aActivity!!,
567
567
{ consentForm ->
568
568
var consentStatusMsg =""
569
-
if (aConsentInformation!!.getConsentStatus() ===ConsentInformation.ConsentStatus.REQUIRED) {
569
+
if (aConsentInformation!!.getConsentStatus() ==ConsentInformation.ConsentStatus.REQUIRED) {
570
570
consentForm.show(
571
-
aActivity
571
+
aActivity!!
572
572
) { formError ->
573
573
loadConsentForm()
574
574
emitSignal("consent_form_dismissed")
@@ -619,13 +619,13 @@ class AdMob(crossbow: Crossbow) : CrossbowPlugin(crossbow) {
619
619
}
620
620
621
621
privateval adRequest:AdRequest
622
-
privateget() {
622
+
get() {
623
623
val adRequestBuilder =AdRequest.Builder()
624
624
return adRequestBuilder.build()
625
625
}
626
626
627
627
privateval safeArea:Rect
628
-
privateget() {
628
+
get() {
629
629
val safeInsetRect =Rect()
630
630
if (Build.VERSION.SDK_INT<Build.VERSION_CODES.P) {
631
631
return safeInsetRect
@@ -648,20 +648,20 @@ class AdMob(crossbow: Crossbow) : CrossbowPlugin(crossbow) {
648
648
// Determine the screen width (less decorations) to use for the ad width.
649
649
privateval adSizeAdaptive:AdSize
650
650
// If the ad hasn't been laid out, default to the full screen width.
651
-
privateget() {
651
+
get() {
652
652
// Determine the screen width (less decorations) to use for the ad width.
653
-
val display:Display= aActivity!!.getWindowManager().getDefaultDisplay()
653
+
val display:Display= aActivity!!.getWindowManager().getDefaultDisplay()// getDefaultDisplay() method was deprecated in API level 30. Use Context#getDisplay() instead.
654
654
val outMetrics =DisplayMetrics()
655
655
display.getMetrics(outMetrics)
656
-
val density:Float= outMetrics.density
656
+
val density:Float= outMetrics.density
657
657
var adWidthPixels:Float= aCrossbowLayout!!.getWidth().toFloat()
658
658
659
659
// If the ad hasn't been laid out, default to the full screen width.
0 commit comments