-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIUI8.1 系统可以正常打开app权限页面,但是添加AccessibilityService就出现以下异常 #1
Comments
我这边手上目前没有小米v8的手机,貌似是应为权限问题 Caused by: java.lang.SecurityException:
Permission Denial: starting Intent { act=miui.intent.action.APP_PERM_EDITOR
cmp=com.miui.securitycenter/com.miui.permcenter.permissions.
RealAppPermissionsEditorActivity (has extras) } from ProcessRecord{1d88e87
25016:com.javen.callphone/u0a325} (pid=25016, uid=10325) requires
android.permission.CHANGE_COMPONENT_ENABLED_STATE
我这边看看能不能找台手机,再帮你确认下~
2016-12-26 11:24 GMT+08:00 Javen205 <[email protected]>:
… 第一次使用辅助功能望指点
public void openMiuiPermissionActivity(Context context) {
Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
if ("V5".equals(getProperty())) {
PackageInfo pInfo = null;
try {
pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
Log.e("canking", "error");
}
intent.setClassName("com.miui.securitycenter", "com.miui.securitycenter.permission.AppPermissionsEditor");
intent.putExtra("extra_package_uid", pInfo.applicationInfo.uid);
} else if ("V8".equals(getProperty())) {
PackageInfo pInfo = null;
try {
pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
Log.e("canking", "error");
}
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.RealAppPermissionsEditorActivity");
intent.putExtra("extra_package_uid", pInfo.applicationInfo.uid);
} else {
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsEditorActivity");
intent.putExtra("extra_pkgname", context.getPackageName());
}
if (isActivityAvailable(context, intent)) {
if (context instanceof Activity) {
Activity a = (Activity) context;
a.startActivityForResult(intent, 2);
}
} else {
Log.e("canking", "Intent is not available!");
}
}
12-26 11:13:10.123 25016-25016/com.javen.callphone I/System.out: 小米rom的版本名>V8
12-26 11:13:10.127 25016-25016/com.javen.callphone E/Javen: com.javen.callphone.utils.AppLogger.log(): 0 invoke 1
12-26 11:13:10.127 25016-25016/com.javen.callphone I/System.out: 判断MIUI的悬浮窗权限:false
12-26 11:13:10.128 25016-25016/com.javen.callphone E/Javen: com.javen.callphone.utils.AppLogger.log(): 0 invoke 1
12-26 11:13:10.131 25016-25016/com.javen.callphone I/Timeline: Timeline: Activity_launch_request time:122171774
12-26 11:13:10.136 25016-25016/com.javen.callphone D/AndroidRuntime: Shutting down VM
12-26 11:13:10.137 25016-25016/com.javen.callphone E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.javen.callphone, PID: 25016
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=miui.intent.action.APP_PERM_EDITOR cmp=com.miui.securitycenter/com.miui.permcenter.permissions.RealAppPermissionsEditorActivity (has extras) } from ProcessRecord{1d88e87 25016:com.javen.callphone/u0a325} (pid=25016, uid=10325) requires android.permission.CHANGE_COMPONENT_ENABLED_STATE
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2661)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1509)
at android.app.Activity.startActivityForResult(Activity.java:3978)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:77)
at android.app.Activity.startActivityForResult(Activity.java:3939)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859)
at com.javen.callphone.ui.MiActivity.openMiuiPermissionActivity(MiActivity.java:115)
at com.javen.callphone.ui.MiActivity.xiaomiPJ(MiActivity.java:66)
at com.javen.callphone.ui.MiActivity.openAppPermissionView(MiActivity.java:52)
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
12-26 11:13:10.164 25016-25016/com.javen.callphone I/Process: Sending signal. PID: 25016 SIG: 9
[image: 手机版本]
<https://cloud.githubusercontent.com/assets/10123694/21474619/0ffea572-cb5d-11e6-9755-7e26bb987c98.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFsCIzziAhGDCwfrjbb6GcAuZsqxqabfks5rLzNhgaJpZM4LVh5q>
.
|
|
那貌似小米系统更新相关权限限制了
2016-12-28 21:59 GMT+08:00 Javen205 <[email protected]>:
… android.permission.CHANGE_COMPONENT_ENABLED_STATE 这个权限是系统权限 动态获取貌似也无法获取到
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFsCIwfqWPRYjNhsvrccp0f2Sl1kAc5uks5rMmtOgaJpZM4LVh5q>
.
|
那有其他的解决方案提供参考吗? |
最近没有关注这个问题了,若果弹窗type 为Toast类型的可以满足你的需求,就可以绕过权限问题。这个问题我会抽空再看看。
2016-12-30 18:13 GMT+08:00 Javen205 <[email protected]>:
… 那有其他的解决方案提供参考吗?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFsCIzkLoPmv0zma3nRNvx-R0Amx6LmCks5rNNlGgaJpZM4LVh5q>
.
|
大神,你好,请问有研究MIUI8上 android.permission.CHANGE_COMPONENT_ENABLED_STATE 异常这个问题吗?或者除Toast以为的其他方案,因为我需要悬浮窗是可以拖动的。谢谢,望回复。 |
找到一个miui8 的手机,系统是6.10.27,运行正常,可以一键自动打开, |
我这边MIUI8 正常,如果你手机上系统版本存在 CHANGE_COMPONENT_ENABLED_STATE权限,需要系统签名,目前没有其他办法。
2017-01-06 10:47 GMT+08:00 Bining <[email protected]>:
… 大神,你好,请问有研究MIUI8上 android.permission.CHANGE_COMPONENT_ENABLED_STATE
异常这个问题吗?或者除Toast以为的其他方案,因为我需要悬浮窗是可以拖动的。谢谢,望回复。
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFsCIzazXifppNuMEI0Uu6yTlS9iw5N2ks5rPatJgaJpZM4LVh5q>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第一次使用辅助功能望指点
The text was updated successfully, but these errors were encountered: