Reset target SDK version cache on new connection
Avoids possibility that a stale cache is used if cleanupConnection()
does not get called for some reason.
Bug: 230358834
Test: run POC from b/230358834#comment4
Change-Id: I2e7422d90cec87167968d56458af9aac6d525506
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index 234dc9c..4ba3c51 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -377,6 +377,7 @@
const String16& opPackageName);
static bool hasPermissionForSensor(const Sensor& sensor);
static int getTargetSdkVersion(const String16& opPackageName);
+ static void resetTargetSdkVersionCache(const String16& opPackageName);
// SensorService acquires a partial wakelock for delivering events from wake up sensors. This
// method checks whether all the events from these wake up sensors have been delivered to the
// corresponding applications, if yes the wakelock is released.