Request for help: Android app to shut down a smartphone late at night

post by The_Jaded_One · 2015-04-02T11:38:47.994Z · score: 2 (3 votes) · LW · GW · Legacy · 30 comments

I have been playing around with life hacking ideas inspired by hyperbolic discounting.

One idea that seems to have worked reasonably well is was the idea that I could get to bed on time better if my computer simply switched itself off at a certain time, with absolutely no way (that I am capable of executing!) to make it work until the morning. I found and paid for a piece of software that does this - isurveillance shutdown timer. Unfortnately, this seems to have just shifted my late night computer use to my android mobile device, though gaming sessions that last till 5am are a thing of the past. 

So, I'd like an android app that shuts down your (rooted) android phone if it is ever detected on within a prespecified time window on a particular day - e.g. between 11pm and 6am, with no way for the user to circumvent the shutdown. If the user restarts the phone, it should shut down again immediately when it finds out that the time is not within the specified window. 

I have looked for something like this on Google Play, however most offerings will shut down the phone *once*, but it will stay on if you switch it on again. 

LW being a community of tech-savvy people, I was wondering whether anyone was interested in building such an app? It probably isn't hard to do if you are already an android developer, and I think it would really improve my life, and possibly the lives of other people. You could even make it a paid app - I'd pay. In fact I will commit to paying $50 for the app if someone develops this app and it works as described. If the community finds it useful, I'd expect there'd be some karma in it too. Alternatively if anyone can *find* such an app, I'd be extremely grateful. 

A more advanced version of this would be to lock the phone into "emergency calls only" mode within a specific time window. I don't know how hard that would be to pull off. 

This idea might even be good enough to turn into a business - millions of people around the world have the same problem. The requirement to root the device obviously puts something of a dampener on the viability of a business, there may be legal issues with rooting devices as part of a business. 

30 comments

Comments sorted by top scores.

comment by sixes_and_sevens · 2015-04-02T11:59:57.343Z · score: 7 (7 votes) · LW · GW

Tasker is an Android app that lets you specify "contexts" (specific states of the phone), and carry out actions depending on these contexts. An example use-case might be something like "when I am connected to my home WiFi network, disable my screen lock".

One of the actions available under Tasker is "Run Shell", which lets you issue shell commands to the underlying operating system. To achieve your desired effect, you could:

  • Acquire Tasker (a few dollars)
  • Set it up to run with root privileges
  • Set a context of "between 11pm and 6am"
  • Set an action of the shell command "su -c shutdown -h now" (or something similar) to run under that context

This does seem quite hazardous, though. If an emergency happened at 3am, I'm pretty sure I'd want my phone easily available and usable.

ETA: I just Googled to see if there was an existing recipe for this. It turns out Android doesn't have a conventional shutdown terminal command, but does have the "reboot" command, with the switch -p for powering down. Tasker also has a "reboot" under System->Misc, with a power-down option on rooted phones. This can absolutely do what you want it to do. Just don't go having any emergencies between 11 and 6.

comment by Sean_o_h · 2015-04-02T12:33:36.887Z · score: 4 (4 votes) · LW · GW

This does seem quite hazardous, though. If an emergency happened at 3am, I'm pretty sure I'd want my phone easily available and usable.

I was going to say this too, it's a good point. Potential fix: have a cheap non-smartphone on standby at home.

comment by The_Jaded_One · 2015-04-02T12:39:22.198Z · score: 1 (1 votes) · LW · GW

I already have another phone. Yes, this is a good point though.

comment by joaolkf · 2015-04-02T13:30:39.451Z · score: 1 (1 votes) · LW · GW

Thanks! This will be useful for me as well, it definitely seems better than my current solution: leaving my cell phone locked in my office(EDIT: at work).

comment by The_Jaded_One · 2015-04-02T15:12:44.842Z · score: 0 (0 votes) · LW · GW

I tried leaving it in another room for a while, but that lead to other problems, including trips to the other room at night to just look at one more message etc

comment by joaolkf · 2015-04-02T15:36:38.407Z · score: 0 (0 votes) · LW · GW

Sorry, I meant my office at work (yeap...). Fixed that.

comment by The_Jaded_One · 2015-04-02T13:06:43.537Z · score: 0 (0 votes) · LW · GW

That's great!

I'll see if I can implement this.

comment by sixes_and_sevens · 2015-04-02T13:15:11.330Z · score: 0 (0 votes) · LW · GW

A general observation on Tasker: when I first got it (a few years ago) I thought I'd use it for all sorts of things. In reality, whenever I set something up in Tasker, it's usually either superseded by a more appropriate service or app a few months later, or broken by security fixes in subsequent versions of Android.

comment by ChristianKl · 2015-04-02T14:59:53.844Z · score: 1 (1 votes) · LW · GW

What are the most important things you replaced with other apps?

comment by sixes_and_sevens · 2015-04-02T15:54:45.828Z · score: 2 (2 votes) · LW · GW

None of them were that important, really. They were more customisations to how I wanted the device to work. "Make sure GPS is turned on when Maps is turned on" sort of thing (which you now can't do without rooting the device and jumping through a few hoops, so I just turn it on manually these days).

I had some stuff to conserve and report on battery consumption, which now has a zillion different apps. I also had some location-based contexts and automatic email actions which are now handled by IFTTT. It's easy to forget how rudimentary smartphone apps and services were, even just a few years ago.

comment by wadavis · 2015-04-02T19:33:02.117Z · score: 1 (1 votes) · LW · GW

Made the phone report it's location if you texted it the password. Security updates added hoops to jump through, and FindMyDroid came out for free with all the functionality.

Made the phone autoplay music when headphones were plugged in. I stopped needing these when I got a new car with a bluetooth stereo and stopped using the aux plug in.

comment by ChristianKl · 2015-04-02T19:35:30.218Z · score: 2 (2 votes) · LW · GW

Made the phone report it's location if you texted it the password. Security updates added hoops to jump through, and FindMyDroid came out for free with all the functionality.

Even without an App there's also the Android Device Manager.

comment by wadavis · 2015-04-02T22:50:42.434Z · score: 0 (0 votes) · LW · GW

Thank you kind stranger for showing me something new. I'm glad to have learnt that.

But to paint the full picture, I used that location password to find my lost phone very rarely. It was mostly used during festivals, conventions, and travelling so that my friends and co-travelers could easily find me. People are uncomfortable adopting it, but it is a real easy fix to the 'I'm here, where are you?' coordination problem.

comment by [deleted] · 2015-04-03T07:43:10.744Z · score: 1 (1 votes) · LW · GW

Do you really need to be as strict with yourself as offering absolutely no way, or just putting an obstacle on it - like this - would be enough?

comment by The_Jaded_One · 2015-04-03T09:02:45.892Z · score: 0 (0 votes) · LW · GW

I think the obstacle would have to be sufficiently annoying. E.g. copying out 50 random characters for 5 minutes of extra time. Even then, it's so tempting.

comment by imuli · 2015-04-02T17:51:39.424Z · score: 1 (1 votes) · LW · GW

A more advanced version of this would be to lock the phone into "emergency calls only" mode within a specific time window. I don't know how hard that would be to pull off.

This appears to be possible with the Device Administration API to relock the screen upon receiving an ACTION_USER_PRESENT intent. Neither of which requires a rooted phone.

comment by The_Jaded_One · 2015-04-02T17:56:50.122Z · score: 0 (0 votes) · LW · GW

If you can write an app that kicks the user back to the lock screen within a specific time window, that would be fantastic

comment by imuli · 2015-04-02T21:21:38.090Z · score: 1 (1 votes) · LW · GW

Basic version debug apk here, (more recent) source on GitHub, and Google Play.

The most notable feature lacking is locking the phone when the start time arrives. PM me if you run into problems. Don't set the end time one minute before the start time, or you'll only be able to unlock the phone in that minute.

comment by joaolkf · 2015-04-02T16:08:11.502Z · score: 1 (1 votes) · LW · GW

Is there a thread with suggestions/requests for non-obvious productivity apps like that? Because I do have a few requests:

1) One chrome extension that would do this, but for search results. That is, that upon highlighting/double-clicking a term would display a short list of top Google search results in a context/drop-box menu on the same page.

2) Something like the StayFocusd extension that blocks sites like Facebook and YouTube for a given time of the day, but which would be extremely hard to remove. Some people suggested to block these websites IPs directly on the router, but I don't have access to routers on my network.

3) Something that would turn-off the internet for a given set of time in a way completely impossible to put it back up. I use Freedom, but sometimes it's not enough. My current strategy is removing the Ethernet cable, locking it in my drawer and throwing the keys behind my desk (I have to get a stick to pick it up). But it would be nice something that would cost me as much willpower as clicking a button.

comment by [deleted] · 2015-04-05T16:57:51.260Z · score: 0 (0 votes) · LW · GW

Why is it so hard for you to, say, dump the computer and go to sleep at [desired time]?

Replace computer with any other activity you think does less good than you could have done.

comment by The_Jaded_One · 2015-04-05T20:32:47.391Z · score: 0 (0 votes) · LW · GW

Probably because of hyperbolic discounting. Actually the topic of "not doing what you really want to do" AKA Akrasia has been discussed to death on here and AFAIK there isn't a full consensus on what causes it.

comment by [deleted] · 2015-04-06T10:57:38.168Z · score: -4 (4 votes) · LW · GW

So, you can't - for whatever reason - make yourself an alarm, a checklist, or basically anything that's a sign that says "negative ROI - stop immedietly"?

I don't care for "hyperbolic discounting" (I have no idea what it means and neither do I care) and akrasia as far as I can tell is usually codeword for "I'm a lazy fuck".

I think it's due time to tell that I find this post absurd. Your solutions, absurd, to an absurd enough problem, that you're (ironically) well-aware of. You might have some psychological problem.

comment by The_Jaded_One · 2015-04-06T19:43:32.525Z · score: 2 (2 votes) · LW · GW

I don't care for "hyperbolic discounting" (I have no idea what it means and neither do I care)

Well if you don't know what it is then how do you know ... Anyway if you don't care about any of this then why are you even participating? The internet is a big place man with plenty of other fora...

comment by CAE_Jones · 2015-04-06T11:40:29.996Z · score: 2 (2 votes) · LW · GW

(I do not claim to speak for the_jaded_one, but this needs to be said.)

So, you can't - for whatever reason - make yourself an alarm, a checklist, or basically anything that's a sign that says "negative ROI - stop immedietly"?

No. On the occasion that this is an option, it is fairly useless.

akrasia as far as I can tell is usually codeword for "I'm a lazy fuck".

Akrasia is shorthand for "I have spent the past nine years desperately trying to get the action part of my brain and the conscious desire part of my brain to agree, and I have failed so hard for nearly a decade that I've anthropomorphized the condition so I can disguise the resulting suicidality as threatening a supernatural being to a fight to the death".

If you'd rather, Akrasia is code for "I am a lazy fuck, but not by choice".

You might have some psychological problem.

It was obvious to me that this was a psychological problem seven years ago. Professionals have been so fucking useless I don't even.

The only thing that's ever helped* me reliably in the past is restrictions I can't easily work around. If the_jaded_one is healthier enough that an easily-deleted smartphone-disabling app would help, then I find this post not absurd, but enviable.

* help is not a solution, but we're talking the difference between suicidally depressed and "What the fuck do I say about Cahier d'un retour au pays natal?".

comment by [deleted] · 2015-04-06T12:28:16.387Z · score: -1 (3 votes) · LW · GW

No. On the occasion that this is an option, it is fairly useless.

Why?

If you'd rather, Akrasia is code for "I am a lazy fuck, but not by choice".

I'd rather.

The only thing that's ever helped* me reliably in the past is restrictions I can't easily work around. If the_jaded_one is healthier enough that an easily-deleted smartphone-disabling app would help, then I find this post not absurd, but enviable.

Those are still EXTREME measures. He either has it, and we know what happens, or he either doesn't have it, and he himself said that it switched from his PC to his smartphone. This would imply that he's simply blaming other stuff, like his PC and phone, so he says that if he'll eliminate these from the equation, he'll be productive. As good a proposition as any other, but:

  1. Will it (not) pass into another object?
  2. Is it an inability to resist temptation?

I might be blessed, but I often think that people like the OP simply lack some sort of self-control. I've seen it in other forms, for example - people on a diet unable to resist a candy or something else, and I think these people lack self control.

I also think OP doesn't have any goal to strive for, so maybe gaming sessions til 5 AM are not such a bad idea.

comment by The_Jaded_One · 2015-04-06T19:32:55.575Z · score: 2 (2 votes) · LW · GW

I can resist anything except temptation

Seriously though, if you say "akrasia" is a codeword for "lazy as fuck" (or whatever), you've just replaced one symbol with another. Have you made any progress? If you found yourself going to bed an hour or two later than is optimal, and you said "aha! I'm not akraitic, I'm lazy as fuck!", how would that help you?

People often say "just have some self discipline!", but that is like saying to a beggar "just cause money to exist in your pocket!" - it's stating the obvious.

Having an app that shuts the phone down is a way of achieving your goals with the self discipline you already have, and it is something you can actually do. It's specific and actionable.

comment by Emile · 2015-04-02T15:05:10.895Z · score: 0 (0 votes) · LW · GW

Alternative implementation: an android widget that posts a "snitch" message somewhere online if ever your phone is unlocked in certain time frames; such that other people can easily see online whether you unlocked your phone in the "forbidden" timeframe.

comment by The_Jaded_One · 2015-04-02T15:11:23.992Z · score: 0 (0 votes) · LW · GW

there are already severe consequences the next day - being tired, grumpy etc. I already don't want to stay up late on my phone. The problem is the "hyperbolic discount"/time preference inconsistency.

comment by [deleted] · 2015-04-07T11:56:05.746Z · score: -1 (3 votes) · LW · GW

Seriously though, if you say "akrasia" is a codeword for "lazy as fuck" (or whatever), you've just replaced one symbol with another. Have you made any progress?

Well, for starters, you aren't using a who-knows-where-it-came-from word. You're thinking more simply, which is good.

If you found yourself going to bed an hour or two later than is optimal, and you said "aha! I'm not akraitic, I'm lazy as fuck!", how would that help you?

Second.. that's not going to help you. You should've gone to bed already. But that means you're aware of the problem.

People often say "just have some self discipline!", but that is like saying to a beggar "just cause money to exist in your pocket!" - it's stating the obvious.

Then, why do you not do it? You're aware of both the problem and the solution - why aren't you implementing them?

Having an app that shuts the phone down is a way of achieving your goals with the self discipline you already have, and it is something you can actually do. It's specific and actionable.

With respect to anything that's not your brain, I think you still should self-improve rather than rely on other things. You've yourself said that you haven't found anything optimal and even admitted that it might not exist, so I think the self-improvement way is probably more reliable.

Another problem I have with this is that it seems to be badness-avoidance, rather than goodness-maximizing. Again, once you've shut off your phone, what are you going to do?

Well if you don't know what it is then how do you know ... Anyway if you don't care about any of this then why are you even participating? The internet is a big place man with plenty of other fora...

Because when you post links instead of being able to explain things yourself means that you cannot explain why you hold a certain belief or perform a certain action, but it's all justified as long as you have that piece of information somewhere.

comment by The_Jaded_One · 2015-05-01T23:20:18.916Z · score: 1 (1 votes) · LW · GW

Then, why do you not do it? You're aware of both the problem and the solution

Because whilst I'd like to have more self discipline, I don't: just do what you cannot do isn't a solution, it's an oxymoron. By analogy, it's like saying to a beggar: just walk into that office and pick up your paycheck.