-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Anbox wakes up my laptop #1436
Comments
Same here. Additional Info: |
It seems that the wake-up behaviour is caused by static void wakealarm_init(void) {
wakealarm_fd = timerfd_create(CLOCK_BOOTTIME_ALARM, TFD_NONBLOCK);
if (wakealarm_fd == -1) {
KLOG_ERROR(LOG_TAG, "wakealarm_init: timerfd_create failed\n");
return;
}
if (healthd_register_event(wakealarm_fd, wakealarm_event))
KLOG_ERROR(LOG_TAG,
"Registration of wakealarm event failed\n");
wakealarm_set_interval(healthd_config.periodic_chores_interval_fast);
} Dropping the CAP_WAKE_ALARM capability of the lxc container, by setting
i.e. adding set_config_item("lxc.cap.drop", "wake_alarm"); somewhere in anbox/src/anbox/container/lxc_container.cpp Line 304 in 73804a3
seems to mitigate this issue as healthd will fail to create the timer. I'm not sure about any other implication of this change though.
|
This seems to be consistent with my observations. Do we need healthd at all? |
https://source.android.com/devices/tech/health Since |
The figure in Section "Health in Android 8.x shows that apps touch only the Battery Manager and Battery Service. I would expect that these APIs could be mapped to usual Linux APIs or replaced with some stubs (if appropriate). A quick look at android.os.health tells me that most of the stats are not relevant for the most apps so replacing them with a dummy could save more trouble than it makes. (But I don't know this API so maybe this is a complete nonsense.) |
I figure another potential problem is an app in anbox can also wake up the host device by using AlarmManager, just like an app can wake up an Android phone. This behaviour isn't specific to healthd. Ultimately they all use the timer syscalls. |
note that it would be possible to include both fixes, if neutralizing healthd is useful |
closes anbox#1436. `lxc.cap.drop` existed already in LXC1.0, so I assume this should be backward compatible.
closes anbox/anbox#1436. `lxc.cap.drop` existed already in LXC1.0, so I assume this should be backward compatible.
anbox system-info output
Please describe your problem:
When anbox is running, e.g.,
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
it wakes up my laptop from suspend. The laptop can be suspended as usual, it goes to sleep with no trouble. However, in a few seconds or a minute it wakes up on its own. When I stop anbox (only the container-manager keeps runnig) and suspend the laptop, it keeps sleeping as it should.What were you expecting?:
Not waking up my laptop. How it can happen anyway?
Additional info:
Thinkpad Yoga 12, Debian (bullseye), Linux kernel 5.5.0-amd64.
The text was updated successfully, but these errors were encountered: