2010-01-15 00:02:27 -05:00
|
|
|
package com.fsck.k9.remotecontrol;
|
|
|
|
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
class AccountReceiver extends BroadcastReceiver
|
|
|
|
{
|
|
|
|
K9AccountReceptor receptor = null;
|
|
|
|
|
|
|
|
protected AccountReceiver(K9AccountReceptor nReceptor)
|
|
|
|
{
|
|
|
|
receptor = nReceptor;
|
|
|
|
}
|
2010-01-17 19:11:02 -05:00
|
|
|
|
2010-01-15 00:02:27 -05:00
|
|
|
@Override
|
|
|
|
public void onReceive(Context context, Intent intent)
|
|
|
|
{
|
|
|
|
if (K9RemoteControl.K9_REQUEST_ACCOUNTS.equals(intent.getAction()))
|
|
|
|
{
|
|
|
|
Bundle bundle = getResultExtras(false);
|
|
|
|
if (bundle == null)
|
|
|
|
{
|
|
|
|
Log.w(K9RemoteControl.LOG_TAG, "Response bundle is empty");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
receptor.accounts(bundle.getStringArray(K9RemoteControl.K9_ACCOUNT_UUIDS), bundle.getStringArray(K9RemoteControl.K9_ACCOUNT_DESCRIPTIONS));
|
|
|
|
}
|
|
|
|
}
|
2010-01-17 19:11:02 -05:00
|
|
|
|
2010-01-15 00:02:27 -05:00
|
|
|
}
|