Merge "Revert "Get rid of deleteAccountPIMData from IEmailService"" into ub-mail-master
This commit is contained in:
commit
92a059ece4
|
@ -247,6 +247,28 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService {
|
||||||
}, "sendMeetingResponse");
|
}, "sendMeetingResponse");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request the service to delete the account's PIM (personal information management) data. This
|
||||||
|
* data includes any data that is 1) associated with the account and 2) created/stored by the
|
||||||
|
* service or its sync adapters and 3) not stored in the EmailProvider database (e.g. contact
|
||||||
|
* and calendar information).
|
||||||
|
*
|
||||||
|
* @param emailAddress the email address for the account whose data should be deleted
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void deleteAccountPIMData(final String emailAddress) throws RemoteException {
|
||||||
|
setTask(new ProxyTask() {
|
||||||
|
@Override
|
||||||
|
public void run() throws RemoteException {
|
||||||
|
mService.deleteAccountPIMData(emailAddress);
|
||||||
|
}
|
||||||
|
}, "deleteAccountPIMData");
|
||||||
|
// This can be called when deleting accounts. After making this call, the caller will
|
||||||
|
// ask for account reconciliation, which will kill the processes. We wait for completion
|
||||||
|
// to avoid the race.
|
||||||
|
waitForCompletion();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search for messages given a query string. The string is interpreted as the logical AND of
|
* Search for messages given a query string. The string is interpreted as the logical AND of
|
||||||
* terms separated by white space. The search is performed on the specified mailbox in the
|
* terms separated by white space. The search is performed on the specified mailbox in the
|
||||||
|
|
|
@ -53,4 +53,7 @@ interface IEmailService {
|
||||||
|
|
||||||
// Service control operations (i.e. does not generate a client-server message).
|
// Service control operations (i.e. does not generate a client-server message).
|
||||||
oneway void setLogging(int on);
|
oneway void setLogging(int on);
|
||||||
|
|
||||||
|
// Needs to get moved into Email since this is NOT a client-server command.
|
||||||
|
void deleteAccountPIMData(String emailAddress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5954,10 +5954,17 @@ public class EmailProvider extends ContentProvider {
|
||||||
cv.putNull(AccountColumns.SYNC_KEY);
|
cv.putNull(AccountColumns.SYNC_KEY);
|
||||||
resolver.update(Account.CONTENT_URI, cv, Account.ID_SELECTION, accountIdArgs);
|
resolver.update(Account.CONTENT_URI, cv, Account.ID_SELECTION, accountIdArgs);
|
||||||
|
|
||||||
// Delete the account from the Android account manager.
|
// Delete PIM data (contacts, calendar), stop syncs, etc. if applicable
|
||||||
// This will delete any contacts and calendar data, stop syncs, etc.
|
|
||||||
if (emailAddress != null) {
|
if (emailAddress != null) {
|
||||||
AccountReconciler.reconcileAccounts(context);
|
final IEmailService service =
|
||||||
|
EmailServiceUtils.getServiceForAccount(context, accountId);
|
||||||
|
if (service != null) {
|
||||||
|
try {
|
||||||
|
service.deleteAccountPIMData(emailAddress);
|
||||||
|
} catch (final RemoteException e) {
|
||||||
|
// Can't do anything about this
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -380,6 +380,11 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm
|
||||||
// Not required
|
// Not required
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAccountPIMData(final String emailAddress) throws RemoteException {
|
||||||
|
AccountReconciler.reconcileAccounts(mContext);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int searchMessages(long accountId, SearchParams params, long destMailboxId)
|
public int searchMessages(long accountId, SearchParams params, long destMailboxId)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
|
|
|
@ -679,6 +679,10 @@ public class EmailServiceUtils {
|
||||||
public void sendMeetingResponse(long messageId, int response) throws RemoteException {
|
public void sendMeetingResponse(long messageId, int response) throws RemoteException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAccountPIMData(final String emailAddress) throws RemoteException {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int searchMessages(long accountId, SearchParams params, long destMailboxId)
|
public int searchMessages(long accountId, SearchParams params, long destMailboxId)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
|
|
Loading…
Reference in New Issue