power-off

How to make linux power off when halt is run?

风格不统一 提交于 2019-12-01 21:29:18
问题 I have successfully used the pm_power_off function pointer to make my custom Linux board call its power management chip over i2c (to turn the power off). I would like the Linux halt command to switch the power off too. How can I achieve this? The (ARM) code for machine_halt does not have an pointer analogous to machine_power_off 's pm_power_off . arch/arm/kernel/reboot.c: /* * Halting simply requires that the secondary CPUs stop performing any * activity (executing tasks, handling interrupts)

How to make linux power off when halt is run?

纵饮孤独 提交于 2019-12-01 18:35:48
I have successfully used the pm_power_off function pointer to make my custom Linux board call its power management chip over i2c (to turn the power off). I would like the Linux halt command to switch the power off too. How can I achieve this? The (ARM) code for machine_halt does not have an pointer analogous to machine_power_off 's pm_power_off . arch/arm/kernel/reboot.c: /* * Halting simply requires that the secondary CPUs stop performing any * activity (executing tasks, handling interrupts). smp_send_stop() * achieves this. */ void machine_halt(void) { local_irq_disable(); smp_send_stop();

How to reveal that screen is locked?

穿精又带淫゛_ 提交于 2019-11-30 02:24:10
In my application I need to know when device is locked (on HTC's it looks like short press on "power" button). So the question is: which event is triggered when device is locked? Or device is going to sleep? You should extend BroadcastReceiver and implement onReceive , like this: public class YourBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_SCREEN_OFF.equalsIgnoreCase(intent.getAction())) { //screen has been switched off! } } } Then you just have to register it and you'll start receiving events when the screen

How to reveal that screen is locked?

混江龙づ霸主 提交于 2019-11-29 00:01:47
问题 In my application I need to know when device is locked (on HTC's it looks like short press on "power" button). So the question is: which event is triggered when device is locked? Or device is going to sleep? 回答1: You should extend BroadcastReceiver and implement onReceive , like this: public class YourBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_SCREEN_OFF.equalsIgnoreCase(intent.getAction())) { //screen has

Powering off Android Things

…衆ロ難τιáo~ 提交于 2019-11-28 08:54:33
Usually, to power down an Android device, you do this via the power button of course. You can also do adb shell and reboot -p . But in Android Things , I don't see a way to shut down the device. If it is no problem, I'd love to just cut the power of my Raspberry Pi for this, but is that acceptable? Could it corrupt the SD-card? Android (and by extension, Android Things) should have no problem with a sudden loss of power. The core operating system is housed in read-only partitions on the file system, so there is no risk of corrupting the OS from a failed in-flight write. Also, reboot -p should

Powering off Android Things

这一生的挚爱 提交于 2019-11-27 02:30:20
问题 Usually, to power down an Android device, you do this via the power button of course. You can also do adb shell and reboot -p . But in Android Things , I don't see a way to shut down the device. If it is no problem, I'd love to just cut the power of my Raspberry Pi for this, but is that acceptable? Could it corrupt the SD-card? 回答1: Android (and by extension, Android Things) should have no problem with a sudden loss of power. The core operating system is housed in read-only partitions on the