联系人中的Add android.permission.CALL\u PRIVILEGED出现错误

联系人中的Add android.permission.CALL\u PRIVILEGED出现错误,android,contacts,Android,Contacts,它在android4.0.4的联系人中具有android.permission.CALL_特权。但它仍然有一个错误: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:xxx flg=0x10000000 cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster

它在android4.0.4的联系人中具有android.permission.CALL_特权。但它仍然有一个错误:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL_PRIVILEGED dat=tel:xxx flg=0x10000000 cmp=com.android.phone/.PrivilegedOutgoingCallBroadcaster (has extras) } from ProcessRecord{41878ad0 3991:com.android.contacts/10000} (pid=3991, uid=10000) requires android.permission.CALL_PRIVILEGED?
我修改了联系人,重新打包并签名,然后安装apk。我拨的时候有错误

我还在AndroiManifest.xml应用程序中添加了

这是相关代码:

public void dialButtonPressed() {
        if (isDigitsEmpty()) { // No number entered.
            if (phoneIsCdma() && phoneIsOffhook()) {
                // This is really CDMA specific. On GSM is it possible
                // to be off hook and wanted to add a 3rd party using
                // the redial feature.
                startActivity(newFlashIntent());
            } else {
                if (!TextUtils.isEmpty(mLastNumberDialed)) {
                    // Recall the last number dialed.
                    mDigits.setText(mLastNumberDialed);

                    // ...and move the cursor to the end of the digits string,
                    // so you'll be able to delete digits using the Delete
                    // button (just as if you had typed the number manually.)
                    //
                    // Note we use mDigits.getText().length() here, not
                    // mLastNumberDialed.length(), since the EditText widget now
                    // contains a *formatted* version of mLastNumberDialed (due to
                    // mTextWatcher) and its length may have changed.
                    mDigits.setSelection(mDigits.getText().length());
                } else {
                    // There's no "last number dialed" or the
                    // background query is still running. There's
                    // nothing useful for the Dial button to do in
                    // this case.  Note: with a soft dial button, this
                    // can never happens since the dial button is
                    // disabled under these conditons.
                    playTone(ToneGenerator.TONE_PROP_NACK);
                }
            }
        } else {
            final String number = mDigits.getText().toString();

            // "persist.radio.otaspdial" is a temporary hack needed for one carrier's automated
            // test equipment.
            // TODO: clean it up.
            if (number != null
                    && !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp)
                    && number.matches(mProhibitedPhoneNumberRegexp)
                    && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) {
                Log.i(TAG, "The phone number is prohibited explicitly by a rule.");
                if (getActivity() != null) {
                    DialogFragment dialogFragment = ErrorDialogFragment.newInstance(
                                    R.string.dialog_phone_call_prohibited_title);
                    dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog");
                }

                // Clear the digits just in case.
                mDigits.getText().clear();
            } else {
                final Intent intent = newDialNumberIntent(number);
                if (getActivity() instanceof DialtactsActivity) {
                    intent.putExtra(DialtactsActivity.EXTRA_CALL_ORIGIN,
                            DialtactsActivity.CALL_ORIGIN_DIALTACTS);
                }
                startActivity(intent);
                mDigits.getText().clear();  // TODO: Fix bug 1745781
                getActivity().finish();
            }
        }
    }

谁知道原因?提前谢谢

请从/system/app和/data/app中删除您的apk,然后 使用adb shell pm clear com.android.contacts清理数据, 最后使用adb push命令安装apk。
祝你好运。

android.permission.CALL\u PRIVILEGED
对第三方开发人员不可用。它由拨号器等系统应用程序内部使用

如果您有一个根手机,并且用户将您的应用程序作为系统应用程序安装,那么这将起作用

更多信息