标签:try pac apk ted xmlns exception hide share get
/**
* AndroidUSBCamera-master
* Created by lzw on 2018/6/20. 10:53:22
* 邮箱:632393724@qq.com
* All Rights Saved! Chongqing AnYun Tech co. LTD
*/
public class ShieldUtil {
public static final String STATUS_BAR_SERVICE = "statusbar";
public static final String CLASS_STATUS_BAR_MANAGER = "android.app.StatusBarManager";
public static final String METHOD_DISABLE = "disable";
public static final String METHOD_ENABLE = "enable";
public static void hideKeys(Context context){
try {
@SuppressLint("WrongConstant") Object service = context.getSystemService(STATUS_BAR_SERVICE);
Class<?> statusBarManager = Class.forName(CLASS_STATUS_BAR_MANAGER);
Method disable = statusBarManager.getMethod(METHOD_DISABLE,
int.class);
// disable.invoke(service, 0x00200000); // 为View.STATUS_BAR_DISABLE_HOME 的值
// disable.invoke(service, 0x00400000); // 为View.STATUS_BAR_DISABLE_BACK 的值
disable.invoke(service, 0x00200000|0x01000000); // 为View.STATUS_BAR_DISABLE_RECENT的值
} catch (Exception e) {
e.printStackTrace();
}
}
public static void showKeys(Context context){
try {
@SuppressLint("WrongConstant") Object service = context.getSystemService(STATUS_BAR_SERVICE);
Class<?> statusBarManager = Class.forName(CLASS_STATUS_BAR_MANAGER);
Method disable = statusBarManager.getMethod(METHOD_DISABLE,
int.class);
disable.invoke(service, 0x00000000|0x00000000); // 为View.STATUS_BAR_DISABLE_RECENT的值
} catch (Exception e) {
e.printStackTrace();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="android.uid.system"
package="com.jiangdg.usbcamera">
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR"/>
标签:try pac apk ted xmlns exception hide share get
原文地址:https://www.cnblogs.com/endian11/p/9202929.html