Пример #1
0
 public void write(
     SQLiteDatabase paramSQLiteDatabase,
     String paramString1,
     byte[] paramArrayOfByte,
     int paramInt1,
     int paramInt2,
     int paramInt3,
     String paramString2,
     String paramString3) {
   Debug.i("BraceletDbHelper", "1======write......" + paramString1);
   ContentValues localContentValues = new ContentValues();
   localContentValues.put("type", Integer.valueOf(paramInt1));
   localContentValues.put("source", Integer.valueOf(paramInt2));
   localContentValues.put("date", paramString1);
   localContentValues.put("summary", paramString2);
   localContentValues.put("indexs", paramString3);
   localContentValues.put("data", paramArrayOfByte);
   localContentValues.put("sync", Integer.valueOf(paramInt3));
   String[] arrayOfString = new String[3];
   arrayOfString[0] = paramString1;
   arrayOfString[1] = paramInt1;
   arrayOfString[2] = paramInt2;
   Cursor localCursor =
       paramSQLiteDatabase.query(
           "date_data", null, "date=? AND type=? AND source=?", arrayOfString, null, null, null);
   if ((localCursor != null) && (localCursor.getCount() > 0))
     paramSQLiteDatabase.update(
         "date_data", localContentValues, "date=? AND type=? AND source=?", arrayOfString);
   while (true) {
     if (localCursor != null) localCursor.close();
     return;
     paramSQLiteDatabase.insert("date_data", null, localContentValues);
   }
 }
Пример #2
0
 protected cn.com.smartdevices.bracelet.chart.StatisticChartView.StatisticChartData a(int i)
 {
     SportDay sportday = StatisticFragment.x(q).addDay(i);
     Debug.i("Statistic.Main", (new StringBuilder()).append("Load Day : ").append(sportday).toString());
     String s1 = sportday.getKey();
     cn.com.smartdevices.bracelet.model.DaySportData.Summary summary;
     cn.com.smartdevices.bracelet.chart.StatisticChartView.StatisticChartData statisticchartdata;
     if (!StatisticFragment.t(q).containsKey(s1))
     {
         summary = StatisticFragment.y(q).getSummary(sportday);
         StatisticFragment.t(q).put(s1, summary);
     } else
     {
         summary = (cn.com.smartdevices.bracelet.model.DaySportData.Summary)StatisticFragment.t(q).get(s1);
     }
     statisticchartdata = new cn.com.smartdevices.bracelet.chart.StatisticChartView.StatisticChartData();
     if (summary != null)
     {
         statisticchartdata.stepValue = summary.getSteps();
         statisticchartdata.sleepValue = summary.getSleep();
         statisticchartdata.sleepDeepValue = summary.getSleepDeepTime();
     }
     statisticchartdata.date = b(sportday);
     return statisticchartdata;
 }
Пример #3
0
 public void updateSyncState(
     ArrayList<UploadData> paramArrayList, int paramInt1, int paramInt2, int paramInt3) {
   if ((paramArrayList == null) || (paramArrayList.size() <= 0)) return;
   SQLiteDatabase localSQLiteDatabase = getWritableDatabase();
   localSQLiteDatabase.beginTransaction();
   Iterator localIterator = paramArrayList.iterator();
   while (true) {
     if (!localIterator.hasNext()) {
       localSQLiteDatabase.setTransactionSuccessful();
       localSQLiteDatabase.endTransaction();
       return;
     }
     UploadData localUploadData = (UploadData) localIterator.next();
     String str =
         "update date_data set sync = "
             + paramInt1
             + " where date"
             + " = '"
             + localUploadData.date
             + "' and "
             + "type = "
             + paramInt2
             + " and source"
             + " = "
             + paramInt3
             + ";";
     Debug.i("WPJ", "update sync state:" + str);
     localSQLiteDatabase.execSQL(str);
   }
 }
Пример #4
0
 public final void onItemClick(
     AdapterView<?> paramAdapterView, View paramView, int paramInt, long paramLong) {
   Debug.i("NewAlarmActivity", "onItemClick: " + paramInt);
   int i = cn.com.smartdevices.bracelet.model.AlarmClockItem.WEEK_MASK[paramInt];
   int j = (1 << paramInt & NewAlarmActivity.AlarmRepeatFragment.a(this.a)) >> paramInt;
   Debug.i("NewAlarmActivity", "thebit at position: " + paramInt + ", thebit=" + j);
   NewAlarmActivity.AlarmRepeatFragment localAlarmRepeatFragment = this.a;
   if (j == 0) ;
   for (int k = i | NewAlarmActivity.AlarmRepeatFragment.a(this.a);
       ;
       k = NewAlarmActivity.AlarmRepeatFragment.a(this.a) & (i ^ 0xFFFFFFFF)) {
     NewAlarmActivity.AlarmRepeatFragment.a(localAlarmRepeatFragment, k);
     NewAlarmActivity.AlarmRepeatFragment.b(this.a)
         .setDays(NewAlarmActivity.AlarmRepeatFragment.a(this.a));
     return;
   }
 }
Пример #5
0
 public static void waitingFwUpdate()
 {
     Object obj = f;
     obj;
     JVM INSTR monitorenter ;
     Debug.i(TAG, "BleFwUpgradeTask before waitingFwUpdate...");
     Exception exception;
     try
     {
         f.wait(10000L);
     }
     catch (InterruptedException interruptedexception) { }
     Debug.i(TAG, (new StringBuilder()).append("BleFwUpgradeTask after waitingFwUpdate...").append(g).toString());
     return;
     exception;
     obj;
     JVM INSTR monitorexit ;
     throw exception;
 }
Пример #6
0
 public static void waitingNotify(Object obj)
 {
     Debug.i(TAG, (new StringBuilder()).append("waitingNotify:").append(obj).toString());
     synchronized (d)
     {
         e = obj;
         d.notify();
     }
     return;
     exception;
     obj1;
     JVM INSTR monitorexit ;
     throw exception;
 }
Пример #7
0
 public ArrayList<UploadData> readNotSyncDatas(int paramInt1, int paramInt2) {
   String[] arrayOfString1 = {"date", "data", "summary", "indexs"};
   String[] arrayOfString2 = new String[3];
   arrayOfString2[0] = paramInt1;
   arrayOfString2[1] = paramInt2;
   arrayOfString2[2] = "0";
   Cursor localCursor =
       getReadableDatabase()
           .query(
               "date_data",
               arrayOfString1,
               "type=? AND source=? AND sync=?",
               arrayOfString2,
               null,
               null,
               "date ASC");
   if ((localCursor == null) || (localCursor.getCount() == 0)) {
     if (localCursor != null) localCursor.close();
     return null;
   }
   ArrayList localArrayList = new ArrayList();
   localArrayList.ensureCapacity(localCursor.getCount());
   localCursor.moveToFirst();
   while (true) {
     if (localCursor.isAfterLast()) {
       localCursor.close();
       return localArrayList;
     }
     UploadData localUploadData = new UploadData();
     localUploadData.date = localCursor.getString(localCursor.getColumnIndex("date"));
     localUploadData.data = localCursor.getBlob(localCursor.getColumnIndex("data"));
     localUploadData.summary = localCursor.getString(localCursor.getColumnIndex("summary"));
     localUploadData.indexs = localCursor.getString(localCursor.getColumnIndex("indexs"));
     Debug.i(
         "WPJ", "not sync data:" + localUploadData.date + ",size:" + localUploadData.data.length);
     localArrayList.add(localUploadData);
     localCursor.moveToNext();
   }
 }
Пример #8
0
 public void doWork(BleCallBack blecallback)
 {
     Thread.currentThread().setPriority(10);
     e = Integer.valueOf(-1);
     blecallback.sendOnStartMessage();
     if (a != null)
     {
         try
         {
             FileInputStream fileinputstream = new FileInputStream(a);
             c = new byte[fileinputstream.available()];
             fileinputstream.read(c);
             fileinputstream.close();
         }
         catch (Exception exception)
         {
             c = null;
         }
     }
     if (c == null || c.length < 1)
     {
         Debug.i(TAG, "no fw data!");
         blecallback.sendOnFinishMessage(Integer.valueOf(1));
         return;
     }
     int i = Utils.getFwVersion(c);
     Debug.i(TAG, (new StringBuilder()).append("new firmware version:").append(i).toString());
     String as[] = b.split(":");
     int j = ((0xff & Integer.decode((new StringBuilder()).append("0x").append(as[4]).toString()).byteValue()) << 8 | 0xff & Integer.decode((new StringBuilder()).append("0x").append(as[5]).toString()).byteValue()) ^ Helper.CRC16(c);
     if (!gattPeripheral.sendFirmwareInfo(gattPeripheral.getDeviceInfo().firmwareVersion, i, c.length, j))
     {
         Debug.i(TAG, "prepareFirmwareUpdate failed!");
         blecallback.sendOnFinishMessage(Integer.valueOf(1));
         return;
     }
     if (((Integer)e).intValue() == -1)
     {
         waiting();
     }
     if (((Integer)e).intValue() != 12)
     {
         blecallback.sendOnFinishMessage(Integer.valueOf(1));
         return;
     }
     g = Integer.valueOf(-1);
     if (!gattPeripheral.sendFirmwareData(c))
     {
         Debug.i(TAG, "sendFirmwareData failed!");
         blecallback.sendOnFinishMessage(Integer.valueOf(1));
         gattPeripheral.resetFirmwareUpdatingProgress();
         return;
     }
     if (((Integer)g).intValue() == -1)
     {
         waitingFwUpdate();
     }
     int k = ((Integer)g).intValue();
     int l;
     boolean flag;
     byte byte0;
     if (k == -1)
     {
         l = 1;
     } else
     {
         l = k;
     }
     flag = false;
     if (l == 2)
     {
         flag = gattPeripheral._reboot();
     }
     if (flag)
     {
         byte0 = 2;
     } else
     {
         byte0 = 1;
     }
     blecallback.sendOnFinishMessage(Integer.valueOf(byte0));
     gattPeripheral.resetFirmwareUpdatingProgress();
 }
 private List a(List list, int i1, int j1)
 {
     Collections.sort(list, new cn.com.smartdevices.bracelet.chart.base.BarChart.BarItemComparator());
     ArrayList arraylist = new ArrayList();
     Iterator iterator = list.iterator();
     Object obj = null;
     do
     {
         if (!iterator.hasNext())
         {
             break;
         }
         Object obj1 = (cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem)iterator.next();
         Debug.i("Chart.DynamicDetailChartView", (new StringBuilder()).append("Sleep : ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).scope).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).value).toString());
         if (((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index >= i1)
         {
             if (obj != null)
             {
                 int l1 = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj)).index + ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj)).scope;
                 if (l1 == ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index && ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj)).value == ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).value)
                 {
                     DynamicDetailChart.DynamicDetailBarItem dynamicdetailbaritem2 = new DynamicDetailChart.DynamicDetailBarItem();
                     dynamicdetailbaritem2.index = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj)).index;
                     dynamicdetailbaritem2.scope = (((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index + ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).scope) - ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj)).index;
                     dynamicdetailbaritem2.value = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).value;
                     dynamicdetailbaritem2.setRenderer(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).getRenderer());
                     Debug.i("Chart.DynamicDetailChartView", (new StringBuilder()).append("Sleep Merge : ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem2)).index).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem2)).scope).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem2)).value).toString());
                     arraylist.remove(obj);
                     arraylist.add(dynamicdetailbaritem2);
                     obj1 = dynamicdetailbaritem2;
                 } else
                 {
                     if (l1 != ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index && l1 > i1 && l1 < j1)
                     {
                         DynamicDetailChart.DynamicDetailBarItem dynamicdetailbaritem1 = new DynamicDetailChart.DynamicDetailBarItem();
                         dynamicdetailbaritem1.index = l1;
                         dynamicdetailbaritem1.scope = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index - l1;
                         dynamicdetailbaritem1.value = 1;
                         dynamicdetailbaritem1.setRenderer(d);
                         Debug.i("Chart.DynamicDetailChartView", (new StringBuilder()).append("Sleep Active : ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem1)).index).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem1)).scope).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem1)).value).toString());
                         arraylist.add(dynamicdetailbaritem1);
                     }
                     arraylist.add(obj1);
                 }
             } else
             {
                 int k1 = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index + ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).scope;
                 if (((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index > i1 && k1 < j1)
                 {
                     DynamicDetailChart.DynamicDetailBarItem dynamicdetailbaritem = new DynamicDetailChart.DynamicDetailBarItem();
                     dynamicdetailbaritem.index = i1;
                     dynamicdetailbaritem.scope = ((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (obj1)).index - i1;
                     dynamicdetailbaritem.value = 1;
                     dynamicdetailbaritem.setRenderer(d);
                     Debug.i("Chart.DynamicDetailChartView", (new StringBuilder()).append("Sleep Active : ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem)).index).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem)).scope).append(" , ").append(((cn.com.smartdevices.bracelet.chart.base.BarChart.BarItem) (dynamicdetailbaritem)).value).toString());
                     arraylist.add(dynamicdetailbaritem);
                 }
                 arraylist.add(obj1);
             }
             obj = obj1;
         }
     } while (true);
     return arraylist;
 }
Пример #10
0
 protected final void doScroll(float paramFloat) {
   this.offset = (-Math.round(this.mScroll / StatisticChartOld.a()));
   Debug.i("Chart.StatisticChart", "DateLine Offset : " + this.offset);
 }
 private void a(int i)
 {
     Debug.i(TAG, (new StringBuilder()).append("value:").append(i).toString());
     Debug.f(TAG, (new StringBuilder()).append("value:").append(i).toString());
     waitingResult = Integer.valueOf(-1);
     if (i != 39) goto _L2; else goto _L1