Relies on the ordering in SparseIntArray, as it's documented as ordered.
Bug: 187852819
Test: Manual
Change-Id: I3942a7f3826c173d99544ac0b4f81266b4ca3cc1
If new colors are set but do not change, do not re-inflate the App
Widget.
Bug: 187852819
Test: Added logs and added a widget, moved it to see
Change-Id: I672ee7984cab8966f79d839494ac8a7b91679102
This ensures that adapters have their caches filles and other benefits
such as lists maintaining their scroll positions
Bug: 183503469
Test: validated with local app that service is not called on drag for
colors changing and that flicker is removed
Change-Id: I043d1d7a547b012f7a12eb555b35854a9bb7109b
This will allow Quickstep launchers, e.g. NexusLauncher, to
provide a custom interaction handler.
Bug: 169042867
Test: manual testing
Change-Id: Id70cb463e2671e32ea9f52f06487ac63fcf57e0d
UX landed on a format where we have 2 neutral palettes, and 3 accent
palettes. It's the ideal format to play with elevation and hue rotation,
in order to have a more vibrant and less muddy UI.
Fixes: 181986389
Bug: 173553055
Test: atest SystemPalette
Test: atest ThemeOverlayControllerTest
Test: atest ThemeOverlayApplierTest
Test: atest DeviceDefaultThemeTest
Change-Id: I80d3f7d1cc92e97efcb40fe6dc9f09918321d273
Views shouldn't be recycled if the view id is changed as the identity
of the view is then altered.
Second pass: this has been further tested by adding/removing AppWidgets
on a test phone.
Bug: 181985606
Test: atest CtsWidgetTestCases:RemoteViewsTest
Test: atest CtsWidgetTestCases:RemoteViewsRecyclingTest
Test: atest CtsInputMethodTestCases:android.view.inputmethod.cts.InputConnectionBlockingMethodTest
Change-Id: I8924c02f7f0223458f556a07a3dfdc96b4ce612e
This reverts commit 308a272289.
Bug: 183104573
Test: Install from Play Store with the screen off on wembley, and the device doesn't crash when the screen turns back on.
Change-Id: I289fcafc6685c4ede295e8d6916a54da9bac1ad5
Views shouldn't be recycled if the view id is changed as the identity
of the view is then altered.
Bug: 181985606
Test: atest CtsWidgetTestCases:RemoteViewsTest
Test: atest CtsWidgetTestCases:RemoteViewsRecyclingTest
Change-Id: I68415087297312eb2c1985d272be2ac535507c2a
The mViewMode variable is only used if there is no RemoteViews object.
But we still want to update the colors in that case.
Bug: 179783721
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsThemeColorsTest
Change-Id: I078d21422a6300e7aaecb0baa2a49b9e14cae9e9
This follow recommendations from the API council review.
Based on those recommendations: I updated the API and updated the
comments to make the function behavior clearer.
Bug: 181611658
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Test: Local widget to check rendering
Change-Id: Ie9fcedbc7b18b83f6d1220f99240f264e53e3649
The flag value should be 4 and not 3 so that we can use bitwise
operations to determine the existence of a flag.
For example, we want to use the following to determine if a widget is
reconfigurable:
(providerInfo.widgetFeatures & WIDGET_FEATURE_RECONFIGURABLE) != 0
But if the value of WIDGET_FEATURE_CONFIGURATION_OPTIONAL is 3, the
above check would fail.
Test: atest FrameworksServicesTests:AppWidgetServiceImplTest, atest
CtsAppWidgetTestCases
Bug: 177977976
Change-Id: I15d4baae5e17acb9a0b936485a53f9b3359d65ca
Update the framework to:
1 - Allow creating RemoteViews with a mapping from size to layouts
2 - Use the closes sized layout in any given situation
3 - Allow the launher to specify the current size when inflating a
remote views
Bug: 179025145
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Change-Id: Icf98d01bd0cf8b48c47555a1af6acb498b46b1a4
This is needed to replace usage of the adb shell
command 'appwidget grantbind' in some cts tests with
TestAPIs.
Bug: 180328483
Test: N/A
Change-Id: Ie74149c2045e19261c77da2ffa757a803cc61d95
and getting resources for a particular config
This would allow fetching display infos for the activity in a particular
config independent of system config.
Bug: 156154533
Test: Included CTS
Change-Id: Ie245d685fb21444c10a88b4ca86dc7ff08e2b599
Merged-In: Ie245d685fb21444c10a88b4ca86dc7ff08e2b599
If configuration_optional is present, the widget provides a default
configuration. The host may decide not to launch the provided
configuration activity.
Design doc: go/deferrable-widget-config
Test: Successfully built blueline-userdebug. Since this CL only adds
a new value for an existing field, no unit test will be added at this
point. Once we introduce unit tests for widget configurations xml, we
will add related unit tests.
Bug: 177977976
Change-Id: I507cba0b9b8900f9b9616d76c48eb0ed9c50ed72
Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.
This change should have no behavior change; famous last words.
Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I85cd830eb6bfde18fca6e73ee7adfdc385a890de
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.
APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I
Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
RemoteViews is public API used out of scope of widget. The correct place
to call noteAppWidgetTapped is in AppWidgetHostView.
Fix: 153676411
Test: manual test, tap a widget, "adb shell dumpsys usagestats | grep
USER_INTERACTION" to oberserve USER_INTERACTION event sent to UsageStas, "adb shell dumpsys appops | grep appWidgetVisible" to observer appWidgetVisible flag.
Change-Id: Ic473211b91fd952dbb81b09b1e1568d6f69a0dd8
When the app widget on the launcher is tapped on:
1. Update AppOps. AppOps treats the underlying app as foreground so the app can get while-in-use
permission.
2. Report a USER_INTERACTION event to UsageStats so UsageStats can
update mLastTimeUsed and mLastTimeVisible of this package.
Bug: 149043079
Test: manual test, tapped on a widget.
Change-Id: Ic8c91190881cf5dcf89f0f72cfd410b0c2e86bf6
After restore, the app should set OPTION_APPWIDGET_RESTORE_COMPLETED to
true on its widgets followed by calling updateAppWidget to update views.
Bug:63667276
Test: Manual
Change-Id: Idb6fc63b0f894fca9e0470aaf335240fc124e2e9
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
If they were null, then the Parcelable would fail to work.
Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
This avoids packageManager call everytime a widget updates and
on swipe up
Test: Everything compiles
Change-Id: I58e8613b7a8c9d27fb9293e623ccb274edab82d3