0

linux驱动程序应该如何向用户空间指示低电量指示?我在 power_supply.h 中找不到对此的任何支持。android 服务是否应该通过读取电池容量来处理这个问题?

Highyl 感谢您为回答这个问题所做的努力。

谢谢加内什。

4

1 回答 1

0

添加此代码

private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){
      @Override
      public void onReceive(Context arg0, Intent intent) {          
          int level = intent.getIntExtra("level", 0);
          // level...... it will show the battery information
          // you can use this variable to show the battery information.               
      }
};

this.registerReceiver(this.mBatInfoReceiver,new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
于 2011-10-20T10:14:06.963 回答