diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-11-11 21:38:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-11 21:38:25 +0000 |
commit | 7d34a79a4c1e128b29153102e260d9f791bd8041 (patch) | |
tree | 4cc0c61bbf593c9d88f064ba7fe36de270ccb733 /java | |
parent | 0e21a20448a4c12a71cf81d6e3bd1a86f3fa0df9 (diff) | |
parent | c6deafc10cd005ba046f3d87693012c6b81e0bc4 (diff) |
Merge changes Iaf842b35,I987c0d19,If20e9fb9
* changes:
Rename value name to avoid conflict.
Fix previous usage of LoggingBinding with Logger class.
Disable "Switch Camera" button when not transmitting
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/dialer/app/DialtactsActivity.java | 11 | ||||
-rw-r--r-- | java/com/android/dialer/util/PermissionsUtil.java | 5 | ||||
-rw-r--r-- | java/com/android/incallui/CallButtonPresenter.java | 3 | ||||
-rw-r--r-- | java/com/android/incallui/InCallActivity.java | 23 | ||||
-rw-r--r-- | java/com/android/incallui/call/CallList.java | 17 | ||||
-rw-r--r-- | java/com/android/newbubble/NewBubble.java | 4 | ||||
-rw-r--r-- | java/com/android/newbubble/res/values/values.xml | 2 |
7 files changed, 26 insertions, 39 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java index 5af9b95ac..12c191e53 100644 --- a/java/com/android/dialer/app/DialtactsActivity.java +++ b/java/com/android/dialer/app/DialtactsActivity.java @@ -112,7 +112,6 @@ import com.android.dialer.interactions.PhoneNumberInteraction.InteractionErrorCo import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.logging.LoggingBindings; -import com.android.dialer.logging.LoggingBindingsFactory; import com.android.dialer.logging.ScreenEvent; import com.android.dialer.logging.UiAction; import com.android.dialer.main.Main; @@ -593,13 +592,9 @@ public class DialtactsActivity extends TransactionSafeActivity } // add 1 sec delay to get memory snapshot so that dialer wont react slowly on resume. ThreadUtil.postDelayedOnUiThread( - () -> { - if (getApplicationContext() instanceof LoggingBindingsFactory) { - ((LoggingBindingsFactory) getApplicationContext()) - .newLoggingBindings() - .logRecordMemory(LoggingBindings.ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME); - } - }, + () -> + Logger.get(this) + .logRecordMemory(LoggingBindings.ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME), 1000); } diff --git a/java/com/android/dialer/util/PermissionsUtil.java b/java/com/android/dialer/util/PermissionsUtil.java index 012b83ff1..6684f954b 100644 --- a/java/com/android/dialer/util/PermissionsUtil.java +++ b/java/com/android/dialer/util/PermissionsUtil.java @@ -36,6 +36,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.support.annotation.NonNull; +import android.support.annotation.VisibleForTesting; import android.support.v4.content.ContextCompat; import android.support.v4.content.LocalBroadcastManager; import android.widget.Toast; @@ -49,7 +50,9 @@ import java.util.List; /** Utility class to help with runtime permissions. */ public class PermissionsUtil { - private static final String PREFERENCE_CAMERA_ALLOWED_BY_USER = "camera_allowed_by_user"; + @VisibleForTesting + public static final String PREFERENCE_CAMERA_ALLOWED_BY_USER = "camera_allowed_by_user"; + private static final String PERMISSION_PREFERENCE = "dialer_permissions"; private static final String CEQUINT_PERMISSION = "com.cequint.ecid.CALLER_ID_LOOKUP"; diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index cc95f7b84..6b7eb9b4c 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -477,7 +477,8 @@ public class CallButtonPresenter mInCallButtonUi.showButton(InCallButtonIds.BUTTON_UPGRADE_TO_VIDEO, showUpgradeToVideo); mInCallButtonUi.showButton(InCallButtonIds.BUTTON_DOWNGRADE_TO_AUDIO, showDowngradeToAudio); mInCallButtonUi.showButton( - InCallButtonIds.BUTTON_SWITCH_CAMERA, isVideo && hasCameraPermission); + InCallButtonIds.BUTTON_SWITCH_CAMERA, + isVideo && hasCameraPermission && call.getVideoTech().isTransmitting()); mInCallButtonUi.showButton(InCallButtonIds.BUTTON_PAUSE_VIDEO, showPauseVideo); if (isVideo) { mInCallButtonUi.setVideoPaused(!call.getVideoTech().isTransmitting() || !hasCameraPermission); diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 34ffdf5b7..cdab6b4f5 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -42,7 +42,6 @@ import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.logging.LoggingBindings; -import com.android.dialer.logging.LoggingBindingsFactory; import com.android.dialer.logging.ScreenEvent; import com.android.incallui.answer.bindings.AnswerBindings; import com.android.incallui.answer.protocol.AnswerScreen; @@ -148,14 +147,10 @@ public class InCallActivity extends TransactionSafeFragmentActivity pseudoBlackScreenOverlay = findViewById(R.id.psuedo_black_screen_overlay); sendBroadcast(CallPendingActivity.getFinishBroadcast()); Trace.endSection(); - if (getApplicationContext() instanceof LoggingBindingsFactory) { - LoggingBindings loggingBindings = - ((LoggingBindingsFactory) getApplicationContext()).newLoggingBindings(); - loggingBindings.logStopLatencyTimer( - LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); - loggingBindings.logStopLatencyTimer( - LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); - } + Logger.get(this) + .logStopLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); + Logger.get(this) + .logStopLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); } @Override @@ -199,13 +194,9 @@ public class InCallActivity extends TransactionSafeFragmentActivity Trace.endSection(); // add 1 sec delay to get memory snapshot so that dialer wont react slowly on resume. ThreadUtil.postDelayedOnUiThread( - () -> { - if (getApplicationContext() instanceof LoggingBindingsFactory) { - ((LoggingBindingsFactory) getApplicationContext()) - .newLoggingBindings() - .logRecordMemory(LoggingBindings.INCALL_ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME); - } - }, + () -> + Logger.get(this) + .logRecordMemory(LoggingBindings.INCALL_ACTIVITY_ON_RESUME_MEMORY_EVENT_NAME), 1000); } diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index 4f1dfd43f..fd43a4aaa 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -37,7 +37,6 @@ import com.android.dialer.enrichedcall.EnrichedCallManager; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.logging.LoggingBindings; -import com.android.dialer.logging.LoggingBindingsFactory; import com.android.dialer.shortcuts.ShortcutUsageReporter; import com.android.dialer.spam.Spam; import com.android.dialer.spam.SpamBindings; @@ -119,16 +118,12 @@ public class CallList implements DialerCallDelegate { public void onCallAdded( final Context context, final android.telecom.Call telecomCall, LatencyReport latencyReport) { Trace.beginSection("CallList.onCallAdded"); - if (context.getApplicationContext() instanceof LoggingBindingsFactory) { - if (telecomCall.getState() == Call.STATE_CONNECTING) { - ((LoggingBindingsFactory) context.getApplicationContext()) - .newLoggingBindings() - .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); - } else if (telecomCall.getState() == Call.STATE_RINGING) { - ((LoggingBindingsFactory) context.getApplicationContext()) - .newLoggingBindings() - .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); - } + if (telecomCall.getState() == Call.STATE_CONNECTING) { + Logger.get(context) + .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_OUTGOING); + } else if (telecomCall.getState() == Call.STATE_RINGING) { + Logger.get(context) + .logStartLatencyTimer(LoggingBindings.ON_CALL_ADDED_TO_ON_INCALL_UI_SHOWN_INCOMING); } if (mUiListeners != null) { mUiListeners.onCallAdded(); diff --git a/java/com/android/newbubble/NewBubble.java b/java/com/android/newbubble/NewBubble.java index fb6a5e458..e690f4be4 100644 --- a/java/com/android/newbubble/NewBubble.java +++ b/java/com/android/newbubble/NewBubble.java @@ -475,7 +475,9 @@ public class NewBubble { .getPrimaryButton() .animate() .translationZ( - context.getResources().getDimensionPixelOffset(R.dimen.bubble_move_elevation_change)); + context + .getResources() + .getDimensionPixelOffset(R.dimen.bubble_dragging_elevation_change)); } void onMoveFinish() { diff --git a/java/com/android/newbubble/res/values/values.xml b/java/com/android/newbubble/res/values/values.xml index d8cd08f87..a028254c7 100644 --- a/java/com/android/newbubble/res/values/values.xml +++ b/java/com/android/newbubble/res/values/values.xml @@ -18,7 +18,7 @@ <resources> <dimen name="bubble_size">56dp</dimen> <dimen name="bubble_icon_padding">16dp</dimen> - <dimen name="bubble_move_elevation_change">6dp</dimen> + <dimen name="bubble_dragging_elevation_change">6dp</dimen> <dimen name="bubble_button_height">36dp</dimen> <dimen name="bubble_button_icon_padding">16dp</dimen> |