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

Commit c9cf7c8f authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Fix default phone account handle deserialization am: ded880cf

am: a92dd2a3

Change-Id: I3222f45ac00ad8372deb19167644e6f81fd5d4e6
parents 6cc3c24f a92dd2a3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -448,6 +448,8 @@ public class PhoneAccountRegistrar {
     */
    public boolean enablePhoneAccount(PhoneAccountHandle accountHandle, boolean isEnabled) {
        PhoneAccount account = getPhoneAccountUnchecked(accountHandle);
        Log.i(this, "Phone account %s %s.", accountHandle.toString(),
                isEnabled ? "enabled" : "disabled");
        if (account == null) {
            Log.w(this, "Could not find account to enable: " + accountHandle);
            return false;
@@ -1481,10 +1483,11 @@ public class PhoneAccountRegistrar {
                                parser.next();
                                userSerialNumberString = parser.getText();
                            } else if (parser.getName().equals(GROUP_ID)) {
                                parser.next();
                                if (parser.next() == XmlPullParser.TEXT) {
                                    groupId = parser.getText();
                                }
                            }
                        }
                        UserHandle userHandle = null;
                        if (userSerialNumberString != null) {
                            try {
+10 −0
Original line number Diff line number Diff line
@@ -126,6 +126,16 @@ public class PhoneAccountRegistrarTest extends TelecomTestCase {
        assertPhoneAccountEquals(input, result);
    }

    @MediumTest
    public void testDefaultPhoneAccountHandleEmptyGroup() throws Exception {
        DefaultPhoneAccountHandle input = new DefaultPhoneAccountHandle(Process.myUserHandle(),
                makeQuickAccountHandle("i1"), "");
        DefaultPhoneAccountHandle result = roundTripXml(this, input,
                PhoneAccountRegistrar.sDefaultPhoneAcountHandleXml, mContext);

        assertDefaultPhoneAccountHandleEquals(input, result);
    }

    /**
     * Test to ensure non-supported values
     * @throws Exception