On some devices, the USB "set configuration" command is propogated to the framework
after the "start accessory" event is received. However, on other devices like
the 2011 ADK board, no "set configuration" command is sent at all until we have
reenumerated in acccessory mode. To fix the original problem without breaking other
devices, we can simply remove assumptions about if or when "set configuration"
will be received. Now we simply remain switch USB configuration to accessory mode
when we receive the "start accessory" command, and remain there until the existing
10 second timeout expires.
Bug: 13393825
Change-Id: I4c9e3423185bd7252a907e4568d9e3ff06044b7d
This reverts commit fbd5521fb5e94fad066e21b9f91f4782afe71660.
This change broke support for the 2011 ADK board, which never sends a "set configuration"
command before "accessory start". So we revert this change and will replace it with a better fix.
Bug: 13535051
Bug: 13393825
Change-Id: Icd870d7ff6daff1567e04d93907f70f5d7e37884
Backup/restore now supports app widgets.
An application involved with app widgets, either hosting or publishing,
now has associated data in its backup dataset related to the state of
widget instantiation on the ancestral device. That data is processed
by the OS during restore so that the matching widget instances can be
"automatically" regenerated.
To take advantage of this facility, widget-using apps need to do two
things: first, implement a backup agent and store whatever widget
state they need to properly deal with them post-restore (e.g. the
widget instance size & location, for a host); and second, implement
handlers for new AppWidgetManager broadcasts that describe how to
translate ancestral-dataset widget id numbers to the post-restore
world. Note that a host or provider doesn't technically need to
store *any* data on its own via its agent; it just needs to opt in
to the backup/restore process by publishing an agent. The OS will
then store a small amount of data on behalf of each widget-savvy
app within the backup dataset, and act on that data at restore time.
The broadcasts are AppWidgetManager.ACTION_APPWIDGET_RESTORED and
ACTION_APPWIDGET_HOST_RESTORED, and have three associated extras:
EXTRA_APPWIDGET_OLD_IDS
EXTRA_APPWIDGET_IDS
EXTRA_HOST_ID [for the host-side broadcast]
The first two are same-sized arrays of integer widget IDs. The
_OLD_IDS values are the widget IDs as known to the ancestral device.
The _IDS array holds the corresponding widget IDs in the new post-
restore environment. The app should simply update the stored
widget IDs in its bookkeeping to the new values, and things are
off and running. The HOST_ID extra, as one might expect, is the
app-defined host ID value of the particular host instance which
has just been restored.
The broadcasts are sent following the conclusion of the overall
restore pass. This is because the restore might have occurred in a
tightly restricted lifecycle environment without content providers
or the package's custom Application class. The _RESTORED broadcast,
however, is always delivered into a normal application environment,
so that the app can use its content provider etc as expected.
*All* widget instances that were processed over the course of the
system restore are indicated in the _RESTORED broadcast, even if
the backing provider or host is not yet installed. The widget
participant is responsible for understanding that these are
promises that might be fulfilled later rather than necessarily
reflecting the immediate presentable widget state. (Remember
that following a cloud restore, apps may be installed piecemeal
over a lengthy period of time.) Telling the hosts up front
about all intended widget instances allows them to show placeholder
UI or similarly useful information rather than surprising the user
with piecemeal unexpected appearances.
The AppWidgetProvider helper class has been updated to add a new
callback, onRestored(...), invoked when the _RESTORED broadcast
is received. The call to onRestored() is immediately followed by
an invocation of onUpdate() for the affected widgets because
they will need to have their RemoteViews regenerated under the
new ID values.
Bug 10622506
Bug 10707117
Change-Id: Ie0007cdf809600b880d91989c00c3c3b8a4f988b
W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothInputDevice.doBind:262 android.bluetooth.BluetoothInputDevice.<init>:255 android.bluetooth.BluetoothAdapter.getProfileProxy:1365
W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothPan.doBind:148 android.bluetooth.BluetoothPan.<init>:140 android.bluetooth.BluetoothAdapter.getProfileProxy:1368
W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothMap.doBind:108 android.bluetooth.BluetoothMap.<init>:101 android.bluetooth.BluetoothAdapter.getProfileProxy:1374
W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothPbap.doBind:163 android.bluetooth.BluetoothPbap.<init>:156 com.android.settings.bluetooth.PbapServerProfile.<init>:68
Change-Id: I0a1e24ee71aef7d796fcee5692b9d19462a93637
* commit 'd4d42af5c5ee62c8c53b87b3794cf5d762d2e67d':
update to wear docs. includes javadoc changes from Id95383d18f9a679927f462822335dce8890fa414 and html doc changes from patch set 9 from I949011be5abfb5190dc5716ce935d1555ff1b2ad
* commit '331ef6127cd9df4a2d2a32178121e4b412ed9239':
DO NOT MERGE: Move advetise clean up to callback code. fixes b/13289050 Cherrypick from master to fix b/13289050
* commit 'df00735c6791811534d3d2e2790a0dcf7daffcf1':
update to wear docs. includes javadoc changes from Id95383d18f9a679927f462822335dce8890fa414 and html doc changes from patch set 9 from I949011be5abfb5190dc5716ce935d1555ff1b2ad
* commit '32779536bcd66d45019f4ab80dd0d844e618e16b':
DO NOT MERGE: Move advetise clean up to callback code. fixes b/13289050 Cherrypick from master to fix b/13289050
* commit 'e02d5a20ede8a6ac46e7b60cc0b258d42e224087':
update to wear docs. includes javadoc changes from Id95383d18f9a679927f462822335dce8890fa414 and html doc changes from patch set 9 from I949011be5abfb5190dc5716ce935d1555ff1b2ad