Question
After a recent software update, my Service App that previously restarted immediately after overheating now takes 5 hours to restart.
Before the update:
- When overheating occurred and the cooling system terminated the app
- The service would restart immediately due to
auto-restart="true"in tizen-manifest.xml
After the update:
- Same overheating scenario occurs
- Service takes 5 hours to restart
- Environment: Gear S3 LTE (SM-R765K) with poor network connectivity (weak signal or shielded areas)
- Tizen version: 2.3.2.4
- SW version: R765KOU2BQE2
The update notes mentioned battery optimization for disconnected network situations. Could this be causing the delayed restart? If so, what's the solution to make the service restart immediately again?
Answer
Problem Understanding
The issue appears to be related to battery optimization changes in the recent update, particularly affecting service restart behavior in poor network conditions.
Solution Methods
-
Add background-category to manifest:
- This helps maintain network connectivity for background services
- Works even on Tizen 2.3 despite being officially introduced in 2.4
-
Update manifest with the following addition:
<service-application ...>
...
<background-category value="background-network"/>
</service-application>
Code Examples
Here's the complete manifest example with the solution:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3.2" package="your.package" version="1.0.0">
<profile name="wearable"/>
<service-application
appid="your.app.id"
auto-restart="true"
exec="your.service"
multiple="false"
nodisplay="true"
on-boot="true"
taskmanage="false"
type="capp">
<label>Your Service</label>
<icon>service.png</icon>
<background-category value="background-network"/>
</service-application>
<privileges>
<!-- Your existing privileges -->
</privileges>
</manifest>
Additional Tips
- The
background-categorytag works in Tizen 2.3 despite being officially documented for 2.4+ - Monitor battery usage after implementing this solution
- Consider testing in various network conditions to ensure consistent behavior