11 package com.freerdp.freerdpcore.application;
13 import android.content.Context;
14 import android.graphics.Bitmap;
15 import android.graphics.drawable.BitmapDrawable;
16 import android.net.Uri;
17 import android.os.Parcel;
18 import android.os.Parcelable;
20 import com.freerdp.freerdpcore.domain.BookmarkBase;
21 import com.freerdp.freerdpcore.services.LibFreeRDP;
25 public static final Parcelable.Creator<
SessionState> CREATOR =
37 private long instance;
40 private BitmapDrawable surface;
45 instance = parcel.readLong();
46 bookmark = parcel.readParcelable(
null);
47 openUri = parcel.readParcelable(
null);
49 Bitmap bitmap = parcel.readParcelable(
null);
50 surface =
new BitmapDrawable(bitmap);
55 this.instance = instance;
56 this.bookmark = bookmark;
58 this.uiEventListener =
null;
63 this.instance = instance;
65 this.openUri = openUri;
66 this.uiEventListener =
null;
69 public void connect(Context context)
73 LibFreeRDP.setConnectionInfo(context, instance, bookmark);
77 LibFreeRDP.setConnectionInfo(context, instance, openUri);
82 public long getInstance()
92 public Uri getOpenUri()
99 return uiEventListener;
104 this.uiEventListener = uiEventListener;
107 public BitmapDrawable getSurface()
112 public void setSurface(BitmapDrawable surface)
114 this.surface = surface;
117 @Override
public int describeContents()
122 @Override
public void writeToParcel(Parcel out,
int flags)
124 out.writeLong(instance);
125 out.writeParcelable(bookmark, flags);
126 out.writeParcelable(openUri, flags);
127 out.writeParcelable(surface.getBitmap(), flags);