pass through original primary ID

This commit is contained in:
Ashley Hughes 2014-03-27 13:35:03 +00:00
parent 4923c9b8e3
commit 140646fa12
3 changed files with 21 additions and 0 deletions

View File

@ -597,6 +597,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
saveParams.oldPassPhrase = mCurrentPassphrase;
saveParams.newKeys = toPrimitiveArray(mKeysView.getNewKeysArray());
saveParams.keys = getKeys(mKeysView);
saveParams.originalPrimaryID = mUserIdsView.getOriginalPrimaryID();
// fill values for this action

View File

@ -198,6 +198,21 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
return ret;
}
public String getOriginalPrimaryID()
{ //NB: this will have to change when we change how Primary IDs are chosen, and so we need to be
// careful about where Master key capabilities are stored... multiple primaries and
// revoked ones make this harder than the simple case we are continuing to assume here
for (int i = 0; i < mEditors.getChildCount(); ++i) {
Editor editor = (Editor) mEditors.getChildAt(i);
if (mType == Id.type.user_id) {
if(((UserIdEditor)editor).getIsOriginallyMainUserID()) {
return ((UserIdEditor)editor).getOriginalID();
}
}
}
return null;
}
public ArrayList<String> getOriginalIDs()
{
ArrayList<String> orig = new ArrayList<String>();

View File

@ -229,6 +229,11 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
return retval;
}
public boolean getIsOriginallyMainUserID()
{
return mOriginallyMainUserID;
}
public boolean primarySwapped()
{
return (mOriginallyMainUserID != isMainUserId());