Update showCallScreen & isInAPhoneCall to use PhoneManager.
Change-Id: Ibe6900a0560611346d4ec8e109349b0c82c8a463
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 4141351..60826a8 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -30,6 +30,9 @@
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.phone.PhoneManager;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Intents;
import android.speech.RecognizerIntent;
@@ -801,7 +804,7 @@
final boolean callKey = Intent.ACTION_CALL_BUTTON.equals(intent.getAction());
if (callKey) {
- getTelephonyManager().showCallScreen();
+ getPhoneManager().showCallScreen(false);
return true;
}
@@ -1029,8 +1032,7 @@
}
private boolean phoneIsInUse() {
- // TODO(santoscordon): Replace with a TelecommService method call.
- return getTelephonyManager().getCallState() != TelephonyManager.CALL_STATE_IDLE;
+ return getPhoneManager().isInAPhoneCall();
}
public static Intent getAddNumberToContactIntent(CharSequence text) {
@@ -1160,6 +1162,10 @@
return (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
}
+ private PhoneManager getPhoneManager() {
+ return (PhoneManager) getSystemService(Context.PHONE_SERVICE);
+ }
+
@Override
public boolean isActionBarShowing() {
return mActionBarController.isActionBarShowing();