Loading AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" package="com.android.server.telecom" android:debuggable="true" coreApp="true" android:sharedUserId="android.uid.system"> Loading src/com/android/server/telecom/CallsManager.java +0 −2 Original line number Diff line number Diff line Loading @@ -495,8 +495,6 @@ public final class CallsManager extends Call.ListenerBase { List<PhoneAccountHandle> accounts = mPhoneAccountRegistrar.getCallCapablePhoneAccounts(scheme); Log.v(this, "startOutgoingCall found accounts = " + accounts); // Only dial with the requested phoneAccount if it is still valid. Otherwise treat this call // as if a phoneAccount was not specified (does the default behavior instead). // Note: We will not attempt to dial with a requested phoneAccount if it is disabled. Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +17 −52 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class PhoneAccountRegistrar { private static final String FILE_NAME = "phone-account-registrar-state.xml"; @VisibleForTesting public static final int EXPECTED_STATE_VERSION = 5; public static final int EXPECTED_STATE_VERSION = 3; /** Keep in sync with the same in SipSettings.java */ private static final String SIP_SHARED_PREFERENCES = "SIP_PREFERENCES"; Loading Loading @@ -460,9 +460,6 @@ public final class PhoneAccountRegistrar { * @param account The {@code PhoneAccount} to add or replace. */ private void addOrReplacePhoneAccount(PhoneAccount account) { Log.d(this, "addOrReplacePhoneAccount(%s -> %s)", account.getAccountHandle(), account); mState.accounts.add(account); // Search for duplicates and remove any that are found. for (int i = 0; i < mState.accounts.size() - 1; i++) { Loading Loading @@ -884,10 +881,7 @@ public final class PhoneAccountRegistrar { private static final String SUBSCRIPTION_ADDRESS = "subscription_number"; private static final String CAPABILITIES = "capabilities"; private static final String ICON_RES_ID = "icon_res_id"; private static final String ICON_PACKAGE_NAME = "icon_package_name"; private static final String ICON_BITMAP = "icon_bitmap"; private static final String ICON_TINT = "icon_tint"; private static final String HIGHLIGHT_COLOR = "highlight_color"; private static final String COLOR = "color"; private static final String LABEL = "label"; private static final String SHORT_DESCRIPTION = "short_description"; private static final String SUPPORTED_URI_SCHEMES = "supported_uri_schemes"; Loading @@ -906,17 +900,13 @@ public final class PhoneAccountRegistrar { serializer.endTag(null, ACCOUNT_HANDLE); } writeTextIfNonNull(ADDRESS, o.getAddress(), serializer); writeTextIfNonNull(SUBSCRIPTION_ADDRESS, o.getSubscriptionAddress(), serializer); writeTextIfNonNull(CAPABILITIES, Integer.toString(o.getCapabilities()), serializer); writeTextIfNonNull(ICON_RES_ID, Integer.toString(o.getIconResId()), serializer); writeTextIfNonNull(ICON_PACKAGE_NAME, o.getIconPackageName(), serializer); writeBitmapIfNonNull(ICON_BITMAP, o.getIconBitmap(), serializer); writeTextIfNonNull(ICON_TINT, Integer.toString(o.getIconTint()), serializer); writeTextIfNonNull(HIGHLIGHT_COLOR, Integer.toString(o.getHighlightColor()), serializer); writeTextIfNonNull(LABEL, o.getLabel(), serializer); writeTextIfNonNull(SHORT_DESCRIPTION, o.getShortDescription(), serializer); writeTextSafely(ADDRESS, o.getAddress(), serializer); writeTextSafely(SUBSCRIPTION_ADDRESS, o.getSubscriptionAddress(), serializer); writeTextSafely(CAPABILITIES, Integer.toString(o.getCapabilities()), serializer); writeTextSafely(ICON_RES_ID, Integer.toString(o.getIconResId()), serializer); writeTextSafely(COLOR, Integer.toString(o.getColor()), serializer); writeTextSafely(LABEL, o.getLabel(), serializer); writeTextSafely(SHORT_DESCRIPTION, o.getShortDescription(), serializer); writeStringList(SUPPORTED_URI_SCHEMES, o.getSupportedUriSchemes(), serializer); serializer.endTag(null, CLASS_PHONE_ACCOUNT); Loading @@ -931,11 +921,8 @@ public final class PhoneAccountRegistrar { Uri address = null; Uri subscriptionAddress = null; int capabilities = 0; int iconResId = PhoneAccount.NO_RESOURCE_ID; String iconPackageName = null; Bitmap iconBitmap = null; int iconTint = PhoneAccount.NO_COLOR; int highlightColor = PhoneAccount.NO_COLOR; int iconResId = 0; int color = 0; String label = null; String shortDescription = null; List<String> supportedUriSchemes = null; Loading @@ -958,18 +945,9 @@ public final class PhoneAccountRegistrar { } else if (parser.getName().equals(ICON_RES_ID)) { parser.next(); iconResId = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(ICON_PACKAGE_NAME)) { parser.next(); iconPackageName = parser.getText(); } else if (parser.getName().equals(ICON_BITMAP)) { parser.next(); iconBitmap = readBitmap(parser); } else if (parser.getName().equals(ICON_TINT)) { } else if (parser.getName().equals(COLOR)) { parser.next(); iconTint = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(HIGHLIGHT_COLOR)) { parser.next(); highlightColor = Integer.parseInt(parser.getText()); color = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(LABEL)) { parser.next(); label = parser.getText(); Loading Loading @@ -1002,28 +980,15 @@ public final class PhoneAccountRegistrar { } } // Upgrade older phone accounts with explicit package name if (version < 5) { if (iconBitmap == null) { iconPackageName = accountHandle.getComponentName().getPackageName(); } } PhoneAccount.Builder builder = PhoneAccount.builder(accountHandle, label) return PhoneAccount.builder(accountHandle, label) .setAddress(address) .setSubscriptionAddress(subscriptionAddress) .setCapabilities(capabilities) .setIconResId(iconResId) .setColor(color) .setShortDescription(shortDescription) .setSupportedUriSchemes(supportedUriSchemes) .setHighlightColor(highlightColor); if (iconBitmap == null) { builder.setIcon(iconPackageName, iconResId, iconTint); } else { builder.setIcon(iconBitmap); } return builder.build(); .build(); } return null; } Loading tests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package="com.android.server.telecom.tests" android:debuggable="true"> <!-- Test connection service outgoing video preview. --> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="com.android.server.telecom.permission.REGISTER_PROVIDER_OR_SUBSCRIPTION" /> Loading tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java +9 −15 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.net.Uri; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; Loading Loading @@ -110,7 +107,6 @@ public class CallServiceNotifier { .setAddress(Uri.parse("tel:555-TEST")) .setSubscriptionAddress(Uri.parse("tel:555-TEST")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.RED) .setShortDescription("a short description for the call provider") .setSupportedUriSchemes(Arrays.asList("tel")) .build()); Loading @@ -124,7 +120,6 @@ public class CallServiceNotifier { .setSubscriptionAddress(Uri.parse("tel:555-TSIM")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) .setIcon(context, R.drawable.stat_sys_phone_call, Color.GREEN) .setShortDescription("a short description for the sim subscription") .build()); Loading @@ -136,7 +131,6 @@ public class CallServiceNotifier { .setAddress(Uri.parse("tel:555-CMGR")) .setSubscriptionAddress(Uri.parse("tel:555-CMGR")) .setCapabilities(PhoneAccount.CAPABILITY_CONNECTION_MANAGER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.BLUE) .setShortDescription("a short description for the connection manager") .build()); } Loading Loading
AndroidManifest.xml +0 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" package="com.android.server.telecom" android:debuggable="true" coreApp="true" android:sharedUserId="android.uid.system"> Loading
src/com/android/server/telecom/CallsManager.java +0 −2 Original line number Diff line number Diff line Loading @@ -495,8 +495,6 @@ public final class CallsManager extends Call.ListenerBase { List<PhoneAccountHandle> accounts = mPhoneAccountRegistrar.getCallCapablePhoneAccounts(scheme); Log.v(this, "startOutgoingCall found accounts = " + accounts); // Only dial with the requested phoneAccount if it is still valid. Otherwise treat this call // as if a phoneAccount was not specified (does the default behavior instead). // Note: We will not attempt to dial with a requested phoneAccount if it is disabled. Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +17 −52 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class PhoneAccountRegistrar { private static final String FILE_NAME = "phone-account-registrar-state.xml"; @VisibleForTesting public static final int EXPECTED_STATE_VERSION = 5; public static final int EXPECTED_STATE_VERSION = 3; /** Keep in sync with the same in SipSettings.java */ private static final String SIP_SHARED_PREFERENCES = "SIP_PREFERENCES"; Loading Loading @@ -460,9 +460,6 @@ public final class PhoneAccountRegistrar { * @param account The {@code PhoneAccount} to add or replace. */ private void addOrReplacePhoneAccount(PhoneAccount account) { Log.d(this, "addOrReplacePhoneAccount(%s -> %s)", account.getAccountHandle(), account); mState.accounts.add(account); // Search for duplicates and remove any that are found. for (int i = 0; i < mState.accounts.size() - 1; i++) { Loading Loading @@ -884,10 +881,7 @@ public final class PhoneAccountRegistrar { private static final String SUBSCRIPTION_ADDRESS = "subscription_number"; private static final String CAPABILITIES = "capabilities"; private static final String ICON_RES_ID = "icon_res_id"; private static final String ICON_PACKAGE_NAME = "icon_package_name"; private static final String ICON_BITMAP = "icon_bitmap"; private static final String ICON_TINT = "icon_tint"; private static final String HIGHLIGHT_COLOR = "highlight_color"; private static final String COLOR = "color"; private static final String LABEL = "label"; private static final String SHORT_DESCRIPTION = "short_description"; private static final String SUPPORTED_URI_SCHEMES = "supported_uri_schemes"; Loading @@ -906,17 +900,13 @@ public final class PhoneAccountRegistrar { serializer.endTag(null, ACCOUNT_HANDLE); } writeTextIfNonNull(ADDRESS, o.getAddress(), serializer); writeTextIfNonNull(SUBSCRIPTION_ADDRESS, o.getSubscriptionAddress(), serializer); writeTextIfNonNull(CAPABILITIES, Integer.toString(o.getCapabilities()), serializer); writeTextIfNonNull(ICON_RES_ID, Integer.toString(o.getIconResId()), serializer); writeTextIfNonNull(ICON_PACKAGE_NAME, o.getIconPackageName(), serializer); writeBitmapIfNonNull(ICON_BITMAP, o.getIconBitmap(), serializer); writeTextIfNonNull(ICON_TINT, Integer.toString(o.getIconTint()), serializer); writeTextIfNonNull(HIGHLIGHT_COLOR, Integer.toString(o.getHighlightColor()), serializer); writeTextIfNonNull(LABEL, o.getLabel(), serializer); writeTextIfNonNull(SHORT_DESCRIPTION, o.getShortDescription(), serializer); writeTextSafely(ADDRESS, o.getAddress(), serializer); writeTextSafely(SUBSCRIPTION_ADDRESS, o.getSubscriptionAddress(), serializer); writeTextSafely(CAPABILITIES, Integer.toString(o.getCapabilities()), serializer); writeTextSafely(ICON_RES_ID, Integer.toString(o.getIconResId()), serializer); writeTextSafely(COLOR, Integer.toString(o.getColor()), serializer); writeTextSafely(LABEL, o.getLabel(), serializer); writeTextSafely(SHORT_DESCRIPTION, o.getShortDescription(), serializer); writeStringList(SUPPORTED_URI_SCHEMES, o.getSupportedUriSchemes(), serializer); serializer.endTag(null, CLASS_PHONE_ACCOUNT); Loading @@ -931,11 +921,8 @@ public final class PhoneAccountRegistrar { Uri address = null; Uri subscriptionAddress = null; int capabilities = 0; int iconResId = PhoneAccount.NO_RESOURCE_ID; String iconPackageName = null; Bitmap iconBitmap = null; int iconTint = PhoneAccount.NO_COLOR; int highlightColor = PhoneAccount.NO_COLOR; int iconResId = 0; int color = 0; String label = null; String shortDescription = null; List<String> supportedUriSchemes = null; Loading @@ -958,18 +945,9 @@ public final class PhoneAccountRegistrar { } else if (parser.getName().equals(ICON_RES_ID)) { parser.next(); iconResId = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(ICON_PACKAGE_NAME)) { parser.next(); iconPackageName = parser.getText(); } else if (parser.getName().equals(ICON_BITMAP)) { parser.next(); iconBitmap = readBitmap(parser); } else if (parser.getName().equals(ICON_TINT)) { } else if (parser.getName().equals(COLOR)) { parser.next(); iconTint = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(HIGHLIGHT_COLOR)) { parser.next(); highlightColor = Integer.parseInt(parser.getText()); color = Integer.parseInt(parser.getText()); } else if (parser.getName().equals(LABEL)) { parser.next(); label = parser.getText(); Loading Loading @@ -1002,28 +980,15 @@ public final class PhoneAccountRegistrar { } } // Upgrade older phone accounts with explicit package name if (version < 5) { if (iconBitmap == null) { iconPackageName = accountHandle.getComponentName().getPackageName(); } } PhoneAccount.Builder builder = PhoneAccount.builder(accountHandle, label) return PhoneAccount.builder(accountHandle, label) .setAddress(address) .setSubscriptionAddress(subscriptionAddress) .setCapabilities(capabilities) .setIconResId(iconResId) .setColor(color) .setShortDescription(shortDescription) .setSupportedUriSchemes(supportedUriSchemes) .setHighlightColor(highlightColor); if (iconBitmap == null) { builder.setIcon(iconPackageName, iconResId, iconTint); } else { builder.setIcon(iconBitmap); } return builder.build(); .build(); } return null; } Loading
tests/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package="com.android.server.telecom.tests" android:debuggable="true"> <!-- Test connection service outgoing video preview. --> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="com.android.server.telecom.permission.REGISTER_PROVIDER_OR_SUBSCRIPTION" /> Loading
tests/src/com/android/server/telecom/testapps/CallServiceNotifier.java +9 −15 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.net.Uri; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; Loading Loading @@ -110,7 +107,6 @@ public class CallServiceNotifier { .setAddress(Uri.parse("tel:555-TEST")) .setSubscriptionAddress(Uri.parse("tel:555-TEST")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.RED) .setShortDescription("a short description for the call provider") .setSupportedUriSchemes(Arrays.asList("tel")) .build()); Loading @@ -124,7 +120,6 @@ public class CallServiceNotifier { .setSubscriptionAddress(Uri.parse("tel:555-TSIM")) .setCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER | PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION) .setIcon(context, R.drawable.stat_sys_phone_call, Color.GREEN) .setShortDescription("a short description for the sim subscription") .build()); Loading @@ -136,7 +131,6 @@ public class CallServiceNotifier { .setAddress(Uri.parse("tel:555-CMGR")) .setSubscriptionAddress(Uri.parse("tel:555-CMGR")) .setCapabilities(PhoneAccount.CAPABILITY_CONNECTION_MANAGER) .setIcon(context, R.drawable.stat_sys_phone_call, Color.BLUE) .setShortDescription("a short description for the connection manager") .build()); } Loading