diff --git a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java index 47b3497a9..6e642c92d 100644 --- a/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java +++ b/plugins/openpgp-api-lib/openpgp-api/src/main/java/org/openintents/openpgp/util/OpenPgpKeyPreference.java @@ -23,8 +23,6 @@ import android.content.Context; import android.content.Intent; import android.content.IntentSender; import android.content.res.TypedArray; -import android.os.Parcel; -import android.os.Parcelable; import android.preference.Preference; import android.util.AttributeSet; import android.util.Log; @@ -213,84 +211,6 @@ public class OpenPgpKeyPreference extends Preference implements OpenPgpApiManage } } - @Override - protected Parcelable onSaveInstanceState() { - /* - * Suppose a client uses this preference type without persisting. We - * must save the instance state so it is able to, for example, survive - * orientation changes. - */ - - final Parcelable superState = super.onSaveInstanceState(); - if (isPersistent()) { - // No need to save instance state since it's persistent - return superState; - } - - // Save the instance state - final SavedState myState = new SavedState(superState); - myState.keyId = keyId; - myState.defaultUserId = defaultUserId; - return myState; - } - - @Override - protected void onRestoreInstanceState(Parcelable state) { - if (!state.getClass().equals(SavedState.class)) { - // Didn't save state for us in onSaveInstanceState - super.onRestoreInstanceState(state); - return; - } - - // Restore the instance state - SavedState myState = (SavedState) state; - super.onRestoreInstanceState(myState.getSuperState()); - keyId = myState.keyId; - defaultUserId = myState.defaultUserId; - notifyChanged(); - } - - /** - * SavedState, a subclass of {@link BaseSavedState}, will store the state - * of MyPreference, a subclass of Preference. - *

- * It is important to always call through to super methods. - */ - private static class SavedState extends BaseSavedState { - long keyId; - String defaultUserId; - - public SavedState(Parcel source) { - super(source); - - keyId = source.readLong(); - defaultUserId = source.readString(); - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - super.writeToParcel(dest, flags); - - dest.writeLong(keyId); - dest.writeString(defaultUserId); - } - - public SavedState(Parcelable superState) { - super(superState); - } - - public static final Parcelable.Creator CREATOR = - new Parcelable.Creator() { - public SavedState createFromParcel(Parcel in) { - return new SavedState(in); - } - - public SavedState[] newArray(int size) { - return new SavedState[size]; - } - }; - } - public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case REQUEST_CODE_API_MANAGER: