diff options
| author | Harsh Shandilya <me@msfjarvis.dev> | 2023-12-17 12:16:35 +0530 |
|---|---|---|
| committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-12-17 12:16:35 +0530 |
| commit | 7c3410f390c7d12315e7c3e829c1714435361fe8 (patch) | |
| tree | 18ec78cb053107ea79ceb5f3e46ed0da38565649 /openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt | |
| parent | 97bc1e0ce52fc8411b252ae912bac40d29feee64 (diff) | |
| download | HardenedPass-7c3410f390c7d12315e7c3e829c1714435361fe8.tar.gz HardenedPass-7c3410f390c7d12315e7c3e829c1714435361fe8.zip | |
chore: remove obsolete openpgp-ktx code
Diffstat (limited to 'openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt')
| -rw-r--r-- | openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt deleted file mode 100644 index 0756c023..00000000 --- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpError.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ -@file:JvmName("OpenPgpError") - -package org.openintents.openpgp - -import android.os.Parcel -import android.os.Parcelable -import android.os.Parcelable.Creator - -public class OpenPgpError() : Parcelable { - - public var errorId: Int = 0 - public var message: String? = null - - private constructor(parcel: Parcel) : this() { - errorId = parcel.readInt() - message = parcel.readString() - } - - internal constructor(errorId: Int, message: String?) : this() { - this.errorId = errorId - this.message = message - } - - internal constructor(b: OpenPgpError) : this() { - errorId = b.errorId - message = b.message - } - - override fun describeContents(): Int { - return 0 - } - - override fun writeToParcel(dest: Parcel, flags: Int) { - /** - * NOTE: When adding fields in the process of updating this API, make sure to bump - * [PARCELABLE_VERSION]. - */ - dest.writeInt(PARCELABLE_VERSION) - // Inject a placeholder that will store the parcel size from this point on - // (not including the size itself). - val sizePosition = dest.dataPosition() - dest.writeInt(0) - val startPosition = dest.dataPosition() - // version 1 - dest.writeInt(errorId) - dest.writeString(message) - // Go back and write the size - val parcelableSize = dest.dataPosition() - startPosition - dest.setDataPosition(sizePosition) - dest.writeInt(parcelableSize) - dest.setDataPosition(startPosition + parcelableSize) - } - - public companion object CREATOR : Creator<OpenPgpError> { - - /** - * Since there might be a case where new versions of the client using the library getting old - * versions of the protocol (and thus old versions of this class), we need a versioning system - * for the parcels sent between the clients and the providers. - */ - private const val PARCELABLE_VERSION = 1 - - // possible values for errorId - public const val CLIENT_SIDE_ERROR: Int = -1 - public const val GENERIC_ERROR: Int = 0 - public const val INCOMPATIBLE_API_VERSIONS: Int = 1 - public const val NO_OR_WRONG_PASSPHRASE: Int = 2 - public const val NO_USER_IDS: Int = 3 - public const val OPPORTUNISTIC_MISSING_KEYS: Int = 4 - - override fun createFromParcel(source: Parcel): OpenPgpError? { - source.readInt() // parcelableVersion - val parcelableSize = source.readInt() - val startPosition = source.dataPosition() - val error = OpenPgpError() - error.errorId = source.readInt() - error.message = source.readString() - // skip over all fields added in future versions of this parcel - source.setDataPosition(startPosition + parcelableSize) - return error - } - - override fun newArray(size: Int): Array<OpenPgpError?> { - return arrayOfNulls(size) - } - } -} |
