Is System Permission required for android.intent.action.CALL_PRIVILEGED?

流过昼夜 提交于 2020-01-15 10:48:48

问题


I am try to use "android.intent.action.CALL_PRIVILEGED" to run USSD code in android but it throw SecurityException even i am using required permission.

Code :

            String encodedHash = Uri.encode("#");
            String ussd = "*141" + encodedHash;
            startActivityForResult(new Intent("android.intent.action.CALL_PRIVILEGED",
                    Uri.parse("tel:" + ussd)), 1);

AndroidManifest.xml :

 <uses-permission android:name="android.permission.CALL_PRIVILEGED"></uses-permission>

But still I am getting SecurityException

Exception :

   AndroidRuntime(2756): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:xxxxx cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster }from ProcessRecord{418f47c0 2756:com.usdrun/u0a10046} (pid=2756, uid=10046)requires android.permission.CALL_PRIVILEGED

I am not getting why it throw SecurityException.

Is "android.permission.CALL_PRIVILEGED" required System Permission ? if yes than how can i use this in my Application ?


回答1:


Is "android.permission.CALL_PRIVILEGED" required System Permission ?

Yes.

if yes than how can i use this in my Application ?

Your app will need to be installed on the system partition (e.g., by a rooted device user) or signed with the same signing key that signed the rest of the firmware (e.g., by a device manufacturer or ROM modder).



来源:https://stackoverflow.com/questions/21492713/is-system-permission-required-for-android-intent-action-call-privileged

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!