Block formatting fixes
This commit is contained in:
parent
cba2e67a70
commit
d415ceae15
@ -50,7 +50,7 @@ public class BluetoothSwap extends SwapType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDiscoverable () {
|
||||
public boolean isDiscoverable() {
|
||||
return isDiscoverable;
|
||||
}
|
||||
|
||||
@ -120,8 +120,7 @@ public class BluetoothSwap extends SwapType {
|
||||
}
|
||||
}
|
||||
|
||||
if (adapter.isEnabled())
|
||||
{
|
||||
if (adapter.isEnabled()) {
|
||||
setConnected(true);
|
||||
} else {
|
||||
Log.i(TAG, "Didn't start Bluetooth swapping server, because Bluetooth is disabled and couldn't be enabled.");
|
||||
|
@ -33,8 +33,7 @@ public abstract class SwapType {
|
||||
|
||||
abstract protected String getBroadcastAction();
|
||||
|
||||
public boolean isDiscoverable ()
|
||||
{
|
||||
public boolean isDiscoverable() {
|
||||
return isConnected();
|
||||
}
|
||||
|
||||
|
@ -97,8 +97,7 @@ public class BluetoothDownloader extends Downloader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close ()
|
||||
{
|
||||
public void close() {
|
||||
if (connection != null)
|
||||
connection.closeQuietly();
|
||||
}
|
||||
|
@ -166,8 +166,7 @@ public abstract class Downloader {
|
||||
|
||||
int readLength = Math.min(input.available(), buffer.length);
|
||||
count = input.read(buffer, 0, readLength);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
count = input.read(buffer);
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,7 @@ public class HttpDownloader extends Downloader {
|
||||
* only stream the file through the {@link HttpDownloader#getInputStream()}
|
||||
* @return
|
||||
*/
|
||||
public HttpDownloader streamDontDownload()
|
||||
{
|
||||
public HttpDownloader streamDontDownload() {
|
||||
onlyStream = true;
|
||||
return this;
|
||||
}
|
||||
@ -69,8 +68,7 @@ public class HttpDownloader extends Downloader {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public BufferedReader getBufferedReader () throws IOException
|
||||
{
|
||||
public BufferedReader getBufferedReader() throws IOException {
|
||||
return new BufferedReader(new InputStreamReader(getInputStream()));
|
||||
}
|
||||
|
||||
@ -169,14 +167,13 @@ public class HttpDownloader extends Downloader {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public void close ()
|
||||
{
|
||||
public void close() {
|
||||
try {
|
||||
if (stream != null)
|
||||
stream.close();
|
||||
}
|
||||
catch (IOException e) {}
|
||||
|
||||
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,7 @@ public class IconDownloader extends BaseImageDownloader {
|
||||
}
|
||||
|
||||
//bluetooth isn't a scheme in the Scheme. library, so we can add a check here
|
||||
if (imageUri.toLowerCase().startsWith("bluetooth"))
|
||||
{
|
||||
if (imageUri.toLowerCase().startsWith("bluetooth")) {
|
||||
Downloader downloader = DownloaderFactory.create(context, imageUri);
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
@ -276,9 +276,9 @@ public class LocalHTTPD extends NanoHTTPD {
|
||||
res.addHeader("ETag", etag);
|
||||
}
|
||||
} else {
|
||||
if (etag.equals(header.get("if-none-match")))
|
||||
if (etag.equals(header.get("if-none-match"))) {
|
||||
res = createResponse(Response.Status.NOT_MODIFIED, mime, "");
|
||||
else {
|
||||
} else {
|
||||
res = createResponse(Response.Status.OK, mime, new FileInputStream(file));
|
||||
res.addHeader("Content-Length", "" + fileLen);
|
||||
res.addHeader("ETag", etag);
|
||||
|
@ -311,9 +311,9 @@ public class BluetoothServer extends Thread {
|
||||
res.addHeader("ETag", etag);
|
||||
}
|
||||
} else {
|
||||
if (etag.equals(header.get("if-none-match")))
|
||||
if (etag.equals(header.get("if-none-match"))) {
|
||||
res = createResponse(NanoHTTPD.Response.Status.NOT_MODIFIED, mime, "");
|
||||
else {
|
||||
} else {
|
||||
res = createResponse(NanoHTTPD.Response.Status.OK, mime, new FileInputStream(file));
|
||||
res.addHeader("Content-Length", "" + fileLen);
|
||||
res.addHeader("ETag", etag);
|
||||
|
@ -44,8 +44,7 @@ public class Request {
|
||||
input = connection.getInputStream();
|
||||
}
|
||||
|
||||
public static Request createHEAD(String path, BluetoothConnection connection)
|
||||
{
|
||||
public static Request createHEAD(String path, BluetoothConnection connection) {
|
||||
return new Request(Methods.HEAD, path, connection);
|
||||
}
|
||||
|
||||
@ -141,8 +140,7 @@ public class Request {
|
||||
return Integer.parseInt(status);
|
||||
}
|
||||
|
||||
private String readLine () throws IOException
|
||||
{
|
||||
private String readLine() throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
String line = null;
|
||||
|
||||
|
@ -62,8 +62,7 @@ public class Response {
|
||||
this.contentStream = contentStream;
|
||||
}
|
||||
|
||||
public void addHeader (String key, String value)
|
||||
{
|
||||
public void addHeader (String key, String value) {
|
||||
headers.put(key, value);
|
||||
}
|
||||
|
||||
|
@ -38,8 +38,7 @@ public abstract class ThemeableListFragment extends ListFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private LayoutInflater getThemedInflater(Context context)
|
||||
{
|
||||
private LayoutInflater getThemedInflater(Context context) {
|
||||
Context c = (getThemeStyle() == 0) ? context : new ContextThemeWrapper(context, getThemeStyle());
|
||||
return (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
String bluetooth = service.getBluetoothSwap().isConnected() ? "Y" : " N";
|
||||
String wifi = service.getWifiSwap().isConnected() ? "Y" : " N";
|
||||
String mdns = service.getWifiSwap().getBonjour().isConnected() ? "Y" : " N";
|
||||
message += "Swap { BT: " + bluetooth + ", WiFi: " + wifi + ", mDNS: " + mdns + "}, ";
|
||||
message += "Swap { BT: " + bluetooth + ", WiFi: " + wifi + ", mDNS: " + mdns + "}, ";
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user