MonitorState.java
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.radiusnetworks.ibeacon.service;
import java.util.Date;
public class MonitorState
{
public static long INSIDE_EXPIRATION_MILLIS = 10000L;
private boolean a = false;
private long b = 0L;
private Callback c;
public MonitorState(Callback paramCallback)
{
this.c = paramCallback;
}
public Callback getCallback()
{
return this.c;
}
public boolean isInside()
{
return (this.a) && (!isNewlyOutside());
}
public boolean isNewlyOutside()
{
boolean bool2 = false;
boolean bool1 = bool2;
if (this.a)
{
bool1 = bool2;
if (this.b > 0L)
{
bool1 = bool2;
if (new Date().getTime() - this.b > INSIDE_EXPIRATION_MILLIS)
{
this.a = false;
new StringBuilder("We are newly outside the region because the lastSeenTime of ").append(this.b).append(" was ").append(new Date().getTime() - this.b).append(" seconds ago, and that is over the expiration duration of ").append(INSIDE_EXPIRATION_MILLIS);
this.b = 0L;
bool1 = true;
}
}
}
return bool1;
}
public boolean markInside()
{
this.b = new Date().getTime();
if (!this.a)
{
this.a = true;
return true;
}
return false;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/radiusnetworks/ibeacon/service/MonitorState.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/