summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/shortcuts
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-08-31 06:57:16 -0700
committerRoland Levillain <rpl@google.com>2017-09-04 18:05:19 +0100
commitfc0eb8ccebcc7846db5e8b5c5430070055679bfa (patch)
treea8a23c3202e4161ffd57a71095a404db1bcf5735 /java/com/android/dialer/shortcuts
parentea7b4dc89590ffa3332766a531e0eab6ffb9aebd (diff)
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. (cherry picked from commit 2ca4318cc1ee57dda907ba2069bd61d162b1baef and amended to match paths of dependencies under prebuilts/maven_repo/bumptech/com/github/bumptech/glide/.) This CL was generated using these commands from a repository at stage-stage-master at revision ea7b4dc89590ffa3332766a531e0eab6ffb9aebd ("Merge "Update Dialer source to latest internal Google revision." am: c39ea3c55f -s ours"): git diff --binary 2ca4318cc1ee57dda907ba2069bd61d162b1baef | git apply -R --index git commit -c 2ca4318cc1ee57dda907ba2069bd61d162b1baef Test: make, flash install, run Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/dialer/shortcuts')
-rw-r--r--java/com/android/dialer/shortcuts/CallContactActivity.java1
-rw-r--r--java/com/android/dialer/shortcuts/IconFactory.java2
-rw-r--r--java/com/android/dialer/shortcuts/ShortcutRefresher.java31
-rw-r--r--java/com/android/dialer/shortcuts/res/values/strings.xml6
4 files changed, 14 insertions, 26 deletions
diff --git a/java/com/android/dialer/shortcuts/CallContactActivity.java b/java/com/android/dialer/shortcuts/CallContactActivity.java
index b80797984..87f6fcedc 100644
--- a/java/com/android/dialer/shortcuts/CallContactActivity.java
+++ b/java/com/android/dialer/shortcuts/CallContactActivity.java
@@ -70,6 +70,7 @@ public class CallContactActivity extends TransactionSafeActivity
private void makeCall() {
CallSpecificAppData callSpecificAppData =
CallSpecificAppData.newBuilder()
+ .setAllowAssistedDialing(true)
.setCallInitiationType(CallInitiationType.Type.LAUNCHER_SHORTCUT)
.build();
PhoneNumberInteraction.startInteractionForPhoneCall(
diff --git a/java/com/android/dialer/shortcuts/IconFactory.java b/java/com/android/dialer/shortcuts/IconFactory.java
index 4ec964c7b..7aad1129a 100644
--- a/java/com/android/dialer/shortcuts/IconFactory.java
+++ b/java/com/android/dialer/shortcuts/IconFactory.java
@@ -33,8 +33,8 @@ import android.support.annotation.RequiresApi;
import android.support.annotation.WorkerThread;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
-import com.android.contacts.common.lettertiles.LetterTileDrawable;
import com.android.dialer.common.Assert;
+import com.android.dialer.lettertile.LetterTileDrawable;
import com.android.dialer.util.DrawableConverter;
import java.io.InputStream;
diff --git a/java/com/android/dialer/shortcuts/ShortcutRefresher.java b/java/com/android/dialer/shortcuts/ShortcutRefresher.java
index 120382dc5..496f3f02a 100644
--- a/java/com/android/dialer/shortcuts/ShortcutRefresher.java
+++ b/java/com/android/dialer/shortcuts/ShortcutRefresher.java
@@ -20,21 +20,17 @@ import android.content.Context;
import android.os.Build;
import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
-import android.support.annotation.WorkerThread;
import com.android.contacts.common.list.ContactEntry;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
-import com.android.dialer.common.concurrent.AsyncTaskExecutor;
-import com.android.dialer.common.concurrent.AsyncTaskExecutors;
-import com.android.dialer.common.concurrent.FallibleAsyncTask;
+import com.android.dialer.common.concurrent.DialerExecutor.Worker;
+import com.android.dialer.common.concurrent.DialerExecutors;
import java.util.ArrayList;
import java.util.List;
/** Refreshes launcher shortcuts from UI components using provided list of contacts. */
public final class ShortcutRefresher {
- private static final AsyncTaskExecutor EXECUTOR = AsyncTaskExecutors.createThreadPoolExecutor();
-
/** Asynchronously updates launcher shortcuts using the provided list of contacts. */
@MainThread
public static void refresh(@NonNull Context context, List<ContactEntry> contacts) {
@@ -49,36 +45,27 @@ public final class ShortcutRefresher {
return;
}
- //noinspection unchecked
- EXECUTOR.submit(Task.ID, new Task(context), new ArrayList<>(contacts));
+ DialerExecutors.createNonUiTaskBuilder(new RefreshWorker(context))
+ .build()
+ .executeSerial(new ArrayList<>(contacts));
}
- private static final class Task extends FallibleAsyncTask<List<ContactEntry>, Void, Void> {
- private static final String ID = "ShortcutRefresher.Task";
-
+ private static final class RefreshWorker implements Worker<List<ContactEntry>, Void> {
private final Context context;
- Task(Context context) {
+ RefreshWorker(Context context) {
this.context = context;
}
- /**
- * @param params array containing exactly one element, the list of contacts from favorites
- * tiles, ordered in tile order.
- */
- @SafeVarargs
@Override
- @NonNull
- @WorkerThread
- protected final Void doInBackgroundFallible(List<ContactEntry>... params) {
- Assert.isWorkerThread();
+ public Void doInBackground(List<ContactEntry> contacts) {
LogUtil.enterBlock("ShortcutRefresher.Task.doInBackground");
// Only dynamic shortcuts are maintained from UI components. Pinned shortcuts are maintained
// by the job scheduler. This is because a pinned contact may not necessarily still be in the
// favorites tiles, so refreshing it would require an additional database query. We don't want
// to incur the cost of that extra database query every time the favorites tiles change.
- new DynamicShortcuts(context, new IconFactory(context)).refresh(params[0]); // Blocking
+ new DynamicShortcuts(context, new IconFactory(context)).refresh(contacts); // Blocking
return null;
}
diff --git a/java/com/android/dialer/shortcuts/res/values/strings.xml b/java/com/android/dialer/shortcuts/res/values/strings.xml
index 5f14a8100..b3ff190d9 100644
--- a/java/com/android/dialer/shortcuts/res/values/strings.xml
+++ b/java/com/android/dialer/shortcuts/res/values/strings.xml
@@ -14,12 +14,12 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Text to display in launcher shortcut for adding a new contact. Short version. [CHAR LIMIT=10] -->
- <string name="dialer_shortcut_add_contact_short">New contact</string>
+ <string name="dialer_shortcut_add_contact_short" tools:ignore="UnusedResources">New contact</string>
<!-- Text to display in launcher shortcut for adding a new contact. Long version. [CHAR LIMIT=25] -->
- <string name="dialer_shortcut_add_contact_long">New contact</string>
+ <string name="dialer_shortcut_add_contact_long" tools:ignore="UnusedResources">New contact</string>
<!-- Message to display when the user taps a pinned launcher shortcut (on a
homescreen) which has been disabled. A shortcut may be disabled if the