35146a4fb8dfe46c9222acf30fc9f1761fe17a74
1 /* ownCloud Android Library is available under MIT license
2 * Copyright (C) 2014 ownCloud (http://www.owncloud.org/)
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 package com
.owncloud
.android
.authentication
;
27 import android
.accounts
.Account
;
28 import android
.os
.Parcel
;
29 import android
.os
.Parcelable
;
32 * Account with extra information specific for ownCloud accounts.
34 * TODO integrate in the main app
36 * @author David A. Velasco
38 public class OwnCloudAccount
extends Account
{
40 private String mAuthTokenType
;
42 public OwnCloudAccount(String name
, String type
, String authTokenType
) {
44 // TODO validate authTokentype as supported
45 mAuthTokenType
= authTokenType
;
49 * Reconstruct from parcel
51 * @param source The source parcel
53 public OwnCloudAccount(Parcel source
) {
55 mAuthTokenType
= source
.readString();
59 public void writeToParcel(Parcel dest
, int flags
) {
60 super.writeToParcel(dest
, flags
);
61 dest
.writeString(mAuthTokenType
);
65 public String
getAuthTokenType() {
66 return mAuthTokenType
;
70 public static final Parcelable
.Creator
<OwnCloudAccount
> CREATOR
= new Parcelable
.Creator
<OwnCloudAccount
>() {
72 public OwnCloudAccount
createFromParcel(Parcel source
) {
73 return new OwnCloudAccount(source
);
77 public OwnCloudAccount
[] newArray(int size
) {
78 return new OwnCloudAccount
[size
];