Fix memory leak on sensormanager
Test: Monkey test Google: 2954774 Change-Id: I597f6bc93a7a440fe0e6018025302a27c5ee2b3f Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
This commit is contained in:
@@ -50,7 +50,7 @@ open class SensorPrivacyManagerHelper(context: Context) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
sensorPrivacyManager = context.getSystemService(SensorPrivacyManager::class.java)!!
|
sensorPrivacyManager = (context.applicationContext ?: context).getSystemService(SensorPrivacyManager::class.java)!!
|
||||||
|
|
||||||
sensorPrivacyManager.addSensorPrivacyListener(context.mainExecutor, this)
|
sensorPrivacyManager.addSensorPrivacyListener(context.mainExecutor, this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user