From 2df4538eb90b896be15eebc1d9adf1206131c8a3 Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Thu, 16 Mar 2017 20:19:43 +0000 Subject: Revert "Update dialer to tap green cl 150332012." This reverts commit 1019500220518fb5fb023fcb7d370ab3cbf12307. Change-Id: Ie6e4f81a995fca7345132b596521b0bd06ceffb9 --- .../res/drawable-hdpi/ic_voicemail_avatar.png | Bin 2856 -> 3607 bytes .../res/drawable-mdpi/ic_voicemail_avatar.png | Bin 1752 -> 2120 bytes .../res/drawable-xhdpi/ic_voicemail_avatar.png | Bin 3783 -> 4894 bytes .../res/drawable-xxhdpi/ic_voicemail_avatar.png | Bin 6206 -> 7976 bytes .../res/drawable-xxxhdpi/ic_voicemail_avatar.png | Bin 8570 -> 11277 bytes .../dialer/app/calllog/PhoneAccountHandles.java | 15 --- .../app/voicemail/error/VoicemailErrorAlert.java | 2 +- .../res/layout/voicemai_error_message_fragment.xml | 113 ++++++++++++++++++++ .../layout/voicemail_error_message_fragment.xml | 113 -------------------- .../android/dialer/binary/aosp/AndroidManifest.xml | 116 +++++++++++++++++++++ .../dialer/calldetails/CallDetailsAdapter.java | 5 +- .../res/drawable/multimedia_image_background.xml | 2 +- .../res/layout/call_details_activity.xml | 33 +++--- .../calldetails/res/layout/contact_container.xml | 33 +++--- .../calldetails/res/layout/ec_data_container.xml | 34 +++--- .../dialer/calldetails/res/values/dimens.xml | 2 +- .../dialer/calllogutils/res/values/colors.xml | 2 +- .../dialer/calllogutils/res/values/strings.xml | 8 +- java/com/android/dialer/debug/AndroidManifest.xml | 3 + .../dialer/debug/bindings/impl/DebugBindings.java | 32 ++++++ .../dialer/debug/bindings/stub/DebugBindings.java | 27 +++++ .../android/dialer/debug/impl/AndroidManifest.xml | 18 ++++ .../android/dialer/debug/impl/DebugConnection.java | 55 ++++++++++ .../dialer/debug/impl/DebugConnectionService.java | 103 ++++++++++++++++++ .../enrichedcall/FuzzyPhoneNumberMatcher.java | 15 --- .../enrichedcall/historyquery/HistoryQuery.java | 15 --- .../videoshare/VideoShareListener.java | 15 --- java/com/android/dialer/oem/MotorolaUtils.java | 15 --- .../simulator/impl/SimulatorActionProvider.java | 10 -- .../com/android/dialer/theme/res/values/dimens.xml | 4 +- .../impl/answermethod/FlingUpDownMethod.java | 4 + .../impl/GoogleLocationSettingHelper.java | 3 +- .../incallui/calllocation/impl/HttpFetcher.java | 2 + .../incallui/incall/impl/FakeDragAnimation.java | 62 +++++++++++ .../incallui/incall/impl/InCallFragment.java | 15 ++- .../voicemail/impl/sync/OmtpVvmSyncService.java | 2 +- .../voicemail/impl/sync/VoicemailsQueryHelper.java | 5 +- 37 files changed, 604 insertions(+), 279 deletions(-) create mode 100644 java/com/android/dialer/app/voicemail/error/res/layout/voicemai_error_message_fragment.xml delete mode 100644 java/com/android/dialer/app/voicemail/error/res/layout/voicemail_error_message_fragment.xml create mode 100644 java/com/android/dialer/binary/aosp/AndroidManifest.xml create mode 100644 java/com/android/dialer/debug/AndroidManifest.xml create mode 100644 java/com/android/dialer/debug/bindings/impl/DebugBindings.java create mode 100644 java/com/android/dialer/debug/bindings/stub/DebugBindings.java create mode 100644 java/com/android/dialer/debug/impl/AndroidManifest.xml create mode 100644 java/com/android/dialer/debug/impl/DebugConnection.java create mode 100644 java/com/android/dialer/debug/impl/DebugConnectionService.java create mode 100644 java/com/android/incallui/incall/impl/FakeDragAnimation.java (limited to 'java') diff --git a/java/com/android/contacts/common/res/drawable-hdpi/ic_voicemail_avatar.png b/java/com/android/contacts/common/res/drawable-hdpi/ic_voicemail_avatar.png index 2121878ae..c74bfab13 100644 Binary files a/java/com/android/contacts/common/res/drawable-hdpi/ic_voicemail_avatar.png and b/java/com/android/contacts/common/res/drawable-hdpi/ic_voicemail_avatar.png differ diff --git a/java/com/android/contacts/common/res/drawable-mdpi/ic_voicemail_avatar.png b/java/com/android/contacts/common/res/drawable-mdpi/ic_voicemail_avatar.png index a7875c5de..a5a30213d 100644 Binary files a/java/com/android/contacts/common/res/drawable-mdpi/ic_voicemail_avatar.png and b/java/com/android/contacts/common/res/drawable-mdpi/ic_voicemail_avatar.png differ diff --git a/java/com/android/contacts/common/res/drawable-xhdpi/ic_voicemail_avatar.png b/java/com/android/contacts/common/res/drawable-xhdpi/ic_voicemail_avatar.png index 8dc1d595b..ca9d7d66b 100644 Binary files a/java/com/android/contacts/common/res/drawable-xhdpi/ic_voicemail_avatar.png and b/java/com/android/contacts/common/res/drawable-xhdpi/ic_voicemail_avatar.png differ diff --git a/java/com/android/contacts/common/res/drawable-xxhdpi/ic_voicemail_avatar.png b/java/com/android/contacts/common/res/drawable-xxhdpi/ic_voicemail_avatar.png index 5d22cbeea..d0979e9eb 100644 Binary files a/java/com/android/contacts/common/res/drawable-xxhdpi/ic_voicemail_avatar.png and b/java/com/android/contacts/common/res/drawable-xxhdpi/ic_voicemail_avatar.png differ diff --git a/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_voicemail_avatar.png b/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_voicemail_avatar.png index 762b63648..1d6e1aa0f 100644 Binary files a/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_voicemail_avatar.png and b/java/com/android/contacts/common/res/drawable-xxxhdpi/ic_voicemail_avatar.png differ diff --git a/java/com/android/dialer/app/calllog/PhoneAccountHandles.java b/java/com/android/dialer/app/calllog/PhoneAccountHandles.java index b0fa1ed45..6d51b853c 100644 --- a/java/com/android/dialer/app/calllog/PhoneAccountHandles.java +++ b/java/com/android/dialer/app/calllog/PhoneAccountHandles.java @@ -1,18 +1,3 @@ -/* - * 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.dialer.app.calllog; import android.content.ComponentName; diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java index 628ef87eb..d34a0f3c7 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java @@ -56,7 +56,7 @@ public class VoicemailErrorAlert { this.modalAlertManager = modalAlertManager; this.messageCreator = messageCreator; - view = alertManager.inflate(R.layout.voicemail_error_message_fragment); + view = alertManager.inflate(R.layout.voicemai_error_message_fragment); header = (TextView) view.findViewById(R.id.error_card_header); details = (TextView) view.findViewById(R.id.error_card_details); primaryAction = (TextView) view.findViewById(R.id.primary_action); diff --git a/java/com/android/dialer/app/voicemail/error/res/layout/voicemai_error_message_fragment.xml b/java/com/android/dialer/app/voicemail/error/res/layout/voicemai_error_message_fragment.xml new file mode 100644 index 000000000..4a40857a0 --- /dev/null +++ b/java/com/android/dialer/app/voicemail/error/res/layout/voicemai_error_message_fragment.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_error_message_fragment.xml b/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_error_message_fragment.xml deleted file mode 100644 index 4a40857a0..000000000 --- a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_error_message_fragment.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/com/android/dialer/binary/aosp/AndroidManifest.xml b/java/com/android/dialer/binary/aosp/AndroidManifest.xml new file mode 100644 index 000000000..63edb8397 --- /dev/null +++ b/java/com/android/dialer/binary/aosp/AndroidManifest.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/calldetails/CallDetailsAdapter.java b/java/com/android/dialer/calldetails/CallDetailsAdapter.java index 7471c9c1e..954583077 100644 --- a/java/com/android/dialer/calldetails/CallDetailsAdapter.java +++ b/java/com/android/dialer/calldetails/CallDetailsAdapter.java @@ -71,12 +71,11 @@ public class CallDetailsAdapter extends RecyclerView.Adapter 0 && position != getItemCount() - 2); + position != getItemCount() - 2); } } diff --git a/java/com/android/dialer/calldetails/res/drawable/multimedia_image_background.xml b/java/com/android/dialer/calldetails/res/drawable/multimedia_image_background.xml index 8182e247a..421bdbfee 100644 --- a/java/com/android/dialer/calldetails/res/drawable/multimedia_image_background.xml +++ b/java/com/android/dialer/calldetails/res/drawable/multimedia_image_background.xml @@ -16,5 +16,5 @@ --> - + diff --git a/java/com/android/dialer/calldetails/res/layout/call_details_activity.xml b/java/com/android/dialer/calldetails/res/layout/call_details_activity.xml index 79f283705..038a8745e 100644 --- a/java/com/android/dialer/calldetails/res/layout/call_details_activity.xml +++ b/java/com/android/dialer/calldetails/res/layout/call_details_activity.xml @@ -14,25 +14,24 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> - + + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="@color/dialer_theme_color" + android:elevation="4dp" + android:titleTextAppearance="@style/toolbar_title_text" + android:title="@string/call_details" + android:navigationIcon="@drawable/quantum_ic_arrow_back_white_24"/> + android:id="@+id/recycler_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/background_dialer_white"/> \ No newline at end of file diff --git a/java/com/android/dialer/calldetails/res/layout/contact_container.xml b/java/com/android/dialer/calldetails/res/layout/contact_container.xml index bcda55e11..95fe189b2 100644 --- a/java/com/android/dialer/calldetails/res/layout/contact_container.xml +++ b/java/com/android/dialer/calldetails/res/layout/contact_container.xml @@ -18,7 +18,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/call_details_top_margin" android:gravity="center_vertical" android:padding="@dimen/contact_container_padding"> @@ -26,31 +25,27 @@ android:id="@+id/quick_contact_photo" android:layout_width="@dimen/call_details_contact_photo_size" android:layout_height="@dimen/call_details_contact_photo_size" - android:layout_marginTop="2dp" android:focusable="true"/> - + style="@style/PrimaryText"/> - - - - + - @@ -9,7 +8,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" - android:layout_marginStart="1dp" android:maxLines="2" style="@style/SecondaryText"/> @@ -24,21 +22,21 @@ android:outlineProvider="background" android:visibility="gone"> - + - + \ No newline at end of file diff --git a/java/com/android/dialer/calldetails/res/values/dimens.xml b/java/com/android/dialer/calldetails/res/values/dimens.xml index 59f237103..b1a8f1c8e 100644 --- a/java/com/android/dialer/calldetails/res/values/dimens.xml +++ b/java/com/android/dialer/calldetails/res/values/dimens.xml @@ -15,9 +15,9 @@ ~ limitations under the License --> + 2dp 16sp 14sp - 6dp 16dp diff --git a/java/com/android/dialer/calllogutils/res/values/colors.xml b/java/com/android/dialer/calllogutils/res/values/colors.xml index e0e6fb2a5..dc4ec2493 100644 --- a/java/com/android/dialer/calllogutils/res/values/colors.xml +++ b/java/com/android/dialer/calllogutils/res/values/colors.xml @@ -16,7 +16,7 @@ --> - #C53929 + #ff2e58 #00c853 diff --git a/java/com/android/dialer/calllogutils/res/values/strings.xml b/java/com/android/dialer/calllogutils/res/values/strings.xml index 01a5a9b87..6a6f10113 100644 --- a/java/com/android/dialer/calllogutils/res/values/strings.xml +++ b/java/com/android/dialer/calllogutils/res/values/strings.xml @@ -82,9 +82,9 @@ Voicemail - - %sm %ss + + %s min %s sec - - %ss + + %s sec \ No newline at end of file diff --git a/java/com/android/dialer/debug/AndroidManifest.xml b/java/com/android/dialer/debug/AndroidManifest.xml new file mode 100644 index 000000000..053d7e789 --- /dev/null +++ b/java/com/android/dialer/debug/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/java/com/android/dialer/debug/bindings/impl/DebugBindings.java b/java/com/android/dialer/debug/bindings/impl/DebugBindings.java new file mode 100644 index 000000000..a8b44605c --- /dev/null +++ b/java/com/android/dialer/debug/bindings/impl/DebugBindings.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2016 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.dialer.debug.bindings; + +import android.content.Context; +import com.android.dialer.debug.impl.DebugConnectionService; + +/** Hooks into the debug module. */ +public class DebugBindings { + + public static void registerConnectionService(Context context) { + DebugConnectionService.register(context); + } + + public static void addNewIncomingCall(Context context, String phoneNumber) { + DebugConnectionService.addNewIncomingCall(context, phoneNumber); + } +} diff --git a/java/com/android/dialer/debug/bindings/stub/DebugBindings.java b/java/com/android/dialer/debug/bindings/stub/DebugBindings.java new file mode 100644 index 000000000..7df38341d --- /dev/null +++ b/java/com/android/dialer/debug/bindings/stub/DebugBindings.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2016 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.dialer.debug.bindings; + +import android.content.Context; + +/** Hooks into the debug module. */ +public class DebugBindings { + + public static void registerConnectionService(Context context) {} + + public static void addNewIncomingCall(Context context, String phoneNumber) {} +} diff --git a/java/com/android/dialer/debug/impl/AndroidManifest.xml b/java/com/android/dialer/debug/impl/AndroidManifest.xml new file mode 100644 index 000000000..b8756614b --- /dev/null +++ b/java/com/android/dialer/debug/impl/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/debug/impl/DebugConnection.java b/java/com/android/dialer/debug/impl/DebugConnection.java new file mode 100644 index 000000000..2ef83aa76 --- /dev/null +++ b/java/com/android/dialer/debug/impl/DebugConnection.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 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.dialer.debug.impl; + +import android.telecom.Connection; +import android.telecom.DisconnectCause; +import com.android.dialer.common.LogUtil; + +class DebugConnection extends Connection { + + @Override + public void onAnswer() { + LogUtil.i("DebugConnection.onAnswer", null); + setActive(); + } + + @Override + public void onReject() { + LogUtil.i("DebugConnection.onReject", null); + setDisconnected(new DisconnectCause(DisconnectCause.REJECTED)); + } + + @Override + public void onHold() { + LogUtil.i("DebugConnection.onHold", null); + setOnHold(); + } + + @Override + public void onUnhold() { + LogUtil.i("DebugConnection.onUnhold", null); + setActive(); + } + + @Override + public void onDisconnect() { + LogUtil.i("DebugConnection.onDisconnect", null); + setDisconnected(new DisconnectCause(DisconnectCause.LOCAL)); + destroy(); + } +} diff --git a/java/com/android/dialer/debug/impl/DebugConnectionService.java b/java/com/android/dialer/debug/impl/DebugConnectionService.java new file mode 100644 index 000000000..69aab1e13 --- /dev/null +++ b/java/com/android/dialer/debug/impl/DebugConnectionService.java @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2016 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.dialer.debug.impl; + +import android.content.ComponentName; +import android.content.Context; +import android.net.Uri; +import android.os.Bundle; +import android.telecom.Connection; +import android.telecom.ConnectionRequest; +import android.telecom.ConnectionService; +import android.telecom.PhoneAccount; +import android.telecom.PhoneAccountHandle; +import android.telecom.TelecomManager; +import android.telephony.TelephonyManager; +import com.android.dialer.common.LogUtil; +import java.util.ArrayList; +import java.util.List; + +/** Simple connection provider to create an incoming call. This is useful for emulators. */ +public class DebugConnectionService extends ConnectionService { + + private static final String PHONE_ACCOUNT_ID = "DEBUG_DIALER"; + + public static void register(Context context) { + LogUtil.i( + "DebugConnectionService.register", + context.getSystemService(Context.TELECOM_SERVICE).toString()); + context.getSystemService(TelecomManager.class).registerPhoneAccount(buildPhoneAccount(context)); + } + + public static void addNewIncomingCall(Context context, String phoneNumber) { + LogUtil.i("DebugConnectionService.addNewIncomingCall", null); + Bundle bundle = new Bundle(); + bundle.putString(TelephonyManager.EXTRA_INCOMING_NUMBER, phoneNumber); + try { + context + .getSystemService(TelecomManager.class) + .addNewIncomingCall(getConnectionServiceHandle(context), bundle); + } catch (SecurityException e) { + LogUtil.i( + "DebugConnectionService.addNewIncomingCall", + "unable to add call. Make sure to enable the service in Phone app -> Settings -> Calls ->" + + " Calling accounts."); + } + } + + private static PhoneAccount buildPhoneAccount(Context context) { + PhoneAccount.Builder builder = + new PhoneAccount.Builder( + getConnectionServiceHandle(context), "DebugDialerConnectionService"); + List uriSchemes = new ArrayList<>(); + uriSchemes.add(PhoneAccount.SCHEME_TEL); + + return builder + .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) + .setShortDescription("Debug Dialer Connection Serivce") + .setSupportedUriSchemes(uriSchemes) + .build(); + } + + private static PhoneAccountHandle getConnectionServiceHandle(Context context) { + ComponentName componentName = new ComponentName(context, DebugConnectionService.class); + return new PhoneAccountHandle(componentName, PHONE_ACCOUNT_ID); + } + + private static Uri getPhoneNumber(ConnectionRequest request) { + String phoneNumber = request.getExtras().getString(TelephonyManager.EXTRA_INCOMING_NUMBER); + return Uri.fromParts(PhoneAccount.SCHEME_TEL, phoneNumber, null); + } + + @Override + public Connection onCreateOutgoingConnection( + PhoneAccountHandle phoneAccount, ConnectionRequest request) { + return null; + } + + @Override + public Connection onCreateIncomingConnection( + PhoneAccountHandle phoneAccount, ConnectionRequest request) { + LogUtil.i("DebugConnectionService.onCreateIncomingConnection", null); + DebugConnection connection = new DebugConnection(); + connection.setRinging(); + connection.setAddress(getPhoneNumber(request), TelecomManager.PRESENTATION_ALLOWED); + connection.setConnectionCapabilities( + Connection.CAPABILITY_MUTE | Connection.CAPABILITY_SUPPORT_HOLD); + return connection; + } +} diff --git a/java/com/android/dialer/enrichedcall/FuzzyPhoneNumberMatcher.java b/java/com/android/dialer/enrichedcall/FuzzyPhoneNumberMatcher.java index 250c64313..f589f94a6 100644 --- a/java/com/android/dialer/enrichedcall/FuzzyPhoneNumberMatcher.java +++ b/java/com/android/dialer/enrichedcall/FuzzyPhoneNumberMatcher.java @@ -1,18 +1,3 @@ -/* - * 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.dialer.enrichedcall; import android.support.annotation.NonNull; diff --git a/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java b/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java index e61c79ec8..b7593cebb 100644 --- a/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java +++ b/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java @@ -1,18 +1,3 @@ -/* - * 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.dialer.enrichedcall.historyquery; import android.support.annotation.NonNull; diff --git a/java/com/android/dialer/enrichedcall/videoshare/VideoShareListener.java b/java/com/android/dialer/enrichedcall/videoshare/VideoShareListener.java index f24724afd..bcc387a3f 100644 --- a/java/com/android/dialer/enrichedcall/videoshare/VideoShareListener.java +++ b/java/com/android/dialer/enrichedcall/videoshare/VideoShareListener.java @@ -1,18 +1,3 @@ -/* - * 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.dialer.enrichedcall.videoshare; import android.support.annotation.MainThread; diff --git a/java/com/android/dialer/oem/MotorolaUtils.java b/java/com/android/dialer/oem/MotorolaUtils.java index e31ec98b8..29bf0b23d 100644 --- a/java/com/android/dialer/oem/MotorolaUtils.java +++ b/java/com/android/dialer/oem/MotorolaUtils.java @@ -1,18 +1,3 @@ -/* - * 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.dialer.oem; import android.content.Context; diff --git a/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java b/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java index 4acb548a6..6cd573361 100644 --- a/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java +++ b/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java @@ -17,9 +17,7 @@ package com.android.dialer.simulator.impl; import android.content.Context; -import android.content.Intent; import android.os.AsyncTask; -import android.provider.VoicemailContract; import android.support.annotation.NonNull; import android.view.ActionProvider; import android.view.MenuItem; @@ -74,14 +72,6 @@ final class SimulatorActionProvider extends ActionProvider { populateDatabase(); return true; }); - subMenu - .add("Sync Voicemail") - .setOnMenuItemClickListener( - (item) -> { - Intent intent = new Intent(VoicemailContract.ACTION_SYNC_VOICEMAIL); - context.sendBroadcast(intent); - return true; - }); } private void populateDatabase() { diff --git a/java/com/android/dialer/theme/res/values/dimens.xml b/java/com/android/dialer/theme/res/values/dimens.xml index 373b33dfc..fa750c625 100644 --- a/java/com/android/dialer/theme/res/values/dimens.xml +++ b/java/com/android/dialer/theme/res/values/dimens.xml @@ -26,8 +26,8 @@ 107dp 72dp - 14sp - 12sp + 20sp + 14sp 4dp diff --git a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java index 587b923c4..6e8e1f7bf 100644 --- a/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java +++ b/java/com/android/incallui/answer/impl/answermethod/FlingUpDownMethod.java @@ -388,6 +388,10 @@ public class FlingUpDownMethod extends AnswerMethod implements OnProgressChanged // Since the animation progression is controlled by user gesture instead of real timeline, the // 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/calllocation/impl/GoogleLocationSettingHelper.java b/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java index bcb3e8dbb..18a80b8ce 100644 --- a/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java +++ b/java/com/android/incallui/calllocation/impl/GoogleLocationSettingHelper.java @@ -28,7 +28,8 @@ import android.provider.Settings.SettingNotFoundException; import com.android.dialer.common.LogUtil; /** - * Helper class to check if Google Location Services is enabled. + * 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 c4aaa2257..7bfbaa6ef 100644 --- a/java/com/android/incallui/calllocation/impl/HttpFetcher.java +++ b/java/com/android/incallui/calllocation/impl/HttpFetcher.java @@ -223,6 +223,8 @@ public class HttpFetcher { /** * Lookup up url re-write rules from gServices and apply to the given url. * + *

https://wiki.corp.google.com/twiki/bin/view/Main/AndroidGservices#URL_Rewriting_Rules + * * @return The new url. */ private static URL reWriteUrl(Context context, String url) { diff --git a/java/com/android/incallui/incall/impl/FakeDragAnimation.java b/java/com/android/incallui/incall/impl/FakeDragAnimation.java new file mode 100644 index 000000000..c84c3c409 --- /dev/null +++ b/java/com/android/incallui/incall/impl/FakeDragAnimation.java @@ -0,0 +1,62 @@ +/* + * 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.incall.impl; + +import android.animation.ValueAnimator; +import android.animation.ValueAnimator.AnimatorUpdateListener; +import android.support.v4.view.ViewPager; +import android.support.v4.view.animation.FastOutSlowInInterpolator; + +/** + * An animation that controls the fake drag of a {@link ViewPager}. See {@link + * ViewPager#fakeDragBy(float)} for more details. + */ +public class FakeDragAnimation implements AnimatorUpdateListener { + + /** The view to animate. */ + private final ViewPager pager; + + private final ValueAnimator animator; + private int oldDragPosition; + + public FakeDragAnimation(ViewPager pager) { + this.pager = pager; + animator = ValueAnimator.ofInt(0, pager.getWidth()); + animator.addUpdateListener(this); + animator.setInterpolator(new FastOutSlowInInterpolator()); + animator.setDuration(600); + } + + public void start() { + animator.start(); + } + + @Override + public void onAnimationUpdate(ValueAnimator animation) { + if (!pager.isFakeDragging()) { + pager.beginFakeDrag(); + } + int dragPosition = (Integer) animation.getAnimatedValue(); + int dragOffset = dragPosition - oldDragPosition; + oldDragPosition = dragPosition; + pager.fakeDragBy(-dragOffset); + + if (animation.getAnimatedFraction() == 1) { + pager.endFakeDrag(); + } + } +} diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index b6ae4902a..3f31651a0 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -253,16 +253,13 @@ public class InCallFragment extends Fragment if (!stateRestored) { new Handler() .postDelayed( - new Runnable() { - @Override - public void run() { - // In order to prevent user confusion and educate the user on our UI, we animate - // the view pager to the button grid after 2 seconds show them when the UI is - // that they are more familiar with. - pager.setCurrentItem(adapter.getButtonGridPosition()); - } + () -> { + // In order to prevent user confusion and educate the user on our UI, we animate + // the view pager to the button grid after a short period to show them where the + // UI that they are more familiar with is located. + new FakeDragAnimation(pager).start(); }, - 2000); + 333); } } else { tabLayout.setVisibility(View.GONE); diff --git a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java index 2c706d2a8..c255019fc 100644 --- a/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java +++ b/java/com/android/voicemail/impl/sync/OmtpVvmSyncService.java @@ -180,7 +180,7 @@ public class OmtpVvmSyncService { // The number of voicemails that exceed our threshold and should be deleted from the server int numVoicemails = imapHelper.getOccuupiedQuota() - - (int) (AUTO_DELETE_ARCHIVE_VM_THRESHOLD * imapHelper.getTotalQuota()); + - ((int) AUTO_DELETE_ARCHIVE_VM_THRESHOLD * imapHelper.getTotalQuota()); List oldestVoicemails = mQueryHelper.oldestVoicemailsOnServer(numVoicemails); if (!oldestVoicemails.isEmpty()) { mQueryHelper.markArchivedInDatabase(oldestVoicemails); diff --git a/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java b/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java index fc8119a80..d129406ff 100644 --- a/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java +++ b/java/com/android/voicemail/impl/sync/VoicemailsQueryHelper.java @@ -272,15 +272,14 @@ public class VoicemailsQueryHelper { String sortAndLimit = "date ASC limit " + numVoicemails; try (Cursor cursor = - mContentResolver.query(mSourceUri, PROJECTION, ARCHIVED_SELECTION, null, sortAndLimit)) { + mContentResolver.query(mSourceUri, null, ARCHIVED_SELECTION, null, sortAndLimit)) { Assert.isNotNull(cursor); List voicemails = new ArrayList<>(); while (cursor.moveToNext()) { - final long id = cursor.getLong(_ID); final String sourceData = cursor.getString(SOURCE_DATA); - Voicemail voicemail = Voicemail.createForUpdate(id, sourceData).build(); + Voicemail voicemail = Voicemail.createForUpdate(cursor.getLong(_ID), sourceData).build(); voicemails.add(voicemail); } -- cgit v1.2.3