Plugins: transferring list of protected fields

CreateDatabaseActivity: Passing app task to next activity
Keepass.cs: added documentation on Activities and AppTasks
SearchActivity.cs: passing appTask to next activity, using ForwardResult to pass ActivityResult back to previous activity
FileSelectActivity: pass AppTask to CreateDatabaseActivity, Recreate instead of Start+Finish (to have correct handling of ActivityResults)
This commit is contained in:
Philipp Crocoll
2014-05-14 07:23:31 +02:00
parent 00332523e6
commit f613206dab
19 changed files with 246 additions and 89 deletions

View File

@@ -52,6 +52,12 @@ public abstract class PluginActionBroadcastReceiver extends BroadcastReceiver {
}
return res;
}
protected String[] getProtectedFieldsListFromIntent()
{
return _intent.getStringArrayExtra(Strings.EXTRA_PROTECTED_FIELDS_LIST);
}
}
protected class ActionSelected extends PluginActionBase
@@ -89,10 +95,23 @@ public abstract class PluginActionBroadcastReceiver extends BroadcastReceiver {
return getFieldId() == null;
}
/**
*
* @return a hashmap containing the entry fields in key/value form
*/
public HashMap<String, String> getEntryFields()
{
return getEntryFieldsFromIntent();
}
/**
*
* @return an array with the keys of all protected fields in the entry
*/
public String[] getProtectedFieldsList()
{
return getProtectedFieldsListFromIntent();
}
}
protected class CloseEntryView extends PluginActionBase
@@ -125,6 +144,15 @@ public abstract class PluginActionBroadcastReceiver extends BroadcastReceiver {
return getEntryFieldsFromIntent();
}
/**
*
* @return an array with the keys of all protected fields in the entry
*/
public String[] getProtectedFieldsList()
{
return getProtectedFieldsListFromIntent();
}
public void addEntryAction(String actionDisplayText, int actionIconResourceId, Bundle actionData) throws PluginAccessException
{
addEntryFieldAction(null, null, actionDisplayText, actionIconResourceId, actionData);

View File

@@ -88,6 +88,12 @@ public class Strings {
*/
public static final String EXTRA_ENTRY_OUTPUT_DATA = "keepass2android.EXTRA_ENTRY_OUTPUT_DATA";
/**
* Json serialized lisf of field keys, specifying which field of the EXTRA_ENTRY_OUTPUT_DATA is protected.
*/
public static final String EXTRA_PROTECTED_FIELDS_LIST = "keepass2android.EXTRA_PROTECTED_FIELDS_LIST";
/**
* Extra key for passing the access token (both ways)
*/