|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Service com.vodafone360.people.service.RemoteService
public class RemoteService
Implementation of People client's Service class. Loads properties from SettingsManager. Creates NetworkAgent. Connects to ConnectionManager enabling transport layer. Activates service's worker thread when required.
Field Summary | |
---|---|
static java.lang.String |
ACTION_AUTHENTICATOR_INTENT
Action for an Authenticator. |
static java.lang.String |
ACTION_SYNC_ADAPTER_INTENT
Sync Adapter System intent action received on Bind. |
static java.lang.String |
ALARM_KEY
Intent received when service is started is tested against the value stored in this key to determine if the service has been started because of an alarm. |
private NativeAccountObjectsHolder |
mAccountsObjectsHolder
|
private Handler |
mHandler
Handler for remotely calling the kickWorkerThread() method. |
private IPeopleServiceImpl |
mIPeopleServiceImpl
The following object contains the implementation of the IPeopleService
interface. |
private boolean |
mIsConnected
Stores the previous network connection state (true = connected) |
private boolean |
mIsStarted
true when the service has been fully initialised |
private NetworkAgent |
mNetworkAgent
Main reference to network agent |
private IWakeupListener |
mWakeListener
Used by comms when waking up the CPI at regular intervals and sending a heartbeat is necessary |
private WorkerThread |
mWorkerThread
Worker thread reference |
Constructor Summary | |
---|---|
RemoteService()
|
Method Summary | |
---|---|
NetworkAgent |
getNetworkAgent()
Return handle to NetworkAgent |
void |
kickWorkerThread()
Ensures that the WorkerThread runs at least once. |
IBinder |
onBind(Intent intent)
Service binding is not used internally by this Application, but called externally by the system when it needs an Authenticator or Sync Adapter. |
void |
onCreate()
Creation of RemoteService. |
void |
onDestroy()
Destroy RemoteService Close WorkerThread, destroy EngineManger and NetworkAgent. |
void |
onStart(Intent intent,
int startId)
Called on start of RemoteService. |
void |
registerCpuWakeupListener(IWakeupListener wakeListener)
Registers a listener (e.g. the HeartbeatSender for TCP) that will be notified whenever an intent for a new alarm is received. |
void |
setAlarm(boolean set,
long realTime)
Set an Alarm with the AlarmManager to trigger the next update check. |
void |
signalConnectionManager(boolean connected)
Called by NetworkAgent to notify whether device has become connected or disconnected. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ALARM_KEY
public static final java.lang.String ACTION_AUTHENTICATOR_INTENT
public static final java.lang.String ACTION_SYNC_ADAPTER_INTENT
private NetworkAgent mNetworkAgent
NetworkAgent
private WorkerThread mWorkerThread
WorkerThread
private IPeopleServiceImpl mIPeopleServiceImpl
IPeopleService
interface.
private IWakeupListener mWakeListener
private boolean mIsStarted
private boolean mIsConnected
private NativeAccountObjectsHolder mAccountsObjectsHolder
private final Handler mHandler
Constructor Detail |
---|
public RemoteService()
Method Detail |
---|
public void onCreate()
public void onStart(Intent intent, int startId)
public void onDestroy()
public IBinder onBind(Intent intent)
public void kickWorkerThread()
kickWorkerThread
in interface IWorkerThreadControl
public void signalConnectionManager(boolean connected)
signalConnectionManager
in interface IConnectionManagerInterface
connected
- true if device has become connected, false if device is
disconnected.public void registerCpuWakeupListener(IWakeupListener wakeListener)
Registers a listener (e.g. the HeartbeatSender for TCP) that will be notified whenever an intent for a new alarm is received.
This is desperately needed as the CPU of Android devices will halt when the user turns off the screen and all CPU related activity is suspended for that time. The wake up alarm is one simple way of achieving the CPU to wake up and send out data (e.g. the heartbeat sender).
public NetworkAgent getNetworkAgent()
NetworkAgent
NetworkAgent
public void setAlarm(boolean set, long realTime)
set
- Set or cancel the AlarmrealTime
- Time when the Alarm should be triggered
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc