程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> contacts-聯系人有android.permission.CALL_PRIVILEGED權限為什麼還會報這個錯??

contacts-聯系人有android.permission.CALL_PRIVILEGED權限為什麼還會報這個錯??

編輯:編程綜合問答
聯系人有android.permission.CALL_PRIVILEGED權限為什麼還會報這個錯??

android4.0.4的contacts有android.permission.CALL_PRIVILEGED這個權限,為什麼還會報:

    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?

哪些大俠知道?

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();
            }
        }
    }

最佳回答:


你是修改了Contacts麼?如何操作的?是要自制rom?

修改了Contacts以後,要使用本身系統的簽名,既然是自制rom,如何簽名你應該知道。

簽名完成後,要push進system/app然後重啟,如果有必要,需要wipe data。原因在於你如果權限更改了,system/app裡面的應用有的系統是不會更改權限的,需要重新建立權限列表,所以需要wipe data。

xiaoyaovsxin
xiaoyaovsxin
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved