implements DataApi.DataListener MessageApi.MessageListener CapabilityApi.CapabilityListener ChannelApi.ChannelListener
Receives events from other nodes, such as data changes, messages or connectivity events.
The life-cycle of this service is managed by Android Wear. This service will be bound to and events delivered as a result of various Android Wear events, including data, messages and events indicating a device has connected or disconnected from the Android Wear network.
Applications expecting to be notified of events while in the background should extend this
class. Activities and other short-lived Android components may use
DataClient.addListener(DataClient.OnDataChangedListener)
,
MessageClient.addListener(MessageClient.OnMessageReceivedListener)
to receive
events for a limited period of time.
Implementors could use a LocalBroadcastManager
to dispatch events to other components in an application.
For best performance, limit the number of listeners and use mutually exclusive filters where there are multiple listeners. A common pattern is to use prefix filters to listen to different namespaces within an application.
Example manifest entry:
android:pathPrefix is optional.
<service android:name=".MyWearableListenerService" > <intent-filter> <!-- listeners receive events that match the action and data filters --> <action android:name="com.google.android.gms.wearable.DATA_CHANGED" /> <action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" /> <action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" /> <action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" /> <data android:scheme="wear" android:host="*" android:pathPrefix="/prefix" /> </intent-filter> </service>
Inherited Constant Summary
int | START_CONTINUATION_MASK | |
int | START_FLAG_REDELIVERY | |
int | START_FLAG_RETRY | |
int | START_NOT_STICKY | |
int | START_REDELIVER_INTENT | |
int | START_STICKY | |
int | START_STICKY_COMPATIBILITY | |
int | STOP_FOREGROUND_DETACH | |
int | STOP_FOREGROUND_REMOVE |
String | ACCESSIBILITY_SERVICE | |
String | ACCOUNT_SERVICE | |
String | ACTIVITY_SERVICE | |
String | ALARM_SERVICE | |
String | APPWIDGET_SERVICE | |
String | APP_HIBERNATION_SERVICE | |
String | APP_INTEGRITY_SERVICE | |
String | APP_OPS_SERVICE | |
String | APP_PREDICTION_SERVICE | |
String | APP_SEARCH_SERVICE | |
String | AUDIO_SERVICE | |
String | BACKUP_SERVICE | |
String | BATTERY_SERVICE | |
String | BATTERY_STATS_SERVICE | |
int | BIND_ABOVE_CLIENT | |
int | BIND_ADJUST_WITH_ACTIVITY | |
int | BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS | |
int | BIND_ALLOW_FOREGROUND_SERVICE_STARTS_FROM_BACKGROUND | |
int | BIND_ALLOW_OOM_MANAGEMENT | |
int | BIND_AUTO_CREATE | |
int | BIND_DEBUG_UNBIND | |
int | BIND_EXTERNAL_SERVICE | |
int | BIND_IMPORTANT | |
int | BIND_INCLUDE_CAPABILITIES | |
int | BIND_NOT_FOREGROUND | |
int | BIND_NOT_PERCEPTIBLE | |
int | BIND_WAIVE_PRIORITY | |
String | BIOMETRIC_SERVICE | |
String | BLOB_STORE_SERVICE | |
String | BLUETOOTH_SERVICE | |
String | BUGREPORT_SERVICE | |
String | CAMERA_SERVICE | |
String | CAPTIONING_SERVICE | |
String | CARRIER_CONFIG_SERVICE | |
String | CLIPBOARD_SERVICE | |
String | COMPANION_DEVICE_SERVICE | |
String | CONNECTIVITY_DIAGNOSTICS_SERVICE | |
String | CONNECTIVITY_SERVICE | |
String | CONSUMER_IR_SERVICE | |
String | CONTENT_SUGGESTIONS_SERVICE | |
String | CONTEXTHUB_SERVICE | |
int | CONTEXT_IGNORE_SECURITY | |
int | CONTEXT_INCLUDE_CODE | |
int | CONTEXT_RESTRICTED | |
String | CROSS_PROFILE_APPS_SERVICE | |
String | DEVICE_POLICY_SERVICE | |
String | DISPLAY_HASH_SERVICE | |
String | DISPLAY_SERVICE | |
String | DOMAIN_VERIFICATION_SERVICE | |
String | DOWNLOAD_SERVICE | |
String | DROPBOX_SERVICE | |
String | ETHERNET_SERVICE | |
String | EUICC_CARD_SERVICE | |
String | EUICC_SERVICE | |
String | FILE_INTEGRITY_SERVICE | |
String | FINGERPRINT_SERVICE | |
String | FONT_SERVICE | |
String | GAME_SERVICE | |
String | HARDWARE_PROPERTIES_SERVICE | |
String | HDMI_CONTROL_SERVICE | |
String | INPUT_METHOD_SERVICE | |
String | INPUT_SERVICE | |
String | IPSEC_SERVICE | |
String | JOB_SCHEDULER_SERVICE | |
String | KEYGUARD_SERVICE | |
String | LAUNCHER_APPS_SERVICE | |
String | LAYOUT_INFLATER_SERVICE | |
String | LOCATION_SERVICE | |
String | MEDIA_COMMUNICATION_SERVICE | |
String | MEDIA_METRICS_SERVICE | |
String | MEDIA_PROJECTION_SERVICE | |
String | MEDIA_ROUTER_SERVICE | |
String | MEDIA_SESSION_SERVICE | |
String | MEDIA_TRANSCODING_SERVICE | |
String | MIDI_SERVICE | |
int | MODE_APPEND | |
int | MODE_ENABLE_WRITE_AHEAD_LOGGING | |
int | MODE_MULTI_PROCESS | |
int | MODE_NO_LOCALIZED_COLLATORS | |
int | MODE_PRIVATE | |
int | MODE_WORLD_READABLE | |
int | MODE_WORLD_WRITEABLE | |
String | MUSIC_RECOGNITION_SERVICE | |
String | NETD_SERVICE | |
String | NETWORK_SCORE_SERVICE | |
String | NETWORK_STATS_SERVICE | |
String | NFC_SERVICE | |
String | NOTIFICATION_SERVICE | |
String | NSD_SERVICE | |
String | OEM_LOCK_SERVICE | |
String | PEOPLE_SERVICE | |
String | PERFORMANCE_HINT_SERVICE | |
String | PERMISSION_SERVICE | |
String | PERSISTENT_DATA_BLOCK_SERVICE | |
String | POWER_SERVICE | |
String | PRINT_SERVICE | |
String | REBOOT_READINESS_SERVICE | |
int | RECEIVER_VISIBLE_TO_INSTANT_APPS | |
String | RESTRICTIONS_SERVICE | |
String | ROLE_SERVICE | |
String | ROLLBACK_SERVICE | |
String | SEARCH_SERVICE | |
String | SEARCH_UI_SERVICE | |
String | SECURE_ELEMENT_SERVICE | |
String | SENSOR_SERVICE | |
String | SHORTCUT_SERVICE | |
String | SMARTSPACE_SERVICE | |
String | STATS_MANAGER | |
String | STATUS_BAR_SERVICE | |
String | STORAGE_SERVICE | |
String | STORAGE_STATS_SERVICE | |
String | SYSTEM_CONFIG_SERVICE | |
String | SYSTEM_HEALTH_SERVICE | |
String | SYSTEM_UPDATE_SERVICE | |
String | TELECOM_SERVICE | |
String | TELEPHONY_IMS_SERVICE | |
String | TELEPHONY_SERVICE | |
String | TELEPHONY_SUBSCRIPTION_SERVICE | |
String | TETHERING_SERVICE | |
String | TEXT_CLASSIFICATION_SERVICE | |
String | TEXT_SERVICES_MANAGER_SERVICE | |
String | TRANSLATION_MANAGER_SERVICE | |
String | TV_INPUT_SERVICE | |
String | UI_MODE_SERVICE | |
String | UI_TRANSLATION_SERVICE | |
String | USAGE_STATS_SERVICE | |
String | USB_SERVICE | |
String | USER_SERVICE | |
String | VIBRATOR_MANAGER_SERVICE | |
String | VIBRATOR_SERVICE | |
String | VPN_MANAGEMENT_SERVICE | |
String | VR_SERVICE | |
String | WALLPAPER_SERVICE | |
String | WIFI_AWARE_SERVICE | |
String | WIFI_NL80211_SERVICE | |
String | WIFI_P2P_SERVICE | |
String | WIFI_RTT_RANGING_SERVICE | |
String | WIFI_RTT_SERVICE | |
String | WIFI_SCANNING_SERVICE | |
String | WIFI_SERVICE | |
String | WINDOW_SERVICE |
int | TRIM_MEMORY_BACKGROUND | |
int | TRIM_MEMORY_COMPLETE | |
int | TRIM_MEMORY_MODERATE | |
int | TRIM_MEMORY_RUNNING_CRITICAL | |
int | TRIM_MEMORY_RUNNING_LOW | |
int | TRIM_MEMORY_RUNNING_MODERATE | |
int | TRIM_MEMORY_UI_HIDDEN |
Public Constructor Summary
Public Method Summary
Looper |
getLooper()
This method is used to retrieve the looper all callbacks will run on.
|
final IBinder | |
void |
onCapabilityChanged(CapabilityInfo
capabilityInfo)
|
void |
onChannelClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed.
|
void |
onChannelClosed(ChannelClient.Channel
channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed.
|
void | |
void |
onChannelOpened(ChannelClient.Channel
channel)
Called when a new channel is opened by a remote node.
|
void | |
void |
onCreate()
|
void | |
void | |
void |
onInputClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
|
void |
onInputClosed(ChannelClient.Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
|
void | |
void |
onOutputClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
|
void |
onOutputClosed(ChannelClient.Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
|
void |
onPeerConnected(Node peer)
|
void |
onPeerDisconnected(Node peer)
|
Inherited Method Summary
void |
attachBaseContext(Context
arg0)
|
void | |
final Application |
getApplication()
|
final int |
getForegroundServiceType()
|
abstract IBinder |
onBind(Intent
arg0)
|
void |
onConfigurationChanged(Configuration
arg0)
|
void |
onCreate()
|
void |
onDestroy()
|
void |
onLowMemory()
|
void |
onRebind(Intent
arg0)
|
void |
onStart(Intent
arg0, int arg1)
|
int |
onStartCommand(Intent
arg0, int arg1, int arg2)
|
void |
onTaskRemoved(Intent
arg0)
|
void |
onTrimMemory(int arg0)
|
boolean |
onUnbind(Intent
arg0)
|
final void |
startForeground(int arg0, Notification
arg1)
|
final void |
startForeground(int arg0, Notification
arg1, int arg2)
|
final void |
stopForeground(int arg0)
|
final void |
stopForeground(boolean arg0)
|
final void |
stopSelf()
|
final void |
stopSelf(int arg0)
|
final boolean |
stopSelfResult(int arg0)
|
void |
attachBaseContext(Context
arg0)
|
boolean | |
boolean | |
boolean | |
boolean | |
int |
checkCallingOrSelfPermission(String arg0)
|
int |
checkCallingOrSelfUriPermission(Uri arg0, int
arg1)
|
int[] | |
int |
checkCallingPermission(String arg0)
|
int |
checkCallingUriPermission(Uri arg0, int
arg1)
|
int[] | |
int |
checkPermission(String arg0,
int arg1, int arg2)
|
int |
checkSelfPermission(String arg0)
|
int | |
int |
checkUriPermission(Uri arg0, int
arg1, int arg2, int arg3)
|
int[] | |
void |
clearWallpaper()
|
Context |
createAttributionContext(String arg0)
|
Context |
createConfigurationContext(Configuration
arg0)
|
Context |
createContext(ContextParams arg0)
|
Context |
createContextAsUser(UserHandle
arg0, int arg1)
|
Context |
createContextForSplit(String arg0)
|
Context |
createCredentialProtectedStorageContext()
|
Context |
createDeviceProtectedStorageContext()
|
Context |
createDisplayContext(Display
arg0)
|
Context |
createPackageContext(String arg0,
int arg1)
|
Context | |
Context |
createWindowContext(int arg0, Bundle arg1)
|
Context | |
String[] |
databaseList()
|
boolean |
deleteDatabase(String arg0)
|
boolean |
deleteFile(String arg0)
|
boolean |
deleteSharedPreferences(String arg0)
|
void | |
void | |
void | |
void | |
void | |
void | |
void | |
String[] |
fileList()
|
Context |
getApplicationContext()
|
ApplicationInfo |
getApplicationInfo()
|
AssetManager |
getAssets()
|
AttributionSource |
getAttributionSource()
|
String |
getAttributionTag()
|
Context |
getBaseContext()
|
File |
getCacheDir()
|
ClassLoader |
getClassLoader()
|
File |
getCodeCacheDir()
|
ContentResolver |
getContentResolver()
|
File |
getDataDir()
|
File |
getDatabasePath(String arg0)
|
File |
getDir(String arg0,
int arg1)
|
Display |
getDisplay()
|
File |
getExternalCacheDir()
|
File[] |
getExternalCacheDirs()
|
File |
getExternalFilesDir(String arg0)
|
File[] |
getExternalFilesDirs(String arg0)
|
File[] |
getExternalMediaDirs()
|
File |
getFileStreamPath(String arg0)
|
File |
getFilesDir()
|
Executor |
getMainExecutor()
|
Looper |
getMainLooper()
|
File |
getNoBackupFilesDir()
|
File |
getObbDir()
|
File[] |
getObbDirs()
|
String |
getOpPackageName()
|
String |
getPackageCodePath()
|
PackageManager |
getPackageManager()
|
String |
getPackageName()
|
String |
getPackageResourcePath()
|
ContextParams |
getParams()
|
File |
getPreloadsFileCache()
|
Resources |
getResources()
|
SharedPreferences |
getSharedPreferences(String arg0,
int arg1)
|
Object |
getSystemService(String arg0)
|
String |
getSystemServiceName(Class<?>
arg0)
|
Resources.Theme |
getTheme()
|
Drawable |
getWallpaper()
|
int |
getWallpaperDesiredMinimumHeight()
|
int |
getWallpaperDesiredMinimumWidth()
|
void | |
boolean |
isCredentialProtectedStorage()
|
boolean |
isDeviceProtectedStorage()
|
boolean |
isRestricted()
|
boolean |
isUiContext()
|
boolean | |
boolean | |
FileInputStream |
openFileInput(String arg0)
|
FileOutputStream |
openFileOutput(String arg0,
int arg1)
|
SQLiteDatabase |
openOrCreateDatabase(String arg0,
int arg1,
SQLiteDatabase.CursorFactory arg2,
DatabaseErrorHandler arg3)
|
SQLiteDatabase | |
Drawable |
peekWallpaper()
|
Intent | |
Intent | |
Intent | |
Intent | |
Intent | |
void |
removeStickyBroadcast(Intent
arg0)
|
void | |
void |
revokeUriPermission(Uri arg0, int
arg1)
|
void | |
void | |
void | |
void |
sendBroadcast(Intent
arg0)
|
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void |
sendOrderedBroadcastAsUser(Intent
arg0, UserHandle
arg1, String arg2,
BroadcastReceiver
arg3, Handler
arg4, int arg5, String arg6,
Bundle arg7)
|
void |
sendStickyBroadcast(Intent
arg0)
|
void | |
void | |
void |
sendStickyOrderedBroadcast(Intent
arg0, BroadcastReceiver
arg1, Handler
arg2, int arg3, String arg4,
Bundle arg5)
|
void |
sendStickyOrderedBroadcastAsUser(Intent
arg0, UserHandle
arg1, BroadcastReceiver
arg2, Handler
arg3, int arg4, String arg5,
Bundle arg6)
|
void |
setTheme(int arg0)
|
void |
setWallpaper(Bitmap
arg0)
|
void |
setWallpaper(InputStream
arg0)
|
void | |
void |
startActivities(Intent[]
arg0)
|
void |
startActivity(Intent
arg0)
|
void | |
void | |
ComponentName |
startForegroundService(Intent
arg0)
|
boolean | |
void | |
void | |
ComponentName |
startService(Intent
arg0)
|
boolean |
stopService(Intent
arg0)
|
void |
unbindService(ServiceConnection
arg0)
|
void |
unregisterReceiver(BroadcastReceiver
arg0)
|
void |
updateServiceGroup(ServiceConnection
arg0, int arg1, int arg2)
|
boolean | |
boolean | |
abstract boolean | |
boolean | |
abstract int |
checkCallingOrSelfPermission(String arg0)
|
abstract int |
checkCallingOrSelfUriPermission(Uri arg0, int
arg1)
|
int[] | |
abstract int |
checkCallingPermission(String arg0)
|
abstract int |
checkCallingUriPermission(Uri arg0, int
arg1)
|
int[] | |
abstract int |
checkPermission(String arg0,
int arg1, int arg2)
|
abstract int |
checkSelfPermission(String arg0)
|
abstract int | |
abstract int |
checkUriPermission(Uri arg0, int
arg1, int arg2, int arg3)
|
int[] | |
abstract void |
clearWallpaper()
|
Context |
createAttributionContext(String arg0)
|
abstract Context |
createConfigurationContext(Configuration
arg0)
|
Context |
createContext(ContextParams arg0)
|
Context |
createContextAsUser(UserHandle
arg0, int arg1)
|
abstract Context |
createContextForSplit(String arg0)
|
abstract Context |
createCredentialProtectedStorageContext()
|
abstract Context |
createDeviceProtectedStorageContext()
|
abstract Context |
createDisplayContext(Display
arg0)
|
abstract Context |
createPackageContext(String arg0,
int arg1)
|
Context | |
Context |
createWindowContext(int arg0, Bundle arg1)
|
Context | |
abstract String[] |
databaseList()
|
abstract boolean |
deleteDatabase(String arg0)
|
abstract boolean |
deleteFile(String arg0)
|
abstract boolean |
deleteSharedPreferences(String arg0)
|
abstract void | |
abstract void | |
abstract void | |
abstract void | |
abstract void | |
abstract void | |
abstract void | |
abstract String[] |
fileList()
|
abstract Context |
getApplicationContext()
|
abstract ApplicationInfo |
getApplicationInfo()
|
abstract AssetManager |
getAssets()
|
AttributionSource |
getAttributionSource()
|
String |
getAttributionTag()
|
abstract File |
getCacheDir()
|
abstract ClassLoader |
getClassLoader()
|
abstract File |
getCodeCacheDir()
|
final int |
getColor(int arg0)
|
final ColorStateList |
getColorStateList(int arg0)
|
abstract ContentResolver |
getContentResolver()
|
abstract File |
getDataDir()
|
abstract File |
getDatabasePath(String arg0)
|
abstract File |
getDir(String arg0,
int arg1)
|
Display |
getDisplay()
|
final Drawable |
getDrawable(int arg0)
|
abstract File |
getExternalCacheDir()
|
abstract File[] |
getExternalCacheDirs()
|
abstract File |
getExternalFilesDir(String arg0)
|
abstract File[] |
getExternalFilesDirs(String arg0)
|
abstract File[] |
getExternalMediaDirs()
|
abstract File |
getFileStreamPath(String arg0)
|
abstract File |
getFilesDir()
|
Executor |
getMainExecutor()
|
abstract Looper |
getMainLooper()
|
abstract File |
getNoBackupFilesDir()
|
abstract File |
getObbDir()
|
abstract File[] |
getObbDirs()
|
String |
getOpPackageName()
|
abstract String |
getPackageCodePath()
|
abstract PackageManager |
getPackageManager()
|
abstract String |
getPackageName()
|
abstract String |
getPackageResourcePath()
|
ContextParams |
getParams()
|
abstract File |
getPreloadsFileCache()
|
abstract Resources |
getResources()
|
abstract SharedPreferences |
getSharedPreferences(String arg0,
int arg1)
|
final String |
getString(int arg0, Object...
arg1)
|
final String |
getString(int arg0)
|
final <T> T |
getSystemService(Class<T>
arg0)
|
abstract Object |
getSystemService(String arg0)
|
abstract String |
getSystemServiceName(Class<?>
arg0)
|
final CharSequence |
getText(int arg0)
|
abstract Resources.Theme |
getTheme()
|
abstract Drawable |
getWallpaper()
|
abstract int |
getWallpaperDesiredMinimumHeight()
|
abstract int |
getWallpaperDesiredMinimumWidth()
|
abstract void | |
abstract boolean |
isCredentialProtectedStorage()
|
abstract boolean |
isDeviceProtectedStorage()
|
boolean |
isRestricted()
|
boolean |
isUiContext()
|
abstract boolean | |
abstract boolean | |
final TypedArray |
obtainStyledAttributes(AttributeSet
arg0, int[] arg1)
|
final TypedArray |
obtainStyledAttributes(AttributeSet
arg0, int[] arg1, int arg2, int arg3)
|
final TypedArray |
obtainStyledAttributes(int arg0, int[] arg1)
|
final TypedArray |
obtainStyledAttributes(int[] arg0)
|
abstract FileInputStream |
openFileInput(String arg0)
|
abstract FileOutputStream |
openFileOutput(String arg0,
int arg1)
|
abstract SQLiteDatabase |
openOrCreateDatabase(String arg0,
int arg1,
SQLiteDatabase.CursorFactory arg2,
DatabaseErrorHandler arg3)
|
abstract SQLiteDatabase | |
abstract Drawable |
peekWallpaper()
|
void |
registerComponentCallbacks(ComponentCallbacks
arg0)
|
abstract Intent | |
abstract Intent | |
abstract Intent | |
abstract Intent | |
Intent | |
abstract void |
removeStickyBroadcast(Intent
arg0)
|
abstract void | |
abstract void |
revokeUriPermission(Uri arg0, int
arg1)
|
abstract void | |
abstract void | |
abstract void | |
abstract void |
sendBroadcast(Intent
arg0)
|
abstract void | |
abstract void | |
abstract void | |
void | |
void | |
abstract void | |
abstract void | |
abstract void | |
abstract void |
sendOrderedBroadcastAsUser(Intent
arg0, UserHandle
arg1, String arg2,
BroadcastReceiver
arg3, Handler
arg4, int arg5, String arg6,
Bundle arg7)
|
abstract void |
sendStickyBroadcast(Intent
arg0)
|
void | |
abstract void | |
abstract void |
sendStickyOrderedBroadcast(Intent
arg0, BroadcastReceiver
arg1, Handler
arg2, int arg3, String arg4,
Bundle arg5)
|
abstract void |
sendStickyOrderedBroadcastAsUser(Intent
arg0, UserHandle
arg1, BroadcastReceiver
arg2, Handler
arg3, int arg4, String arg5,
Bundle arg6)
|
abstract void |
setTheme(int arg0)
|
abstract void |
setWallpaper(Bitmap
arg0)
|
abstract void |
setWallpaper(InputStream
arg0)
|
abstract void | |
abstract void |
startActivities(Intent[]
arg0)
|
abstract void |
startActivity(Intent
arg0)
|
abstract void | |
void | |
abstract ComponentName |
startForegroundService(Intent
arg0)
|
abstract boolean | |
abstract void | |
abstract void | |
abstract ComponentName |
startService(Intent
arg0)
|
abstract boolean |
stopService(Intent
arg0)
|
abstract void |
unbindService(ServiceConnection
arg0)
|
void |
unregisterComponentCallbacks(ComponentCallbacks
arg0)
|
abstract void |
unregisterReceiver(BroadcastReceiver
arg0)
|
void |
updateServiceGroup(ServiceConnection
arg0, int arg1, int arg2)
|
abstract void |
onTrimMemory(int arg0)
|
abstract void |
onDataChanged(DataEventBuffer
dataEvents)
Notification that a set of data items have been changed or deleted.
|
abstract void |
abstract void |
onCapabilityChanged(CapabilityInfo
capabilityInfo)
|
abstract void |
onChannelClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed.
|
abstract void | |
abstract void |
onInputClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
|
abstract void |
onOutputClosed(Channel
channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
|
abstract void |
onConfigurationChanged(Configuration
arg0)
|
abstract void |
onLowMemory()
|
Public Constructors
public WearableListenerService ()
Public Methods
public Looper getLooper ()
This method is used to retrieve the looper all callbacks will run on. The default behavior is to construct a new background thread the first time called and use that thread. If a different looper is desired, subclasses should override this method.
public void onCapabilityChanged (CapabilityInfo capabilityInfo)
public void onChannelClosed (Channel channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed. This can happen through an explicit call to
Channel.close(GoogleApiClient)
or
Channel.close(GoogleApiClient, int)
on either side of the connection, or due
to disconnecting from the remote node.
Parameters
channel | |
---|---|
closeReason | the reason for the channel closing. One of
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED ,
ChannelApi.ChannelListener.CLOSE_REASON_REMOTE_CLOSE ,
ChannelApi.ChannelListener.CLOSE_REASON_LOCAL_CLOSE , or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT |
appSpecificErrorCode | the error code specified on
Channel.close(GoogleApiClient) , or 0 if closeReason is
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT . |
public void onChannelClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed.
Parameters
channel | the ChannelClient.Channel
that was closed. |
---|---|
closeReason | the reason for the input closing. One of
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED ,
ChannelClient.ChannelCallback.CLOSE_REASON_REMOTE_CLOSE ,
ChannelClient.ChannelCallback.CLOSE_REASON_LOCAL_CLOSE , or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |
appSpecificErrorCode | the error code specified on
ChannelClient.close(ChannelClient.Channel, int) , or 0 if
closeReason is
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |
public void onChannelOpened (Channel channel)
Called when a new channel is opened by a remote node.
public void onChannelOpened (ChannelClient.Channel channel)
Called when a new channel is opened by a remote node.
Parameters
channel | the ChannelClient.Channel
that was opened. |
---|
public void onCreate ()
public void onDataChanged (DataEventBuffer dataEvents)
Receives data changed events. The provided buffer will be closed after this method
completes. Use Freezable.freeze()
on items in the buffer to use them outside of this callscope.
Multiple data events may delivered in a single call and may only contain final-state
modifications of a data item. (Eg, multiple calls to putDataItem changing the value of
the data item's DataItem.getData()
may only appear as a single event, with the last modification expressed).
Applications needing to track the of all its data items, may use
DataApi.getDataItems(GoogleApiClient)
on boot to retrieve all existing data
items.
public void onDestroy ()
public void onInputClosed (Channel channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
Parameters
channel | |
---|---|
closeReason | the reason for the input closing. One of
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED ,
ChannelApi.ChannelListener.CLOSE_REASON_REMOTE_CLOSE ,
ChannelApi.ChannelListener.CLOSE_REASON_LOCAL_CLOSE ,
ChannelApi.ChannelListener.CLOSE_REASON_NORMAL , or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT |
appSpecificErrorCode | the error code specified on
Channel.close(GoogleApiClient) , or 0 if closeReason is
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED ,
ChannelApi.ChannelListener.CLOSE_REASON_NORMAL , or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT . |
public void onInputClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
Parameters
channel | the ChannelClient.Channel
whose input was closed. |
---|---|
closeReason | the reason for the input closing. One of
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED ,
ChannelClient.ChannelCallback.CLOSE_REASON_REMOTE_CLOSE ,
ChannelClient.ChannelCallback.CLOSE_REASON_LOCAL_CLOSE , or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |
appSpecificErrorCode | the error code specified on
ChannelClient.close(ChannelClient.Channel, int) , or 0 if
closeReason is
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |
public void onMessageReceived (MessageEvent messageEvent)
Receives message events.
public void onOutputClosed (Channel channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
Parameters
channel | |
---|---|
closeReason | the reason for the output closing. One of
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED ,
ChannelApi.ChannelListener.CLOSE_REASON_REMOTE_CLOSE ,
ChannelApi.ChannelListener.CLOSE_REASON_LOCAL_CLOSE ,
ChannelApi.ChannelListener.CLOSE_REASON_NORMAL , or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT |
appSpecificErrorCode | the error code specified on
Channel.close(GoogleApiClient) , or 0 if closeReason is
ChannelApi.ChannelListener.CLOSE_REASON_DISCONNECTED ,
ChannelApi.ChannelListener.CLOSE_REASON_NORMAL , or
ChannelApi.ChannelListener.CLOSE_REASON_CONNECTION_TIMEOUT . |
public void onOutputClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
Parameters
channel | the ChannelClient.Channel
whose output was closed. |
---|---|
closeReason | the reason for the output closing. One of
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED ,
ChannelClient.ChannelCallback.CLOSE_REASON_REMOTE_CLOSE ,
ChannelClient.ChannelCallback.CLOSE_REASON_LOCAL_CLOSE , or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |
appSpecificErrorCode | the error code specified on
ChannelClient.close(ChannelClient.Channel, int) , or 0 if
closeReason is
ChannelClient.ChannelCallback.CLOSE_REASON_DISCONNECTED or
ChannelClient.ChannelCallback.CLOSE_REASON_NORMAL . |