Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPavlenko committed Apr 27, 2019
1 parent 890e246 commit 65bfc18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def version = '1.3.0'
def versionNum = 64
def version = '1.3.1'
def versionNum = 65
def basic_version = '1.0.0'
def basic_versionNum = 1

Expand Down
13 changes: 6 additions & 7 deletions src/main/java/com/ap/transmission/btc/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.provider.DocumentFile;
import android.system.ErrnoException;
import android.system.Os;
import android.util.DisplayMetrics;
import android.util.Log;
Expand Down Expand Up @@ -104,7 +103,7 @@ public static String getIPAddress(Context context) {

public static InetAddress getInterfaceAddress(Context context) {
InetAddress result = ifaddr;
if(result != null) return result;
if (result != null) return result;

Context ctx = context.getApplicationContext();
ConnectivityManager cmgr = (ConnectivityManager) ctx.getSystemService(CONNECTIVITY_SERVICE);
Expand Down Expand Up @@ -242,7 +241,7 @@ public static String getRealDirPath(Context ctx, Uri dirUri) {
} else {
err(TAG, "getRealDirPath: pfd is null");
}
} catch (IOException | ErrnoException ex) {
} catch (Exception ex) {
Log.e(TAG, "Failed to resolve real path: " + dirUri, ex);
} finally {
if (pfd != null) try { pfd.close(); } catch (IOException ignored) {}
Expand All @@ -253,7 +252,7 @@ public static String getRealDirPath(Context ctx, Uri dirUri) {
}

@TargetApi(VERSION_CODES.LOLLIPOP)
public static String getDescriptorPath(ParcelFileDescriptor fd) throws ErrnoException {
public static String getDescriptorPath(ParcelFileDescriptor fd) throws Exception {
String path = Os.readlink("/proc/self/fd/" + fd.getFd());

if (path.startsWith("/mnt/media_rw/")) {
Expand Down Expand Up @@ -428,9 +427,9 @@ public static void copyAssets(AssetManager amgr, String src, File dstDir, boolea

private static void copyAssets(AssetManager amgr, String src, File dstDir, byte[] buf)
throws IOException {
String ls[] = amgr.list(src);
String[] ls = amgr.list(src);

if (ls.length > 0) {
if ((ls != null) && (ls.length > 0)) {
for (String f : ls) {
copyAssets(amgr, src + '/' + f, dstDir, buf);
}
Expand Down Expand Up @@ -859,7 +858,7 @@ public static void enableMenuIcons(PopupMenu popup) {
f.setAccessible(true);
Object h = f.get(popup);
h.getClass().getDeclaredMethod("setForceShowIcon", boolean.class).invoke(h, true);
} catch (Exception ignore) {ignore.printStackTrace();}
} catch (Exception ignore) { }
}

public static void openUri(Activity a, Uri uri, String mime) {
Expand Down

0 comments on commit 65bfc18

Please sign in to comment.