Fixing a couple crashes in the SoundTriggerTestApp
Bug: 78269975 Test: built and ran the SoundTriggerTestApp Change-Id: I966550a3d64e9f6a66c40e062a89f39b897aaea2
This commit is contained in:
@@ -828,7 +828,12 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {
|
||||
// internalClearGlobalStateLocked() cleans up the telephony and power save listeners.
|
||||
private void internalClearGlobalStateLocked() {
|
||||
// Unregister from call state changes.
|
||||
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
||||
long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(token);
|
||||
}
|
||||
|
||||
// Unregister from power save mode changes.
|
||||
if (mPowerSaveModeListener != null) {
|
||||
|
||||
@@ -435,9 +435,10 @@ public class SoundTriggerTestService extends Service {
|
||||
if (!file.getName().endsWith(".properties")) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
|
||||
try (FileInputStream in = new FileInputStream(file)) {
|
||||
Properties properties = new Properties();
|
||||
properties.load(new FileInputStream(file));
|
||||
properties.load(in);
|
||||
createModelInfo(properties);
|
||||
loadedModel = true;
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user