delete public key if storage of private key did not worked

This commit is contained in:
tobiasKaminsky 2018-02-13 10:56:13 +01:00
parent 6a35a44598
commit 04de5cab62
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -41,6 +41,7 @@ import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.users.DeletePublicKeyOperation;
import com.owncloud.android.lib.resources.users.GetPrivateKeyOperation;
import com.owncloud.android.lib.resources.users.GetPublicKeyOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
@ -346,8 +347,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
// get user id
String userID;
GetRemoteUserInfoOperation remoteUserNameOperation =
new GetRemoteUserInfoOperation();
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
RemoteOperationResult remoteUserNameOperationResult = remoteUserNameOperation
.execute(account, getContext(), true);
@ -398,8 +398,10 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
keyResult = KEY_CREATED;
return (String) storePrivateKeyResult.getData().get(0);
} else {
DeletePublicKeyOperation deletePublicKeyOperation = new DeletePublicKeyOperation();
deletePublicKeyOperation.execute(account, getContext(), true);
}
} catch (Exception e) {
Log_OC.e(TAG, e.getMessage());
}