History log of /frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
adfe8b86e9178a553b6db9722340fa4ff5201cf1 05-Feb-2014 Christopher Tate <ctate@google.com> App widget backup/restore infrastructure

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
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
3a084af2e90849aaa8beb3a610189e3399c63ea0 07-Nov-2012 Kenny Root <kroot@google.com> Correct executable bit for source files

Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
d2097ebacf3a3658624cad10669a4d98e8d7d846 02-May-2012 Adam Cohen <adamcohen@google.com> Changing app widget "extras" to "options" and another small API Review issue

-> (issue 6427146), (issue 6427861)

Change-Id: Ib69a9b3717a5b62317ec227936bc3b2fd5954043
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
e8724c82ab1479f13c85a2c6219841e1fd95f2d2 20-Apr-2012 Adam Cohen <adamcohen@google.com> Adding callback for widget size changed, and potentially other extra info

Change-Id: I57738c92b6a0ba68ae66b19a533559470c64e6f1
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
3aef8e1d1b2f0b87d470bcccf37ba4ebb6560c45 20-Dec-2011 Joe Fernandez <joefernandez@google.com> docs: Add developer guide cross-references, Project ACRE, round 4

Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
eda4be30a2a3a63093faf052be5d804bf633e6f5 10-Jul-2009 Jeff Sharkey <jsharkey@android.com> Correctly deliver AppWidgetProvider.onDeleted() events.

When the AppWidgetService sends APPWIDGET_DELETED
broadcasts, it only sends a single APPWIDGET_ID extra. This
change fixes the Provider to handle this extra correctly.

Fixes http://b/issue?id=1800738
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
60b88edea7132ddce90f2dced07c6706f1502270 14-May-2009 Ken Shirriff <kens@google.com> Fix typos.
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
8a4c53a7c7911b8f4c73a8fcfbbad3ac903b3367 24-Apr-2009 Scott Main <> AI 147732: fix broken links
BUG=1810005

Automated import of CL 147732
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java
c39a6e0c51e182338deb8b63d07933b585134929 11-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137873
/frameworks/base/core/java/android/appwidget/AppWidgetProvider.java