@24i/smartapps-bigscreen-rnv-build-engine 0.17.27-alpha.2782 → 0.17.27-alpha.2785

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,4 +129,6 @@ dependencies {
129
129
  }
130
130
 
131
131
  implementation project(':common')
132
+
133
+ implementation "com.google.android.gms:play-services-ads-identifier:18.2.0"
132
134
  }
@@ -8,15 +8,14 @@ import android.webkit.JavascriptInterface
8
8
  import com.google.gson.JsonObject
9
9
  import com.twentyfouri.player.base.TextTrack
10
10
  import com.twentyfouri.player.base.TrackKind
11
- import com.twentyfouri.tvbridge.webview.parser.SourceParser.stringToJson
12
11
  import com.twentyfouri.tvbridge.webview.parser.PlaybackInfoParser.parse
13
- import com.twentyfouri.tvbridge.webview.parser.SourceParser
12
+ import com.twentyfouri.tvbridge.webview.parser.SourceParser.stringToJson
14
13
  import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.audioFromJson
15
14
  import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.textFromJson
16
15
  import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.toJson
17
16
  import com.twentyfouri.tvbridge.webview.viewmodel.WebViewModel
18
17
  import java.text.SimpleDateFormat
19
- import java.util.*
18
+ import java.util.Arrays
20
19
  import java.util.concurrent.CountDownLatch
21
20
  import java.util.concurrent.TimeUnit
22
21
  import kotlin.math.roundToInt
@@ -375,6 +374,18 @@ class BridgeFromJavaScript(
375
374
  return ""
376
375
  }
377
376
 
377
+ /***
378
+ * Bridget JS 2 Android to get advertising id
379
+ */
380
+ @JavascriptInterface
381
+ fun bridgeJavaScriptToAndroid_GetAdId() = viewModel.adId
382
+
383
+ /***
384
+ * Bridget JS 2 Android to get limit ad tracking info
385
+ */
386
+ @JavascriptInterface
387
+ fun bridgeJavaScriptToAndroid_GetLimitAdTracking() = viewModel.limitAdTracking
388
+
378
389
  companion object {
379
390
  const val LOG_TAG = "JavaScriptBridge"
380
391
  val DISABLED_AUDIO_TRACK = JsonObject().apply {
@@ -6,12 +6,15 @@ import android.content.Intent
6
6
  import android.graphics.Bitmap
7
7
  import android.graphics.Canvas
8
8
  import android.os.Build
9
+ import android.provider.Settings
9
10
  import android.util.Log
10
11
  import android.view.KeyEvent
11
12
  import android.view.View
12
13
  import android.webkit.CookieManager
13
14
  import android.webkit.WebChromeClient
14
15
  import android.webkit.WebView
16
+ import com.google.android.gms.ads.identifier.AdvertisingIdClient
17
+ import com.google.android.gms.common.GooglePlayServicesNotAvailableException
15
18
  import com.google.gson.JsonArray
16
19
  import com.google.gson.JsonObject
17
20
  import com.twentyfouri.player.base.*
@@ -23,7 +26,6 @@ import com.twentyfouri.tvbridge.bridge.BridgeToJavaScript
23
26
  import com.twentyfouri.tvbridge.common.*
24
27
  import com.twentyfouri.tvbridge.configuration.BridgeConfig
25
28
  import com.twentyfouri.tvbridge.global.utils.LocalStorage
26
- import com.twentyfouri.tvbridge.global.utils.PlayerFactoryTheoPlayerCustomized
27
29
  import com.twentyfouri.tvbridge.global.utils.PlayerFactoryVersion
28
30
  import com.twentyfouri.tvbridge.global.utils.SourceDrmOverridden
29
31
  import com.twentyfouri.tvbridge.webview.client.BridgeWebView
@@ -627,6 +629,30 @@ class WebViewModel @Inject constructor(
627
629
  }
628
630
  }
629
631
 
632
+ val adId get() = try {
633
+ // Let's try Google first
634
+ AdvertisingIdClient.getAdvertisingIdInfo(context).id
635
+ } catch (e: GooglePlayServicesNotAvailableException) {
636
+ // Probably Amazon
637
+ try {
638
+ Settings.Secure.getString(context.contentResolver, "advertising_id")
639
+ } catch (snfe: Settings.SettingNotFoundException) {
640
+ null
641
+ }
642
+ }
643
+
644
+ val limitAdTracking get() = try {
645
+ // Let's try Google first
646
+ AdvertisingIdClient.getAdvertisingIdInfo(context).isLimitAdTrackingEnabled
647
+ } catch (e: GooglePlayServicesNotAvailableException) {
648
+ // Probably Amazon
649
+ try {
650
+ Settings.Secure.getInt(context.contentResolver, "limit_ad_tracking") != 0
651
+ } catch (snfe: Settings.SettingNotFoundException) {
652
+ null
653
+ }
654
+ }
655
+
630
656
  private inner class InnerIapCallback : IapCallback {
631
657
  override fun checkNewPurchasesFinished(result: List<IapPurchase>) {
632
658
  // not actually used at the moment
@@ -13,6 +13,7 @@
13
13
  <tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
14
14
  <tizen:privilege name="http://tizen.org/privilege/internet"/>
15
15
  <tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
16
+ <tizen:privilege name="http://developer.samsung.com/privilege/adinfo"/>
16
17
  <tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
17
18
  <tizen:metadata key="http://samsung.com/tv/metadata/use.voiceguide" value="false"/>
18
19
  </widget>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.17.27-alpha.2782",
3
+ "version": "0.17.27-alpha.2785",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {