preventing状态栏扩展 [英] Preventing status bar expansion

查看:102
本文介绍了preventing状态栏扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

反正是有prevent用户滑动状态栏(扩大)或折叠回来?

Is there anyway to prevent users from sliding the status bar (expand) or collapsing back?

我想了一个锁屏更换,似乎就像是一个必备功能。是否有任何可能的方式来做到这一点,无需root特权?

I'm trying out a lockscreen replacement and seems like it's a must-have feature. Is there any possible way to do it without requiring root privileges?

推荐答案

简短的回答:这是不可能的。

Short answer: this is impossible!

现在,你应该有兴趣知道为什么这是不可能的:

Now should you be interested to know why this is impossible:

有操纵系统状态栏,<双权限href="http://developer.android.com/reference/android/Manifest.permission.html#EXPAND_STATUS_BAR">EXPAND_STATUS_BAR和<一href="http://developer.android.com/reference/android/Manifest.permission.html#STATUS_BAR">STATUS_BAR.前者可通过任何应用请求,但后来被保留用于与平台签名进行签名的应用程序(系统应用程序,而不是第三方)。它的可以的展开/折叠系统状态栏(见<一href="http://stackoverflow.com/questions/7021310/how-to-open-or-expand-status-bar-through-intent">"How打开或通过有意扩大状态栏?),但要注意,反射是必需的,因为<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.3.4_r1/android/app/StatusBarManager.java?av=f">StatusBarManager类不是SDK的一部分。这种禁止功能的方法,它是从被扩展,不能由一个应用没有上述STATUS_BAR许可访问。所使用的机器人拨号到prevent状态栏

There are two permissions for manipulating the system status bar, EXPAND_STATUS_BAR and STATUS_BAR. The former can be requested by any application, but the later is reserved for applications signed with the platform signature (system applications, not third-party). It is possible to expand/ collapse the system status bar (see "How to open or expand status bar through intent?") but note that reflection is required because the StatusBarManager class is not part of the SDK. The disable method, which is used by the Android dialer to prevent the status bar from being expanded, cannot be accessed by an application without the aforementioned STATUS_BAR permission.

来源:个人经验: - )

Sources: personal experience :-)

这篇关于preventing状态栏扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆