Merge "switch TelecomManager List getters to ParceledListSlice" into qt-dev

This commit is contained in:
TreeHugger Robot
2022-08-10 16:17:49 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 12 deletions

View File

@@ -953,7 +953,7 @@ public class TelecomManager {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getPhoneAccountsSupportingScheme(uriScheme, return getTelecomService().getPhoneAccountsSupportingScheme(uriScheme,
mContext.getOpPackageName()); mContext.getOpPackageName()).getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getPhoneAccountsSupportingScheme", e); Log.e(TAG, "Error calling ITelecomService#getPhoneAccountsSupportingScheme", e);
@@ -995,7 +995,8 @@ public class TelecomManager {
public List<PhoneAccountHandle> getSelfManagedPhoneAccounts() { public List<PhoneAccountHandle> getSelfManagedPhoneAccounts() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getSelfManagedPhoneAccounts(mContext.getOpPackageName()); return getTelecomService()
.getSelfManagedPhoneAccounts(mContext.getOpPackageName()).getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getSelfManagedPhoneAccounts()", e); Log.e(TAG, "Error calling ITelecomService#getSelfManagedPhoneAccounts()", e);
@@ -1017,7 +1018,7 @@ public class TelecomManager {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getCallCapablePhoneAccounts( return getTelecomService().getCallCapablePhoneAccounts(
includeDisabledAccounts, mContext.getOpPackageName()); includeDisabledAccounts, mContext.getOpPackageName()).getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getCallCapablePhoneAccounts(" + Log.e(TAG, "Error calling ITelecomService#getCallCapablePhoneAccounts(" +
@@ -1037,7 +1038,8 @@ public class TelecomManager {
public List<PhoneAccountHandle> getPhoneAccountsForPackage() { public List<PhoneAccountHandle> getPhoneAccountsForPackage() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getPhoneAccountsForPackage(mContext.getPackageName()); return getTelecomService()
.getPhoneAccountsForPackage(mContext.getPackageName()).getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getPhoneAccountsForPackage", e); Log.e(TAG, "Error calling ITelecomService#getPhoneAccountsForPackage", e);
@@ -1091,7 +1093,7 @@ public class TelecomManager {
public List<PhoneAccount> getAllPhoneAccounts() { public List<PhoneAccount> getAllPhoneAccounts() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getAllPhoneAccounts(); return getTelecomService().getAllPhoneAccounts().getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getAllPhoneAccounts", e); Log.e(TAG, "Error calling ITelecomService#getAllPhoneAccounts", e);
@@ -1109,7 +1111,7 @@ public class TelecomManager {
public List<PhoneAccountHandle> getAllPhoneAccountHandles() { public List<PhoneAccountHandle> getAllPhoneAccountHandles() {
try { try {
if (isServiceConnected()) { if (isServiceConnected()) {
return getTelecomService().getAllPhoneAccountHandles(); return getTelecomService().getAllPhoneAccountHandles().getList();
} }
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#getAllPhoneAccountHandles", e); Log.e(TAG, "Error calling ITelecomService#getAllPhoneAccountHandles", e);

View File

@@ -23,6 +23,7 @@ import android.telecom.PhoneAccountHandle;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.telecom.PhoneAccount; import android.telecom.PhoneAccount;
import android.content.pm.ParceledListSlice;
/** /**
* Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
@@ -55,24 +56,24 @@ interface ITelecomService {
/** /**
* @see TelecomServiceImpl#getCallCapablePhoneAccounts * @see TelecomServiceImpl#getCallCapablePhoneAccounts
*/ */
List<PhoneAccountHandle> getCallCapablePhoneAccounts( ParceledListSlice getCallCapablePhoneAccounts(
boolean includeDisabledAccounts, String callingPackage); boolean includeDisabledAccounts, String callingPackage);
/** /**
* @see TelecomServiceImpl#getSelfManagedPhoneAccounts * @see TelecomServiceImpl#getSelfManagedPhoneAccounts
*/ */
List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage); ParceledListSlice getSelfManagedPhoneAccounts(String callingPackage);
/** /**
* @see TelecomManager#getPhoneAccountsSupportingScheme * @see TelecomManager#getPhoneAccountsSupportingScheme
*/ */
List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme, ParceledListSlice getPhoneAccountsSupportingScheme(in String uriScheme,
String callingPackage); String callingPackage);
/** /**
* @see TelecomManager#getPhoneAccountsForPackage * @see TelecomManager#getPhoneAccountsForPackage
*/ */
List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName); ParceledListSlice getPhoneAccountsForPackage(in String packageName);
/** /**
* @see TelecomManager#getPhoneAccount * @see TelecomManager#getPhoneAccount
@@ -87,12 +88,12 @@ interface ITelecomService {
/** /**
* @see TelecomManager#getAllPhoneAccounts * @see TelecomManager#getAllPhoneAccounts
*/ */
List<PhoneAccount> getAllPhoneAccounts(); ParceledListSlice getAllPhoneAccounts();
/** /**
* @see TelecomManager#getAllPhoneAccountHandles * @see TelecomManager#getAllPhoneAccountHandles
*/ */
List<PhoneAccountHandle> getAllPhoneAccountHandles(); ParceledListSlice getAllPhoneAccountHandles();
/** /**
* @see TelecomServiceImpl#getSimCallManager * @see TelecomServiceImpl#getSimCallManager