private static byte[] getCryptKey() { final String transmitterId = getTransmitterID(); if (transmitterId.length() != 6) UserError.Log.e(TAG, "cryptKey: Wrong transmitter id length!: " + transmitterId.length()); try { final String padding = "00"; return (padding + transmitterId + padding + transmitterId).getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { UserError.Log.wtf(TAG, "System encoding problem: " + e); } return null; }
WebResponse(String str, int resultCode, String mimeType) { try { bytes = str.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { UserError.Log.wtf(TAG, "UTF8 is unsupported!"); } this.mimeType = mimeType; this.resultCode = resultCode; } }
private static byte[] getCryptKey() { final String transmitterId = getTransmitterID(); if (transmitterId.length() != 6) UserError.Log.e(TAG, "cryptKey: Wrong transmitter id length!: " + transmitterId.length()); try { final String padding = "00"; return (padding + transmitterId + padding + transmitterId).getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { UserError.Log.wtf(TAG, "System encoding problem: " + e); } return null; }
private boolean sendMessageReal(String msg) { final List<EmergencyContact> destinations = EmergencyContact.load(); for (EmergencyContact dest : destinations) { UserError.Log.wtf(TAG, "Sending SMS to: " + dest.number + " :: " + msg); try { SMS.sendSMS(dest.number, msg); } catch (Exception e) { UserError.Log.wtf(TAG, "Exception sending sms: " + e); } } return true; }
private static void fmSend(Bundle data) { final FirebaseMessaging fm = FirebaseMessaging.getInstance(); if (senderid != null) { fm.send(new RemoteMessage.Builder(senderid + "@gcm.googleapis.com") .setMessageId(Integer.toString(msgId.incrementAndGet())) .setData(JoH.bundleToMap(data)) .build()); } else { Log.wtf(TAG, "senderid is null"); } }
private void getInsulinLog() { //noinspection NonAtomicOperationOnVolatileField if (loaded_records++ < 100) { // we seem to get back records in order newest to oldest with the next one each time we ask regardless of parameter // looks a little like device implementation is incomplete. Might change in future firmware so // worth keeping an eye on as 'since' is always set to 0 - for a complete implementation this should be // tracked with most recent updated with inevitable delay. addToWriteQueueWithWakeup(new InsulinLogTx(0).getFragmentStream(), 50, 10, true, "Get Insulin Log"); } else { UserError.Log.wtf(TAG, "Attempted to exceed maximum record loading"); } }
public static void handleHomeScreenScanPreference(Context context, boolean state) { try { Log.d(TAG, "HomeScreen Scan State: " + (state ? "enable" : "disable")); context.getPackageManager().setComponentEnabledSetting(new ComponentName(context, NFCFilterX.class), state ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } catch (Exception e) { Log.wtf(TAG, "Exception in handleHomeScreenScanPreference: " + e); } }
private static int getHighestRecord() { if (mBluetoothDeviceAddress == null) { UserError.Log.wtf(TAG, "Null BT address in getHighestRecord"); return 0; } return (int) PersistentStore.getLong(BluetoothGlucoseMeter.mBluetoothDeviceAddress + "-verio-highest"); }
public static void checkPermissionRemoved() { if (EmergencyAssist.isEnabled() && !isSMSPermissionGranted()) { if (JoH.ratelimit("emergency-start-activity", 30)) { JoH.startActivity(EmergencyAssistActivity.class); } final String msg = "NEED SMS PERMISSION! - EMERGENCY FEATURE CANNOT WORK!!!"; UserError.Log.wtf(TAG, msg); JoH.static_toast_long(msg); } }
public synchronized void PreSnooze(Context ctx, String uuid, int repeatTime) { Log.i(TAG, "PreSnooze called repeatTime = "+ repeatTime); stopAlert(ctx, true, false); ActiveBgAlert.Create(uuid, true, new Date().getTime() + repeatTime * 60000); ActiveBgAlert activeBgAlert = ActiveBgAlert.getOnly(); if (activeBgAlert == null) { Log.wtf(TAG, "Just created the alert, where did it go..."); return; } activeBgAlert.snooze(repeatTime); }
public static BatteryInfoRxMessage getBatteryDetails(String tx_id) { try { return new BatteryInfoRxMessage(PersistentStore.getBytes(G5_BATTERY_MARKER + tx_id)); } catch (Exception e) { Log.wtf(TAG, "Exception in getFirmwareDetails: " + e); return null; } }
public static void handleHomeScreenScanPreference(Context context, boolean state) { try { Log.d(TAG, "HomeScreen Scan State: " + (state ? "enable" : "disable")); context.getPackageManager().setComponentEnabledSetting(new ComponentName(context, NFCFilterX.class), state ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } catch (Exception e) { Log.wtf(TAG, "Exception in handleHomeScreenScanPreference: " + e); } }
private static byte[] nn(final byte[] array) { if (array == null) { if (JoH.ratelimit("never-null", 60)) { UserError.Log.wtf("NeverNullOb1", "Attempt to pass null!!! " + JoH.backTrace()); return new byte[1]; } } return array; }
private static void setHighestRecord(int m) { if (mBluetoothDeviceAddress == null) { UserError.Log.wtf(TAG, "Null BT address in setHighestRecord"); return; } if (getHighestRecord() >= m) return; // not higher PersistentStore.setLong(BluetoothGlucoseMeter.mBluetoothDeviceAddress + "-verio-highest", (long) m); }
private static void fmSend(Bundle data) { final FirebaseMessaging fm = FirebaseMessaging.getInstance(); if (senderid != null) { fm.send(new RemoteMessage.Builder(senderid + "@gcm.googleapis.com") .setMessageId(Integer.toString(msgId.incrementAndGet())) .setData(JoH.bundleToMap(data)) .build()); } else { Log.wtf(TAG, "senderid is null"); } }
public void onClick(View v) { if (uuid == null) { Log.wtf(TAG, "Error remove pressed, while we were adding an alert"); } else { AlertType.remove_alert(uuid); startWatchUpdaterService(mContext, WatchUpdaterService.ACTION_SYNC_ALERTTYPE, TAG); } Intent returnIntent = new Intent(); setResult(RESULT_OK,returnIntent); finish(); }
private static int getHighestRecord() { if (mBluetoothDeviceAddress == null) { UserError.Log.wtf(TAG, "Null BT address in getHighestRecord"); return 0; } return (int) PersistentStore.getLong(BluetoothGlucoseMeter.mBluetoothDeviceAddress + "-verio-highest"); }
public static VersionRequestRxMessage getFirmwareDetails(String tx_id) { try { byte[] stored = getStoredFirmwareBytes(tx_id); if ((stored != null) && (stored.length > 9)) { return new VersionRequestRxMessage(stored); } } catch (Exception e) { Log.wtf(TAG, "Exception in getFirmwareDetails: " + e); return null; } return null; }
protected static byte[] nn(final byte[] array) { if (array == null) { if (JoH.ratelimit("never-null", 60)) { UserError.Log.wtf("NeverNullG5Base", "Attempt to pass null!!! " + JoH.backTrace()); return new byte[1]; } } return array; }
public static boolean alertSnoozeOver() { ActiveBgAlert activeBgAlert = getOnly(); if (activeBgAlert == null) { // no alert exists, so snoozing is over... (this should not happen) Log.wtf(TAG, "ActiveBgAlert getOnly returning null (we have just checked it)"); return true; } return activeBgAlert.ready_to_alarm(); }