/** Connects to the passed 'Server' object. */ public void connectToServer(Server server) { this.connectedServer = server; String plumbleVersion; try { plumbleVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (NameNotFoundException e) { plumbleVersion = "???"; } final String certificatePath = settings.getCertificatePath(); final String certificatePassword = settings.getCertificatePassword(); mProtocolHost = new ServiceProtocolHost(); mConnectionHost = new ServiceConnectionHost(); mAudioHost = new ServiceAudioOutputHost(); mClient = new MumbleConnection( mConnectionHost, plumbleVersion, connectedServer.getHost(), connectedServer.getPort(), connectedServer.getUsername(), connectedServer.getPassword(), certificatePath, certificatePassword, settings.isTcpForced(), settings.isOpusDisabled()); mProtocol = new MumbleProtocol(mProtocolHost, mAudioHost, mClient, getApplicationContext()); mClientThread = mClient.start(mProtocol); // Acquire wake lock wakeLock.acquire(); // Enable TTS tts = new TextToSpeech(this, this); }
/** * @return True if the connected server does not have a database representation; hence, 'public'. */ public boolean isConnectedServerPublic() { return connectedServer.getId() == -1; }