提交 65979144 编写于 作者: 杜庆泉's avatar 杜庆泉

适配最新的 android 内置库路径

上级 6f59180a
...@@ -84,7 +84,7 @@ export function clearIntervalTask(taskId:number) { ...@@ -84,7 +84,7 @@ export function clearIntervalTask(taskId:number) {
* 实现一个添加view的 Runnable类 * 实现一个添加view的 Runnable类
* 用法说明:https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB * 用法说明:https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#%E5%8C%BF%E5%90%8D%E5%86%85%E9%83%A8%E7%B1%BB
*/ */
class AddUIRunnable extends Runnable { class AddUIRunnable implements Runnable {
override run():void { override run():void {
......
import Context from "android.content.Context"; import Context from "android.content.Context";
import BatteryManager from "android.os.BatteryManager"; import BatteryManager from "android.os.BatteryManager";
import { getAppContext } from "io.dcloud.uts.android"; import { UTSAndroid } from "io.dcloud.uts";
type GetBatteryInfoOptions = { type GetBatteryInfoOptions = {
...@@ -10,7 +10,7 @@ type GetBatteryInfoOptions = { ...@@ -10,7 +10,7 @@ type GetBatteryInfoOptions = {
} }
export default function getBatteryInfo(options: GetBatteryInfoOptions) { export default function getBatteryInfo(options: GetBatteryInfoOptions) {
const context = getAppContext(); const context = UTSAndroid.getAppContext();
if (context != null) { if (context != null) {
const manager = context.getSystemService( const manager = context.getSystemService(
Context.BATTERY_SERVICE Context.BATTERY_SERVICE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册