/** * @return the minor part of the running OS version. */ public static int getMinorSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return minorSystemVersion; } /**
@Override public void flush() { if (st.length() > 0) { Foundation.log("%@", new NSString(st.toString())); st.setLength(0); } }
@Override public void invoke(NSNotification notification) { AVCaptureSessionInterruptionReason reason = AVCaptureSessionInterruptionReason.Unavailable; if (Foundation.getMajorSystemVersion() >= 9) { NSDictionary<?, ?> data = notification.getUserInfo(); int value = data.getInt(NotificationInterruptionReasonKey(), 0); if (value != 0) { reason = AVCaptureSessionInterruptionReason.valueOf(value); } } block.invoke((AVCaptureSession)notification.getObject(), reason); } });
@Override public void flush() { if (st.length() > 0) { Foundation.log("%@", new NSString(st.toString())); st.setLength(0); } }
@Override public void invoke(NSNotification notification) { AVCaptureSessionInterruptionReason reason = AVCaptureSessionInterruptionReason.Unavailable; if (Foundation.getMajorSystemVersion() >= 9) { NSDictionary<?, ?> data = notification.getUserInfo(); int value = data.getInt(NotificationInterruptionReasonKey(), 0); if (value != 0) { reason = AVCaptureSessionInterruptionReason.valueOf(value); } } block.invoke((AVCaptureSession)notification.getObject(), reason); } });
/** * @return the major part of the running OS version. */ public static int getMajorSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return majorSystemVersion; } /**
/** * Preloads classes added during compilation, if any. */ private static void preloadClasses() throws UnsupportedEncodingException { byte[] data = VM.getRuntimeData(UIApplication.class.getName() + ".preloadClasses"); if (data != null) { String[] customClasses = new String(data, "UTF8").split(","); for (String customClass : customClasses) { try { // Register class. @SuppressWarnings("unchecked") Class<? extends ObjCClass> cls = (Class<? extends ObjCClass>) Class.forName(customClass); ObjCClass.registerCustomClass(cls); } catch (Throwable t) { Foundation.log("Failed to preload class " + customClass + ": " + t.getMessage()); t.printStackTrace(); } } } }
/** * Cached convenience method for {@link UIDevice#getSystemVersion()}. * @return the OS version that this app is running on. */ public static String getSystemVersionString() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return systemVersionString; } /**
/** * Preloads classes added during compilation, if any. */ private static void preloadClasses() throws UnsupportedEncodingException { byte[] data = VM.getRuntimeData(UIApplication.class.getName() + ".preloadClasses"); if (data != null) { String[] customClasses = new String(data, "UTF8").split(","); for (String customClass : customClasses) { try { // Register class. @SuppressWarnings("unchecked") Class<? extends ObjCClass> cls = (Class<? extends ObjCClass>) Class.forName(customClass); ObjCClass.registerCustomClass(cls); } catch (Throwable t) { Foundation.log("Failed to preload class " + customClass + ": " + t.getMessage()); t.printStackTrace(); } } } }
/** * @return the minor part of the running OS version. */ public static int getMinorSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return minorSystemVersion; } /**
@Override public void uncaughtException (Thread thread, Throwable ex) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); pw.flush(); Foundation.log(sw.toString()); NSException exception = new NSException(ex.getClass().getName(), sw.toString(), new NSDictionary<>()); if (NSThread.getCurrentThread().isMainThread()) { exception.raise(); } else { long handler = getUncaughtExceptionHandler(); callUncaughtExceptionHandler(handler, exception); // We should never get to this line! } } });
/** * @return the patch part of the running OS version. */ public static int getPatchSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return patchSystemVersion; }
@Override public void uncaughtException (Thread thread, Throwable ex) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); pw.flush(); Foundation.log(sw.toString()); NSException exception = new NSException(ex.getClass().getName(), sw.toString(), new NSDictionary<>()); if (NSThread.getCurrentThread().isMainThread()) { exception.raise(); } else { long handler = getUncaughtExceptionHandler(); callUncaughtExceptionHandler(handler, exception); // We should never get to this line! } } });
/** * @return the major part of the running OS version. */ public static int getMajorSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return majorSystemVersion; } /**
/** * @return the patch part of the running OS version. */ public static int getPatchSystemVersion() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return patchSystemVersion; }
/** * Cached convenience method for {@link UIDevice#getSystemVersion()}. * @return the OS version that this app is running on. */ public static String getSystemVersionString() { if (majorSystemVersion == 0) fetchSystemVersion(); // Lazily fetch the device's system version. return systemVersionString; } /**