Review the behaviour when delete locally a keep_in_sync_file.Clear etag to force...
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / OwnCloudAccount.java
1 /* ownCloud Android client application
2 * Copyright (C) 2014 ownCloud Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 */
17
18 package com.owncloud.android.authentication;
19
20 import android.accounts.Account;
21 import android.os.Parcel;
22 import android.os.Parcelable;
23
24 /**
25 * Account with extra information specific for ownCloud accounts.
26 *
27 * TODO integrate in the main app
28 *
29 * @author David A. Velasco
30 */
31 public class OwnCloudAccount extends Account {
32
33 private String mAuthTokenType;
34
35 public OwnCloudAccount(String name, String type, String authTokenType) {
36 super(name, type);
37 // TODO validate authTokentype as supported
38 mAuthTokenType = authTokenType;
39 }
40
41 /**
42 * Reconstruct from parcel
43 *
44 * @param source The source parcel
45 */
46 public OwnCloudAccount(Parcel source) {
47 super(source);
48 mAuthTokenType = source.readString();
49 }
50
51 @Override
52 public void writeToParcel(Parcel dest, int flags) {
53 super.writeToParcel(dest, flags);
54 dest.writeString(mAuthTokenType);
55 }
56
57
58 public String getAuthTokenType() {
59 return mAuthTokenType;
60 }
61
62
63 public static final Parcelable.Creator<OwnCloudAccount> CREATOR = new Parcelable.Creator<OwnCloudAccount>() {
64 @Override
65 public OwnCloudAccount createFromParcel(Parcel source) {
66 return new OwnCloudAccount(source);
67 }
68
69 @Override
70 public OwnCloudAccount [] newArray(int size) {
71 return new OwnCloudAccount[size];
72 }
73 };
74
75 }