MCPcopy Create free account
hub / github.com/buggins/coolreader / getSDKLevel

Method getSDKLevel

android/src/org/coolreader/CoolReader.java:242–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240
241 private int sdkInt = 0;
242 public int getSDKLevel() {
243 if (sdkInt > 0)
244 return sdkInt;
245 // hack for Android 1.5
246 sdkInt = 3;
247 Field fld;
248 try {
249 Class<?> cl = android.os.Build.VERSION.class;
250 fld = cl.getField("SDK_INT");
251 sdkInt = fld.getInt(cl);
252 log.i("API LEVEL " + sdkInt + " detected");
253 } catch (SecurityException e) {
254 // ignore
255 } catch (NoSuchFieldException e) {
256 // ignore
257 } catch (IllegalArgumentException e) {
258 // ignore
259 } catch (IllegalAccessException e) {
260 // ignore
261 }
262 return sdkInt;
263 }
264
265 public boolean isWakeLockEnabled() {
266 return screenBacklightDuration > 0;

Callers 2

setScreenOrientationMethod · 0.95
onCreateMethod · 0.80

Calls 2

iMethod · 0.65
getIntMethod · 0.45

Tested by

no test coverage detected