Loading java/com/android/dialer/precall/impl/CallingAccountSelector.java +11 −14 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.annotation.WorkerThread; import android.support.v4.util.ArraySet; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; Loading Loading @@ -67,7 +66,6 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; import java.util.List; import java.util.Set; /** PreCallAction to select which phone account to call with. Ignored if there's only one account */ @SuppressWarnings("MissingPermission") Loading Loading @@ -353,24 +351,23 @@ public class CallingAccountSelector implements PreCallAction { return Optional.absent(); } ImmutableSet<String> validAccountTypes = PreferredAccountUtil.getValidAccountTypes(context); Set<String> result = new ArraySet<>(); String result = null; while (cursor.moveToNext()) { Optional<String> accountType = getAccountType(context.getContentResolver(), cursor.getLong(0)); if (accountType.isPresent() && validAccountTypes.contains(accountType.get())) { result.add(cursor.getString(0)); } else { if (!accountType.isPresent() || !validAccountTypes.contains(accountType.get())) { LogUtil.i("CallingAccountSelector.getDataId", "ignoring non-writable " + accountType); continue; } } // TODO(twyen): if there are multiples attempt to grab from the contact that initiated the // call. if (result.size() == 1) { return Optional.of(result.iterator().next()); } else { if (result != null && !result.equals(cursor.getString(0))) { // TODO(twyen): if there are multiple entries attempt to grab from the contact that // initiated the call. LogUtil.i("CallingAccountSelector.getDataId", "lookup result not unique, ignoring"); return Optional.absent(); } result = cursor.getString(0); } return Optional.fromNullable(result); } } Loading Loading
java/com/android/dialer/precall/impl/CallingAccountSelector.java +11 −14 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.annotation.WorkerThread; import android.support.v4.util.ArraySet; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; Loading Loading @@ -67,7 +66,6 @@ import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import java.util.ArrayList; import java.util.List; import java.util.Set; /** PreCallAction to select which phone account to call with. Ignored if there's only one account */ @SuppressWarnings("MissingPermission") Loading Loading @@ -353,24 +351,23 @@ public class CallingAccountSelector implements PreCallAction { return Optional.absent(); } ImmutableSet<String> validAccountTypes = PreferredAccountUtil.getValidAccountTypes(context); Set<String> result = new ArraySet<>(); String result = null; while (cursor.moveToNext()) { Optional<String> accountType = getAccountType(context.getContentResolver(), cursor.getLong(0)); if (accountType.isPresent() && validAccountTypes.contains(accountType.get())) { result.add(cursor.getString(0)); } else { if (!accountType.isPresent() || !validAccountTypes.contains(accountType.get())) { LogUtil.i("CallingAccountSelector.getDataId", "ignoring non-writable " + accountType); continue; } } // TODO(twyen): if there are multiples attempt to grab from the contact that initiated the // call. if (result.size() == 1) { return Optional.of(result.iterator().next()); } else { if (result != null && !result.equals(cursor.getString(0))) { // TODO(twyen): if there are multiple entries attempt to grab from the contact that // initiated the call. LogUtil.i("CallingAccountSelector.getDataId", "lookup result not unique, ignoring"); return Optional.absent(); } result = cursor.getString(0); } return Optional.fromNullable(result); } } Loading