Snap for 8982257 from e468754e90a516fe45cf3a29164545b0ee28b9fa to mainline-conscrypt-release

Change-Id: I3f879938c18d0897aa04573b326d16a4c7e91fa3
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
deleted file mode 100644
index da31304..0000000
--- a/res/values-night/styles.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<resources>
-
-    <style name="Theme.Telecom.DialerSettings" parent="@android:style/Theme.Material.Light">
-        <item name="android:forceDarkAllowed">true</item>
-        <item name="android:tint">@color/blocked_numbers_secondary_text_color</item>
-        <item name="android:actionBarStyle">@style/TelecomDialerSettingsActionBarStyle</item>
-        <item name="android:navigationBarColor">@color/background_color</item>
-        <item name="android:windowBackground">@color/background_color</item>
-        <item name="android:colorPrimaryDark">@color/background_color</item>
-        <item name="android:actionOverflowButtonStyle">@style/TelecomDialerSettingsActionOverflowButtonStyle</item>
-        <item name="android:windowContentOverlay">@null</item>
-    </style>
-
-    <style name="Theme.Telecom.BlockedNumbers" parent="@android:style/Theme.Material.Light">
-        <item name="android:forceDarkAllowed">true</item>
-        <item name="android:actionBarStyle">@style/TelecomDialerSettingsActionBarStyle</item>
-        <item name="android:navigationBarColor">@color/background_color</item>
-        <item name="android:windowBackground">@color/background_color</item>
-        <item name="android:colorPrimaryDark">@color/background_color</item>
-        <item name="android:windowContentOverlay">@null</item>
-        <item name="android:colorAccent">@color/theme_color</item>
-        <item name="android:listDivider">@null</item>
-    </style>
-
-</resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index 5c62bb1..e7e0468 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -40,7 +40,7 @@
     <string name="respond_via_sms_canned_response_3" msgid="6656147963478092035">"ମୁଁ ଆପଣଙ୍କୁ ପରେ କଲ୍ କରିବି।"</string>
     <string name="respond_via_sms_canned_response_4" msgid="9141132488345561047">"ବର୍ତ୍ତମାନ କଥା ହୋ‌ଇପାରିବ ନାହିଁ। ମୋତେ ପରେ କଲ୍ କରିବେ?"</string>
     <string name="respond_via_sms_setting_title" msgid="4762275482898830160">"ଶୀଘ୍ର ଉତ୍ତର"</string>
-    <string name="respond_via_sms_setting_title_2" msgid="4914853536609553457">"ଶୀଘ୍ର ଉତ୍ତରକୁ ଏଡିଟ୍ କରନ୍ତୁ"</string>
+    <string name="respond_via_sms_setting_title_2" msgid="4914853536609553457">"ଶୀଘ୍ର ଉତ୍ତରକୁ ଏଡିଟ କରନ୍ତୁ"</string>
     <string name="respond_via_sms_setting_summary" msgid="8054571501085436868"></string>
     <string name="respond_via_sms_edittext_dialog_title" msgid="6579353156073272157">"ଶୀଘ୍ର ଉତ୍ତର"</string>
     <string name="respond_via_sms_confirmation_format" msgid="2932395476561267842">"<xliff:g id="PHONE_NUMBER">%s</xliff:g>କୁ ମେସେଜ୍ ପଠାଗଲା।"</string>
@@ -55,13 +55,13 @@
     <string name="add_vm_number_str" msgid="5179510133063168998">"ନମ୍ବର୍ ଯୋଡ଼ନ୍ତୁ"</string>
     <string name="change_default_dialer_dialog_title" msgid="5861469279421508060">"<xliff:g id="NEW_APP">%s</xliff:g>କୁ ଆପଣଙ୍କ ଫୋନ୍‌ର ଡିଫଲ୍ଟ ଆପ୍ କରିବେ?"</string>
     <string name="change_default_dialer_dialog_affirmative" msgid="8604665314757739550">"ଡିଫଲ୍ଟ ସେଟ୍ କରନ୍ତୁ"</string>
-    <string name="change_default_dialer_dialog_negative" msgid="8648669840052697821">"ବାତିଲ୍‍ କରନ୍ତୁ"</string>
+    <string name="change_default_dialer_dialog_negative" msgid="8648669840052697821">"ବାତିଲ କରନ୍ତୁ"</string>
     <string name="change_default_dialer_warning_message" msgid="8461963987376916114">"<xliff:g id="NEW_APP">%s</xliff:g> କଲ୍ କରିବା ଏବଂ କଲ୍‌ର ସମସ୍ତ ଦିଗକୁ ନିୟନ୍ତ୍ରଣ କରିବାରେ ସକ୍ଷମ ହେବ। କେବଳ ନିଜର ଭରସାଯୋଗ୍ୟ ଆପ୍‌କୁ ଡିଫଲ୍ଟ ଫୋନ୍ ଆପ୍ ଭାବେ ସେଟ୍ କରିବା ଉଚିତ୍।"</string>
     <string name="change_default_call_screening_dialog_title" msgid="5365787219927262408">"<xliff:g id="NEW_APP">%s</xliff:g>କୁ ଆପଣଙ୍କ ଡିଫଲ୍ଟ କଲ୍ ସ୍କ୍ରିନିଂ ଆପ୍ କରିବେ?"</string>
     <string name="change_default_call_screening_warning_message_for_disable_old_app" msgid="2039830033533243164">"<xliff:g id="OLD_APP">%s</xliff:g> କଲ୍ ସ୍କ୍ରିନ୍‌ କରିପାରିରିବେ ନାହିଁ।"</string>
     <string name="change_default_call_screening_warning_message" msgid="9020537562292754269">"ଆପଣଙ୍କ ଯୋଗାଯୋଗରେ ନଥିବା କଲର୍‌ଙ୍କ ସମ୍ଵନ୍ଧରେ ସୂଚନା ଦେଖିବାକୁ <xliff:g id="NEW_APP">%s</xliff:g> ସକ୍ଷମ ହେବେ। କେବଳ ଆପଣ ବିଶ୍ଵାସ କରୁଥିବା ଆପ୍ସ ଡିଫଲ୍ଟ କଲ୍ ସ୍କ୍ରିନିଂ ଆପ୍ ଭାବରେ ସେଟ୍ ହେବା ଆବଶ୍ୟକ ଅଟେ।"</string>
     <string name="change_default_call_screening_dialog_affirmative" msgid="7162433828280058647">"ଡିଫଲ୍ଟ ସେଟ୍ କରନ୍ତୁ"</string>
-    <string name="change_default_call_screening_dialog_negative" msgid="1839266125623106342">"ବାତିଲ୍‌ କରନ୍ତୁ"</string>
+    <string name="change_default_call_screening_dialog_negative" msgid="1839266125623106342">"ବାତିଲ କରନ୍ତୁ"</string>
     <string name="blocked_numbers" msgid="8322134197039865180">"ବ୍ଲକ୍ କରାଯାଇଥିବା ନମ୍ବର୍"</string>
     <string name="blocked_numbers_msg" msgid="2797422132329662697">"ବ୍ଲକ୍ କରାଯାଇଥିବା ନମ୍ବର୍‌ରୁ ଆପଣ କଲ୍ କିମ୍ବା ଟେକ୍ସଟ୍ ଗ୍ରହଣ କରିପାରିବେ ନାହିଁ।"</string>
     <string name="block_number" msgid="3784343046852802722">"ଗୋଟିଏ ନମ୍ବର୍ ଯୋଡ଼ନ୍ତୁ"</string>
@@ -122,5 +122,5 @@
     <string name="phone_strings_emergency_call_made_dialog_call_blocking_text_txt" msgid="3140411733995271126">"ଜରୁରିକାଳୀନ ସହାୟତା କର୍ମଚାରୀମାନେ ଆପଣଙ୍କୁ ଯୋଗଯୋଗ କରିବା ପାଇଁ କଲ୍ ଅବରୋଧକୁ ଅକ୍ଷମ କରାଯାଇଛି।"</string>
     <string name="developer_title" msgid="9146088855661672353">"ଟେଲେକମ୍ ଡେଭେଲପର୍ ମେନୁ"</string>
     <string name="toast_emergency_can_not_pull_call" msgid="9074229465338410869">"ଜରୁରୀକାଳୀନ କଲ୍ ବେଳେ ଅନ୍ୟ କଲ୍ ଉଠାଇ ପାରିବେ ନାହିଁ।"</string>
-    <string name="cancel" msgid="6733466216239934756">"ବାତିଲ୍ କରନ୍ତୁ"</string>
+    <string name="cancel" msgid="6733466216239934756">"ବାତିଲ କରନ୍ତୁ"</string>
 </resources>
diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml
index b904115..af14060 100644
--- a/res/values-te/strings.xml
+++ b/res/values-te/strings.xml
@@ -69,8 +69,8 @@
     <string name="unblock_button" msgid="8732021675729981781">"అన్‌బ్లాక్ చేయి"</string>
     <string name="add_blocked_dialog_body" msgid="8599974422407139255">"దీని నుండి కాల్స్‌ మరియు మెసేజ్‌లను బ్లాక్ చేయండి"</string>
     <string name="add_blocked_number_hint" msgid="8769422085658041097">"ఫోన్ నంబర్"</string>
-    <string name="block_button" msgid="485080149164258770">"బ్లాక్ చేయి"</string>
-    <string name="non_primary_user" msgid="315564589279622098">"కేవలం పరికర యజమాని మాత్రమే బ్లాక్ చేసిన నంబర్‌లను వీక్షించగలరు మరియు నిర్వహించగలరు."</string>
+    <string name="block_button" msgid="485080149164258770">"బ్లాక్ చేయండి"</string>
+    <string name="non_primary_user" msgid="315564589279622098">"కేవలం పరికర యజమాని మాత్రమే బ్లాక్ చేసిన నంబర్‌లను చూడగలరు మరియు నిర్వహించగలరు."</string>
     <string name="delete_icon_description" msgid="5335959254954774373">"అన్‌బ్లాక్ చేస్తుంది"</string>
     <string name="blocked_numbers_butter_bar_title" msgid="582982373755950791">"బ్లాకింగ్ తాత్కాలికంగా ఆఫ్ చేయబడింది"</string>
     <string name="blocked_numbers_butter_bar_body" msgid="1261213114919301485">"మీరు అత్యవసర నంబర్‌కి డయల్ చేసాక లేదా వచన మెసేజ్‌ పంపాక, అత్యవసర సేవలు తిరిగి మిమ్మల్ని సంప్రదించగలిగేలా చేయడానికి బ్లాకింగ్ ఆఫ్ చేయబడుతుంది."</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 64dfabd..53e1bcb 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -28,33 +28,24 @@
 
    <style name="Theme.Telecom.DialerSettings" parent="@android:style/Theme.DeviceDefault.Light">
         <item name="android:forceDarkAllowed">true</item>
-        <item name="android:tint">@color/blocked_numbers_secondary_text_color</item>
         <item name="android:actionBarStyle">@style/TelecomDialerSettingsActionBarStyle</item>
         <item name="android:actionOverflowButtonStyle">@style/TelecomDialerSettingsActionOverflowButtonStyle</item>
-        <item name="android:colorPrimaryDark">@color/background_color</item>
         <item name="android:windowLightStatusBar">true</item>
-        <item name="android:navigationBarColor">@color/background_color</item>
-        <item name="android:navigationBarDividerColor">@color/blocked_numbers_divider_color</item>
         <item name="android:windowLightNavigationBar">true</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
 
     <style name="Theme.Telecom.BlockedNumbers" parent="@android:style/Theme.DeviceDefault.Light">
         <item name="android:forceDarkAllowed">true</item>
-        <item name="android:tint">@color/blocked_numbers_secondary_text_color</item>
         <item name="android:actionBarStyle">@style/TelecomDialerSettingsActionBarStyle</item>
-        <item name="android:colorPrimaryDark">@color/background_color</item>
         <item name="android:windowLightStatusBar">true</item>
-        <item name="android:navigationBarColor">@color/background_color</item>
-        <item name="android:navigationBarDividerColor">@color/blocked_numbers_divider_color</item>
         <item name="android:windowLightNavigationBar">true</item>
         <item name="android:windowContentOverlay">@null</item>
-        <item name="android:colorAccent">@color/theme_color</item>
         <item name="android:listDivider">@null</item>
     </style>
 
     <style name="TelecomDialerSettingsActionBarStyle" parent="android:Widget.DeviceDefault.ActionBar">
-        <item name="android:background">@color/background_color</item>
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:titleTextStyle">@style/BlockedNumbersTextHead1</item>
         <item name="android:elevation">@dimen/dialer_settings_actionbar_elevation</item>
         <!-- Empty icon -->
@@ -63,30 +54,28 @@
 
     <style name="TelecomDialerSettingsActionOverflowButtonStyle"
             parent="@android:style/Widget.DeviceDefault.Light.ActionButton.Overflow">
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:src">@drawable/ic_more_vert_24dp</item>
     </style>
 
     <style name="BlockedNumbersButton" parent="BlockedNumbersTextPrimary2">
-        <item name="android:textColor">@color/theme_color</item>
     </style>
 
     <style name="BlockedNumbersTextHead1"
            parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
-        <item name="android:textColor">@color/blocked_numbers_primary_text_color</item>
+        <item name="android:forceDarkAllowed">true</item>
         <item name="android:textSize">@dimen/blocked_numbers_head1_font_size</item>
         <item name="android:fontFamily">sans-serif-regular</item>
     </style>
 
-    <style name="BlockedNumbersTextPrimary2">
-        <item name="android:textColor">@color/blocked_numbers_primary_text_color</item>
+    <style name="BlockedNumbersTextPrimary2" parent="Theme.Telecom.BlockedNumbers">
         <item name="android:textSize">@dimen/blocked_numbers_primary2_font_size</item>
         <item name="android:fontFamily">sans-serif-regular</item>
         <item name="android:lineSpacingExtra">@dimen/blocked_numbers_line_spacing</item>
         <item name="android:capitalize">sentences</item>
     </style>
 
-    <style name="BlockedNumbersTextSecondary">
-        <item name="android:textColor">@color/blocked_numbers_secondary_text_color</item>
+    <style name="BlockedNumbersTextSecondary" parent="Theme.Telecom.BlockedNumbers">
         <item name="android:textSize">@dimen/blocked_numbers_secondary_font_size</item>
         <item name="android:fontFamily">sans-serif-regular</item>
         <item name="android:lineSpacingExtra">@dimen/blocked_numbers_secondary_line_spacing</item>
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index ef98e5a..4d829bb 100755
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -2198,7 +2198,7 @@
      * @param callId The ID of the call to show the redirection dialog for.
      */
     private void showRedirectionDialog(@NonNull String callId, @NonNull CharSequence appName) {
-        AlertDialog confirmDialog = FrameworksUtils.makeAlertDialogBuilder(mContext).create();
+        AlertDialog confirmDialog = (new AlertDialog.Builder(mContext)).create();
         LayoutInflater layoutInflater = LayoutInflater.from(mContext);
         View dialogView = layoutInflater.inflate(R.layout.call_redirection_confirm_dialog, null);
 
diff --git a/src/com/android/server/telecom/FrameworksUtils.java b/src/com/android/server/telecom/FrameworksUtils.java
deleted file mode 100644
index 08a19f5..0000000
--- a/src/com/android/server/telecom/FrameworksUtils.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2021 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.server.telecom;
-
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.res.Configuration;
-
-/**
- * This class provides utility functions over framework APIs
- */
-public class FrameworksUtils {
-    /**
-     * Create a new instance of {@link AlertDialog.Builder}.
-     * @param context reference to a Context
-     * @return an instance of AlertDialog.Builder
-     */
-    public static AlertDialog.Builder makeAlertDialogBuilder(Context context) {
-        boolean isDarkTheme = (context.getResources().getConfiguration().uiMode
-                & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
-        return new AlertDialog.Builder(context, isDarkTheme
-                ? android.R.style.Theme_DeviceDefault_Dialog_Alert : 0);
-    }
-}
\ No newline at end of file
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index 06a190b..ee7aba6 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -41,6 +41,7 @@
 import android.content.PermissionChecker;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.content.pm.ParceledListSlice;
 import android.content.pm.ResolveInfo;
 import android.net.Uri;
 import android.os.Binder;
@@ -191,25 +192,26 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getCallCapablePhoneAccounts(
+        public ParceledListSlice<PhoneAccountHandle> getCallCapablePhoneAccounts(
                 boolean includeDisabledAccounts, String callingPackage, String callingFeatureId) {
             try {
                 Log.startSession("TSI.gCCPA", Log.getPackageAbbreviation(callingPackage));
                 if (includeDisabledAccounts &&
                         !canReadPrivilegedPhoneState(
                                 callingPackage, "getCallCapablePhoneAccounts")) {
-                    return Collections.emptyList();
+                    return ParceledListSlice.emptyList();
                 }
                 if (!canReadPhoneState(callingPackage, callingFeatureId,
                         "getCallCapablePhoneAccounts")) {
-                    return Collections.emptyList();
+                    return ParceledListSlice.emptyList();
                 }
                 synchronized (mLock) {
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getCallCapablePhoneAccounts(null,
-                                includeDisabledAccounts, callingUserHandle);
+                        return new ParceledListSlice<>(
+                                mPhoneAccountRegistrar.getCallCapablePhoneAccounts(null,
+                                includeDisabledAccounts, callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e, "getCallCapablePhoneAccounts");
                         throw e;
@@ -223,8 +225,8 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage,
-                String callingFeatureId) {
+        public ParceledListSlice<PhoneAccountHandle> getSelfManagedPhoneAccounts(
+                String callingPackage, String callingFeatureId) {
             try {
                 Log.startSession("TSI.gSMPA", Log.getPackageAbbreviation(callingPackage));
                 if (!canReadPhoneState(callingPackage, callingFeatureId,
@@ -235,8 +237,8 @@
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getSelfManagedPhoneAccounts(
-                                callingUserHandle);
+                        return new ParceledListSlice<>(mPhoneAccountRegistrar
+                                .getSelfManagedPhoneAccounts(callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e, "getSelfManagedPhoneAccounts");
                         throw e;
@@ -250,8 +252,8 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getOwnSelfManagedPhoneAccounts(String callingPackage,
-                String callingFeatureId) {
+        public ParceledListSlice<PhoneAccountHandle> getOwnSelfManagedPhoneAccounts(
+                String callingPackage, String callingFeatureId) {
             try {
                 Log.startSession("TSI.gOSMPA", Log.getPackageAbbreviation(callingPackage));
                 try {
@@ -269,9 +271,9 @@
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getSelfManagedPhoneAccountsForPackage(
-                                callingPackage,
-                                callingUserHandle);
+                        return new ParceledListSlice<>(mPhoneAccountRegistrar
+                                .getSelfManagedPhoneAccountsForPackage(callingPackage,
+                                callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e,
                                 "getSelfManagedPhoneAccountsForPackage");
@@ -286,8 +288,8 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme,
-                String callingPackage) {
+        public ParceledListSlice<PhoneAccountHandle> getPhoneAccountsSupportingScheme(
+                String uriScheme, String callingPackage) {
             try {
                 Log.startSession("TSI.gPASS", Log.getPackageAbbreviation(callingPackage));
                 try {
@@ -296,15 +298,16 @@
                 } catch (SecurityException e) {
                     EventLog.writeEvent(0x534e4554, "62347125", Binder.getCallingUid(),
                             "getPhoneAccountsSupportingScheme: " + callingPackage);
-                    return Collections.emptyList();
+                    return ParceledListSlice.emptyList();
                 }
 
                 synchronized (mLock) {
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getCallCapablePhoneAccounts(uriScheme, false,
-                                callingUserHandle);
+                        return new ParceledListSlice<>(mPhoneAccountRegistrar
+                                .getCallCapablePhoneAccounts(uriScheme, false,
+                                callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e, "getPhoneAccountsSupportingScheme %s", uriScheme);
                         throw e;
@@ -318,7 +321,8 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getPhoneAccountsForPackage(String packageName) {
+        public ParceledListSlice<PhoneAccountHandle> getPhoneAccountsForPackage(
+                String packageName) {
             //TODO: Deprecate this in S
             try {
                 enforceCallingPackage(packageName, "getPhoneAccountsForPackage");
@@ -341,8 +345,8 @@
                 long token = Binder.clearCallingIdentity();
                 try {
                     Log.startSession("TSI.gPAFP");
-                    return mPhoneAccountRegistrar.getPhoneAccountsForPackage(packageName,
-                            callingUserHandle);
+                    return new ParceledListSlice<>(mPhoneAccountRegistrar
+                            .getPhoneAccountsForPackage(packageName, callingUserHandle));
                 } catch (Exception e) {
                     Log.e(this, e, "getPhoneAccountsForPackage %s", packageName);
                     throw e;
@@ -412,7 +416,7 @@
                 synchronized (mLock) {
                     try {
                         // This list is pre-filtered for the calling user.
-                        return getAllPhoneAccounts().size();
+                        return getAllPhoneAccounts().getList().size();
                     } catch (Exception e) {
                         Log.e(this, e, "getAllPhoneAccountsCount");
                         throw e;
@@ -425,7 +429,7 @@
         }
 
         @Override
-        public List<PhoneAccount> getAllPhoneAccounts() {
+        public ParceledListSlice<PhoneAccount> getAllPhoneAccounts() {
             synchronized (mLock) {
                 try {
                     Log.startSession("TSI.gAPA");
@@ -441,7 +445,8 @@
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getAllPhoneAccounts(callingUserHandle);
+                        return new ParceledListSlice<>(mPhoneAccountRegistrar
+                                .getAllPhoneAccounts(callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e, "getAllPhoneAccounts");
                         throw e;
@@ -455,7 +460,7 @@
         }
 
         @Override
-        public List<PhoneAccountHandle> getAllPhoneAccountHandles() {
+        public ParceledListSlice<PhoneAccountHandle> getAllPhoneAccountHandles() {
             try {
                 Log.startSession("TSI.gAPAH");
                 try {
@@ -471,7 +476,8 @@
                     final UserHandle callingUserHandle = Binder.getCallingUserHandle();
                     long token = Binder.clearCallingIdentity();
                     try {
-                        return mPhoneAccountRegistrar.getAllPhoneAccountHandles(callingUserHandle);
+                        return new ParceledListSlice<>(mPhoneAccountRegistrar
+                                .getAllPhoneAccountHandles(callingUserHandle));
                     } catch (Exception e) {
                         Log.e(this, e, "getAllPhoneAccounts");
                         throw e;
diff --git a/src/com/android/server/telecom/components/ErrorDialogActivity.java b/src/com/android/server/telecom/components/ErrorDialogActivity.java
index 3618b77..fd55a35 100644
--- a/src/com/android/server/telecom/components/ErrorDialogActivity.java
+++ b/src/com/android/server/telecom/components/ErrorDialogActivity.java
@@ -16,7 +16,6 @@
 
 package com.android.server.telecom.components;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 
 import android.app.Activity;
@@ -85,7 +84,7 @@
             }
         };
 
-        final AlertDialog errorDialog = FrameworksUtils.makeAlertDialogBuilder(this)
+        final AlertDialog errorDialog = new AlertDialog.Builder(this)
                 .setMessage(msg).setPositiveButton(android.R.string.ok, clickListener)
                         .setOnCancelListener(cancelListener).create();
 
@@ -98,7 +97,7 @@
     }
 
     private void showMissingVoicemailErrorDialog() {
-        FrameworksUtils.makeAlertDialogBuilder(this)
+        final AlertDialog errorDialog = new AlertDialog.Builder(this)
                 .setTitle(R.string.no_vm_number)
                 .setMessage(R.string.no_vm_number_msg)
                 .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
diff --git a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
index cb4b3e3..bc54e11 100644
--- a/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
+++ b/src/com/android/server/telecom/settings/BlockedNumbersActivity.java
@@ -54,7 +54,6 @@
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 
 
@@ -246,7 +245,7 @@
         final EditText editText = (EditText) dialogView.findViewById(R.id.add_blocked_number);
         editText.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
         editText.addTextChangedListener(this);
-        AlertDialog dialog = FrameworksUtils.makeAlertDialogBuilder(this)
+        AlertDialog dialog = new AlertDialog.Builder(this)
                 .setView(dialogView)
                 .setPositiveButton(R.string.block_button, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
diff --git a/src/com/android/server/telecom/settings/BlockedNumbersAdapter.java b/src/com/android/server/telecom/settings/BlockedNumbersAdapter.java
index 333e451..df68f6e 100644
--- a/src/com/android/server/telecom/settings/BlockedNumbersAdapter.java
+++ b/src/com/android/server/telecom/settings/BlockedNumbersAdapter.java
@@ -29,7 +29,6 @@
 import android.widget.SimpleCursorAdapter;
 import android.widget.TextView;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 
 public class BlockedNumbersAdapter extends SimpleCursorAdapter {
@@ -73,7 +72,7 @@
         Spannable messageSpannable = new SpannableString(message);
         PhoneNumberUtils.addTtsSpan(messageSpannable, startingPosition,
                 startingPosition + formattedNumber.length());
-        AlertDialog dialog = FrameworksUtils.makeAlertDialogBuilder(context)
+        AlertDialog dialog = new AlertDialog.Builder(context)
                 .setMessage(messageSpannable)
                 .setPositiveButton(R.string.unblock_button,
                         new DialogInterface.OnClickListener() {
diff --git a/src/com/android/server/telecom/settings/CallBlockDisabledActivity.java b/src/com/android/server/telecom/settings/CallBlockDisabledActivity.java
index 232546b..5f42b37 100644
--- a/src/com/android/server/telecom/settings/CallBlockDisabledActivity.java
+++ b/src/com/android/server/telecom/settings/CallBlockDisabledActivity.java
@@ -22,7 +22,6 @@
 import android.os.Bundle;
 import android.provider.BlockedNumberContract;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 
 /**
@@ -51,7 +50,7 @@
             return;
         }
 
-        AlertDialog.Builder builder = FrameworksUtils.makeAlertDialogBuilder(this);
+        AlertDialog.Builder builder = new AlertDialog.Builder(this);
         mDialog = builder
                 .setTitle(R.string.phone_strings_emergency_call_made_dialog_title_txt)
                 .setMessage(R.string
diff --git a/src/com/android/server/telecom/ui/CallRedirectionTimeoutDialogActivity.java b/src/com/android/server/telecom/ui/CallRedirectionTimeoutDialogActivity.java
index b5c850e..5aa80c6 100644
--- a/src/com/android/server/telecom/ui/CallRedirectionTimeoutDialogActivity.java
+++ b/src/com/android/server/telecom/ui/CallRedirectionTimeoutDialogActivity.java
@@ -16,7 +16,6 @@
 
 package com.android.server.telecom.ui;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 
 import android.app.Activity;
@@ -46,7 +45,7 @@
         Log.i(this, "showDialog: timeout redirection with %s", redirectionAppName);
         CharSequence message = getString(
                 R.string.alert_redirect_outgoing_call_timeout, redirectionAppName);
-        final AlertDialog errorDialog = FrameworksUtils.makeAlertDialogBuilder(this)
+        final AlertDialog errorDialog = new AlertDialog.Builder(this)
                 .setMessage(message)
                 .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                     @Override
diff --git a/src/com/android/server/telecom/ui/ConfirmCallDialogActivity.java b/src/com/android/server/telecom/ui/ConfirmCallDialogActivity.java
index e9f99b6..4735e3c 100644
--- a/src/com/android/server/telecom/ui/ConfirmCallDialogActivity.java
+++ b/src/com/android/server/telecom/ui/ConfirmCallDialogActivity.java
@@ -16,7 +16,6 @@
 
 package com.android.server.telecom.ui;
 
-import com.android.server.telecom.FrameworksUtils;
 import com.android.server.telecom.R;
 import com.android.server.telecom.TelecomBroadcastIntentProcessor;
 import com.android.server.telecom.components.TelecomBroadcastReceiver;
@@ -49,7 +48,7 @@
     private void showDialog(final String callId, CharSequence ongoingAppName) {
         Log.i(this, "showDialog: confirming callId=%s, ongoing=%s", callId, ongoingAppName);
         CharSequence message = getString(R.string.alert_outgoing_call, ongoingAppName);
-        final AlertDialog errorDialog = FrameworksUtils.makeAlertDialogBuilder(this)
+        final AlertDialog errorDialog = new AlertDialog.Builder(this)
                 .setMessage(message)
                 .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                     @Override
diff --git a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
index 210f80e..90bdc80 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java
@@ -391,9 +391,11 @@
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_16, SIP_PA_HANDLE_17);
 
         assertEquals(fullPHList,
-                mTSIBinder.getCallCapablePhoneAccounts(true, DEFAULT_DIALER_PACKAGE, null));
+                mTSIBinder.getCallCapablePhoneAccounts(
+                        true, DEFAULT_DIALER_PACKAGE, null).getList());
         assertEquals(smallPHList,
-                mTSIBinder.getCallCapablePhoneAccounts(false, DEFAULT_DIALER_PACKAGE, null));
+                mTSIBinder.getCallCapablePhoneAccounts(
+                        false, DEFAULT_DIALER_PACKAGE, null).getList());
     }
 
     @SmallTest
@@ -408,7 +410,7 @@
 
         List<PhoneAccountHandle> result = null;
         try {
-            result = mTSIBinder.getCallCapablePhoneAccounts(true, "", null);
+            result = mTSIBinder.getCallCapablePhoneAccounts(true, "", null).getList();
         } catch (SecurityException e) {
             // intended behavior
         }
@@ -436,9 +438,11 @@
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_16, SIP_PA_HANDLE_17);
 
         assertEquals(telPHList,
-                mTSIBinder.getPhoneAccountsSupportingScheme("tel", DEFAULT_DIALER_PACKAGE));
+                mTSIBinder.getPhoneAccountsSupportingScheme(
+                        "tel", DEFAULT_DIALER_PACKAGE).getList());
         assertEquals(sipPHList,
-                mTSIBinder.getPhoneAccountsSupportingScheme("sip", DEFAULT_DIALER_PACKAGE));
+                mTSIBinder.getPhoneAccountsSupportingScheme(
+                        "sip", DEFAULT_DIALER_PACKAGE).getList());
     }
 
     @SmallTest
@@ -454,7 +458,7 @@
         makeAccountsVisibleToAllUsers(TEL_PA_HANDLE_16, SIP_PA_HANDLE_17);
         assertEquals(phoneAccountHandleList,
                 mTSIBinder.getPhoneAccountsForPackage(
-                        TEL_PA_HANDLE_16.getComponentName().getPackageName()));
+                        TEL_PA_HANDLE_16.getComponentName().getPackageName()).getList());
     }
 
     @SmallTest
@@ -483,7 +487,7 @@
         when(mFakePhoneAccountRegistrar.getAllPhoneAccounts(any(UserHandle.class)))
                 .thenReturn(phoneAccountList);
 
-        assertEquals(2, mTSIBinder.getAllPhoneAccounts().size());
+        assertEquals(2, mTSIBinder.getAllPhoneAccounts().getList().size());
     }
 
     @SmallTest