成品直播源码推荐,Android 禁止下拉菜单栏
1.屏蔽非锁屏下的下拉菜单栏
这种Android 系统其实是提供了方法的,只不过是隐藏的,只给系统应用,也就是用mk 编译的apk使用。如果第三方应用想要使用,或者Android stuido 编译方式的想要使用。则可以使用反射。
/**
* Allows an app to control the status bar.
*/
@SystemService(Context.STATUS_BAR_SERVICE)
public class StatusBarManager {
/** @hide */
public static final int DISABLE_EXPAND = View.STATUS_BAR_DISABLE_EXPAND;
/** @hide */
public static final int DISABLE_NOTIFICATION_ICONS = View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS;
/** @hide */
public static final int DISABLE_NOTIFICATION_ALERTS
= View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS;
/** @hide */
@Deprecated
@UnsupportedAppUsage
public static final int DISABLE_NOTIFICATION_TICKER
= View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER;
/** @hide */
public static final int DISABLE_SYSTEM_INFO = View.STATUS_BAR_DISABLE_SYSTEM_INFO;
/** @hide */
public static final int DISABLE_HOME = View.STATUS_BAR_DISABLE_HOME;
/** @hide */
public static final int DISABLE_RECENT = View.STATUS_BAR_DISABLE_RECENT;
/** @hide */
public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK;
/** @hide */
public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK;
/** @hide */
public static final int DISABLE_SEARCH = View.STATUS_BAR_DISABLE_SEARCH;
/** @hide */
@Deprecated
public static final int DISABLE_NAVIGATION =
View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_RECENT;
/** @hide */
public static final int DISABLE_NONE = 0x00000000;
/** @hide */
public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS
| DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER
| DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
| DISABLE_SEARCH;
/**
* Disable some features in the status bar. Pass the bitwise-or of the DISABLE_* flags.
* To re-enable everything, pass {@link #DISABLE_NONE}.
*
* @hide
*/
@UnsupportedAppUsage
public void disable(int what) {
try {
final int userId = Binder.getCallingUserHandle().getIdentifier();
final IStatusBarService svc = getService();
if (svc != null) {
svc.disableForUser(what, mToken, mContext.getPackageName(), userId);
}
} catch (RemoteException ex) {
throw ex.rethrowFromSystemServer();
}
}
2. 屏蔽锁屏下的下拉菜单栏
这种没有接口,只能在systemui 里面修改源码,来屏蔽掉
以上就是 成品直播源码推荐,Android 禁止下拉菜单栏,更多内容欢迎关注之后的文章
标签:hide,int,下拉菜单,public,DISABLE,static,源码,Android,final From: https://www.cnblogs.com/yunbaomengnan/p/17282902.html