(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) {
|
public static PhoneAccountHandle getHandle(final Context context, final Account account) {
|
||||||
final var competentName =
|
final var competentName =
|
||||||
new ComponentName(context, CallIntegrationConnectionService.class);
|
new ComponentName(context, CallIntegrationConnectionService.class);
|
||||||
|
|
|
@ -2460,6 +2460,7 @@ public class XmppConnectionService extends Service {
|
||||||
public void createAccount(final Account account) {
|
public void createAccount(final Account account) {
|
||||||
account.initAccountServices(this);
|
account.initAccountServices(this);
|
||||||
databaseBackend.createAccount(account);
|
databaseBackend.createAccount(account);
|
||||||
|
CallIntegrationConnectionService.registerPhoneAccount(this, account);
|
||||||
this.accounts.add(account);
|
this.accounts.add(account);
|
||||||
this.reconnectAccountInBackground(account);
|
this.reconnectAccountInBackground(account);
|
||||||
updateAccountUi();
|
updateAccountUi();
|
||||||
|
@ -2644,6 +2645,7 @@ public class XmppConnectionService extends Service {
|
||||||
};
|
};
|
||||||
mDatabaseWriterExecutor.execute(runnable);
|
mDatabaseWriterExecutor.execute(runnable);
|
||||||
this.accounts.remove(account);
|
this.accounts.remove(account);
|
||||||
|
CallIntegrationConnectionService.unregisterPhoneAccount(this, account);
|
||||||
this.mRosterSyncTaskManager.clear(account);
|
this.mRosterSyncTaskManager.clear(account);
|
||||||
updateAccountUi();
|
updateAccountUi();
|
||||||
mNotificationService.updateErrorNotification();
|
mNotificationService.updateErrorNotification();
|
||||||
|
|
Loading…
Reference in a new issue