diff options
author | Eric Erfanian <erfanian@google.com> | 2017-06-19 12:40:59 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-06-19 20:00:08 +0000 |
commit | ea7890cd5e829ed3f0b5f726561c569690af2030 (patch) | |
tree | 235ab5ab9f9215782c29ef350d275fe12e7b2f74 /java/com/android/incallui/ReturnToCallController.java | |
parent | 91ce7d2a476bd04fe525049a37a2f8b2824e9724 (diff) |
Update AOSP Dialer source from internal google3 repository at
cl/159428781.
Test: make, treehugger
This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/158012278 (6/05/2017) to cl/159428781 (6/19/2017).
This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.
Merged-In: Ie60a84b3936efd0ea3d95d7c86bf96d2b1663030
Change-Id: If1fa394df2609f0d38b4f794c83f4db3f1006484
Diffstat (limited to 'java/com/android/incallui/ReturnToCallController.java')
-rw-r--r-- | java/com/android/incallui/ReturnToCallController.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/java/com/android/incallui/ReturnToCallController.java b/java/com/android/incallui/ReturnToCallController.java index 4cb6aaf89..314aa45d4 100644 --- a/java/com/android/incallui/ReturnToCallController.java +++ b/java/com/android/incallui/ReturnToCallController.java @@ -24,6 +24,7 @@ import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import android.telecom.CallAudioState; import com.android.dialer.common.LogUtil; +import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.telecom.TelecomUtil; import com.android.dialershared.bubble.Bubble; import com.android.dialershared.bubble.BubbleInfo; @@ -57,6 +58,10 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio private final PendingIntent toggleMute; private final PendingIntent endCall; + public static boolean isEnabled(Context context) { + return !ConfigProviderBindings.get(context).getBoolean("disable_return_to_call_bubble", false); + } + public ReturnToCallController(Context context) { this.context = context; @@ -108,6 +113,7 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio private Bubble startNewBubble() { if (!Bubble.canShowBubbles(context)) { LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); + context.startActivity(Bubble.getRequestPermissionIntent(context)); return null; } Bubble returnToCallBubble = Bubble.createBubble(context, generateBubbleInfo()); @@ -156,12 +162,14 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio } private BubbleInfo generateBubbleInfo() { + Intent activityIntent = InCallActivity.getIntent(context, false, false, false); + activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return BubbleInfo.builder() .setPrimaryColor(context.getResources().getColor(R.color.dialer_theme_color, null)) - .setPrimaryIcon(Icon.createWithResource(context, R.drawable.quantum_ic_call_white_24)) - .setPrimaryAction( - PendingIntent.getActivity( - context, 0, InCallActivity.getIntent(context, false, false, false), 0)) + .setPrimaryIcon(Icon.createWithResource(context, R.drawable.on_going_call)) + .setStartingYPosition( + context.getResources().getDimensionPixelOffset(R.dimen.return_to_call_initial_offset_y)) + .setPrimaryIntent(PendingIntent.getActivity(context, 0, activityIntent, 0)) .setActions(generateActions()) .build(); } @@ -176,7 +184,7 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio .setIcon(Icon.createWithResource(context, speakerButtonInfo.icon)) .setName(context.getText(speakerButtonInfo.label)) .setChecked(speakerButtonInfo.isChecked) - .setAction(speakerButtonInfo.checkable ? toggleSpeaker : showSpeakerSelect) + .setIntent(speakerButtonInfo.checkable ? toggleSpeaker : showSpeakerSelect) .build()); actions.add( @@ -184,21 +192,21 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio .setIcon(Icon.createWithResource(context, R.drawable.quantum_ic_mic_off_white_24)) .setName(context.getText(R.string.incall_label_mute)) .setChecked(audioState.isMuted()) - .setAction(toggleMute) + .setIntent(toggleMute) .build()); actions.add( Action.builder() .setIcon(Icon.createWithResource(context, R.drawable.quantum_ic_call_end_white_24)) .setName(context.getText(R.string.incall_label_end_call)) - .setAction(endCall) + .setIntent(endCall) .build()); return actions; } @NonNull - private PendingIntent createActionIntent(String actionToggleSpeaker) { + private PendingIntent createActionIntent(String action) { Intent toggleSpeaker = new Intent(context, ReturnToCallActionReceiver.class); - toggleSpeaker.setAction(actionToggleSpeaker); + toggleSpeaker.setAction(action); return PendingIntent.getBroadcast(context, 0, toggleSpeaker, 0); } } |