总监看见别的手机上在 status Bar上显示蓝牙耳机电量的功能。
就要求实现这个需求。 
愁啊 。
有哪位大牛有熟悉的,给点提示呗

解决方案 »

  1.   

        private void addBluetoothUsage(long uSecNow) {
            long btOnTimeMs = mStats.getBluetoothOnTime(uSecNow, mStatsType) / 1000;
            double btPower = btOnTimeMs * mPowerProfile.getAveragePower(PowerProfile.POWER_BLUETOOTH_ON)
                    / 1000;
            int btPingCount = mStats.getBluetoothPingCount();
            btPower += (btPingCount
                    * mPowerProfile.getAveragePower(PowerProfile.POWER_BLUETOOTH_AT_CMD)) / 1000;
            BatterySipper bs = addEntry(getActivity().getString(R.string.power_bluetooth),
                    DrainType.BLUETOOTH, btOnTimeMs, R.drawable.ic_settings_bluetooth,
                    btPower + mBluetoothPower);
            aggregateSippers(bs, mBluetoothSippers, "Bluetooth");
        }