/**@class android.os.CommonTimeConfig @extends java.lang.Object Used for configuring and controlling the status of the android common time service. @hide */ var CommonTimeConfig = { /** Successful operation. */ SUCCESS : "0", /** Unspecified error. */ ERROR : "-1", /** Operation failed due to bad parameter value. */ ERROR_BAD_VALUE : "-4", /** Operation failed due to dead remote object. */ ERROR_DEAD_OBJECT : "-7", /** Sentinel value returned by {@link #getMasterElectionGroupId}() when an error occurs trying to fetch the master election group. */ INVALID_GROUP_ID : "-1", /** Name of the underlying native binder service */ SERVICE_NAME : "common_time.config", /**Handy class factory method. */ create : function( ) {}, /**Release all native resources held by this {@link android.os.CommonTimeConfig} instance. Once resources have been released, the {@link android.os.CommonTimeConfig} instance is disconnected from the native service and will throw a {@link android.os.RemoteException} if any of its methods are called. Clients should always call release on their client instances before releasing their last Java reference to the instance. Failure to do this will cause non-deterministic native resource reclamation and may cause the common time service to remain active on the network for longer than it should. */ release : function( ) {}, /**Gets the current priority of the common time service used in the master election protocol. @return {Number} an 8 bit value indicating the priority of this common time service relative to other common time services operating in the same domain. @throws android.os.RemoteException */ getMasterElectionPriority : function( ) {}, /**Sets the current priority of the common time service used in the master election protocol. @param {Number} priority priority of the common time service used in the master election protocol. Lower numbers are lower priority. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setMasterElectionPriority : function( ) {}, /**Gets the IP endpoint used by the time service to participate in the master election protocol. @return {Object {java.net.InetSocketAddress}} an InetSocketAddress containing the IP address and UDP port being used by the system's common time service to participate in the master election protocol. @throws android.os.RemoteException */ getMasterElectionEndpoint : function( ) {}, /**Sets the IP endpoint used by the common time service to participate in the master election protocol. @param {Object {InetSocketAddress}} ep The IP address and UDP port to be used by the common time service to participate in the master election protocol. The supplied IP address must be either the broadcast or multicast address, unicast addresses are considered to be illegal values. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setMasterElectionEndpoint : function( ) {}, /**Gets the current group ID used by the common time service in the master election protocol. @return {Number} The 64-bit group ID of the common time service. @throws android.os.RemoteException */ getMasterElectionGroupId : function( ) {}, /**Sets the current group ID used by the common time service in the master election protocol. @param {Number} id The 64-bit group ID of the common time service. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setMasterElectionGroupId : function( ) {}, /**Gets the name of the network interface which the common time service attempts to bind to. @return {String} a string with the network interface name which the common time service is bound to, or null if the service is currently unbound. Examples of interface names are things like "eth0", or "wlan0". @throws android.os.RemoteException */ getInterfaceBinding : function( ) {}, /**Sets the name of the network interface which the common time service should attempt to bind to. @param {String} ifaceName The name of the network interface ("eth0", "wlan0", etc...) wich the common time service should attempt to bind to, or null to force the common time service to unbind from the network and run in networkless mode. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setNetworkBinding : function( ) {}, /**Gets the amount of time the common time service will wait between master announcements when it is the timeline master. @return {Number} The time (in milliseconds) between master announcements. @throws android.os.RemoteException */ getMasterAnnounceInterval : function( ) {}, /**Sets the amount of time the common time service will wait between master announcements when it is the timeline master. @param {Number} interval The time (in milliseconds) between master announcements. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setMasterAnnounceInterval : function( ) {}, /**Gets the amount of time the common time service will wait between time synchronization requests when it is the client of another common time service on the network. @return {Number} The time (in milliseconds) between time sync requests. @throws android.os.RemoteException */ getClientSyncInterval : function( ) {}, /**Sets the amount of time the common time service will wait between time synchronization requests when it is the client of another common time service on the network. @param {Number} interval The time (in milliseconds) between time sync requests. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setClientSyncInterval : function( ) {}, /**Gets the panic threshold for the estimated error level of the common time service. When the common time service's estimated error rises above this level, the service will panic and reset, causing a discontinuity in the currently synchronized timeline. @return {Number} The threshold (in microseconds) past which the common time service will panic. @throws android.os.RemoteException */ getPanicThreshold : function( ) {}, /**Sets the panic threshold for the estimated error level of the common time service. When the common time service's estimated error rises above this level, the service will panic and reset, causing a discontinuity in the currently synchronized timeline. @param {Number} threshold The threshold (in microseconds) past which the common time service will panic. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR}, {@link #ERROR_BAD_VALUE} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setPanicThreshold : function( ) {}, /**Gets the current state of the common time service's auto disable flag. @return {Boolean} The current state of the common time service's auto disable flag. @throws android.os.RemoteException */ getAutoDisable : function( ) {}, /**Sets the current state of the common time service's auto disable flag. When the time service's auto disable flag is set, it will automatically cease all network activity when it has no active local clients, resuming activity the next time the service has interested local clients. When the auto disabled flag is cleared, the common time service will continue to participate the time synchronization group even when it has no active local clients. @param {Boolean} autoDisable The desired state of the common time service's auto disable flag. @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ setAutoDisable : function( ) {}, /**At startup, the time service enters the initial state and remains there until it is given a network interface to bind to. Common time will be unavailable to clients of the common time service until the service joins a network (even an empty network). Devices may use the {@link #forceNetworklessMasterMode}() method to force a time service in the INITIAL state with no network configuration to assume MASTER status for a brand new timeline in order to allow clients of the common time service to operate, even though the device is isolated and not on any network. When a networkless master does join a network, it will defer to any masters already on the network, or continue to maintain the timeline it made up during its networkless state if no other masters are detected. Attempting to force a client into master mode while it is actively bound to a network will fail with the status code {@link #ERROR} @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR} or {@link #ERROR_DEAD_OBJECT} in case of failure. */ forceNetworklessMasterMode : function( ) {}, /**Registers an OnServerDiedListener interface. <p>Call this method with a null listener to stop receiving server death notifications. */ setServerDiedListener : function( ) {}, };