Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4264575 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ic71e99ed,Ic7dec5ee,If801b452,Iecb99c65,I8db7e08b, ...

* changes:
  Support GID1 for VVM configs
  Add VVM Config for Bouygues FR
  Fix new special codes
  Handle concurrently deleted rows in all updateSmartDialDatabase cursors
  Deleted some unused classes
  Replace ContactPhotoManager with GlidePhotoManager in new call log.
  Fix glide makefile
parents dd4c4e0b 981a3e9d
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
	dialer-mime4j-dom-target \
	dialer-error-prone-target \
	dialer-guava-target \
	dialer-glide-target \
	dialer-glide-annotation-target \
	jsr305 \
	libbackup \
	libphonenumber \
@@ -130,11 +132,12 @@ LOCAL_JAVA_LIBRARIES := \

LOCAL_ANNOTATION_PROCESSORS := \
	dialer-auto-value \
	dialer-javapoet \
	dialer-dagger2 \
	dialer-dagger2-compiler \
	dialer-dagger2-producers \
	dialer-glide-compiler \
	dialer-glide-annotation \
	dialer-glide-compiler \
	dialer-guava \
	dialer-javax-annotation-api \
	dialer-javax-inject \
@@ -197,7 +200,8 @@ LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
    dialer-grpc-stub:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-stub/1.0.3/grpc-stub-1.0.3.jar \
    dialer-guava:../../../prebuilts/tools/common/m2/repository/com/google/guava/guava/23.0/guava-23.0.jar \
    dialer-javax-annotation-api:../../../prebuilts/tools/common/m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar \
    dialer-javax-inject:../../../prebuilts/tools/common/m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
    dialer-javax-inject:../../../prebuilts/tools/common/m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar \
    dialer-javapoet:../../../prebuilts/tools/common/m2/repository/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar \

include $(BUILD_HOST_PREBUILT)

@@ -265,6 +269,16 @@ include $(BUILD_PREBUILT)

include $(CLEAR_VARS)

LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := dialer-glide-annotation-target
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/annotation/SNAPSHOT/annotation-SNAPSHOT.jar
LOCAL_UNINSTALLABLE_MODULE := true

include $(BUILD_PREBUILT)

include $(CLEAR_VARS)

LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := dialer-javax-annotation-api-target
LOCAL_SDK_VERSION := current
+24 −1
Original line number Diff line number Diff line
@@ -375,7 +375,9 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {

      do {
        if (deletedContactCursor.isNull(DeleteContactQuery.DELETED_CONTACT_ID)) {
          LogUtil.i("DialerDatabaseHelper.removeDeletedContacts", "null contact id, skipping row");
          LogUtil.i(
              "DialerDatabaseHelper.removeDeletedContacts",
              "contact_id column null. Row was deleted during iteration, skipping");
          continue;
        }

@@ -455,6 +457,13 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
    try {
      updatedContactCursor.moveToPosition(-1);
      while (updatedContactCursor.moveToNext()) {
        if (updatedContactCursor.isNull(UpdatedContactQuery.UPDATED_CONTACT_ID)) {
          LogUtil.i(
              "DialerDatabaseHelper.removeUpdatedContacts",
              "contact_id column null. Row was deleted during iteration, skipping");
          continue;
        }

        final Long contactId = updatedContactCursor.getLong(UpdatedContactQuery.UPDATED_CONTACT_ID);

        db.delete(Tables.SMARTDIAL_TABLE, SmartDialDbColumns.CONTACT_ID + "=" + contactId, null);
@@ -529,6 +538,13 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
      while (updatedContactCursor.moveToNext()) {
        insert.clearBindings();

        if (updatedContactCursor.isNull(PhoneQuery.PHONE_ID)) {
          LogUtil.i(
              "DialerDatabaseHelper.insertUpdatedContactsAndNumberPrefix",
              "_id column null. Row was deleted during iteration, skipping");
          continue;
        }

        // Handle string columns which can possibly be null first. In the case of certain
        // null columns (due to malformed rows possibly inserted by third-party apps
        // or sync adapters), skip the phone number row.
@@ -607,6 +623,13 @@ public class DialerDatabaseHelper extends SQLiteOpenHelper {
      final SQLiteStatement insert = db.compileStatement(sqlInsert);

      while (nameCursor.moveToNext()) {
        if (nameCursor.isNull(columnIndexContactId)) {
          LogUtil.i(
              "DialerDatabaseHelper.insertNamePrefixes",
              "contact_id column null. Row was deleted during iteration, skipping");
          continue;
        }

        /** Computes a list of prefixes of a given contact name. */
        final ArrayList<String> namePrefixes =
            SmartDialPrefix.generateNamePrefixes(context, nameCursor.getString(columnIndexName));
+2 −2
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ public class SpecialCharSequenceMgr {
        {
          add("*#07#");
          add("*#87#");
          add("#43#");
          add("*#43#");
          add("*#2727#");
          add("#88#");
          add("*#88#");
        }
      };

+0 −84
Original line number Diff line number Diff line
/*
 * 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.main.impl;

import android.content.Context;
import android.support.annotation.IntDef;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.android.dialer.calllog.ui.NewCallLogFragment;
import com.android.dialer.common.Assert;
import com.android.dialer.voicemail.listui.NewVoicemailFragment;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/** Adapter for {@link MainActivity} ViewPager. */
final class MainPagerAdapter extends FragmentPagerAdapter {

  @Retention(RetentionPolicy.SOURCE)
  @IntDef({
    TabIndex.SPEED_DIAL,
    TabIndex.HISTORY,
    TabIndex.VOICEMAIL,
  })
  private @interface TabIndex {
    int SPEED_DIAL = 0;
    int HISTORY = 1;
    int VOICEMAIL = 2;
  }

  private final Context context;

  MainPagerAdapter(Context context, FragmentManager fragmentManager) {
    super(fragmentManager);
    this.context = context;
  }

  @Override
  public int getCount() {
    // TODO(calderwoodra): add logic to hide/show voicemail tab
    return 3;
  }

  @Override
  public Fragment getItem(@TabIndex int position) {
    // TODO(calderwoodra): implement tabs
    switch (position) {
      case TabIndex.VOICEMAIL:
        return new NewVoicemailFragment();
      case TabIndex.HISTORY:
        return new NewCallLogFragment();
      default:
        return new StubFragment();
    }
  }

  @Override
  public CharSequence getPageTitle(int position) {
    switch (position) {
      case TabIndex.SPEED_DIAL:
        return context.getString(R.string.tab_title_speed_dial);
      case TabIndex.HISTORY:
        return context.getString(R.string.tab_title_call_history);
      case TabIndex.VOICEMAIL:
        return context.getString(R.string.tab_title_voicemail);
      default:
        throw Assert.createIllegalStateFailException("Tab position with no title: " + position);
    }
  }
}
+71 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.voicemail.impl;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build.VERSION_CODES;
import android.telecom.PhoneAccountHandle;
import android.telephony.TelephonyManager;
import com.google.auto.value.AutoValue;

/** Identifies a carrier. */
@AutoValue
@TargetApi(VERSION_CODES.O)
@SuppressWarnings("missingpermission")
public abstract class CarrierIdentifier {

  public abstract String mccMnc();

  /**
   * Group ID Level 1. Used to identify MVNO(Mobile Virtual Network Operators) who subleases other
   * carrier's network and share their mccMnc. MVNO should have a GID1 different from the host.
   */
  public abstract String gid1();

  /** Builder for the matcher */
  @AutoValue.Builder
  public abstract static class Builder {

    public abstract Builder setMccMnc(String mccMnc);

    public abstract Builder setGid1(String gid1);

    public abstract CarrierIdentifier build();
  }

  public static Builder builder() {
    return new AutoValue_CarrierIdentifier.Builder().setGid1("");
  }

  public static CarrierIdentifier forHandle(
      Context context, PhoneAccountHandle phoneAccountHandle) {
    TelephonyManager telephonyManager =
        context
            .getSystemService(TelephonyManager.class)
            .createForPhoneAccountHandle(phoneAccountHandle);
    if (telephonyManager == null) {
      throw new IllegalArgumentException("Invalid PhoneAccountHandle");
    }
    String gid1 = telephonyManager.getGroupIdLevel1();
    if (gid1 == null) {
      gid1 = "";
    }

    return builder().setMccMnc(telephonyManager.getSimOperator()).setGid1(gid1).build();
  }
}
Loading