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

Commit 62fe4b99 authored by Xin Li's avatar Xin Li
Browse files

Merge tm-dev-plus-aosp-without-vendor@8763363

Bug: 236760014
Merged-In: Id047eab50366273d99580d53433e25742e1f8516
Change-Id: Ia487d015d8550d3dfe44b5774071f98882bc448d
parents 30cf9a72 416973e5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
    android:minSdkVersion="24"
    android:targetSdkVersion="30"/>


  <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
  <uses-permission android:name="android.permission.CALL_PHONE"/>
  <uses-permission android:name="android.permission.READ_CONTACTS"/>
  <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
@@ -60,6 +62,7 @@
  <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
  <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
  <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
  <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

  <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE"/>
  <!-- We use this to disable the status bar buttons of home, back and recent
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.text.TextUtils;
import com.android.contacts.common.GroupMetaData;
import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.AccountTypeWithDataSet;
import com.android.contacts.common.model.account.GoogleAccountType;
import com.android.contacts.common.model.dataitem.DataItem;
import com.android.contacts.common.model.dataitem.PhoneDataItem;
import com.android.contacts.common.model.dataitem.PhotoDataItem;
@@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> {
      final String servicePackageName = accountType.getViewContactNotifyServicePackageName();
      if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) {
        final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
        if (accountType instanceof GoogleAccountType) {
          ((GoogleAccountType) accountType).handleRawContactViewed(context, uri);
          continue;
        }
        final Intent intent = new Intent();
        intent.setClassName(servicePackageName, serviceName);
        intent.setAction(Intent.ACTION_VIEW);
+21 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.contacts.common.model.account;

import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Event;
import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -196,11 +198,28 @@ public class GoogleAccountType extends BaseAccountType {

  @Override
  public String getViewContactNotifyServiceClassName() {
    return "com.google.android.syncadapters.contacts." + "SyncHighResPhotoIntentService";
    return PLUS_EXTENSION_PACKAGE_NAME + ".people.sync.focus.SyncHighResPhotoIntentOperation";
  }

  @Override
  public String getViewContactNotifyServicePackageName() {
    return "com.google.android.syncadapters.contacts";
    return PLUS_EXTENSION_PACKAGE_NAME;
  }

  /**
   * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which
   * was viewed
   * @param context context to send broadcast in
   * @param rawContactUri Uri of the raw contact viewed
   */
  public void handleRawContactViewed(Context context, Uri rawContactUri) {
    final Intent intent = new Intent();
    intent.setData(rawContactUri);
    // New broadcast for syncing high res photo.
    intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME);
    intent.setAction(
        "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO");

    context.sendBroadcast(intent);
  }
}
+54 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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;

import android.app.admin.DevicePolicyManager;

/**
 * Class containing the required identifiers to update device management resources.
 *
 * <p>See {@link DevicePolicyManager#getDrawable} and {@link DevicePolicyManager#getString}.
 */
public class DevicePolicyResources {

    private static final String PREFIX = "Dialer.";

    /**
     * The title of the in-call notification for an incoming work call.
     */
    public static final String NOTIFICATION_INCOMING_WORK_CALL_TITLE =
            PREFIX + "NOTIFICATION_INCOMING_WORK_CALL_TITLE";

    /**
     * The title of the in-call notification for an ongoing work call.
     */
    public static final String NOTIFICATION_ONGOING_WORK_CALL_TITLE =
            PREFIX + "NOTIFICATION_ONGOING_WORK_CALL_TITLE";

    /**
     * Missed call notification label, used when there's exactly one missed call from work
     * contact.
     */
    public static final String NOTIFICATION_MISSED_WORK_CALL_TITLE =
            PREFIX + "NOTIFICATION_MISSED_WORK_CALL_TITLE";

    /**
     * Label for notification indicating that call is being made over wifi.
     */
    public static final String NOTIFICATION_WIFI_WORK_CALL_LABEL =
            PREFIX + "NOTIFICATION_WIFI_WORK_CALL_LABEL";
}
+2 −3
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import com.android.dialer.common.LogUtil;
import com.android.dialer.location.GeoUtil;
import com.android.dialer.notification.DialerNotificationManager;
import com.android.dialer.notification.NotificationChannelManager;
import com.android.dialer.notification.VoicemailChannelUtils;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.theme.base.ThemeComponent;
@@ -182,8 +181,8 @@ public final class LegacyVoicemailNotifier {
    if (context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1) {
      return NOTIFICATION_TAG;
    }
    return NOTIFICATION_TAG_PREFIX
        + VoicemailChannelUtils.getHashedPhoneAccountId(phoneAccountHandle);

    return NOTIFICATION_TAG_PREFIX + phoneAccountHandle.getId();
  }

  private LegacyVoicemailNotifier() {}
Loading