23public class BookmarkBase
implements Parcelable, Cloneable
25 private static final String keyLabel =
"bookmark.label";
26 private static final String keyUsername =
"bookmark.username";
27 private static final String keyPassword =
"bookmark.password";
28 private static final String keyDomain =
"bookmark.domain";
30 private static final String keyColors =
"bookmark.colors";
31 private static final String keyResolution =
"bookmark.resolution";
32 private static final String keyWidth =
"bookmark.width";
33 private static final String keyScaleMode =
"bookmark.scale_mode";
34 private static final String keyScaleDesktop =
"bookmark.scale_desktop";
35 private static final String keyScaleDevice =
"bookmark.scale_device";
36 private static final String keyHeight =
"bookmark.height";
38 private static final String keyRFX =
"bookmark.perf_remotefx";
39 private static final String keyGFX =
"bookmark.perf_gfx";
40 private static final String keyH264 =
"bookmark.perf_gfx_h264";
41 private static final String keyFlagWallpaper =
"bookmark.perf_wallpaper";
42 private static final String keyFlagFonts =
"bookmark.perf_font_smoothing";
43 private static final String keyFlagComposition =
"bookmark.perf_desktop_composition";
44 private static final String keyFlagWindowDrag =
"bookmark.perf_window_dragging";
45 private static final String keyFlagMenuAnim =
"bookmark.perf_menu_animation";
46 private static final String keyFlagTheming =
"bookmark.perf_themes";
48 private static final String keyTlsSecLevel =
"bookmark.tlsSecLevel";
49 private static final String keyTlsMinLevel =
"bookmark.tlsMinLevel";
50 private static final String keyLoadBalanceInfo =
"bookmark.loadBalanceInfo";
51 private static final String keyRedirectSDCard =
"bookmark.redirect_sdcard";
52 private static final String keySound =
"bookmark.redirect_sound";
53 private static final String keyMicrophone =
"bookmark.redirect_microphone";
54 private static final String keyCamera =
"bookmark.redirect_camera";
55 private static final String keyPrinter =
"bookmark.redirect_printer";
56 private static final String keySecurity =
"bookmark.security";
57 private static final String keyRemoteApp =
"bookmark.remote_program";
58 private static final String keyAlternateShell =
"bookmark.alternate_shell";
59 private static final String keyWorkDir =
"bookmark.work_dir";
60 private static final String keyConsoleMode =
"bookmark.console_mode";
61 private static final String keyVmConnectMode =
"bookmark.vmconnect_mode";
62 private static final String keyVmConnectGuid =
"bookmark.vmconnect_guid";
64 private static final String keyAsyncChannel =
"bookmark.async_channel";
65 private static final String keyAsyncUpdate =
"bookmark.async_update";
66 private static final String keyDebugLevel =
"bookmark.debug_level";
68 private static final String keyHostname =
"bookmark.hostname";
69 private static final String keyPort =
"bookmark.port";
70 private static final String keyGatewayEnabled =
"bookmark.enable_gateway_settings";
71 private static final String keyGatewayHostname =
"bookmark.gateway_hostname";
72 private static final String keyGatewayPort =
"bookmark.gateway_port";
73 private static final String keyGatewyUser =
"bookmark.gateway_username";
74 private static final String keyGatewayPassword =
"bookmark.gateway_password";
75 private static final String keyGatewayDomain =
"bookmark.gateway_domain";
77 public static final int TYPE_INVALID = -1;
78 public static final int TYPE_MANUAL = 1;
79 public static final int TYPE_QUICKCONNECT = 2;
80 public static final int TYPE_CUSTOM_BASE = 1000;
81 public static final Parcelable.Creator<BookmarkBase> CREATOR =
82 new Parcelable.Creator<BookmarkBase>() {
83 public BookmarkBase createFromParcel(Parcel in)
85 return new BookmarkBase(in);
88 @Override
public BookmarkBase[] newArray(
int size)
90 return new BookmarkBase[size];
93 protected int type = TYPE_MANUAL;
96 @NonNull
private String label =
"";
98 @NonNull
private String username =
"";
100 @NonNull
private String password =
"";
102 @NonNull
private String domain =
"";
112 @NonNull
private String hostname =
"";
113 private int port = 3389;
114 private boolean enableGatewaySettings =
false;
117 private boolean directConnect =
false;
119 public BookmarkBase(Parcel parcel)
121 type = parcel.readInt();
122 id = parcel.readLong();
123 label = Objects.requireNonNull(parcel.readString());
124 username = Objects.requireNonNull(parcel.readString());
125 password = Objects.requireNonNull(parcel.readString());
126 domain = Objects.requireNonNull(parcel.readString());
129 Objects.requireNonNull(parcel.readParcelable(
ScreenSettings.class.getClassLoader()));
131 Objects.requireNonNull(parcel.readParcelable(
PerformanceFlags.class.getClassLoader()));
133 Objects.requireNonNull(parcel.readParcelable(
AdvancedSettings.class.getClassLoader()));
135 Objects.requireNonNull(parcel.readParcelable(
DebugSettings.class.getClassLoader()));
136 hostname = Objects.requireNonNull(parcel.readString());
137 port = parcel.readInt();
138 enableGatewaySettings = (parcel.readInt() == 1);
140 Objects.requireNonNull(parcel.readParcelable(
GatewaySettings.class.getClassLoader()));
141 directConnect = (parcel.readInt() == 1);
144 public BookmarkBase()
153 public void setType(
int type)
163 public void setId(
long id)
168 @NonNull
public String getLabel()
173 public void setLabel(@NonNull String label)
178 @NonNull
public String getUsername()
183 public void setUsername(@NonNull String username)
185 this.username = username;
188 @NonNull
public String getPassword()
193 public void setPassword(@NonNull String password)
195 this.password = password;
198 @NonNull
public String getDomain()
203 public void setDomain(@NonNull String domain)
205 this.domain = domain;
210 return screenSettings;
215 return performanceFlags;
220 return advancedSettings;
225 return debugSettings;
228 @NonNull
public String getHostname()
233 public void setHostname(@NonNull String hostname)
235 this.hostname = hostname;
243 public void setPort(
int port)
248 public boolean getEnableGatewaySettings()
250 return enableGatewaySettings;
253 public void setEnableGatewaySettings(
boolean enableGatewaySettings)
255 this.enableGatewaySettings = enableGatewaySettings;
260 return gatewaySettings;
263 public boolean isDirectConnect()
265 return directConnect;
268 public void setDirectConnect(
boolean directConnect)
270 this.directConnect = directConnect;
275 return screenSettings;
280 return performanceFlags;
283 @Override
public int describeContents()
288 @Override
public void writeToParcel(Parcel out,
int flags)
292 out.writeString(label);
293 out.writeString(username);
294 out.writeString(password);
295 out.writeString(domain);
297 out.writeParcelable(screenSettings, flags);
298 out.writeParcelable(performanceFlags, flags);
299 out.writeParcelable(advancedSettings, flags);
300 out.writeParcelable(debugSettings, flags);
301 out.writeString(hostname);
303 ParcelCompat.writeBoolean(out, enableGatewaySettings);
304 out.writeParcelable(gatewaySettings, flags);
305 ParcelCompat.writeBoolean(out, directConnect);
309 public void writeToSharedPreferences(@NonNull SharedPreferences sharedPrefs)
311 Locale locale = Locale.ENGLISH;
313 SharedPreferences.Editor editor = sharedPrefs.edit();
315 editor.putString(keyLabel, label);
316 editor.putString(keyUsername, username);
317 editor.putString(keyPassword, password);
318 editor.putString(keyDomain, domain);
320 editor.putInt(keyColors, screenSettings.getColors());
321 editor.putString(keyResolution, screenSettings.getResolutionString().toLowerCase(locale));
322 editor.putInt(keyWidth, screenSettings.getWidth());
323 editor.putInt(keyHeight, screenSettings.getHeight());
324 editor.putString(keyScaleMode, screenSettings.getScaleMode());
325 editor.putInt(keyScaleDesktop, screenSettings.getScaleDesktop());
326 editor.putInt(keyScaleDevice, screenSettings.getScaleDevice());
328 editor.putBoolean(keyRFX, performanceFlags.getRemoteFX());
329 editor.putBoolean(keyGFX, performanceFlags.getGfx());
330 editor.putBoolean(keyH264, performanceFlags.getH264());
331 editor.putBoolean(keyFlagWallpaper, performanceFlags.getWallpaper());
332 editor.putBoolean(keyFlagFonts, performanceFlags.getFontSmoothing());
333 editor.putBoolean(keyFlagComposition, performanceFlags.getDesktopComposition());
334 editor.putBoolean(keyFlagWindowDrag, performanceFlags.getFullWindowDrag());
335 editor.putBoolean(keyFlagMenuAnim, performanceFlags.getMenuAnimations());
336 editor.putBoolean(keyFlagTheming, performanceFlags.getTheming());
338 editor.putInt(keyTlsSecLevel, advancedSettings.tlsSecLevel);
339 editor.putInt(keyTlsMinLevel, advancedSettings.tlsMinLevel);
341 editor.putString(keyLoadBalanceInfo, advancedSettings.getLoadBalanceInfo());
342 editor.putBoolean(keyRedirectSDCard, advancedSettings.getRedirectSDCard());
343 editor.putInt(keySound, advancedSettings.getRedirectSound());
344 editor.putBoolean(keyMicrophone, advancedSettings.getRedirectMicrophone());
345 editor.putBoolean(keyCamera, advancedSettings.getRedirectCamera());
346 editor.putBoolean(keyPrinter, advancedSettings.getRedirectPrinter());
347 editor.putInt(keySecurity, advancedSettings.getSecurity());
348 editor.putString(keyRemoteApp, advancedSettings.getRemoteProgram());
349 editor.putString(keyAlternateShell, advancedSettings.getAlternateShell());
350 editor.putString(keyWorkDir, advancedSettings.getWorkDir());
351 editor.putBoolean(keyConsoleMode, advancedSettings.getConsoleMode());
352 editor.putBoolean(keyVmConnectMode, advancedSettings.getVmConnectMode());
353 editor.putString(keyVmConnectGuid, advancedSettings.getVmConnectGuid());
355 editor.putBoolean(keyAsyncChannel, debugSettings.getAsyncChannel());
356 editor.putBoolean(keyAsyncUpdate, debugSettings.getAsyncUpdate());
357 editor.putString(keyDebugLevel, debugSettings.getDebugLevel());
359 editor.putString(keyHostname, hostname);
360 editor.putInt(keyPort, port);
361 editor.putBoolean(keyGatewayEnabled, enableGatewaySettings);
362 editor.putString(keyGatewayHostname, gatewaySettings.getHostname());
363 editor.putInt(keyGatewayPort, gatewaySettings.getPort());
364 editor.putString(keyGatewyUser, gatewaySettings.getUsername());
365 editor.putString(keyGatewayPassword, gatewaySettings.getPassword());
366 editor.putString(keyGatewayDomain, gatewaySettings.getDomain());
372 public void readFromSharedPreferences(@NonNull SharedPreferences sharedPrefs)
374 label = sharedPrefs.getString(keyLabel,
"");
375 username = sharedPrefs.getString(keyUsername,
"");
376 password = sharedPrefs.getString(keyPassword,
"");
377 domain = sharedPrefs.getString(keyDomain,
"");
379 screenSettings.setColors(sharedPrefs.getInt(keyColors, 32));
380 screenSettings.setResolution(sharedPrefs.getString(keyResolution,
"automatic"),
381 sharedPrefs.getInt(keyWidth, 800),
382 sharedPrefs.getInt(keyHeight, 600));
383 screenSettings.setScale(sharedPrefs.getString(keyScaleMode,
"100"),
384 sharedPrefs.getInt(keyScaleDesktop, 100),
385 sharedPrefs.getInt(keyScaleDevice, 100));
387 performanceFlags.setRemoteFX(sharedPrefs.getBoolean(keyRFX,
false));
388 performanceFlags.setGfx(sharedPrefs.getBoolean(keyGFX,
true));
389 performanceFlags.setH264(sharedPrefs.getBoolean(keyH264,
true));
390 performanceFlags.setWallpaper(sharedPrefs.getBoolean(keyFlagWallpaper,
false));
391 performanceFlags.setFontSmoothing(sharedPrefs.getBoolean(keyFlagFonts,
false));
392 performanceFlags.setDesktopComposition(sharedPrefs.getBoolean(keyFlagComposition,
false));
393 performanceFlags.setFullWindowDrag(sharedPrefs.getBoolean(keyFlagWindowDrag,
false));
394 performanceFlags.setMenuAnimations(sharedPrefs.getBoolean(keyFlagMenuAnim,
false));
395 performanceFlags.setTheming(sharedPrefs.getBoolean(keyFlagTheming,
false));
397 advancedSettings.setTlsSecLevel(sharedPrefs.getInt(keyTlsSecLevel, -1));
398 advancedSettings.setTlsMinLevel(sharedPrefs.getInt(keyTlsMinLevel, -1));
400 advancedSettings.setLoadBalanceInfo(sharedPrefs.getString(keyLoadBalanceInfo,
""));
401 advancedSettings.setRedirectSDCard(sharedPrefs.getBoolean(keyRedirectSDCard,
false));
402 advancedSettings.setRedirectSound(sharedPrefs.getInt(keySound, 0));
403 advancedSettings.setRedirectMicrophone(sharedPrefs.getBoolean(keyMicrophone,
false));
404 advancedSettings.setRedirectCamera(sharedPrefs.getBoolean(keyCamera,
false));
405 advancedSettings.setRedirectPrinter(sharedPrefs.getBoolean(keyPrinter,
false));
406 advancedSettings.setSecurity(sharedPrefs.getInt(keySecurity, 0));
407 advancedSettings.setRemoteProgram(sharedPrefs.getString(keyRemoteApp,
""));
408 advancedSettings.setAlternateShell(sharedPrefs.getString(keyAlternateShell,
""));
409 advancedSettings.setWorkDir(sharedPrefs.getString(keyWorkDir,
""));
410 advancedSettings.setConsoleMode(sharedPrefs.getBoolean(keyConsoleMode,
false));
411 advancedSettings.setVmConnectMode(sharedPrefs.getBoolean(keyVmConnectMode,
false));
412 advancedSettings.setVmConnectGuid(sharedPrefs.getString(keyVmConnectGuid,
""));
414 debugSettings.setAsyncChannel(sharedPrefs.getBoolean(keyAsyncChannel,
true));
415 debugSettings.setAsyncUpdate(sharedPrefs.getBoolean(keyAsyncUpdate,
true));
416 debugSettings.setDebugLevel(sharedPrefs.getString(keyDebugLevel,
"INFO"));
418 hostname = sharedPrefs.getString(keyHostname,
"");
419 port = sharedPrefs.getInt(keyPort, 3389);
420 enableGatewaySettings = sharedPrefs.getBoolean(keyGatewayEnabled,
false);
421 gatewaySettings.setHostname(sharedPrefs.getString(keyGatewayHostname,
""));
422 gatewaySettings.setPort(sharedPrefs.getInt(keyGatewayPort, 443));
423 gatewaySettings.setUsername(sharedPrefs.getString(keyGatewyUser,
""));
424 gatewaySettings.setPassword(sharedPrefs.getString(keyGatewayPassword,
""));
425 gatewaySettings.setDomain(sharedPrefs.getString(keyGatewayDomain,
""));
428 @Override
public Object clone()
throws CloneNotSupportedException
430 return super.clone();
434 public static class PerformanceFlags
implements Parcelable
436 public static final Parcelable.Creator<PerformanceFlags> CREATOR =
437 new Parcelable.Creator<PerformanceFlags>() {
438 @NonNull
public PerformanceFlags createFromParcel(Parcel in)
440 return new PerformanceFlags(in);
443 @NonNull @Override
public PerformanceFlags[] newArray(
int size)
445 return new PerformanceFlags[size];
448 private boolean remotefx =
true;
449 private boolean gfx =
true;
450 private boolean h264 =
true;
451 private boolean wallpaper =
true;
452 private boolean theming =
true;
453 private boolean fullWindowDrag =
true;
454 private boolean menuAnimations =
true;
455 private boolean fontSmoothing =
true;
456 private boolean desktopComposition =
true;
458 public PerformanceFlags()
462 public PerformanceFlags(Parcel parcel)
464 remotefx = ParcelCompat.readBoolean(parcel);
465 gfx = ParcelCompat.readBoolean(parcel);
466 h264 = ParcelCompat.readBoolean(parcel);
467 wallpaper = ParcelCompat.readBoolean(parcel);
468 theming = ParcelCompat.readBoolean(parcel);
469 fullWindowDrag = ParcelCompat.readBoolean(parcel);
470 menuAnimations = ParcelCompat.readBoolean(parcel);
471 fontSmoothing = ParcelCompat.readBoolean(parcel);
472 desktopComposition = ParcelCompat.readBoolean(parcel);
475 public boolean getRemoteFX()
480 public void setRemoteFX(
boolean remotefx)
482 this.remotefx = remotefx;
485 public boolean getGfx()
490 public void setGfx(
boolean gfx)
495 public boolean getH264()
500 public void setH264(
boolean h264)
505 public boolean getWallpaper()
510 public void setWallpaper(
boolean wallpaper)
512 this.wallpaper = wallpaper;
515 public boolean getTheming()
520 public void setTheming(
boolean theming)
522 this.theming = theming;
525 public boolean getFullWindowDrag()
527 return fullWindowDrag;
530 public void setFullWindowDrag(
boolean fullWindowDrag)
532 this.fullWindowDrag = fullWindowDrag;
535 public boolean getMenuAnimations()
537 return menuAnimations;
540 public void setMenuAnimations(
boolean menuAnimations)
542 this.menuAnimations = menuAnimations;
545 public boolean getFontSmoothing()
547 return fontSmoothing;
550 public void setFontSmoothing(
boolean fontSmoothing)
552 this.fontSmoothing = fontSmoothing;
555 public boolean getDesktopComposition()
557 return desktopComposition;
560 public void setDesktopComposition(
boolean desktopComposition)
562 this.desktopComposition = desktopComposition;
565 @Override
public int describeContents()
570 @Override
public void writeToParcel(@NonNull Parcel out,
int flags)
572 ParcelCompat.writeBoolean(out, remotefx);
573 ParcelCompat.writeBoolean(out, gfx);
574 ParcelCompat.writeBoolean(out, h264);
575 ParcelCompat.writeBoolean(out, wallpaper);
576 ParcelCompat.writeBoolean(out, theming);
577 ParcelCompat.writeBoolean(out, fullWindowDrag);
578 ParcelCompat.writeBoolean(out, menuAnimations);
579 ParcelCompat.writeBoolean(out, fontSmoothing);
580 ParcelCompat.writeBoolean(out, desktopComposition);
585 public static class ScreenSettings
implements Parcelable
587 public static final int FITSCREEN = -2;
588 public static final int AUTOMATIC = -1;
589 public static final int CUSTOM = 0;
590 public static final int PREDEFINED = 1;
591 public static final Parcelable.Creator<ScreenSettings> CREATOR =
592 new Parcelable.Creator<ScreenSettings>() {
593 @NonNull
public ScreenSettings createFromParcel(Parcel in)
595 return new ScreenSettings(in);
598 @NonNull @Override
public ScreenSettings[] newArray(
int size)
600 return new ScreenSettings[size];
603 private int resolution = AUTOMATIC;
604 private int colors = 32;
605 private int width = 0;
606 private int height = 0;
607 private String scaleMode =
"100";
608 private int scaleDesktop = 100;
609 private int scaleDevice = 100;
611 public ScreenSettings()
615 public ScreenSettings(Parcel parcel)
617 resolution = parcel.readInt();
618 colors = parcel.readInt();
619 width = parcel.readInt();
620 height = parcel.readInt();
621 scaleMode = parcel.readString();
622 scaleDesktop = parcel.readInt();
623 scaleDevice = parcel.readInt();
626 private void validate()
641 if ((width <= 0) || (width > 65536))
646 if ((height <= 0) || (height > 65536))
659 resolution = AUTOMATIC;
664 public void setResolution(@NonNull String resolution,
int width,
int height)
666 if (resolution.contains(
"x"))
668 String[] dimensions = resolution.split(
"x");
669 this.width = Integer.parseInt(dimensions[0]);
670 this.height = Integer.parseInt(dimensions[1]);
671 this.resolution = PREDEFINED;
673 else if (resolution.equalsIgnoreCase(
"custom"))
676 this.height = height;
677 this.resolution = CUSTOM;
679 else if (resolution.equalsIgnoreCase(
"fitscreen"))
681 this.width = this.height = 0;
682 this.resolution = FITSCREEN;
686 this.width = this.height = 0;
687 this.resolution = AUTOMATIC;
691 public int getResolution()
696 public void setResolution(
int resolution)
698 this.resolution = resolution;
700 if (resolution == AUTOMATIC || resolution == FITSCREEN)
707 @NonNull
public String getResolutionString()
710 return (width +
"x" + height);
712 return (isFitScreen() ?
"fitscreen" : isAutomatic() ?
"automatic" :
"custom");
715 public boolean isPredefined()
718 return (resolution == PREDEFINED);
721 public boolean isAutomatic()
724 return (resolution == AUTOMATIC);
727 public boolean isFitScreen()
730 return (resolution == FITSCREEN);
733 public boolean isCustom()
736 return (resolution == CUSTOM);
739 public int getWidth()
745 public void setWidth(
int width)
750 public int getHeight()
756 public void setHeight(
int height)
758 this.height = height;
761 public int getColors()
767 public void setColors(
int colors)
769 this.colors = colors;
772 public void setScale(@NonNull String mode,
int desktop,
int device)
774 scaleMode =
"custom".equalsIgnoreCase(mode) ?
"custom" : mode;
775 scaleDesktop = desktop;
776 scaleDevice = device;
779 public boolean isCustomScale()
781 return "custom".equalsIgnoreCase(scaleMode);
784 @NonNull
public String getScaleMode()
789 public int getScalePreset()
791 if (
"140".equals(scaleMode))
793 if (
"180".equals(scaleMode))
798 public int getScaleDesktop()
803 public int getScaleDevice()
808 @Override
public int describeContents()
813 @Override
public void writeToParcel(@NonNull Parcel out,
int flags)
815 out.writeInt(resolution);
816 out.writeInt(colors);
818 out.writeInt(height);
819 out.writeString(scaleMode);
820 out.writeInt(scaleDesktop);
821 out.writeInt(scaleDevice);
825 public static class DebugSettings
implements Parcelable
827 public static final Parcelable.Creator<DebugSettings> CREATOR =
828 new Parcelable.Creator<DebugSettings>() {
829 @NonNull
public DebugSettings createFromParcel(Parcel in)
831 return new DebugSettings(in);
834 @NonNull @Override
public DebugSettings[] newArray(
int size)
836 return new DebugSettings[size];
840 @NonNull
private String debug =
"INFO";
841 private boolean asyncChannel =
true;
842 private boolean asyncTransport =
false;
843 private boolean asyncUpdate =
true;
845 public DebugSettings()
850 public DebugSettings(@NonNull Parcel parcel)
852 asyncChannel = ParcelCompat.readBoolean(parcel);
853 asyncTransport = ParcelCompat.readBoolean(parcel);
854 asyncUpdate = ParcelCompat.readBoolean(parcel);
855 debug = Objects.requireNonNull(parcel.readString());
858 private void validate()
860 final String[] levels = {
"OFF",
"FATAL",
"ERROR",
"WARN",
"INFO",
"DEBUG",
"TRACE" };
862 for (String level : levels)
864 if (level.equalsIgnoreCase(
this.debug))
873 @NonNull
public String getDebugLevel()
879 public void setDebugLevel(@NonNull String debug)
884 public boolean getAsyncUpdate()
889 public void setAsyncUpdate(
boolean enabled)
891 asyncUpdate = enabled;
894 public boolean getAsyncChannel()
899 public void setAsyncChannel(
boolean enabled)
901 asyncChannel = enabled;
904 @Override
public int describeContents()
909 @Override
public void writeToParcel(@NonNull Parcel out,
int flags)
911 ParcelCompat.writeBoolean(out, asyncChannel);
912 ParcelCompat.writeBoolean(out, asyncTransport);
913 ParcelCompat.writeBoolean(out, asyncUpdate);
914 out.writeString(debug);
919 public static class AdvancedSettings
implements Parcelable
921 public static final Parcelable.Creator<AdvancedSettings> CREATOR =
922 new Parcelable.Creator<AdvancedSettings>() {
923 @NonNull
public AdvancedSettings createFromParcel(Parcel in)
925 return new AdvancedSettings(in);
928 @NonNull @Override
public AdvancedSettings[] newArray(
int size)
930 return new AdvancedSettings[size];
934 @NonNull
private String loadBalanceInfo =
"";
935 private boolean redirectSDCard =
false;
936 private int redirectSound = 0;
937 private boolean redirectMicrophone =
false;
938 private boolean redirectCamera =
false;
939 private boolean redirectPrinter =
false;
940 private int security = 0;
941 private boolean consoleMode =
false;
942 private boolean vmConnectMode =
false;
943 @NonNull
private String vmConnectGuid =
"";
945 @NonNull
private String remoteProgram =
"";
947 @NonNull
private String alternateShell =
"";
949 @NonNull
private String workDir =
"";
950 private int tlsSecLevel = -1;
951 private int tlsMinLevel = -1;
953 public AdvancedSettings()
957 public AdvancedSettings(@NonNull Parcel parcel)
959 loadBalanceInfo = Objects.requireNonNull(parcel.readString());
960 redirectSDCard = ParcelCompat.readBoolean(parcel);
961 redirectSound = parcel.readInt();
962 redirectMicrophone = ParcelCompat.readBoolean(parcel);
963 redirectCamera = ParcelCompat.readBoolean(parcel);
964 redirectPrinter = ParcelCompat.readBoolean(parcel);
965 security = parcel.readInt();
966 consoleMode = ParcelCompat.readBoolean(parcel);
967 vmConnectMode = ParcelCompat.readBoolean(parcel);
968 vmConnectGuid = Objects.requireNonNull(parcel.readString());
969 remoteProgram = Objects.requireNonNull(parcel.readString());
970 alternateShell = Objects.requireNonNull(parcel.readString());
971 workDir = Objects.requireNonNull(parcel.readString());
972 tlsSecLevel = parcel.readInt();
973 tlsMinLevel = parcel.readInt();
976 private void validate()
978 switch (redirectSound)
1002 public int getTlsSecLevel()
1007 public void setTlsSecLevel(
int level)
1009 tlsSecLevel = level;
1012 public void setTlsMinLevel(
int level)
1014 tlsMinLevel = level;
1017 public int getTlsMinLevel()
1022 @NonNull
public String getLoadBalanceInfo()
1024 return loadBalanceInfo;
1027 public void setLoadBalanceInfo(@NonNull String info)
1029 loadBalanceInfo = info;
1031 public boolean getRedirectSDCard()
1033 return redirectSDCard;
1036 public void setRedirectSDCard(
boolean redirectSDCard)
1038 this.redirectSDCard = redirectSDCard;
1041 public boolean getRedirectPrinter()
1043 return redirectPrinter;
1046 public void setRedirectPrinter(
boolean redirectPrinter)
1048 this.redirectPrinter = redirectPrinter;
1051 public int getRedirectSound()
1054 return redirectSound;
1057 public void setRedirectSound(
int redirect)
1059 this.redirectSound = redirect;
1062 public boolean getRedirectMicrophone()
1064 return redirectMicrophone;
1067 public void setRedirectMicrophone(
boolean redirect)
1069 this.redirectMicrophone = redirect;
1072 public boolean getRedirectCamera()
1074 return redirectCamera;
1077 public void setRedirectCamera(
boolean redirect)
1079 this.redirectCamera = redirect;
1082 public int getSecurity()
1088 public void setSecurity(
int security)
1090 this.security = security;
1093 public boolean getConsoleMode()
1098 public void setConsoleMode(
boolean consoleMode)
1100 this.consoleMode = consoleMode;
1103 @NonNull
public String getRemoteProgram()
1105 return remoteProgram;
1108 public void setRemoteProgram(@NonNull String remoteProgram)
1110 this.remoteProgram = remoteProgram;
1113 @NonNull
public String getAlternateShell()
1115 return alternateShell;
1118 public void setAlternateShell(@NonNull String alternateShell)
1120 this.alternateShell = alternateShell;
1123 @NonNull
public String getWorkDir()
1128 public void setWorkDir(@NonNull String workDir)
1130 this.workDir = workDir;
1133 public boolean getVmConnectMode()
1135 return vmConnectMode;
1138 public void setVmConnectMode(
boolean vmConnectMode)
1140 this.vmConnectMode = vmConnectMode;
1143 @NonNull
public String getVmConnectGuid()
1145 return vmConnectGuid;
1148 public void setVmConnectGuid(@NonNull String vmConnectGuid)
1150 this.vmConnectGuid = vmConnectGuid;
1153 @Override
public int describeContents()
1158 @Override
public void writeToParcel(@NonNull Parcel out,
int flags)
1160 out.writeString(loadBalanceInfo);
1161 ParcelCompat.writeBoolean(out, redirectSDCard);
1162 out.writeInt(redirectSound);
1163 ParcelCompat.writeBoolean(out, redirectMicrophone);
1164 ParcelCompat.writeBoolean(out, redirectCamera);
1165 ParcelCompat.writeBoolean(out, redirectPrinter);
1166 out.writeInt(security);
1167 ParcelCompat.writeBoolean(out, consoleMode);
1168 ParcelCompat.writeBoolean(out, vmConnectMode);
1169 out.writeString(vmConnectGuid);
1170 out.writeString(remoteProgram);
1171 out.writeString(alternateShell);
1172 out.writeString(workDir);
1173 out.writeInt(tlsSecLevel);
1174 out.writeInt(tlsMinLevel);
1178 public static class GatewaySettings
implements Parcelable
1180 public static final Parcelable.Creator<GatewaySettings> CREATOR =
1181 new Parcelable.Creator<GatewaySettings>() {
1182 @NonNull
public GatewaySettings createFromParcel(Parcel in)
1184 return new GatewaySettings(in);
1187 @NonNull @Override
public GatewaySettings[] newArray(
int size)
1189 return new GatewaySettings[size];
1193 @NonNull
private String hostname =
"";
1194 private int port = 443;
1196 @NonNull
private String username =
"";
1198 @NonNull
private String password =
"";
1200 @NonNull
private String domain =
"";
1202 public GatewaySettings()
1206 public GatewaySettings(Parcel parcel)
1208 hostname = Objects.requireNonNull(parcel.readString());
1209 port = parcel.readInt();
1210 username = Objects.requireNonNull(parcel.readString());
1211 password = Objects.requireNonNull(parcel.readString());
1212 domain = Objects.requireNonNull(parcel.readString());
1215 @NonNull
public String getHostname()
1220 public void setHostname(@NonNull String hostname)
1222 this.hostname = hostname;
1225 public int getPort()
1230 public void setPort(
int port)
1235 @NonNull
public String getUsername()
1240 public void setUsername(@NonNull String username)
1242 this.username = username;
1245 @NonNull
public String getPassword()
1250 public void setPassword(@NonNull String password)
1252 this.password = password;
1255 @NonNull
public String getDomain()
1260 public void setDomain(@NonNull String domain)
1262 this.domain = domain;
1265 @Override
public int describeContents()
1270 @Override
public void writeToParcel(@NonNull Parcel out,
int flags)
1272 out.writeString(hostname);
1274 out.writeString(username);
1275 out.writeString(password);
1276 out.writeString(domain);