Adjusted sdserver shutdown to try to stop odd crashes on some phones.

This commit is contained in:
Graham Jones
2020-12-18 21:02:09 +00:00
parent fc982d37ce
commit a954957a10
5 changed files with 8 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -10,8 +10,8 @@
{ {
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"versionCode": 83, "versionCode": 84,
"versionName": "3.6.2a", "versionName": "3.6.2b",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
] ]

View File

@@ -393,10 +393,6 @@ public class SdServer extends Service implements SdDataReceiver {
try { try {
// Cancel the notification.
Log.v(TAG, "onDestroy(): cancelling notification");
mUtil.writeToSysLogFile("SdServer.onDestroy - cancelling notification");
mNM.cancel(NOTIFICATION_ID);
// Stop web server // Stop web server
Log.v(TAG, "onDestroy(): stopping web server"); Log.v(TAG, "onDestroy(): stopping web server");
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping Web Server"); mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping Web Server");
@@ -406,6 +402,12 @@ public class SdServer extends Service implements SdDataReceiver {
mToneGenerator.release(); mToneGenerator.release();
mToneGenerator = null; mToneGenerator = null;
this.stopForeground(true);
// Cancel the notification.
Log.v(TAG, "onDestroy(): cancelling notification");
mUtil.writeToSysLogFile("SdServer.onDestroy - cancelling notification");
mNM.cancel(NOTIFICATION_ID);
// stop this service. // stop this service.
Log.v(TAG, "onDestroy(): calling stopSelf()"); Log.v(TAG, "onDestroy(): calling stopSelf()");
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping self"); mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping self");