Example #1
0
 private synchronized boolean j() {
   boolean z = false;
   synchronized (this) {
     if (this.c == null) {
       C0596r.d(a, "connHelper = " + this.c);
     } else {
       c f = this.c.f();
       a a = a(f);
       if (a == null) {
         C0596r.d(a, "Callback is invalid " + f);
       } else if (a.a()) {
         C0596r.e(a, "In syncing = " + f);
         a.c();
         z = true;
       } else {
         if (this.c.j()) {
           a.b();
         }
         C0596r.e(a, "mAddress = " + f);
         z = this.c.a(a);
       }
     }
   }
   return z;
 }
 private void a(e eVar) {
   C0596r.e("isManualSetWeight", this.q + a.f);
   C0596r.e(i, "weightadvdata " + eVar.toString());
   P p = new P();
   p.a = eVar;
   this.t = eVar.j();
   if (eVar.f() && eVar.d()) {
     this.t = 0.0f;
   }
   this.s.sendEmptyMessage(123);
   if (eVar.f() && !eVar.d()) {
     h = false;
     C0401a.a(this.p, C0401a.gk, C0401a.gm);
     UserInfo userInfo = new UserInfo();
     userInfo.name = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_NAME);
     String currentUserInfoByTag = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_GENDER);
     if (currentUserInfoByTag.isEmpty()) {
       userInfo.gender = 1;
     } else {
       userInfo.gender = Integer.parseInt(currentUserInfoByTag);
     }
     userInfo.birthday = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_BIRTH);
     currentUserInfoByTag = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_HEIGHT);
     if (currentUserInfoByTag.isEmpty()) {
       userInfo.height = 100;
     } else {
       userInfo.height = Integer.parseInt(currentUserInfoByTag);
     }
     userInfo.weight = aA.c(this.t, p.a.h(), 0);
     eVar.a(aA.a(userInfo.height, Birthday.fromStr(userInfo.birthday).getAge(), userInfo.weight));
     new f(this, userInfo, eVar).execute(new Void[0]);
   }
 }
 private void d() {
   C0596r.e(a, "adjust left from:" + this.p);
   this.p =
       (int) (this.i * (((this.k - ((float) this.e)) + b) - (((float) (this.j / 2)) / this.i)));
   C0596r.e(a, "adjust left to:" + this.p);
   smoothScrollTo(a(), 0);
   smoothScrollTo(this.p, 0);
   invalidate();
 }
Example #4
0
 public static boolean d(Context context) {
   if (b.h().t.a.booleanValue()) {
     boolean a = F.a(context);
     if (a) {
       return a;
     }
     C0596r.e(B.a, "Failed to syncPartner from Manual");
     return a;
   }
   C0596r.d(B.a, "syncPartnerShoesFromLocal !Config.getInstance().SHOES.ENABLE");
   return true;
 }
Example #5
0
 public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
   C0596r.e("NewAlarmActivity", "onItemClick: " + i);
   int i2 = AlarmClockItem.WEEK_MASK[i];
   int a = ((1 << i) & this.a.b) >> i;
   C0596r.e("NewAlarmActivity", "thebit at position: " + i + ", thebit=" + a);
   cH cHVar = this.a;
   if (a == 0) {
     i2 |= this.a.b;
   } else {
     i2 = (i2 ^ -1) & this.a.b;
   }
   cHVar.b = i2;
   this.a.a.a(this.a.b);
 }
Example #6
0
 public static boolean c(Context context) {
   if (b.h().t.a.booleanValue()) {
     return a(context, null, null);
   }
   C0596r.d(B.a, "syncTwoWayDataASynced !Config.getInstance().SHOES.ENABLE");
   return true;
 }
Example #7
0
 public void onSuccess(int i, Header[] headerArr, byte[] bArr) {
   ArrayList arrayList = new ArrayList();
   if (C0476i.b(this.c, new String(bArr), arrayList).c()) {
     Iterator it = arrayList.iterator();
     boolean z = true;
     while (it.hasNext()) {
       n nVar = (n) it.next();
       if (nVar.d() != null) {
         z = p.a(this.c, new d(nVar.g(), new String(nVar.d())));
         if (z) {
           z = p.h(this.c, nVar.g()) & z;
         }
       }
     }
     this.a.a = z;
     if (!this.a.a) {
       C0596r.e(
           "Sync",
           "syncSportConfigFromServer onSuccess  statusCode = "
               + i
               + ",content = "
               + ",type = "
               + this.b
               + " ,isSucceeded = "
               + z);
     }
   }
 }
Example #8
0
 private synchronized void i() {
   if (this.c != null) {
     this.c.close();
     this.c = null;
   }
   C0596r.e(a, "releaseShoesConnHelper");
 }
Example #9
0
 public void onFailure(int i, Header[] headerArr, byte[] bArr, Throwable th) {
   String a = S.a(bArr);
   this.a.a(false);
   C0596r.e(
       B.a,
       "onFailure statusCode = " + i + "  content = " + a + ",type = " + this.b + ",error:" + th);
 }
Example #10
0
 public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
   this.a.setEnabled(z);
   AlarmActivity.a(this.a, this.b.a.p);
   C0401a.a(this.b.a.p, C0401a.gx, z + a.f);
   C0596r.e("AlarmAdapter", "set clocks item:" + this.a.toJson());
   this.b.notifyDataSetChanged();
   new p(this.b.a.u, new C0807g(this, z)).f();
 }
Example #11
0
 public void a() {
   i();
   if (this.e != null) {
     C0635l.a(this.b).b(this.e);
     this.e = null;
   }
   C0596r.e(a, "destroy");
 }
Example #12
0
 public C0625b(Context context, int i, boolean z, boolean z2) {
   this.g = z2;
   this.d = z;
   this.b = context.getApplicationContext();
   this.e = new C0627d();
   C0635l.a(context).a(this.e);
   c b = C0635l.a(context).b();
   C0596r.e(a, "DeviceDataConsumer identity = " + b);
   b(b);
 }
Example #13
0
 public void onSuccess(int i, Header[] headerArr, byte[] bArr) {
   String a = R.a(bArr);
   n a2 = n.a(this.b, a);
   if (a2.c()) {
     this.a.a = true;
   }
   if (!this.a.a) {
     C0596r.e(
         "Sync",
         "syncTrackInfoToSever onSuccess:" + a + " ,code = " + a2.h + ", success = " + a2.c());
   }
 }
Example #14
0
 public void onFailure(int i, Header[] headerArr, byte[] bArr, Throwable th) {
   String a = R.a(bArr);
   this.a.a = false;
   C0596r.e(
       "Sync",
       "syncSportConfigFromServer onFailure statusCode = "
           + i
           + ",content = "
           + a
           + ",type = "
           + this.b);
 }
Example #15
0
 public static boolean b(Context context) {
   if (!b.h().t.a.booleanValue()) {
     C0596r.d(B.a, "syncAllShoesDataToServerSynced !Config.getInstance().SHOES.ENABLE");
     return true;
   } else if (context != null) {
     return !cn.com.smartdevices.bracelet.shoes.sync.c.c.f(context)
         ? false
         : SyncShoesDataService.b(context);
   } else {
     throw new IllegalArgumentException();
   }
 }
Example #16
0
 private synchronized boolean b(c cVar) {
   boolean z = true;
   synchronized (this) {
     if (cVar != null) {
       if (!cVar.e()) {
         this.c = new C0632i(this.b, cVar);
         this.c.a(true);
       }
     }
     C0596r.d(a, "initShoesConnection identity = " + cVar);
     z = false;
   }
   return z;
 }
Example #17
0
 public static boolean a(Context context) {
   if (!b.h().t.a.booleanValue()) {
     C0596r.d(B.a, "isNeedToSyncDataToServer !Config.getInstance().SHOES.ENABLE");
     return false;
   } else if (context == null) {
     throw new IllegalArgumentException();
   } else {
     List g = t.g(context);
     if (g != null && g.size() > 0) {
       return true;
     }
     g = t.c(context);
     return g != null && g.size() > 0;
   }
 }
Example #18
0
 public static String a(String str, String str2) {
   String str3 = null;
   if (!TextUtils.isEmpty(str)) {
     if (TextUtils.isEmpty(str2)) {
       str2 = "yyyy-MM-dd";
     }
     try {
       SimpleDateFormat simpleDateFormat = new SimpleDateFormat(str2);
       simpleDateFormat.setLenient(false);
       str3 = simpleDateFormat.format(simpleDateFormat.parse(str));
     } catch (Exception e) {
       C0596r.d("TimeVerifier", e.getMessage());
     }
   }
   return str3;
 }
 public void onClick(View view) {
   switch (view.getId()) {
     case R.id.search_devices_exit:
       setResult(-1);
       finish();
       return;
     case R.id.left_button:
       C0596r.e(i, "click left btn");
       return;
     case R.id.right_button:
       C0401a.a(this.p, C0401a.gk, C0401a.gl);
       c.showPanel(
           (Activity) this.p, G.a(this.r ? 8.0f : BitmapDescriptorFactory.HUE_YELLOW).getClass());
       this.q = true;
       return;
     default:
       return;
   }
 }
Example #20
0
 public void onSuccess(int i, Header[] headerArr, byte[] bArr) {
   boolean c = C0642s.a(this.c, S.a(bArr), new n()).c();
   if (c) {
     c &= t.b(this.c, this.d, this.e.e());
   }
   this.a.a(c);
   if (!this.a.b()) {
     C0596r.e(
         B.a,
         "onSuccess isSucceeded = "
             + c
             + ",mac = "
             + this.e.l()
             + ",date = "
             + this.e.e()
             + ",type = "
             + this.b);
   }
 }
 public void a(float f) {
   C0596r.e(i, "onWeightSelect " + f);
   e eVar = new e();
   eVar.b(aA.b(f, Keeper.readPersonInfo().miliConfig.weightUnit));
   eVar.a(Keeper.readPersonInfo().miliConfig.weightUnit);
   eVar.a(true);
   eVar.b(false);
   if (0 == this.v) {
     this.v = System.currentTimeMillis();
   }
   eVar.a(this.v);
   eVar.c(f);
   String currentUserInfoByTag = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_BIRTH);
   String currentUserInfoByTag2 = Keeper.getCurrentUserInfoByTag(Keeper.CURRENT_USER_HEIGHT);
   int i = 100;
   if (!currentUserInfoByTag2.isEmpty()) {
     i = Integer.parseInt(currentUserInfoByTag2);
   }
   eVar.a(aA.a(i, Birthday.fromStr(currentUserInfoByTag).getAge(), f));
   a(eVar);
 }
Example #22
0
 static byte[] a(c cVar) {
   byte[] bArr = new byte[64];
   cn.com.smartdevices.bracelet.gps.h.b.a(bArr, cVar.p, 0);
   cn.com.smartdevices.bracelet.gps.h.b.a(bArr, cVar.q, 8);
   cn.com.smartdevices.bracelet.gps.h.b.a(bArr, cVar.o, 16);
   cn.com.smartdevices.bracelet.gps.h.b.a(bArr, cVar.r, 24);
   try {
     JSONObject c = cVar.c();
     cn.com.smartdevices.bracelet.gps.h.b.a(bArr, c.getInt(c.a), 32);
     cn.com.smartdevices.bracelet.gps.h.b.a(
         bArr, Float.valueOf(c.getString(GroupItemBaseInfo.KEY_START_TIME)).floatValue(), 36);
     cn.com.smartdevices.bracelet.gps.h.b.a(
         bArr, Float.valueOf(c.getString(c.b)).floatValue(), 40);
     cn.com.smartdevices.bracelet.gps.h.b.a(
         bArr, Float.valueOf(c.getString(c.d)).floatValue(), 44);
     cn.com.smartdevices.bracelet.gps.h.b.a(bArr, c.getInt(C0454m.c), 48);
   } catch (JSONException e) {
     C0596r.a("Sync", e.getMessage());
   }
   return bArr;
 }
Example #23
0
 public void a(int i) {
   C0596r.d("unlockscreen", "onState state = " + i);
   if (i == 4) {
     this.a.x.a(this.a.H);
   }
 }
Example #24
0
 public void finalize() {
   C0596r.e(a, "finalize");
 }
Example #25
0
 public void onClick(View view) {
   this.a.a(this.b, this.c);
   C0596r.d("StartUpActivity", "clickUrl = " + this.b);
   C0596r.d("StartUpActivity", "title = " + this.c);
 }
Example #26
0
 public void onFailure(int i, Header[] headerArr, byte[] bArr, Throwable th) {
   String a = R.a(bArr);
   this.a.a = false;
   C0596r.d("Sync", "syncTrackInfoToSever onFailure:" + a + ", statusCode = " + i);
 }
 public void a() {
   C0596r.e(i, "onWeightSelectCancel");
   this.q = false;
 }
 public void onEventBackgroundThread(e eVar) {
   C0596r.e(i, "onEvent WeightAdvData:" + eVar);
   if (h && !this.q && eVar != null) {
     a(eVar);
   }
 }