Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper behavior when device was never plugged in #14

Open
mlynch-isec opened this issue Mar 6, 2013 · 6 comments
Open

Improper behavior when device was never plugged in #14

mlynch-isec opened this issue Mar 6, 2013 · 6 comments
Milestone

Comments

@mlynch-isec
Copy link
Contributor

If the device starts off with AC disconnected and the user locks the screen, YoNTMA hibernates the device immediately.

To reproduce:

  1. Install and run YoNTMA
  2. Disconnect AC power
  3. Lock machine

Expected:
Machine remains powered on in locked state

Actual:
YoNTMA instantly forces machine into hibernation

@ghost ghost assigned mlynch-isec Mar 6, 2013
@mlynch-isec
Copy link
Contributor Author

We can fix most of this pretty simply by exiting the AC monitoring thread if we start off disconnected.

Do we want to do something more complex like handle the case where the user starts off disconnected, locks, and then plugs in AC? The same applies to Ethernet. Do we want to start monitoring wired Ethernet connections that were initiated after the laptop was locked?

mlynch-isec added a commit that referenced this issue Mar 6, 2013
…C power wasn't connected to begin with at the start of monitoring.

Issue #14
@mlynch-isec
Copy link
Contributor Author

Andreas - what do you think? Hold open until we handle the lock > plug in > disconnect case or is this sufficient?

@andreasjunestam
Copy link
Contributor

The cleanest approach is probably to do two things:

  1. Only run the monitoring threads when the machine is locked.
  2. Only trigger on the change in AC and ether, not the state of it. As in, only trigger hibernation when AC goes from up to down and when ehter goes from up to down. The ethernet code already does this.

@mlynch-isec
Copy link
Contributor Author

We already were doing (1). With (2), we're now doing it for Ethernet and AC as of change d2ea136 (above). The problem is we're only tracking when AC goes from up to down when it started as up. Consider the scenario:

User unplugs laptop -> locks screen -> plugs in laptop -> unplugs laptop.

YoNTMA doesn't hibernate in this scenario because at lock time, it will check if AC is plugged in, see that it's not, and stop monitoring.

The question is do we want to hibernate in the scenario above (i.e. monitor for up->down transitions even when we started in down).

@andreasjunestam
Copy link
Contributor

We could restart the monitoring thread on the down->up change if the machine is locked. Would solve it.

@mlynch-isec
Copy link
Contributor Author

Moving to post v1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants