180 Commits

Author SHA1 Message Date
Pinyao Ting
9c2cb7e257 Further defer loading widgets until it is absolutely needed.
Current implementation parses the provider info from all manifests in
every app the first time getInstalledProvidersForProfile is called,
which causes unnecessary delay on the call-site if only a single package
was requested.

This CL ensures widgets loading are deferred further down the line,
until it is absolutely needed to be parsed.

Bug: 202356231
Test: manual
Change-Id: I793bd818781ae956cd5bc590a315c669d01e7ca6
2022-03-21 20:11:58 -07:00
Winson
c8936d367e Null check overlayPaths/resourceDirs when applying widget changes
It's possible a previous snapshot change altered the nullability
of these values, but the String[] for both resourcesDirs and
overlayPaths are expected to be nullable anyways, so just null
check them before cloning.

Bug: 216722631

Test: atest com.android.cts.webkit.WebViewHostSideMultipleProfileTest#testSecondProfile

Change-Id: I56aaf6d5aec1ec14bc7986fe58e1cc77cf6b8376
2022-01-28 01:54:30 -08:00
Sunny Goyal
1b6e6c29fb Adding tracking for widget updates during unlock
Bug: 216416777
Test: Verified logs on devices
Change-Id: I92b0cba1aadd8ea7195bd7137ace59c38b0a3421
2022-01-26 08:52:50 +00:00
Jared Duke
018bb2af0c Add final modifier to private static DEBUG constants
Marking final allows the gated debug code (generally logging) to be
stripped from production builds. This saves ~20KB from system server.

Follow-up work will explore presubmit guards for similar DEBUG cases
(including guarding against DEBUG = true).

Bug: 203143243
Test: m
Change-Id: Ic87a8d8bf183ac0b36c790a2f4a4661ae5e1a87f
2021-10-26 17:32:03 +00:00
Ryan Mitchell
8c86f395be Guard against null info when applying widget RROs
Add null checks to  applyResourceOverlaysToWidgetsLocked to protect
against a widget provider component info being null.

Fixes: 196231621
Fixes: 196331791
Test: none
Change-Id: Ia762694523404ac508eb49600306048037f13658
2021-08-13 13:14:33 -07:00
Ryan Mitchell
a57b0e9c4e Revert "Revert "Apply overlay updates to widget provider info""
Bug: 15332156
Bug: 195649929
This reverts commit 471720cccf848d896639322644314e16264f8af8.

Change-Id: Ifa89ae43613add1137ddeca4cb40543a3a01d6a7
2021-08-09 13:15:12 -07:00
Patrick Baumann
471720cccf Revert "Apply overlay updates to widget provider info"
This reverts commit 0bf76b6296e7095ab98ea175452e5697e9afcc66.

Bug: 193866093
Fixes: 195267626
Reason for revert: b/195267626

Change-Id: I598a99f761e66d8bedbb0745d488ccc35fff9201
2021-08-04 20:05:36 +00:00
Ryan Mitchell
0bf76b6296 Apply overlay updates to widget provider info
When Runtime Resource Overlays (RROs) are applied to an application,
the ApplicationInfo of the app in package manager is updated to have
overlay paths. Widgets create the context used to inflate their
remote views using a snapshot of the ApplicationInfo of the widget
provider. This snapshot is taken when the widget RemoteView is
initially created and sent to system server.

This change updates the snapshot of the widget provider ApplicationInfo
with the new overlay paths and notifies apps hosting widgets to
re-inflate their remote views in order to have RROs apply to widgets
correctly.

Bug: 193866093
Test: Repeatedly change wallpaper & style color to a "basic" color
      and go back to launcher to observe overlay correct color is
      applied
Change-Id: I0b9b8c0d32d83a52e9ea5bc8ba1635cf99e4b921
2021-07-29 16:02:54 +00:00
Bryan
f66eab85a0 Changes to how we notify widget restore participants of new ids
As part of widget restore, we need to notify participants (hosts &
providers) of the mapping between ancestral and new widget ids.
Prior to this change, this was done at the end of system restore
and after each restore-at-install of unbundled apps.

There were two issues with this:
1) We would try to notify not-yet-installed participants at the end of
system restore and then *not* try again when they were installed.
2) We relied on PACKAGE_ADDED broadcasts to know which participants were
installed, but these are delivered asynchronously and not guaranteed
to be processed before the restoreFinished call.

After this change, we:
1) Only notify participants that are actually installed
2) Use receipt of the PACKAGE_ADDED / CHANGED broadcast to trigger
notification of any restore participants that are added or changed
*after* system restore completes.

2 is safe because by the time PackageManager sends the package
added / changed broadcasts, the app data restore has been completed,
and the app has been killed if needed.

Bug: 162057170
Test: Manual restore of Keep widget via cloud and d2d
Change-Id: I51dec33d09b62faba6d7c7daacd718a3c0682f7d
2021-06-23 09:24:09 +00:00
Stevie Kideckel
85be035336 Include widget providers enabled at runtime
The call to queryIntentReceivers only contains receivers that are
enabled. It does not return disabled receivers, whether disabled by
default and unmodified or disabled at runtime.

Therefore, the isEnabled check only has the effect of filtering out enabled widgets that were initially disabled in the manifest.

I have verified this locally with all 8 permutations of manifest-runtime
component enabled states.

Fix: 189087746
Test: locally, AppWidgetServiceImplTest
Change-Id: Ibc35005f8af31622134edb174469b39895b88ecc
2021-06-09 16:54:45 +00:00
Steven Ng
f9a46bc2b9 Fix calling identity ID in AppWidgetServiceImpl
Test: cts-tradefed run cts-instant -m CtsAppWidgetTestCases
Fix: 189811675
Change-Id: If584ba9ffdafa2e372a6fee25448b07662ffa681
2021-06-03 11:41:51 +01:00
Pierre Barbier de Reuille
2debc0a849 Correct AppWidget layout when WP is off
When the work profile (WP) is off, the layout of the widget is provided
by the system.

The layout must have a background with android:id/background as view id
and clip its outline, or it will be considered "legacy" and have the
wrong outline when moved.

Bug: 187907544
Test: Add a widget for the WP and turn the WP off.
Change-Id: Ibee31f5f0e510313ae7f8dc78c208c45a4d0e1fd
2021-05-19 09:28:02 +00:00
Pierre Barbier de Reuille
f8960a0b31 Correct setting the RemoteView's provider id.
This seems to interfere with cross profile remote views otherwise. This
will also avoid changing the stored RemoteViews, or not providing an ID
if the RemoteViews is constructed by the host.

Fix: 187837525
Fix: 187867661
Test: atest ManagedProfileCrossProfileTest#testCrossProfileWidgets
Test: Manually with other apps, checking the colors do no flickr
Test: Check that uninstalling an app with a widget doesn't crash anymore
Change-Id: I7caa3f58d9b554e36f54e6b9d3b793c3ae5023ef
2021-05-17 16:57:50 +01:00
Stevie Kideckel
691ff96db6 Save/restore view states when reapplying RemoteViews for color changes
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
2021-05-04 23:18:45 +01:00
Jackal Guo
c5a303f4a8 Apply package visibility to AppWidgetManager#getInstalledProviders
Package visibility should be applied to #getInstalledProviders as
what we did for similar APIs in PackageManager.

Bug: 180104057
Test: atest AppEnumerationTests
Change-Id: I50f471e6f71613e36cc1b137456a3ee0b23f6a38
2021-04-19 16:35:24 +08:00
Steven Ng
65eb127e6f Replace getResourceId default 0 with Resources.ID_NULL
Test: None

Bug: 181601209
Change-Id: I548947cd4f106baab7428f853cc5342668048476
2021-03-01 23:40:44 +00:00
Sunny Goyal
101fc2483f Merge "Stop listening to config changes in AppWidgetService" into sc-dev 2021-02-25 23:21:03 +00:00
Sunny Goyal
a1e184ebec Stop listening to config changes in AppWidgetService
Config chages are required to load the correct label. But
the label had been deprecated few years ago and hosts are
expected to load the label themselves
This avoids another reload just after unlock since the local
list is not prepared initially

Bug: 180867488
Test: Presubmit and CTS already passing
Change-Id: Iff4543bb62d06c81713b47b76330b2147a10386c
2021-02-24 15:18:10 -08:00
Alina Zaidi
bfefff4115 Merge "Adjust AppWidgetProviderInfo#getDescription to return CharSequence." into sc-dev 2021-02-24 20:01:39 +00:00
Bob Badour
8a6a2bce6c [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  apct-tests/perftests/autofill/Android.bp
  apct-tests/perftests/blobstore/Android.bp
  apct-tests/perftests/core/Android.bp
  apct-tests/perftests/core/apps/overlay/Android.bp
  apct-tests/perftests/core/apps/reources_manager/Android.bp
  apct-tests/perftests/core/jni/Android.bp
  apct-tests/perftests/multiuser/Android.bp
  apct-tests/perftests/multiuser/apps/dummyapp/Android.bp
  apct-tests/perftests/packagemanager/Android.bp
  apct-tests/perftests/packagemanager/apps/query-all/Android.bp
  apct-tests/perftests/textclassifier/Android.bp
  apct-tests/perftests/utils/Android.bp
  apct-tests/perftests/windowmanager/Android.bp
  apex/Android.bp
  apex/blobstore/framework/Android.bp
  apex/blobstore/service/Android.bp
  apex/jobscheduler/framework/Android.bp
  apex/jobscheduler/service/Android.bp
  apex/media/Android.bp
  apex/media/aidl/Android.bp
  apex/media/framework/Android.bp
  cmds/am/Android.bp
  cmds/app_process/Android.bp
  cmds/appops/Android.bp
  cmds/appwidget/Android.bp
  cmds/backup/Android.bp
  cmds/bmgr/Android.bp
  cmds/bootanimation/Android.bp
  cmds/bu/Android.bp
  cmds/content/Android.bp
  cmds/dpm/Android.bp
  cmds/hid/Android.bp
  cmds/hid/jni/Android.bp
  cmds/idmap2/Android.bp
  cmds/ime/Android.bp
  cmds/incident/Android.bp
  cmds/incident_helper/Android.bp
  cmds/incidentd/Android.bp
  cmds/input/Android.bp
  cmds/interrupter/Android.bp
  cmds/locksettings/Android.bp
  cmds/pm/Android.bp
  cmds/requestsync/Android.bp
  cmds/screencap/Android.bp
  cmds/sm/Android.bp
  cmds/svc/Android.bp
  cmds/telecom/Android.bp
  cmds/uiautomator/Android.bp
  cmds/uiautomator/cmds/uiautomator/Android.bp
  cmds/uiautomator/instrumentation/Android.bp
  cmds/uiautomator/library/Android.bp
  cmds/vr/Android.bp
  cmds/wm/Android.bp
  config/Android.bp
  core/java/android/service/wallpaper/Android.bp
  core/jni/Android.bp
  core/sysprop/Android.bp
  core/tests/BroadcastRadioTests/Android.bp
  core/tests/ConnectivityManagerTest/Android.bp
  core/tests/PackageInstallerSessions/Android.bp
  core/tests/PlatformCompatFramework/Android.bp
  core/tests/bandwidthtests/Android.bp
  core/tests/benchmarks/Android.bp
  core/tests/bluetoothtests/Android.bp
  core/tests/bugreports/Android.bp
  core/tests/coretests/Android.bp
  core/tests/coretests/BinderDeathRecipientHelperApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestService/Android.bp
  core/tests/coretests/BstatsTestApp/Android.bp
  core/tests/coretests/DisabledTestApp/Android.bp
  core/tests/coretests/EnabledTestApp/Android.bp
  core/tests/coretests/aidl/Android.bp
  core/tests/coretests/apks/Android.bp
  core/tests/coretests/apks/install/Android.bp
  core/tests/coretests/apks/install_bad_dex/Android.bp
  core/tests/coretests/apks/install_complete_package_info/Android.bp
  core/tests/coretests/apks/install_decl_perm/Android.bp
  core/tests/coretests/apks/install_jni_lib/Android.bp
  core/tests/coretests/apks/install_jni_lib_open_from_apk/Android.bp
  core/tests/coretests/apks/install_loc_auto/Android.bp
  core/tests/coretests/apks/install_loc_internal/Android.bp
  core/tests/coretests/apks/install_loc_sdcard/Android.bp
  core/tests/coretests/apks/install_loc_unspecified/Android.bp
  core/tests/coretests/apks/install_use_perm_good/Android.bp
  core/tests/coretests/apks/install_uses_feature/Android.bp
  core/tests/coretests/apks/install_verifier_bad/Android.bp
  core/tests/coretests/apks/install_verifier_good/Android.bp
  core/tests/coretests/apks/keyset/Android.bp
  core/tests/coretests/apks/locales/Android.bp
  core/tests/coretests/apks/overlay_config/Android.bp
  core/tests/coretests/apks/version/Android.bp
  core/tests/coretests/apks/version_nosys/Android.bp
  core/tests/featureflagtests/Android.bp
  core/tests/hdmitests/Android.bp
  core/tests/hosttests/test-apps/AutoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalLocAllPermsTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocPermsFLTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPerms/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.bp
  core/tests/hosttests/test-apps/InternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/Android.bp
  core/tests/hosttests/test-apps/NoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/java_only/Android.bp
  core/tests/hosttests/test-apps/SimpleTestApp/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v2_int/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v2_none/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Auto/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_External/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Internal/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_None/Android.bp
  core/tests/mockingcoretests/Android.bp
  core/tests/notificationtests/Android.bp
  core/tests/overlaytests/device/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayOne/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayTwo/Android.bp
  core/tests/overlaytests/device/test-apps/FrameworkOverlay/Android.bp
  core/tests/overlaytests/host/Android.bp
  core/tests/overlaytests/remount/Android.bp
  core/tests/overlaytests/remount/test-apps/Overlay/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibrary/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibraryOverlay/Android.bp
  core/tests/overlaytests/remount/test-apps/Target/Android.bp
  core/tests/packagemanagertests/Android.bp
  core/tests/privacytests/Android.bp
  core/tests/screenshothelpertests/Android.bp
  core/tests/systemproperties/Android.bp
  core/tests/utillib/Android.bp
  core/tests/utiltests/Android.bp
  core/tests/utiltests/jni/Android.bp
  core/tests/uwbtests/Android.bp
  core/xsd/Android.bp
  core/xsd/vts/Android.bp
  data/etc/Android.bp
  data/etc/car/Android.bp
  data/fonts/Android.bp
  data/keyboards/Android.mk
  drm/jni/Android.bp
  errorprone/Android.bp
  graphics/proto/Android.bp
  keystore/Android.bp
  keystore/tests/Android.bp
  libs/WindowManager/Jetpack/Android.bp
  libs/WindowManager/Shell/Android.bp
  libs/WindowManager/Shell/tests/Android.bp
  libs/androidfw/Android.bp
  libs/androidfw/fuzz/resourcefile_fuzzer/Android.bp
  libs/hostgraphics/Android.bp
  libs/incident/Android.bp
  libs/input/Android.bp
  libs/input/tests/Android.bp
  libs/protoutil/Android.bp
  libs/services/Android.bp
  libs/storage/Android.bp
  libs/usb/tests/AccessoryChat/Android.bp
  libs/usb/tests/AccessoryChat/accessorychat/Android.bp
  location/lib/Android.bp
  location/tests/Android.bp
  location/tests/locationtests/Android.bp
  lowpan/tests/Android.bp
  media/Android.bp
  media/java/Android.bp
  media/java/android/media/tv/tunerresourcemanager/Android.bp
  media/jni/Android.bp
  media/jni/audioeffect/Android.bp
  media/jni/soundpool/Android.bp
  media/jni/soundpool/tests/Android.bp
  media/lib/remotedisplay/Android.bp
  media/lib/signer/Android.bp
  media/lib/tvremote/Android.bp
  media/lib/tvremote/tests/Android.bp
  media/mca/filterfw/Android.bp
  media/mca/filterfw/native/Android.bp
  media/mca/filterpacks/Android.bp
  media/mca/samples/CameraEffectsRecordingSample/Android.bp
  media/mca/tests/Android.bp
  media/native/midi/Android.bp
  media/packages/BluetoothMidiService/Android.bp
  media/packages/BluetoothMidiService/tests/unit/Android.bp
  media/tests/AudioPolicyTest/Android.bp
  media/tests/CameraBrowser/Android.bp
  media/tests/EffectsTest/Android.bp
  media/tests/MediaDump/Android.bp
  media/tests/MediaFrameworkTest/Android.bp
  media/tests/MediaRouter/Android.bp
  media/tests/MtpTests/Android.bp
  media/tests/ScoAudioTest/Android.bp
  media/tests/SoundPoolTest/Android.bp
  media/tests/TunerTest/Android.bp
  media/tests/audiotests/Android.bp
  media/tests/players/Android.bp
  mime/Android.bp
  native/android/Android.bp
  native/graphics/jni/Android.bp
  native/webview/loader/Android.bp
  nfc-extras/Android.bp
  nfc-extras/tests/Android.bp
  packages/AppPredictionLib/Android.bp
  packages/BackupEncryption/Android.bp
  packages/BackupEncryption/test/robolectric-integration/Android.bp
  packages/BackupEncryption/test/robolectric/Android.bp
  packages/BackupEncryption/test/unittest/Android.bp
  packages/BackupRestoreConfirmation/Android.bp
  packages/CarSystemUI/Android.bp
  packages/CarrierDefaultApp/Android.bp
  packages/CarrierDefaultApp/tests/unit/Android.bp
  packages/CompanionDeviceManager/Android.bp
  packages/Connectivity/framework/Android.bp
  packages/Connectivity/service/Android.bp
  packages/CtsShim/Android.bp
  packages/CtsShim/build/Android.bp
  packages/CtsShim/build/jni/Android.bp
  packages/DynamicSystemInstallationService/Android.bp
  packages/DynamicSystemInstallationService/tests/Android.bp
  packages/EasterEgg/Android.bp
  packages/EncryptedLocalTransport/Android.bp
  packages/ExtShared/Android.bp
  packages/ExternalStorageProvider/Android.bp
  packages/ExternalStorageProvider/tests/Android.bp
  packages/FakeOemFeatures/Android.bp
  packages/FusedLocation/Android.bp
  packages/InputDevices/Android.bp
  packages/LocalTransport/Android.bp
  packages/PackageInstaller/Android.bp
  packages/PrintRecommendationService/Android.bp
  packages/PrintSpooler/Android.bp
  packages/PrintSpooler/jni/Android.bp
  packages/PrintSpooler/tests/outofprocess/Android.bp
  packages/SettingsLib/ActionBarShadow/Android.bp
  packages/SettingsLib/ActionButtonsPreference/Android.bp
  packages/SettingsLib/AdaptiveIcon/Android.bp
  packages/SettingsLib/Android.bp
  packages/SettingsLib/AppPreference/Android.bp
  packages/SettingsLib/BarChartPreference/Android.bp
  packages/SettingsLib/DisplayDensityUtils/Android.bp
  packages/SettingsLib/EntityHeaderWidgets/Android.bp
  packages/SettingsLib/HelpUtils/Android.bp
  packages/SettingsLib/LayoutPreference/Android.bp
  packages/SettingsLib/ProgressBar/Android.bp
  packages/SettingsLib/RadioButtonPreference/Android.bp
  packages/SettingsLib/RestrictedLockUtils/Android.bp
  packages/SettingsLib/SchedulesProvider/Android.bp
  packages/SettingsLib/SearchProvider/Android.bp
  packages/SettingsLib/SearchWidget/Android.bp
  packages/SettingsLib/SettingsSpinner/Android.bp
  packages/SettingsLib/SettingsTheme/Android.bp
  packages/SettingsLib/Tile/Android.bp
  packages/SettingsLib/Utils/Android.bp
  packages/SettingsLib/search/Android.bp
  packages/SettingsLib/tests/integ/Android.bp
  packages/SettingsLib/tests/robotests/Android.bp
  packages/SettingsProvider/Android.bp
  packages/SharedStorageBackup/Android.bp
  packages/Shell/Android.bp
  packages/Shell/tests/Android.bp
  packages/SimAppDialog/Android.bp
  packages/SoundPicker/Android.bp
  packages/StatementService/Android.bp
  packages/SystemUI/Android.bp
  packages/SystemUI/plugin/Android.bp
  packages/SystemUI/plugin/ExamplePlugin/Android.bp
  packages/SystemUI/plugin_core/Android.bp
  packages/SystemUI/shared/Android.bp
  packages/VpnDialogs/Android.bp
  packages/WAPPushManager/Android.bp
  packages/WAPPushManager/tests/Android.bp
  packages/WallpaperBackup/Android.bp
  packages/WallpaperCropper/Android.bp
  packages/overlays/Android.mk
  packages/overlays/tests/Android.bp
  packages/services/PacProcessor/Android.bp
  packages/services/PacProcessor/jni/Android.bp
  packages/services/Proxy/Android.bp
  proto/Android.bp
  rs/jni/Android.mk
  samples/demo/haptic-assessment/Android.bp
  sax/tests/saxtests/Android.bp
  services/Android.bp
  services/accessibility/Android.bp
  services/appprediction/Android.bp
  services/appwidget/Android.bp
  services/autofill/Android.bp
  services/backup/Android.bp
  services/backup/backuplib/Android.bp
  services/companion/Android.bp
  services/contentcapture/Android.bp
  services/contentsuggestions/Android.bp
  services/core/Android.bp
  services/core/java/com/android/server/vcn/Android.bp
  services/core/jni/Android.bp
  services/core/xsd/Android.bp
  services/core/xsd/vts/Android.bp
  services/coverage/Android.bp
  services/devicepolicy/Android.bp
  services/incremental/Android.bp
  services/midi/Android.bp
  services/net/Android.bp
  services/people/Android.bp
  services/print/Android.bp
  services/profcollect/Android.bp
  services/restrictions/Android.bp
  services/robotests/Android.bp
  services/robotests/backup/Android.bp
  services/systemcaptions/Android.bp
  services/tests/PackageManagerComponentOverrideTests/Android.bp
  services/tests/PackageManagerServiceTests/host/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/Android.bp
  services/tests/mockingservicestests/Android.bp
  services/tests/rescueparty/Android.bp
  services/tests/servicestests/Android.bp
  services/tests/servicestests/aidl/Android.bp
  services/tests/servicestests/apks/Android.bp
  services/tests/servicestests/apks/install-split-base/Android.bp
  services/tests/servicestests/apks/install-split-feature-a/Android.bp
  services/tests/servicestests/apks/install_intent_filters/Android.bp
  services/tests/servicestests/apks/install_uses_sdk/Android.bp
  services/tests/servicestests/test-apps/ConnTestApp/Android.bp
  services/tests/servicestests/test-apps/JobTestApp/Android.bp
  services/tests/servicestests/test-apps/PackageParserApp/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  services/tests/servicestests/test-apps/SimpleServiceTestApp/Android.bp
  services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
  services/tests/shortcutmanagerutils/Android.bp
  services/tests/uiservicestests/Android.bp
  services/tests/wmtests/Android.bp
  services/usage/Android.bp
  services/usb/Android.bp
  services/voiceinteraction/Android.bp
  services/wifi/Android.bp
  startop/apps/test/Android.bp
  startop/iorap/Android.bp
  startop/iorap/functional_tests/Android.bp
  startop/iorap/stress/Android.bp
  startop/iorap/tests/Android.bp
  startop/view_compiler/Android.bp
  startop/view_compiler/dex_builder_test/Android.bp
  test-base/hiddenapi/Android.bp
  test-mock/Android.bp
  test-runner/tests/Android.bp
  tests/AccessibilityEventsLogger/Android.bp
  tests/AccessoryDisplay/common/Android.bp
  tests/AccessoryDisplay/sink/Android.bp
  tests/AccessoryDisplay/source/Android.bp
  tests/ActivityManagerPerfTests/stub-app/Android.bp
  tests/ActivityManagerPerfTests/test-app/Android.bp
  tests/ActivityManagerPerfTests/tests/Android.bp
  tests/ActivityManagerPerfTests/utils/Android.bp
  tests/ActivityTests/Android.bp
  tests/ActivityViewTest/Android.bp
  tests/AmSlam/Android.bp
  tests/ApkVerityTest/Android.bp
  tests/ApkVerityTest/ApkVerityTestApp/Android.bp
  tests/ApkVerityTest/block_device_writer/Android.bp
  tests/AppLaunch/Android.bp
  tests/AppLaunchWear/Android.bp
  tests/AppResourcesLoaders/Android.bp
  tests/AppResourcesLoaders/Overlay/Android.bp
  tests/Assist/Android.bp
  tests/AutoVerify/app1/Android.bp
  tests/AutoVerify/app2/Android.bp
  tests/AutoVerify/app3/Android.bp
  tests/AutoVerify/app4/Android.bp
  tests/BackgroundDexOptServiceIntegrationTests/Android.bp
  tests/BandwidthTests/Android.bp
  tests/BatteryWaster/Android.bp
  tests/BiDiTests/Android.bp
  tests/BlobStoreTestUtils/Android.bp
  tests/BootImageProfileTest/Android.bp
  tests/BrowserPowerTest/Android.bp
  tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.bp
  tests/CameraPrewarmTest/Android.bp
  tests/Codegen/Android.bp
  tests/Compatibility/Android.bp
  tests/CoreTests/android/Android.bp
  tests/DataIdleTest/Android.bp
  tests/DozeTest/Android.bp
  tests/DpiTest/Android.bp
  tests/DynamicCodeLoggerIntegrationTests/Android.mk
  tests/FeatureSplit/base/Android.bp
  tests/FeatureSplit/feature1/Android.bp
  tests/FeatureSplit/feature2/Android.bp
  tests/FixVibrateSetting/Android.bp
  tests/FlickerTests/Android.bp
  tests/FlickerTests/test-apps/Android.bp
  tests/FlickerTests/test-apps/flickerapp/Android.bp
  tests/FrameworkPerf/Android.bp
  tests/GamePerformance/Android.bp
  tests/GridLayoutTest/Android.bp
  tests/HierarchyViewerTest/Android.bp
  tests/HugeBackup/Android.bp
  tests/HwAccelerationTest/Android.bp
  tests/Internal/Android.bp
  tests/JankBench/Android.bp
  tests/JobSchedulerPerfTests/Android.bp
  tests/JobSchedulerTestApp/Android.bp
  tests/LargeAssetTest/Android.bp
  tests/LegacyAssistant/Android.bp
  tests/LocalizationTest/Android.bp
  tests/LocationTracker/Android.bp
  tests/LotsOfApps/Android.bp
  tests/LowStorageTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/app/DummyDPC/Android.bp
  tests/MemoryUsage/Android.bp
  tests/MirrorSurfaceTest/Android.bp
  tests/NativeProcessesMemoryTest/Android.bp
  tests/NetworkSecurityConfigTest/Android.bp
  tests/NullHomeTest/Android.bp
  tests/OdmApps/Android.bp
  tests/OdmApps/app/Android.bp
  tests/OdmApps/priv-app/Android.bp
  tests/OneMedia/Android.bp
  tests/PackageWatchdog/Android.bp
  tests/PlatformCompatGating/Android.bp
  tests/PlatformCompatGating/test-rules/Android.bp
  tests/ProtoInputStreamTests/Android.bp
  tests/RemoteDisplayProvider/Android.bp
  tests/RenderThreadTest/Android.bp
  tests/RollbackTest/Android.bp
  tests/SerialChat/Android.bp
  tests/ServiceCrashTest/Android.bp
  tests/SharedLibrary/client/Android.bp
  tests/SharedLibrary/lib/Android.bp
  tests/ShowWhenLockedApp/Android.bp
  tests/SmokeTest/Android.bp
  tests/SmokeTest/tests/Android.bp
  tests/SmokeTestApps/Android.bp
  tests/SoundTriggerTestApp/Android.bp
  tests/Split/Android.bp
  tests/StagedInstallTest/Android.bp
  tests/StatusBar/Android.bp
  tests/SurfaceComposition/Android.bp
  tests/SurfaceControlViewHostTest/Android.bp
  tests/SystemMemoryTest/device/Android.bp
  tests/SystemMemoryTest/host/Android.bp
  tests/SystemUIDemoModeController/Android.bp
  tests/TaskOrganizerTest/Android.bp
  tests/TelephonyCommonTests/Android.bp
  tests/TouchLatency/Android.bp
  tests/TransformTest/Android.bp
  tests/TtsTests/Android.bp
  tests/UiBench/Android.bp
  tests/UsageReportingTest/Android.bp
  tests/UsageStatsPerfTests/Android.bp
  tests/UsageStatsTest/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestDevice/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestHost/Android.bp
  tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/Android.bp
  tests/UsbManagerTests/Android.bp
  tests/UsbManagerTests/lib/Android.bp
  tests/UsbTests/Android.bp
  tests/UsesFeature2Test/Android.bp
  tests/VectorDrawableTest/Android.bp
  tests/VoiceEnrollment/Android.bp
  tests/VoiceInteraction/Android.bp
  tests/WallpaperTest/Android.bp
  tests/WindowAnimationJank/Android.bp
  tests/WindowInsetsTests/Android.bp
  tests/appwidgets/AppWidgetHostTest/Android.bp
  tests/appwidgets/AppWidgetProviderTest/Android.bp
  tests/backup/Android.mk
  tests/benchmarks/Android.bp
  tests/libs-permissions/Android.bp
  tests/net/Android.bp
  tests/net/common/Android.bp
  tests/net/deflake/Android.bp
  tests/net/integration/Android.bp
  tests/net/jni/Android.bp
  tests/net/smoketest/Android.bp
  tests/notification/Android.bp
  tests/permission/Android.bp
  tests/privapp-permissions/Android.bp
  tests/testables/Android.bp
  tests/testables/tests/Android.bp
  tests/utils/StubIME/Android.bp
  tests/utils/hostutils/Android.bp
  tests/utils/testutils/Android.bp
  tests/vcn/Android.bp
  tools/aapt/Android.bp
  tools/aapt2/Android.bp
  tools/aapt2/integration-tests/AutoVersionTest/Android.bp
  tools/aapt2/integration-tests/BasicTest/Android.bp
  tools/aapt2/integration-tests/MergeOnlyTest/LeafLib/Android.mk
  tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk
  tools/aapt2/integration-tests/StaticLibTest/App/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibOne/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibTwo/Android.bp
  tools/aapt2/integration-tests/SymlinkTest/Android.bp
  tools/bit/Android.bp
  tools/codegen/Android.bp
  tools/dump-coverage/Android.bp
  tools/incident_report/Android.bp
  tools/incident_section_gen/Android.bp
  tools/lock_agent/Android.bp
  tools/locked_region_code_injection/Android.bp
  tools/obbtool/Android.bp
  tools/powermodel/Android.bp
  tools/preload-check/Android.bp
  tools/preload-check/device/Android.bp
  tools/preload/loadclass/Android.bp
  tools/processors/staledataclass/Android.bp
  tools/processors/view_inspector/Android.bp
  tools/protologtool/Android.bp
  tools/sdkparcelables/Android.bp
  tools/split-select/Android.bp
  tools/streaming_proto/Android.bp
  tools/validatekeymaps/Android.bp
  wifi/java/Android.bp
  wifi/tests/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  libs/hwui/Android.bp
  native/webview/plat_support/Android.bp
  obex/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    legacy_unencumbered
to:
  core/java/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  test-base/Android.bp
  test-runner/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL
to:
  core/res/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0
to:
  libs/usb/Android.bp
  libs/usb/tests/accessorytest/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  tools/preload/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS
to:
  api/Android.bp
  boot/Android.bp
  cmds/device_config/Android.bp
  cmds/settings/Android.bp
  core/api/Android.bp
  core/tests/coretests/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/overlaid_apex/Android.bp
  core/tests/overlaytests/remount/test-apps/overlay_apex/Android.bp
  libs/tracingproxy/Android.bp
  services/startop/Android.bp
  test-legacy/Android.mk
  tests/ApkVerityTest/testdata/Android.bp
  tests/TransitionTests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Ib9737d8fb5ef5b90a2c14fe71f1a571079edcf02
Merged-In: Ib9737d8fb5ef5b90a2c14fe71f1a571079edcf02
2021-02-21 20:12:24 +00:00
Alina Zaidi
1c9092d127 Adjust AppWidgetProviderInfo#getDescription to return CharSequence.
Also add more developer docs.

Test: atest AppWidgetServiceImplTest#testLoadDescription passed
Bug: b/180015383
Change-Id: Ie6fff9d880ba4721bf6babcd51acaa8fc9bd3cd9
2021-02-19 15:14:41 +00:00
TreeHugger Robot
b9806031ae Add new attributes for widget sizing controls.
Design doc: go/widget-sizing-api-dd

New attributes added:
* maxResizeWidth
* maxResizeHeight
* targetCellWidth
* targetCellHeight

Bug: 179807199
Test: atest FrameworksServicesTests:AppWidgetServiceImplTest
Change-Id: Icadc73da9bd010e42459735493f452cb892e5744
2021-02-17 10:55:01 +00:00
Steven Ng
cd5c9b0642 Add a layout attribute in widget metadata for widget preview
Test: atest FrameworksServicesTests:AppWidgetServiceImplTest. Newly
added test passed.

Bug: 179063291
Change-Id: I17cf97b580ac03d9688d82eeccd3a68e77287655
2021-02-08 14:09:06 +00:00
Sunny Goyal
4671a2d556 Simplifying disabled widget view genration
Removing creating and holding icon bitmaps in systemServer and
directly loading resources in the Host process

Bug: 178616010
Test: Verified View on device
Change-Id: I4abf616985d68ac48f55856bb90fa598a4cebe1c
2021-02-03 22:53:12 +00:00
TreeHugger Robot
f4e7856ce9 Merge "Lazily loading the widget providers to avoid loading app-resources on userUnlock" 2021-01-26 20:19:53 +00:00
Alina Zaidi
016e50a980 Include an attribute for description of the widget in the attributes file for AppWidgetProviderInfo.
Test: Instrumentation test added- AppWidgetServiceImplTest_testLoadDescription

Bug: 178460757

Change-Id: Ic9b9cd8c592936bbe421183f8715ba5d8f770742
2021-01-26 17:04:00 +00:00
Sunny Goyal
9912a46371 Lazily loading the widget providers to avoid loading app-resources on userUnlock
Bug: 177931115
Test: atest FrameworksServicesTests
Change-Id: I879b2b83b2d249b7175ab364a78a92bd3ec12f31
2021-01-25 11:45:49 -08:00
Jeff Sharkey
1ae7f40466 Merge "Update AppWidget owners" am: 8c9bf65b8b am: ea29396752 am: 0cfbc863f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556378

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I051e300cf34545ce632f64ef1dc7711f97c84599
2021-01-21 23:25:37 +00:00
Sunny Goyal
ce8c2017c1 Update AppWidget owners
Change-Id: I89d2fa5339a37c64e76698ed1aa3825d27f88097
Test: manual
2021-01-21 21:56:08 +00:00
Tim Murray
50ddd5856b AppWidgetServiceImpl: add mWidgetPackages lock
JobScheduler calls isBoundWidgetPackage(), but this can be extremely
slow while AppWidgetService is doing any meaningful work, causing
problems for the rest of the system. Remove that serialization by
moving mWidgetPackages behind its own lock.

Test: atest CtsAppWidgetTestCases
Bug: 161866124

Change-Id: Idae7d16d375dfd41f802ad193fa1ec939093c67a
2021-01-12 19:39:10 -08:00
Jeff Sharkey
a2c132d9c6 Hand-migration to TypedXml interface.
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
2020-12-02 13:55:35 -07:00
Jeff Sharkey
8f43151721 Mechanically apply TypedXml refaster template.
This is a purely mechanical CL that applies the output of the
recently added refaster templates to help guide towards more
efficient TypedXml methods.  There is no behavior change.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ic95dd3de77c60482ad36b31706e6b701929f40b3
2020-11-30 20:45:40 -07:00
Jeff Sharkey
236c03b5c3 Mechanical refactoring to new typed XML classes.
Related changes are introducing new TypedXmlSerializer and
TypedXmlPullParser interfaces which offer efficient access to
primitive attributes.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibd93f353ff3cb1f0b7073ebbeae17fe5194b046b
2020-11-30 20:45:25 -07:00
Jeff Sharkey
8099e30b73 Mechanical refactoring to new XML resolvers.
Related changes are introducing new TypedXmlSerializer and
TypedXmlPullParser interfaces which offer efficient access to
primitive attributes.

This change is a purely mechanical refactoring to prepare for
upcoming data format shifts, and has no behavior changes.

Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial no-op refactoring
Change-Id: Ib8045ddba489c254641d6331b64355709c3f6dd7
2020-11-13 14:48:32 -07:00
Jeff Sharkey
d23b5379c0 Enable Error Prone to detect obscure bugs.
We've been writing many new framework-specific Error Prone checkers
to help detect obscure platform bugs, and this change starts enabling
those checkers for more packages across the platform.

Bug: 155703208
Test: manual
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: I1db3412b0be40f6f78c68331ae01756887192071
2020-10-23 16:55:30 -06:00
Jeff Sharkey
864524af17 Apply FLAG_IMMUTABLE to various PendingIntents.
Some careful spot-checking has revealed common cases where it's
reasonable to blanket apply the new FLAG_IMMUTABLE option to newly
created PendingIntents.  Specifically these situations:

-- Simple notification content clicks are immutable; there's no need
to communicate customized data back to the creator
-- Simple notification action clicks are immutable; there's no need
to communicate customized data back to the creator
-- Broadcast intents sent by AlarmManager are immutable; the system
dispatches them without customization.

Bug: 170165227, 170424283, 170425388, 170425877
Bug: 169791183, 170771965, 170226088, 170224928, 170767530
Test: none
Change-Id: I5ed68710d2ccad4635a30fd91136a9e6ad76a01d
2020-10-20 16:20:54 -06:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
Adam Bookatz
82194b8fe0 Use hasBadge instead of isManagedProfile
To determine whether a user has a badge, the
correct call is now hasBadge, rather than isManagedProfile.

Currently, the only user that actually can have a badge
is a managed profile, so this change is a no-op. In the future,
if further profile support is expanded, then hasBadge will
be correct.

Bug: 170249807
Test: Treehugger (this cl is a no-op)
Change-Id: I9144c4dc519936dfc5a2aeae0eb0bd91bea89db2
2020-10-06 15:04:16 -07:00
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
4172f8a62c Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: If75259aab72329f9f8b0e1972a96370ca5134e2c
2020-09-14 10:00:10 -06:00
Felipe Leme
837f8c1e8a Removed @Deprecated SystemService callback methods that take a userId.
This is just a plain refactoring: the removed methods in the changed
classes were called by default by the new methods in the superclass
(SystemService).

Test: m
Test: atest NotificationManagerServiceTest BackupManagerServiceRoboTest

Fixes: 161943081

Exempt-From-Owner-Approval: refactoring without side-effects

Change-Id: Ifd8df592eb4494cc0922b7e0b2ff20187b8a8b3e
2020-08-03 07:24:26 +00:00
Samuel Fufa
f5de7b097e Merge "Resolve NPE on widget.provider.id" into rvc-dev 2020-05-13 01:43:56 +00:00
Samuel Fufa
bc28ebb78c Resolve NPE on widget.provider.id
Test: existing tests should pass
Bug: 156120679
Change-Id: I88108ef6825d72561453d57253cd6d5a14951364
2020-05-12 15:37:22 -07:00
Jeff Sharkey
4d1d7b56cd Add custom Error Prone check for SDK comparisons.
Over the years we've had several obscure bugs related to how SDK level
comparisons are performed, specifically during the window of time
where we've started distributing the "frankenbuild" to developers.

Consider the case where a framework developer shipping release "R"
wants to only grant a specific behavior to modern apps; they could
write this in two different ways:

1. if (targetSdkVersion > Build.VERSION_CODES.Q) {
2. if (targetSdkVersion >= Build.VERSION_CODES.R) {

The safer of these two options is (2), which will ensure that
developers only get the behavior when *both* the app and the
platform concur on the specific SDK level having shipped.

Consider the breakage that would happen with option (1) if we
started shipping APKs that are based on the final R SDK, but are
then installed on earlier preview releases which still consider R
to be CUR_DEVELOPMENT; they'd risk crashing due to behaviors that
were never part of the official R SDK.

Bug: 64412239
Test: ./build/soong/soong_ui.bash --make-mode services RUN_ERROR_PRONE=true
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: Ia20181f8602451ac9a719ea488d148e160708592
2020-05-04 23:09:48 +00:00
Hui Yu
4803268229 Move noteAppWidgetTapped call into AppWidgetHostView.
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
2020-04-15 22:06:12 -07:00
Hui Yu
2001fbafec getDefaultHomeActivity() could return null ComponentName.
Bug: 153400018
Test: Manual test
Change-Id: I29d5a8f00563bdf88ab1f7a00d39d6a39a0ed44d
2020-04-09 16:48:53 -07:00
Hui Yu
3dc45fbc57 Update AppOps & UsageStats when app widget tapped.
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
2020-03-21 08:36:54 -07:00
Hui Yu
00a776682c Only check on launcher proc state when param visible is true.
When launcher moves away from TOP, param visible is false, should skip
the proc state check and move ahead to update AppOps.

Bug: 151835293
Test: Manual test, open another app and move launcher away from top
screen, observe AppOps is updated.

Change-Id: I4b1562994d205d7e5b0327b95cf59e08b91ae048
2020-03-18 15:28:44 -07:00
Suprabh Shukla
a5a576d905 Merge "Resolving a TODO in AppWidgetService" into rvc-dev 2020-02-26 07:25:36 +00:00