1 /* ownCloud Android client application 
   2  *   Copyright (C) 2014 ownCloud Inc. 
   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. 
   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. 
  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/>. 
  18 package com
.owncloud
.android
.authentication
; 
  20 import android
.accounts
.Account
; 
  21 import android
.os
.Parcel
; 
  22 import android
.os
.Parcelable
; 
  25  * Account with extra information specific for ownCloud accounts. 
  27  * TODO integrate in the main app 
  29  * @author David A. Velasco 
  31 public class OwnCloudAccount 
extends Account 
{ 
  33         private String mAuthTokenType
; 
  35         public OwnCloudAccount(String name
, String type
, String authTokenType
) { 
  37                 // TODO validate authTokentype as supported 
  38                 mAuthTokenType 
= authTokenType
; 
  42      * Reconstruct from parcel 
  44      * @param source The source parcel 
  46         public OwnCloudAccount(Parcel source
) { 
  48         mAuthTokenType 
= source
.readString(); 
  52     public void writeToParcel(Parcel dest
, int flags
) { 
  53         super.writeToParcel(dest
, flags
); 
  54         dest
.writeString(mAuthTokenType
); 
  58         public String 
getAuthTokenType() { 
  59                 return mAuthTokenType
; 
  63     public static final Parcelable
.Creator
<OwnCloudAccount
> CREATOR 
= new Parcelable
.Creator
<OwnCloudAccount
>() { 
  65         public OwnCloudAccount 
createFromParcel(Parcel source
) { 
  66             return new OwnCloudAccount(source
); 
  70         public OwnCloudAccount 
[] newArray(int size
) { 
  71             return new OwnCloudAccount
[size
];