Android: add missing printStackTrace() in catch statements

Pick-to: 5.15
Change-Id: Id50743113fcdd450932111cfe1a563276f152bb1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Assam Boudjelthia 2020-06-12 13:29:34 +03:00
parent 8fdd400d99
commit 80f7494e8a
4 changed files with 21 additions and 3 deletions

View File

@ -603,12 +603,14 @@ public class QtActivityDelegate
Method m = initClass.getMethod("setActivity", Activity.class, Object.class);
m.invoke(staticInitDataObject, m_activity, this);
} catch (Exception e) {
e.printStackTrace();
}
try {
Method m = initClass.getMethod("setContext", Context.class);
m.invoke(staticInitDataObject, (Context)m_activity);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();

View File

@ -215,9 +215,11 @@ public class QtNative
return true;
} catch (IllegalArgumentException e) {
Log.e(QtTAG, "openURL(): Invalid Uri");
e.printStackTrace();
return false;
} catch (UnsupportedOperationException e) {
Log.e(QtTAG, "openURL(): Unsupported operation for given Uri");
e.printStackTrace();
return false;
} catch (Exception e) {
e.printStackTrace();
@ -240,9 +242,11 @@ public class QtNative
ParcelFileDescriptor fdDesc = resolver.openFileDescriptor(uri, openMode);
return fdDesc.detachFd();
} catch (FileNotFoundException e) {
e.printStackTrace();
return error;
} catch (IllegalArgumentException e) {
Log.e(QtTAG, "openFdForContentUrl(): Invalid Uri");
e.printStackTrace();
return error;
}
}
@ -268,9 +272,11 @@ public class QtNative
return size;
} catch (IllegalArgumentException e) {
Log.e(QtTAG, "getSize(): Invalid Uri");
e.printStackTrace();
return size;
} catch (UnsupportedOperationException e) {
Log.e(QtTAG, "getSize(): Unsupported operation for given Uri");
e.printStackTrace();
return size;
}
}
@ -295,9 +301,11 @@ public class QtNative
return exists;
} catch (IllegalArgumentException e) {
Log.e(QtTAG, "checkFileExists(): Invalid Uri");
e.printStackTrace();
return exists;
} catch (UnsupportedOperationException e) {
Log.e(QtTAG, "checkFileExists(): Unsupported operation for given Uri");
e.printStackTrace();
return false;
}
}
@ -350,7 +358,7 @@ public class QtNative
systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix");
f = new File(systemLibraryDir + libNameTemplate);
} catch (Exception e) {
e.printStackTrace();
}
}
if (f.exists())
@ -904,6 +912,7 @@ public class QtNative
try {
m_addItemMethod = m_clipboardManager.getClass().getMethod("addItem", cArg);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@ -1176,10 +1185,14 @@ public class QtNative
if (isDir != null && isDir.length > 0)
file += "/";
res.add(file);
} catch (Exception e) {}
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e) {}
}
} catch (Exception e) {
e.printStackTrace();
}
return res.toArray(new String[res.size()]);
}

View File

@ -128,12 +128,14 @@ public class QtServiceDelegate
Method m = initClass.getMethod("setService", Service.class, Object.class);
m.invoke(staticInitDataObject, m_service, this);
} catch (Exception e) {
e.printStackTrace();
}
try {
Method m = initClass.getMethod("setContext", Context.class);
m.invoke(staticInitDataObject, (Context)m_service);
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();

View File

@ -103,6 +103,7 @@ public class QtApplication extends Application
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}