From e11c6b2ae43a81f464fb03dcf873cc8e50840cd9 Mon Sep 17 00:00:00 2001 From: "ITHQ1978\\saranya.sajeev" Date: Mon, 23 May 2022 15:27:09 +0530 Subject: [PATCH] Android 12 os support. --- .../digital/lamp/lamp_kotlin/sensor_core/ActivityTransitions.kt | 2 +- .../src/main/java/digital/lamp/lamp_kotlin/sensor_core/WiFi.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/ActivityTransitions.kt b/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/ActivityTransitions.kt index 1dfdac4..2f884d4 100644 --- a/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/ActivityTransitions.kt +++ b/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/ActivityTransitions.kt @@ -83,7 +83,7 @@ class ActivityTransitions : Service(), SensorEventListener { // TODO: Initialize PendingIntent that will be triggered when a activity transition occurs. val intent = Intent(actions) - mActivityTransitionsPendingIntent = PendingIntent.getBroadcast(this@ActivityTransitions, 0, intent, 0) + mActivityTransitionsPendingIntent = PendingIntent.getBroadcast(this@ActivityTransitions, 0, intent, PendingIntent.FLAG_IMMUTABLE) // TODO: Create a BroadcastReceiver to listen for activity transitions. // The receiver listens for the PendingIntent above that is triggered by the system when an diff --git a/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/WiFi.kt b/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/WiFi.kt index 8a9e54a..08ed2b9 100644 --- a/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/WiFi.kt +++ b/lamp_kotlin/src/main/java/digital/lamp/lamp_kotlin/sensor_core/WiFi.kt @@ -30,7 +30,7 @@ class WiFi : Service() { registerReceiver(wifiMonitor, filter) backgroundService = Intent(this, BackgroundService::class.java) backgroundService!!.action = ACTION_LAMP_WIFI_REQUEST_SCAN - wifiScan = PendingIntent.getService(this, 0, backgroundService!!, PendingIntent.FLAG_UPDATE_CURRENT) + wifiScan = PendingIntent.getService(this, 0, backgroundService!!, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE) } interface LAMPSensorObserver {