Michsh / ics-openvpn

Automatically exported from code.google.com/p/ics-openvpn
0 stars 0 forks source link

Feature request: remove foreground notification #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Launch an emulator with 256 MB of RAM
2. [Install] Stress for Android
3. Install [Bitmask Android 0.5.4] ([with foreground]) run it, connect to
   EIP and go back to Android Home
4. Back to adb shell, /data/tmp/stress -t 5 -m 2 => It doesn't
   crash
5. Repeat command: /data/tmp/stress -t 5 -m 2 => it crashes: foreground
   doesn't stop Android to kill Bitmask
6. Restart the emulator (to clean everything)
7. Uninstall Bitmask Android 0.5.4
8. Install [Bitmask Android 0.6.0] ([no foreground]), connect to EIP and
   go back to Android Home
9. Back to adb shell, /data/tmp/stress -t 5 -m 2 => It doesn't
   crash, as with foreground
10. Repeat command: /data/tmp/stress -t 5 -m 2 => the same as of 0.5.4

[Install]
https://github.com/parmegv/stress-android/blob/master/README.md#install

[Bitmask Android 0.5.4]
https://dl.bitmask.net/client/android/Bitmask-Android-0.5.4.apk

[with foreground]
https://github.com/leapcode/bitmask_android/blob/0.5.4/app/src/main/java/de/blin
kt/openvpn/core/OpenVpnService.java#L164

[Bitmask Android 0.6.0]
https://dl.bitmask.net/client/android/Bitmask-Android-0.6.0.apk

[no foreground]
https://github.com/leapcode/bitmask_android/blob/0.6.0/app/src/main/java/de/blin
kt/openvpn/core/OpenVpnService.java#L169

What is the expected output? What do you see instead?
The expected output would be not getting Bitmask 0.5.4 killed because of memory 
constraints.

What mobile phone are you using?
Emulator.

Which Android Version and stock ROM or aftermarket like cyanogenmod?
api 18.

Please provide any additional information below.

Sorry for referencing the Bitmask project, but I manage that repository so I 
was able to remove the startForeground line properly and compare. You can see 
what's the process of importing your sources in the build.gradle, although you 
can see it's almost your code literally imported.

If you cannot reproduce this issue, I'll follow up with you.

Original issue reported on code.google.com by parm...@sdf.org on 22 Aug 2014 at 1:34

Attachments:

GoogleCodeExporter commented 9 years ago
I think your test scenario is wrong. The test scenario has only the service 
with foreground activity running and almost no other services. For that 
scenario it is no suprise that foreground does not make a difference. But if 
multiple services are running the services which do not have foreground 
priority are killed first. 

Foreground services are killed as a last resort like in your test.

Original comment by arne@rfc2549.org on 22 Aug 2014 at 2:42