Add missing columns for projections, remove use of raw user id

This commit is contained in:
Dominik Schürmann
2017-01-27 00:52:54 +01:00
parent 732aa0de60
commit 78bbe20149
5 changed files with 30 additions and 73 deletions

View File

@@ -174,16 +174,6 @@ public class SelectPublicKeyFragment extends RecyclerFragment<SelectEncryptKeyAd
getAdapter().getMasterKeyIds() : new long[0];
}
public String[] getSelectedRawUserIds() {
return getAdapter() != null ?
getAdapter().getRawUserIds() : new String[0];
}
public OpenPgpUtils.UserId[] getSelectedUserIds() {
return getAdapter() != null ?
getAdapter().getUserIds() : new OpenPgpUtils.UserId[0];
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
Uri baseUri = KeyRings.buildUnifiedKeyRingsUri();
@@ -199,6 +189,9 @@ public class SelectPublicKeyFragment extends RecyclerFragment<SelectEncryptKeyAd
KeyRings.VERIFIED,
KeyRings.HAS_DUPLICATE_USER_ID,
KeyRings.CREATION,
KeyRings.NAME,
KeyRings.EMAIL,
KeyRings.COMMENT
};
String inMasterKeyList = null;

View File

@@ -121,6 +121,9 @@ public class SelectSignKeyIdListFragment extends RecyclerFragment<SelectSignKeyA
KeyRings.HAS_ANY_SECRET,
KeyRings.HAS_DUPLICATE_USER_ID,
KeyRings.CREATION,
KeyRings.NAME,
KeyRings.EMAIL,
KeyRings.COMMENT
};
String selection = KeyRings.HAS_ANY_SECRET + " != 0";

View File

@@ -30,7 +30,6 @@ import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import org.openintents.openpgp.util.OpenPgpUtils;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.provider.KeychainContract;
import org.sufficientlysecure.keychain.ui.adapter.KeyCursorAdapter;
@@ -113,34 +112,6 @@ public class SelectEncryptKeyAdapter extends KeyCursorAdapter<SelectEncryptKeyAd
}
}
public String[] getRawUserIds() {
String[] selected = new String[mSelected.size()];
for (int i = 0; i < selected.length; i++) {
int position = mSelected.get(i);
if (!moveCursor(position)) {
return selected;
}
selected[i] = getCursor().getRawUserId();
}
return selected;
}
public OpenPgpUtils.UserId[] getUserIds() {
OpenPgpUtils.UserId[] selected = new OpenPgpUtils.UserId[mSelected.size()];
for (int i = 0; i < selected.length; i++) {
int position = mSelected.get(i);
if (!moveCursor(position)) {
return selected;
}
selected[i] = getCursor().getUserId();
}
return selected;
}
@Override
public void onContentChanged() {
mSelected.clear();