android 4.4 全屏
Activity style样式修改
<!-- <item name="android:windowFullscreen">true</item>-->
<!-- <item name="windowActionBar">false</item>-->
<!-- <item name="windowNoTitle">true</item>-->
android 8.0悬浮窗
type属性修改成 然后动态申请权限
TYPE_APPLICATION_OVERLAY
android 8.0启动服务
startForegroundService
系统权限
android:sharedUserId="android.uid.system"
充电状态
Intent batteryBroadcast = context.registerReceiver(null,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
// 0 means we are discharging, anything else means charging
boolean isCharging = batteryBroadcast.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0;
return isCharging;