From 762b357ec94aef3e7ee6f991c553aa950840a8bc Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 18 Sep 2015 12:54:59 -0700 Subject: Protect against more Telecom privileged operations Make sure that all invocations of TelecomManager methods that could possibly require a permission are protected by a permission check. Some of these are overcautious - for example, the UI should never show the option to return to a call (READ_PHONE_STATE) if we didn't detect an active call (READ_PHONE_STATE) in the first place, so it is not strictly necessary to protect against the former. But not crashing is the most preferable of all options. Bug: 20266292 Change-Id: Id91dd16e34320a5e607f91dbce9a4296025eeaaf --- src/com/android/dialer/DialtactsActivity.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/com/android/dialer/DialtactsActivity.java') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index f8fb17f6b..fe828a3bb 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -34,7 +34,6 @@ import android.support.design.widget.CoordinatorLayout; import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; import android.telecom.PhoneAccount; -import android.telecom.TelecomManager; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -370,7 +369,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O TouchPointManager.getInstance().setPoint((int) ev.getRawX(), (int) ev.getRawY()); } return super.dispatchTouchEvent(ev); - } @Override @@ -929,7 +927,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O final boolean callKey = Intent.ACTION_CALL_BUTTON.equals(intent.getAction()); if (callKey) { - getTelecomManager().showInCallScreen(false); + TelecomUtil.showInCallScreen(this, false); return true; } @@ -1340,10 +1338,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O public void onPageScrollStateChanged(int state) { } - private TelecomManager getTelecomManager() { - return (TelecomManager) getSystemService(Context.TELECOM_SERVICE); - } - @Override public boolean isActionBarShowing() { return mActionBarController.isActionBarShowing(); -- cgit v1.2.3