(un)register phone account on xmpp account creation/deletion
This commit is contained in:
parent
b9e4296321
commit
f119c36bff
|
@ -181,6 +181,10 @@ public class CallIntegrationConnectionService extends ConnectionService {
|
|||
}
|
||||
}
|
||||
|
||||
public static void unregisterPhoneAccount(final Context context, final Account account) {
|
||||
context.getSystemService(TelecomManager.class).unregisterPhoneAccount(getHandle(context, account));
|
||||
}
|
||||
|
||||
public static PhoneAccountHandle getHandle(final Context context, final Account account) {
|
||||
final var competentName =
|
||||
new ComponentName(context, CallIntegrationConnectionService.class);
|
||||
|
|
|
@ -2460,6 +2460,7 @@ public class XmppConnectionService extends Service {
|
|||
public void createAccount(final Account account) {
|
||||
account.initAccountServices(this);
|
||||
databaseBackend.createAccount(account);
|
||||
CallIntegrationConnectionService.registerPhoneAccount(this, account);
|
||||
this.accounts.add(account);
|
||||
this.reconnectAccountInBackground(account);
|
||||
updateAccountUi();
|
||||
|
@ -2644,6 +2645,7 @@ public class XmppConnectionService extends Service {
|
|||
};
|
||||
mDatabaseWriterExecutor.execute(runnable);
|
||||
this.accounts.remove(account);
|
||||
CallIntegrationConnectionService.unregisterPhoneAccount(this, account);
|
||||
this.mRosterSyncTaskManager.clear(account);
|
||||
updateAccountUi();
|
||||
mNotificationService.updateErrorNotification();
|
||||
|
|
Loading…
Reference in a new issue