From a4d3daaa3e3587d7f6276d938e6018e341552bb3 Mon Sep 17 00:00:00 2001
From: akwizgran <michael@briarproject.org>
Date: Thu, 13 Jun 2013 17:55:12 +0100
Subject: [PATCH] Removed a Java 1.6 API call.

---
 .../net/sf/briar/plugins/tor/TorPlugin.java   | 30 ++++++++-----------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java b/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
index d169b3a6da..1f42a60b2b 100644
--- a/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
+++ b/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java
@@ -40,7 +40,6 @@ import net.sf.briar.api.plugins.duplex.DuplexTransportConnection;
 import net.sf.briar.util.StringUtils;
 import socks.Socks5Proxy;
 import socks.SocksSocket;
-import android.annotation.SuppressLint;
 import android.content.Context;
 import android.os.Build;
 import android.os.FileObserver;
@@ -275,25 +274,20 @@ class TorPlugin implements DuplexPlugin, EventHandler {
 		out.close();
 	}
 
-	@SuppressLint("NewApi")
 	private boolean setExecutable(File f) {
-		if(Build.VERSION.SDK_INT >= 9) {
-			return f.setExecutable(true, true);
-		} else {
-			String[] command = { "chmod", "700", f.getAbsolutePath() };
-			try {
-				return Runtime.getRuntime().exec(command).waitFor() == 0;
-			} catch(IOException e) {
-				if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
-			} catch(InterruptedException e) {
-				if(LOG.isLoggable(WARNING))
-					LOG.warning("Interrupted while executing chmod");
-				Thread.currentThread().interrupt();
-			} catch(SecurityException e) {
-				if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
-			}
-			return false;
+		String[] command = { "chmod", "700", f.getAbsolutePath() };
+		try {
+			return Runtime.getRuntime().exec(command).waitFor() == 0;
+		} catch(IOException e) {
+			if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
+		} catch(InterruptedException e) {
+			if(LOG.isLoggable(WARNING))
+				LOG.warning("Interrupted while executing chmod");
+			Thread.currentThread().interrupt();
+		} catch(SecurityException e) {
+			if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
 		}
+		return false;
 	}
 
 	private void tryToClose(InputStream in) {
-- 
GitLab