diff options
author | Eric Erfanian <erfanian@google.com> | 2017-10-24 14:05:52 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-10-24 14:05:52 -0700 |
commit | 938468da6f5c225ebb161a68bd949c9cf3261892 (patch) | |
tree | 232533fa35dc9d140fdfe0dac82b2bd21ad1b5c4 /java/com/android/incallui | |
parent | 958b292fc04ad15879fff47df929d6d1a826615c (diff) | |
download | android_packages_apps_Dialer-938468da6f5c225ebb161a68bd949c9cf3261892.tar.gz android_packages_apps_Dialer-938468da6f5c225ebb161a68bd949c9cf3261892.tar.bz2 android_packages_apps_Dialer-938468da6f5c225ebb161a68bd949c9cf3261892.zip |
Rename the new bubble package name from "bubble" to "newbubble".
It fixes AOSP for package name conflict.
Test: manual
PiperOrigin-RevId: 173298696
Change-Id: Id10ebe0bcf029e61f65cf6580c7198abd8395081
Diffstat (limited to 'java/com/android/incallui')
31 files changed, 459 insertions, 121 deletions
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index aa17dc4eb..aa96c4fe5 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -456,7 +456,7 @@ public class CallButtonPresenter final boolean hasCameraPermission = isVideo && VideoUtils.hasCameraPermissionAndShownPrivacyToast(mContext); - // Disabling local video doesn't seem to work when dialing. See b/30256571. + // Disabling local video doesn't seem to work when dialing. See a bug. final boolean showPauseVideo = isVideo && call.getState() != DialerCall.State.DIALING @@ -500,7 +500,7 @@ public class CallButtonPresenter * @return {@code true} if downgrading to an audio-only call from a video call is supported. */ private boolean isDowngradeToAudioSupported(DialerCall call) { - // TODO(b/33676907): If there is an RCS video share session, return true here + // TODO(a bug): If there is an RCS video share session, return true here return !call.can(CallCompat.Details.CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO); } diff --git a/java/com/android/incallui/CallerInfo.java b/java/com/android/incallui/CallerInfo.java index 809ed594c..4a9cf2181 100644 --- a/java/com/android/incallui/CallerInfo.java +++ b/java/com/android/incallui/CallerInfo.java @@ -510,7 +510,7 @@ public class CallerInfo { Log.e(TAG, "Cannot access VoiceMail.", se); } // TODO: There is no voicemail picture? - // FIXME: FIND ANOTHER ICON + // photoResource = android.R.drawable.badge_voicemail; return this; } diff --git a/java/com/android/incallui/CallerInfoAsyncQuery.java b/java/com/android/incallui/CallerInfoAsyncQuery.java index 8fc9c4f14..f9d8da819 100644 --- a/java/com/android/incallui/CallerInfoAsyncQuery.java +++ b/java/com/android/incallui/CallerInfoAsyncQuery.java @@ -103,7 +103,7 @@ public class CallerInfoAsyncQuery { public void onQueryComplete(int token, Object cookie, CallerInfo ci) { Log.d(LOG_TAG, "contactsProviderQueryCompleteListener onQueryComplete"); // If there are no other directory queries, make sure that the listener is - // notified of this result. see b/27621628 + // notified of this result. see a bug if ((ci != null && ci.contactExists) || !startOtherDirectoriesQuery(token, context, info, listener, cookie)) { if (listener != null && ci != null) { @@ -206,7 +206,7 @@ public class CallerInfoAsyncQuery { // The current implementation of multiple async query runs in single handler thread // in AsyncQueryHandler. // intermediateListener.onQueryComplete is also called from the same caller thread. - // TODO(b/26019872): use thread pool instead of single thread. + // TODO(a bug): use thread pool instead of single thread. for (int i = 0; i < size; i++) { long directoryId = directoryIds[i]; Uri uri = ContactInfoHelper.getContactInfoLookupUri(info.phoneNumber, directoryId); diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 2e3d721df..c3a68c021 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -516,6 +516,14 @@ public class InCallActivity extends TransactionSafeFragmentActivity common.showInternationalCallOnWifiDialog(call); } + @Override + public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { + super.onMultiWindowModeChanged(isInMultiWindowMode); + if (!isInMultiWindowMode) { + common.updateNavigationBar(isDialpadVisible()); + } + } + public void setAllowOrientationChange(boolean allowOrientationChange) { if (this.allowOrientationChange == allowOrientationChange) { return; diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index 0a7c2689b..d39ce22b0 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -305,6 +305,7 @@ public class InCallActivityCommon { } showDialpadRequest = DIALPAD_REQUEST_NONE; } + updateNavigationBar(isDialpadVisible()); if (showPostCharWaitDialogOnResume) { showPostCharWaitDialog(showPostCharWaitDialogCallId, showPostCharWaitDialogChars); @@ -328,7 +329,7 @@ public class InCallActivityCommon { public void onStop() { // Disconnects call waiting for account when activity is hidden e.g. user press home button. // This is necessary otherwise the pending call will stuck on account choose and no new call - // will be able to create. See b/63600434 for more details. + // will be able to create. See a bug for more details. // Skip this on locked screen since the activity may go over life cycle and start again. if (!isRecreating && !inCallActivity.getSystemService(KeyguardManager.class).isKeyguardLocked()) { @@ -712,6 +713,16 @@ public class InCallActivityCommon { dialog.show(); } + void updateNavigationBar(boolean isDialpadVisible) { + if (!inCallActivity.isInMultiWindowMode()) { + View navigationBarBackground = + inCallActivity.getWindow().findViewById(R.id.navigation_bar_background); + if (navigationBarBackground != null) { + navigationBarBackground.setVisibility(isDialpadVisible ? View.VISIBLE : View.GONE); + } + } + } + public boolean showDialpadFragment(boolean show, boolean animate) { // If the dialpad is already visible, don't animate in. If it's gone, don't animate out. boolean isDialpadVisible = isDialpadVisible(); @@ -772,6 +783,7 @@ public class InCallActivityCommon { dialpadFragmentManager.executePendingTransactions(); Logger.get(inCallActivity).logScreenView(ScreenEvent.Type.INCALL_DIALPAD, inCallActivity); + updateNavigationBar(true /* isDialpadVisible */); } private void performHideDialpadFragment() { @@ -789,6 +801,7 @@ public class InCallActivityCommon { transaction.commitAllowingStateLoss(); fragmentManager.executePendingTransactions(); } + updateNavigationBar(false /* isDialpadVisible */); } public boolean isDialpadVisible() { diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index 1ba3b5d3a..b8a2baa00 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -452,6 +452,7 @@ public class InCallPresenter implements CallList.Listener { if (inCallActivity != null) { if (mInCallActivity == null) { + mContext = inCallActivity.getApplicationContext(); updateListeners = true; LogUtil.i("InCallPresenter.updateActivity", "UI Initialized"); } else { @@ -500,7 +501,7 @@ public class InCallPresenter implements CallList.Listener { // (2) All calls could disconnect and then get a new incoming call before the // activity is destroyed. // - // b/1122139 - We previously had a check for mServiceConnected here as well, but there are + // a bug - We previously had a check for mServiceConnected here as well, but there are // cases where we need to recalculate the current state even if the service in not // connected. In particular the case where startOrFinish() is called while the app is // already finish()ing. In that case, we skip updating the state with the knowledge that @@ -730,7 +731,7 @@ public class InCallPresenter implements CallList.Listener { // incall activity for that call will still exist (even if it's not visible). In the case of // an incoming call in that situation, just disconnect that "waiting for account" call and // dismiss the dialog. The same activity will be reused to handle the new incoming call. See - // b/33247755 for more details. + // a bug for more details. DialerCall waitingForAccountCall; if (newState == InCallState.INCOMING && (waitingForAccountCall = callList.getWaitingForAccountCall()) != null) { diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java index 2c45cb375..402e0021f 100644 --- a/java/com/android/incallui/InCallServiceImpl.java +++ b/java/com/android/incallui/InCallServiceImpl.java @@ -38,6 +38,7 @@ import com.android.incallui.call.TelecomAdapter; public class InCallServiceImpl extends InCallService { private ReturnToCallController returnToCallController; + private NewReturnToCallController newReturnToCallController; @Override public void onCallAudioStateChanged(CallAudioState audioState) { @@ -97,6 +98,9 @@ public class InCallServiceImpl extends InCallService { if (ReturnToCallController.isEnabled(this)) { returnToCallController = new ReturnToCallController(this); } + if (NewReturnToCallController.isEnabled(this)) { + newReturnToCallController = new NewReturnToCallController(this); + } IBinder iBinder = super.onBind(intent); Trace.endSection(); @@ -125,6 +129,10 @@ public class InCallServiceImpl extends InCallService { returnToCallController.tearDown(); returnToCallController = null; } + if (newReturnToCallController != null) { + newReturnToCallController.tearDown(); + newReturnToCallController = null; + } Trace.endSection(); } } diff --git a/java/com/android/incallui/NewReturnToCallController.java b/java/com/android/incallui/NewReturnToCallController.java new file mode 100644 index 000000000..cd69ea1be --- /dev/null +++ b/java/com/android/incallui/NewReturnToCallController.java @@ -0,0 +1,283 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.incallui; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.graphics.drawable.Icon; +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.logging.DialerImpression; +import com.android.dialer.logging.Logger; +import com.android.dialer.telecom.TelecomUtil; +import com.android.incallui.InCallPresenter.InCallUiListener; +import com.android.incallui.audiomode.AudioModeProvider; +import com.android.incallui.audiomode.AudioModeProvider.AudioModeListener; +import com.android.incallui.call.CallList; +import com.android.incallui.call.CallList.Listener; +import com.android.incallui.call.DialerCall; +import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; +import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; +import com.android.newbubble.NewBubble; +import com.android.newbubble.NewBubble.BubbleExpansionStateListener; +import com.android.newbubble.NewBubble.ExpansionState; +import com.android.newbubble.NewBubbleInfo; +import com.android.newbubble.NewBubbleInfo.Action; +import java.util.ArrayList; +import java.util.List; + +/** + * Listens for events relevant to the return-to-call bubble and updates the bubble's state as + * necessary + */ +public class NewReturnToCallController implements InCallUiListener, Listener, AudioModeListener { + + public static final String RETURN_TO_CALL_EXTRA_KEY = "RETURN_TO_CALL_BUBBLE"; + + private final Context context; + + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + NewBubble bubble; + + private CallAudioState audioState; + + private final PendingIntent toggleSpeaker; + private final PendingIntent showSpeakerSelect; + private final PendingIntent toggleMute; + private final PendingIntent endCall; + private final PendingIntent fullScreen; + + public static boolean isEnabled(Context context) { + return ConfigProviderBindings.get(context).getBoolean("enable_return_to_call_bubble_v2", false); + } + + public NewReturnToCallController(Context context) { + this.context = context; + + toggleSpeaker = createActionIntent(ReturnToCallActionReceiver.ACTION_TOGGLE_SPEAKER); + showSpeakerSelect = + createActionIntent(ReturnToCallActionReceiver.ACTION_SHOW_AUDIO_ROUTE_SELECTOR); + toggleMute = createActionIntent(ReturnToCallActionReceiver.ACTION_TOGGLE_MUTE); + endCall = createActionIntent(ReturnToCallActionReceiver.ACTION_END_CALL); + + Intent activityIntent = InCallActivity.getIntent(context, false, false, false); + activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + activityIntent.putExtra(RETURN_TO_CALL_EXTRA_KEY, true); + fullScreen = + PendingIntent.getActivity( + context, InCallActivity.PENDING_INTENT_REQUEST_CODE_BUBBLE, activityIntent, 0); + + InCallPresenter.getInstance().addInCallUiListener(this); + CallList.getInstance().addListener(this); + AudioModeProvider.getInstance().addListener(this); + audioState = AudioModeProvider.getInstance().getAudioState(); + } + + public void tearDown() { + InCallPresenter.getInstance().removeInCallUiListener(this); + CallList.getInstance().removeListener(this); + AudioModeProvider.getInstance().removeListener(this); + } + + @Override + public void onUiShowing(boolean showing) { + if (showing) { + hide(); + } else { + if (TelecomUtil.isInManagedCall(context)) { + show(); + } + } + } + + private void hide() { + if (bubble != null) { + bubble.hide(); + } else { + LogUtil.i("ReturnToCallController.hide", "hide() called without calling show()"); + } + } + + private void hideAndReset() { + if (bubble != null) { + bubble.hideAndReset(); + } else { + LogUtil.i("ReturnToCallController.reset", "reset() called without calling show()"); + } + } + + private void show() { + if (bubble == null) { + bubble = startBubble(); + } else { + bubble.show(); + } + } + + @VisibleForTesting + public NewBubble startBubble() { + if (!NewBubble.canShowBubbles(context)) { + LogUtil.i("ReturnToCallController.startNewBubble", "can't show bubble, no permission"); + return null; + } + NewBubble returnToCallBubble = NewBubble.createBubble(context, generateBubbleInfo()); + returnToCallBubble.setBubbleExpansionStateListener( + new BubbleExpansionStateListener() { + @Override + public void onBubbleExpansionStateChanged( + @ExpansionState int expansionState, boolean isUserAction) { + if (!isUserAction) { + return; + } + + DialerCall call = CallList.getInstance().getActiveOrBackgroundCall(); + switch (expansionState) { + case ExpansionState.START_EXPANDING: + if (call != null) { + Logger.get(context) + .logCallImpression( + DialerImpression.Type.BUBBLE_PRIMARY_BUTTON_EXPAND, + call.getUniqueCallId(), + call.getTimeAddedMs()); + } else { + Logger.get(context) + .logImpression(DialerImpression.Type.BUBBLE_PRIMARY_BUTTON_EXPAND); + } + break; + case ExpansionState.START_COLLAPSING: + if (call != null) { + Logger.get(context) + .logCallImpression( + DialerImpression.Type.BUBBLE_COLLAPSE_BY_USER, + call.getUniqueCallId(), + call.getTimeAddedMs()); + } else { + Logger.get(context).logImpression(DialerImpression.Type.BUBBLE_COLLAPSE_BY_USER); + } + break; + default: + break; + } + } + }); + returnToCallBubble.show(); + return returnToCallBubble; + } + + @Override + public void onIncomingCall(DialerCall call) {} + + @Override + public void onUpgradeToVideo(DialerCall call) {} + + @Override + public void onSessionModificationStateChange(DialerCall call) {} + + @Override + public void onCallListChange(CallList callList) {} + + @Override + public void onDisconnect(DialerCall call) { + if (call.wasParentCall()) { + // It's disconnected after the last child call is disconnected, and we already did everything + // for the last child. + LogUtil.i( + "ReturnToCallController.onDisconnect", "being called for a parent call and do nothing"); + return; + } + if (bubble != null + && bubble.isVisible() + && (!TelecomUtil.isInManagedCall(context) + || CallList.getInstance().getActiveOrBackgroundCall() != null)) { + bubble.showText(context.getText(R.string.incall_call_ended)); + } + // For conference call, we should hideAndReset for the last disconnected child call while the + // parent call is still there. + if (!CallList.getInstance().hasNonParentActiveOrBackgroundCall()) { + hideAndReset(); + } + } + + @Override + public void onWiFiToLteHandover(DialerCall call) {} + + @Override + public void onHandoverToWifiFailed(DialerCall call) {} + + @Override + public void onInternationalCallOnWifi(@NonNull DialerCall call) {} + + @Override + public void onAudioStateChanged(CallAudioState audioState) { + this.audioState = audioState; + if (bubble != null) { + bubble.updateActions(generateActions()); + } + } + + private NewBubbleInfo generateBubbleInfo() { + return NewBubbleInfo.builder() + .setPrimaryColor(context.getResources().getColor(R.color.dialer_theme_color, null)) + .setPrimaryIcon(Icon.createWithResource(context, R.drawable.on_going_call)) + .setStartingYPosition( + context.getResources().getDimensionPixelOffset(R.dimen.return_to_call_initial_offset_y)) + .setActions(generateActions()) + .build(); + } + + @NonNull + private List<Action> generateActions() { + List<Action> actions = new ArrayList<>(); + SpeakerButtonInfo speakerButtonInfo = new SpeakerButtonInfo(audioState, IconSize.SIZE_24_DP); + + actions.add( + Action.builder() + .setIconDrawable(context.getDrawable(R.drawable.quantum_ic_fullscreen_vd_theme_24)) + .setIntent(fullScreen) + .build()); + actions.add( + Action.builder() + .setIconDrawable(context.getDrawable(R.drawable.quantum_ic_mic_off_white_24)) + .setChecked(audioState.isMuted()) + .setIntent(toggleMute) + .build()); + actions.add( + Action.builder() + .setIconDrawable(context.getDrawable(speakerButtonInfo.icon)) + .setName(context.getText(speakerButtonInfo.label)) + .setChecked(speakerButtonInfo.isChecked) + .setIntent(speakerButtonInfo.checkable ? toggleSpeaker : showSpeakerSelect) + .build()); + actions.add( + Action.builder() + .setIconDrawable(context.getDrawable(R.drawable.quantum_ic_call_end_vd_theme_24)) + .setIntent(endCall) + .build()); + return actions; + } + + @NonNull + private PendingIntent createActionIntent(String action) { + Intent toggleSpeaker = new Intent(context, ReturnToCallActionReceiver.class); + toggleSpeaker.setAction(action); + return PendingIntent.getBroadcast(context, 0, toggleSpeaker, 0); + } +} diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index 7ff0040e2..4ce43935e 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -376,8 +376,6 @@ public class StatusBarNotifier builder.setColorized(true); builder.setChannelId(NotificationChannelId.ONGOING_CALL); } - // This will be ignored on O+ and handled by the channel - builder.setPriority(Notification.PRIORITY_MAX); break; default: break; @@ -648,7 +646,8 @@ public class StatusBarNotifier return R.drawable.ic_hd_call; } // If ReturnToCall is enabled, use the static icon. The animated one will show in the bubble. - if (ReturnToCallController.isEnabled(mContext)) { + if (ReturnToCallController.isEnabled(mContext) + || NewReturnToCallController.isEnabled(mContext)) { return R.drawable.quantum_ic_call_vd_theme_24; } else { return R.drawable.on_going_call; @@ -714,7 +713,7 @@ public class StatusBarNotifier if (resId == R.string.notification_incoming_call_wifi_template || resId == R.string.notification_ongoing_call_wifi_template) { - // TODO(b/64525903): Potentially apply this template logic everywhere. + // TODO(a bug): Potentially apply this template logic everywhere. return mContext.getString(resId, wifiBrand); } @@ -1027,11 +1026,6 @@ public class StatusBarNotifier @Override public void onAudioStateChanged(CallAudioState audioState) { - if (CallList.getInstance().getActiveOrBackgroundCall() == null) { - // We only care about speaker mode when in call - return; - } - updateNotification(); } diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java index ab02c3b86..fd775e2f5 100644 --- a/java/com/android/incallui/VideoCallPresenter.java +++ b/java/com/android/incallui/VideoCallPresenter.java @@ -358,7 +358,7 @@ public class VideoCallPresenter // Ensure that the call's camera direction is updated (most likely to UNKNOWN). Normally this // happens after any call state changes but we're unregistering from InCallPresenter above so - // we won't get any more call state changes. See b/32957114. + // we won't get any more call state changes. See a bug. if (mPrimaryCall != null) { updateCameraSelection(mPrimaryCall); } @@ -851,7 +851,7 @@ public class VideoCallPresenter if (!hasCameraPermission) { videoCall.setCamera(null); mPreviewSurfaceState = PreviewSurfaceState.NONE; - // TODO(wangqi): Inform remote party that the video is off. This is similar to b/30256571. + // TODO(wangqi): Inform remote party that the video is off. This is similar to a bug. } else if (isCameraRequired) { InCallCameraManager cameraManager = InCallPresenter.getInstance().getInCallCameraManager(); videoCall.setCamera(cameraManager.getActiveCameraId()); diff --git a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java index ea5956c8c..ebbaef8e5 100644 --- a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java +++ b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java @@ -421,9 +421,7 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged // spec timeline can be divided into 9 slots. Each slot is equivalent to 83ms in the spec. // Therefore, we use 9 slots of 83ms to map user gesture into the spec timeline. // - // See specs - - // Accept: https://direct.googleplex.com/#/spec/8510001 - // Decline: https://direct.googleplex.com/#/spec/3850001 + final float progressSlots = 9; // Fade out the "swipe up to answer". It only takes 1 slot to complete the fade. diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml index 2dc274b05..d79da8843 100644 --- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml +++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml @@ -87,7 +87,7 @@ android:layout_marginEnd="24dp"/> <!-- We have to keep deprecated singleLine to allow long text being truncated with ellipses. - b/31396406 --> + a bug --> <com.android.incallui.autoresizetext.AutoResizeTextView android:id="@id/contactgrid_contact_name" android:layout_width="wrap_content" diff --git a/java/com/android/incallui/answerproximitysensor/AnswerProximitySensor.java b/java/com/android/incallui/answerproximitysensor/AnswerProximitySensor.java index 113144b7f..50f6ae695 100644 --- a/java/com/android/incallui/answerproximitysensor/AnswerProximitySensor.java +++ b/java/com/android/incallui/answerproximitysensor/AnswerProximitySensor.java @@ -90,8 +90,8 @@ public class AnswerProximitySensor } else { // TODO(twyen): choose a wake lock implementation base on framework/device. // These bugs requires the PseudoProximityWakeLock workaround: - // b/30439151 Proximity sensor not working on M - // b/31499931 fautly touch input when screen is off on marlin/sailfish + // a bug Proximity sensor not working on M + // a bug fautly touch input when screen is off on marlin/sailfish answerProximityWakeLock = new SystemProximityWakeLock(context); } answerProximityWakeLock.setScreenOnListener(this); diff --git a/java/com/android/incallui/answerproximitysensor/PseudoScreenState.java b/java/com/android/incallui/answerproximitysensor/PseudoScreenState.java index eda0ee720..676a1a3cc 100644 --- a/java/com/android/incallui/answerproximitysensor/PseudoScreenState.java +++ b/java/com/android/incallui/answerproximitysensor/PseudoScreenState.java @@ -27,7 +27,7 @@ import java.util.Set; * new DOWN event once the point started moving and then behave as a normal gesture. To prevent * accidental answer/rejects, touches that started when the screen is off should be ignored. * - * <p>b/31499931 on certain devices with N-DR1, if the screen is already touched when the screen is + * <p>a bug on certain devices with N-DR1, if the screen is already touched when the screen is * turned on, a "DOWN MOVE UP" will be sent for each movement before the touch is actually released. * These events is hard to discern from other normal events, and keeping the screen on reduces its' * probability. diff --git a/java/com/android/incallui/audiomode/AudioModeProvider.java b/java/com/android/incallui/audiomode/AudioModeProvider.java index eb59e95d4..6bdd23968 100644 --- a/java/com/android/incallui/audiomode/AudioModeProvider.java +++ b/java/com/android/incallui/audiomode/AudioModeProvider.java @@ -69,7 +69,7 @@ public class AudioModeProvider { * Sets a approximated audio state before {@link #onAudioStateChanged} is called. Classes such as * {@link com.android.incallui.ProximitySensor} fetches the audio state before it is updated by * telecom. This method attempts to guess the correct routing based on connected audio devices. - * The audio state may still be wrong on a second call due to b/64811128, telecom setting the + * The audio state may still be wrong on a second call due to a bug, telecom setting the * route back to earpiece when a call ends. */ public void initializeAudioState(Context context) { diff --git a/java/com/android/incallui/audioroute/AudioRouteSelectorDialogFragment.java b/java/com/android/incallui/audioroute/AudioRouteSelectorDialogFragment.java index 9fd3aed5b..d481f4339 100644 --- a/java/com/android/incallui/audioroute/AudioRouteSelectorDialogFragment.java +++ b/java/com/android/incallui/audioroute/AudioRouteSelectorDialogFragment.java @@ -92,7 +92,7 @@ public class AudioRouteSelectorDialogFragment extends BottomSheetDialogFragment CallAudioState.ROUTE_EARPIECE, audioState); - // TODO(b/67013452): set peak height correctly to fully expand it in landscape mode. + // TODO(a bug): set peak height correctly to fully expand it in landscape mode. return view; } diff --git a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java index 5a22b93dc..2789ceac2 100644 --- a/java/com/android/incallui/autoresizetext/AutoResizeTextView.java +++ b/java/com/android/incallui/autoresizetext/AutoResizeTextView.java @@ -35,7 +35,7 @@ import javax.annotation.Nullable; * A TextView that automatically scales its text to completely fill its allotted width. * * <p>Note: In some edge cases, the binary search algorithm to find the best fit may slightly - * overshoot / undershoot its constraints. See b/26704434. No minimal repro case has been + * overshoot / undershoot its constraints. See a bug. No minimal repro case has been * found yet. A known workaround is the solution provided on StackOverflow: * http://stackoverflow.com/a/5535672 */ diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index fcfb0a663..59f38349a 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -298,7 +298,7 @@ public class CallList implements DialerCallDelegate { manager.unregisterStateChangedListener(call); // Don't log an already logged call. logCall() might be called multiple times - // for the same call due to b/24109437. + // for the same call due to a bug. if (call.getLogState() != null && !call.getLogState().isLogged) { getLegacyBindings(context).logCall(call); call.getLogState().isLogged = true; @@ -344,7 +344,7 @@ public class CallList implements DialerCallDelegate { DialerCall call = mCallByTelecomCall.get(telecomCall); // Don't log an already logged call. logCall() might be called multiple times - // for the same call due to b/24109437. + // for the same call due to a bug. if (call.getLogState() != null && !call.getLogState().isLogged) { getLegacyBindings(context).logCall(call); call.getLogState().isLogged = true; diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index d911a4c4f..e8523d650 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -94,7 +94,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public static final int CALL_HISTORY_STATUS_NOT_PRESENT = 2; // Hard coded property for {@code Call}. Upstreamed change from Motorola. - // TODO(b/35359461): Move it to Telecom in framework. + // TODO(a bug): Move it to Telecom in framework. public static final int PROPERTY_CODEC_KNOWN = 0x04000000; private static final String ID_PREFIX = "DialerCall_"; @@ -143,9 +143,12 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @CallHistoryStatus private int mCallHistoryStatus = CALL_HISTORY_STATUS_UNKNOWN; private boolean mIsSpam; private boolean mIsBlocked; - private boolean isInUserSpamList; - private boolean isInUserWhiteList; - private boolean isInGlobalSpamList; + + @Nullable private Boolean isInUserSpamList; + + @Nullable private Boolean isInUserWhiteList; + + @Nullable private Boolean isInGlobalSpamList; private boolean didShowCameraPermission; private String callProviderLabel; private String callbackNumber; @@ -575,7 +578,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa */ protected boolean areCallExtrasCorrupted(Bundle callExtras) { /** - * There's currently a bug in Telephony service (b/25613098) that could corrupt the extras + * There's currently a bug in Telephony service (a bug) that could corrupt the extras * bundle, resulting in a IllegalArgumentException while validating data under {@link * Bundle#containsKey(String)}. */ @@ -1015,7 +1018,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa didShowCameraPermission = didShow; } - public boolean isInGlobalSpamList() { + @Nullable + public Boolean isInGlobalSpamList() { return isInGlobalSpamList; } @@ -1023,7 +1027,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa isInGlobalSpamList = inSpamList; } - public boolean isInUserSpamList() { + @Nullable + public Boolean isInUserSpamList() { return isInUserSpamList; } @@ -1031,7 +1036,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa isInUserSpamList = inSpamList; } - public boolean isInUserWhiteList() { + @Nullable + public Boolean isInUserWhiteList() { return isInUserWhiteList; } diff --git a/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java b/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java index 305ab4377..0884c2fef 100644 --- a/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java +++ b/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java @@ -30,7 +30,7 @@ import com.android.dialer.strictmode.StrictModeUtils; /** * Helper class to check if Google Location Services is enabled. This class is based on - * https://docs.google.com/a/google.com/document/d/1sGm8pHgGY1QmxbLCwTZuWQASEDN7CFW9EPSZXAuGQfo + */ public class GoogleLocationSettingHelper { diff --git a/java/com/android/incallui/calllocation/impl/HttpFetcher.java b/java/com/android/incallui/calllocation/impl/HttpFetcher.java index a63cbc6e1..10cc34d25 100644 --- a/java/com/android/incallui/calllocation/impl/HttpFetcher.java +++ b/java/com/android/incallui/calllocation/impl/HttpFetcher.java @@ -222,7 +222,7 @@ public class HttpFetcher { /** * Lookup up url re-write rules from gServices and apply to the given url. * - * <p>https://wiki.corp.google.com/twiki/bin/view/Main/AndroidGservices#URL_Rewriting_Rules + * * @return The new url. */ diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index f0504bc56..e96060c06 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -45,6 +45,7 @@ import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.multimedia.MultimediaData; import com.android.dialer.strictmode.StrictModeUtils; +import com.android.dialer.util.ViewUtil; import com.android.dialer.widget.LockableViewPager; import com.android.incallui.audioroute.AudioRouteSelectorDialogFragment; import com.android.incallui.audioroute.AudioRouteSelectorDialogFragment.AudioRouteSelectorPresenter; @@ -174,6 +175,9 @@ public class InCallFragment extends Fragment : TelephonyManager.NETWORK_TYPE_UNKNOWN; } phoneType = getContext().getSystemService(TelephonyManager.class).getPhoneType(); + View space = view.findViewById(R.id.navigation_bar_background); + space.getLayoutParams().height = ViewUtil.getNavigationBarHeight(getContext()); + return view; } diff --git a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml index 6d8556759..8e9120b09 100644 --- a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml +++ b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml @@ -1,5 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2017 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> + <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="#FF01579B" android:state_checked="true"/> + <item android:color="#FF1C3AA9" android:state_checked="true"/> <item android:color="#FFFFFFFF"/> </selector> diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml index c06f7099c..73b9c267e 100644 --- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml +++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml @@ -15,107 +15,114 @@ ~ limitations under the License --> <FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent" - android:clipChildren="false" - android:clipToPadding="false" - android:fitsSystemWindows="true"> + android:layout_height="match_parent"> - <LinearLayout - android:id="@id/incall_contact_grid" + <RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="12dp" - android:layout_marginStart="@dimen/incall_window_margin_horizontal" - android:layout_marginEnd="@dimen/incall_window_margin_horizontal" - android:gravity="center_horizontal" - android:orientation="vertical"> + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false" + android:fitsSystemWindows="true"> + + <LinearLayout + android:id="@id/incall_contact_grid" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="12dp" + android:layout_marginStart="@dimen/incall_window_margin_horizontal" + android:layout_marginEnd="@dimen/incall_window_margin_horizontal" + android:gravity="center_horizontal" + android:orientation="vertical"> <ImageView - android:id="@id/contactgrid_avatar" - android:layout_width="@dimen/incall_avatar_size" - android:layout_height="@dimen/incall_avatar_size" - android:layout_marginBottom="8dp" - android:elevation="2dp"/> + android:id="@id/contactgrid_avatar" + android:layout_width="@dimen/incall_avatar_size" + android:layout_height="@dimen/incall_avatar_size" + android:layout_marginBottom="8dp" + android:elevation="2dp"/> <include - layout="@layout/incall_contactgrid_top_row" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + layout="@layout/incall_contactgrid_top_row" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> <!-- We have to keep deprecated singleLine to allow long text being truncated with ellipses. - b/31396406 --> + a bug --> <com.android.incallui.autoresizetext.AutoResizeTextView - android:id="@id/contactgrid_contact_name" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - android:singleLine="true" - android:textAppearance="@style/Dialer.Incall.TextAppearance.Large" - app:autoResizeText_minTextSize="28sp" - tools:text="Jake Peralta" - tools:ignore="Deprecated"/> + android:id="@id/contactgrid_contact_name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="4dp" + android:singleLine="true" + android:textAppearance="@style/Dialer.Incall.TextAppearance.Large" + app:autoResizeText_minTextSize="28sp" + tools:ignore="Deprecated" + tools:text="Jake Peralta"/> <include - layout="@layout/incall_contactgrid_bottom_row" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> + layout="@layout/incall_contactgrid_bottom_row" + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> <FrameLayout - android:id="@+id/incall_location_holder" - android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:id="@+id/incall_location_holder" + android:layout_width="match_parent" + android:layout_height="match_parent"/> </LinearLayout> <com.android.dialer.widget.LockableViewPager - android:id="@+id/incall_pager" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_above="@+id/incall_paginator" - android:layout_below="@+id/incall_contact_grid" - android:layout_centerHorizontal="true"/> + android:id="@+id/incall_pager" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_above="@+id/incall_paginator" + android:layout_below="@+id/incall_contact_grid" + android:layout_centerHorizontal="true"/> <com.android.incallui.incall.impl.InCallPaginator android:id="@+id/incall_paginator" - android:layout_height="@dimen/paginator_height" android:layout_width="@dimen/paginator_width" + android:layout_height="@dimen/paginator_height" android:layout_above="@+id/incall_end_call" android:layout_centerHorizontal="true" android:visibility="gone"/> <FrameLayout - android:id="@+id/incall_dialpad_container" - style="@style/DialpadContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:clipChildren="false" - android:clipToPadding="false" - tools:background="@android:color/white" - tools:visibility="gone"/> + android:id="@+id/incall_dialpad_container" + style="@style/DialpadContainer" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:clipChildren="false" + android:clipToPadding="false" + tools:background="@android:color/white" + tools:visibility="gone"/> <ImageButton - android:id="@+id/incall_end_call" - style="@style/Incall.Button.End" - android:layout_marginTop="16dp" - android:layout_marginBottom="36dp" - android:layout_alignParentBottom="true" - android:layout_centerHorizontal="true" - android:contentDescription="@string/incall_content_description_end_call"/> + android:id="@+id/incall_end_call" + style="@style/Incall.Button.End" + android:layout_marginTop="16dp" + android:layout_marginBottom="36dp" + android:layout_alignParentBottom="true" + android:layout_centerHorizontal="true" + android:contentDescription="@string/incall_content_description_end_call"/> </RelativeLayout> <FrameLayout - android:id="@id/incall_on_hold_banner" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="top"/> + android:id="@id/incall_on_hold_banner" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top"/> + <FrameLayout + android:id="@+id/navigation_bar_background" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_gravity="bottom" + android:visibility="gone" + android:background="@android:color/background_dark"/> </FrameLayout> diff --git a/java/com/android/incallui/incall/protocol/PrimaryCallState.java b/java/com/android/incallui/incall/protocol/PrimaryCallState.java index 4a50fbeaf..7a3abedcd 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryCallState.java +++ b/java/com/android/incallui/incall/protocol/PrimaryCallState.java @@ -71,7 +71,7 @@ public class PrimaryCallState { @Nullable public final String customLabel; @Nullable public final TransformationInfo assistedDialingExtras; - // TODO: Convert to autovalue. b/34502119 + // TODO: Convert to autovalue. a bug public static PrimaryCallState createEmptyPrimaryCallState() { return createEmptyPrimaryCallStateWithState(DialerCall.State.IDLE, null); } diff --git a/java/com/android/incallui/incall/protocol/PrimaryInfo.java b/java/com/android/incallui/incall/protocol/PrimaryInfo.java index 69eee20ff..f7457c3ff 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryInfo.java +++ b/java/com/android/incallui/incall/protocol/PrimaryInfo.java @@ -45,7 +45,7 @@ public class PrimaryInfo { public final boolean showInCallButtonGrid; public final int numberPresentation; - // TODO: Convert to autovalue. b/34502119 + // TODO: Convert to autovalue. a bug public static PrimaryInfo createEmptyPrimaryInfo() { return new PrimaryInfo( null, diff --git a/java/com/android/incallui/sessiondata/MultimediaFragment.java b/java/com/android/incallui/sessiondata/MultimediaFragment.java index 3e6cdbbe0..6c2490f92 100644 --- a/java/com/android/incallui/sessiondata/MultimediaFragment.java +++ b/java/com/android/incallui/sessiondata/MultimediaFragment.java @@ -182,7 +182,7 @@ public class MultimediaFragment extends Fragment implements AvatarPresenter { boolean isFirstResource) { view.findViewById(R.id.loading_spinner).setVisibility(View.GONE); LogUtil.e("MultimediaFragment.onLoadFailed", null, e); - // TODO(b/34720074) handle error cases nicely + // TODO(a bug) handle error cases nicely return false; // Let Glide handle the rest } diff --git a/java/com/android/incallui/spam/SpamNotificationActivity.java b/java/com/android/incallui/spam/SpamNotificationActivity.java index 86988ad23..f5ea73c73 100644 --- a/java/com/android/incallui/spam/SpamNotificationActivity.java +++ b/java/com/android/incallui/spam/SpamNotificationActivity.java @@ -274,7 +274,7 @@ public class SpamNotificationActivity extends FragmentActivity { logCallImpression(DialerImpression.Type.SPAM_AFTER_CALL_NOTIFICATION_BLOCK_NUMBER); filteredNumberAsyncQueryHandler.blockNumber(null, number, getCountryIso()); - // TODO: DialerCall finish() after block/reporting async tasks complete (b/28441936) + // TODO: DialerCall finish() after block/reporting async tasks complete (a bug) finish(); } @@ -289,7 +289,7 @@ public class SpamNotificationActivity extends FragmentActivity { CallLog.Calls.INCOMING_TYPE, ReportingLocation.Type.FEEDBACK_PROMPT, contactLookupResultType); - // TODO: DialerCall finish() after async task completes (b/28441936) + // TODO: DialerCall finish() after async task completes (a bug) finish(); } diff --git a/java/com/android/incallui/spam/SpamNotificationService.java b/java/com/android/incallui/spam/SpamNotificationService.java index 91377db83..3c1061af1 100644 --- a/java/com/android/incallui/spam/SpamNotificationService.java +++ b/java/com/android/incallui/spam/SpamNotificationService.java @@ -117,7 +117,7 @@ public class SpamNotificationService extends Service { break; default: // fall out } - // TODO: call stopSelf() after async tasks complete (b/28441936) + // TODO: call stopSelf() after async tasks complete (a bug) stopSelf(); return START_NOT_STICKY; } diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index b0beb77c1..a3614c09c 100644 --- a/java/com/android/incallui/video/impl/VideoCallFragment.java +++ b/java/com/android/incallui/video/impl/VideoCallFragment.java @@ -85,7 +85,7 @@ import com.android.incallui.videosurface.protocol.VideoSurfaceTexture; import com.android.incallui.videotech.utils.VideoUtils; /** Contains UI elements for a video call. */ -// LINT.IfChange + public class VideoCallFragment extends Fragment implements InCallScreen, InCallButtonUi, @@ -1271,4 +1271,4 @@ public class VideoCallFragment extends Fragment } } } -// LINT.ThenChange(//depot/google3/third_party/java_src/android_app/dialer/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java) + diff --git a/java/com/android/incallui/video/impl/res/layout/video_contact_grid.xml b/java/com/android/incallui/video/impl/res/layout/video_contact_grid.xml index ad984f36e..3cf050467 100644 --- a/java/com/android/incallui/video/impl/res/layout/video_contact_grid.xml +++ b/java/com/android/incallui/video/impl/res/layout/video_contact_grid.xml @@ -15,7 +15,7 @@ android:layout_height="wrap_content"/> <!-- We have to keep deprecated singleLine to allow long text being truncated with ellipses. - b/31396406 --> + a bug --> <com.android.incallui.autoresizetext.AutoResizeTextView android:id="@id/contactgrid_contact_name" android:layout_width="wrap_content" |