Package com.batch.android.core
Class SecureDateProvider
- java.lang.Object
-
- com.batch.android.core.SecureDateProvider
-
- All Implemented Interfaces:
DateProvider
public class SecureDateProvider extends java.lang.Object implements DateProvider
Class used to get the real time based of the server sync date
-
-
Constructor Summary
Constructors Constructor Description SecureDateProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEnableSecureDate()Returns whether secure date can be enabled on this deviceBatchDategetCurrentDate()java.util.DategetDate()Method used to obtain the real date based on the server date if the server date was syncvoidinitServerDate(java.util.Date pServerDate)Method used to init the server datebooleanisSecureDateAvailable()Method used to know if the date is sync with the server
-
-
-
Method Detail
-
getDate
public java.util.Date getDate()
Method used to obtain the real date based on the server date if the server date was sync- Returns:
- the actual secure time
-
isSecureDateAvailable
public boolean isSecureDateAvailable()
Method used to know if the date is sync with the server- Returns:
- true if the secure date is available false otherwise (in which case the system date will be returned)
-
initServerDate
public void initServerDate(java.util.Date pServerDate)
Method used to init the server date- Parameters:
pServerDate- the sync server date
-
canEnableSecureDate
protected boolean canEnableSecureDate()
Returns whether secure date can be enabled on this device
-
getCurrentDate
@NonNull public BatchDate getCurrentDate()
- Specified by:
getCurrentDatein interfaceDateProvider
-
-