如何检查是否在Android<上启用了省电模式5.0? [英] How to check if the Battery Saver Mode is enabled on Android < 5.0?

查看:771
本文介绍了如何检查是否在Android<上启用了省电模式5.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,有些设备的版本为< 5.0带有节电器选项。

As I know, there are some devices with version < 5.0 that have the Power Saver option.

这个类似的问题是不正确的,什么也不能解释。

An answer provided in this similar question is not correct and doesn't explain anything.

在Android 5.0以上版本,我们可以在此处使用此脚本:

On Android 5.0+ we can use this script here:

PowerManager powerManager = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
if ( powerManager.isPowerSaveMode()) {
    //code
}

我的问题是:
有一种通用的方法来检查是否存在省电模式以及是否在API<上启用/禁用了该模式。 21?

My question is: is there a universal way to check if there IS a power saver mode and if it's enabled/disabled on API < 21?

推荐答案

对于KitKat及以下版本,节电不是库存android中启用的标准功能,但是有些制造商通过一些不同的方法。因此,没有标准的方法可以对此进行检查。

For KitKat and below power saving is not a standard feature enabled in the stock android but some manufacturers implement this through some different methods. So there are no standard ways for checking this.

这篇关于如何检查是否在Android&lt;上启用了省电模式5.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆