Skip to content
Snippets Groups Projects
  1. Mar 25, 2024
    • mmanjuna's avatar
      Response stats:counts are not updated sometimes · 04277955
      mmanjuna authored
      This problem occurs only when the timestamp of broadcast and the
      notification event is exactly the same.
      Though ideally they need to occur one after the other,
      it is quite possible that they can occur immediately with the same
      timestamp. Hence, we see flaky behaviour.
      Fix is to process the events even if broadcast event's
      timestamp is equal to the notification event.
      
      Bug: 330844354
      
      Test: atest tests/tests/app.usage/src/android/app/usage/cts/BroadcastResponse
      StatsTest.java
      Change-Id: I69398c1d15ed7a4ae39c31a2b56f19ef0b858614
      04277955
  2. Jan 09, 2024
  3. Dec 27, 2023
  4. Dec 12, 2023
  5. Dec 07, 2023
  6. Nov 28, 2023
    • Xin Guan's avatar
      Introduce user interaction usage events reporting · 751214da
      Xin Guan authored
      Introduce a new dimension to the user interaction event
      by offering additional user interaction details.
      
      Bug: 296061232
      Test: atest
      CtsUsageStatsTestCases:android.app.usage.cts.UsageStatsTest
            atest FrameworksCoreTests:android.app.usage.UsageStatsPersistenceTest
            atest
            FrameworksServicesTests:com.android.server.usage.UsageStatsDatabaseTest
      
      Change-Id: I75446f219ae859853b4243d74db50f83b2fba31e
      751214da
  7. Nov 20, 2023
    • Xin Guan's avatar
      Handle parceled usage events more friendly. · 4eee04e8
      Xin Guan authored
      Make sure the whole list has been transferred
      
      Bug: 301254110
      Test: atest CtsUsageStatsTestCases
      Test: atest FrameworksCoreTests:android.app.usage.*
      Change-Id: Ia90f5869c4f5255cc9e9d059b81c40f7e85c23b1
      4eee04e8
  8. Nov 10, 2023
  9. Nov 02, 2023
  10. Oct 20, 2023
    • Xin Guan's avatar
      Modify usagestats event processing thread · 69b56d9e
      Xin Guan authored
      Use a dedicated thread with default priority to handle
      the usage stats event processing.
      
      Bug: 303798680
      Bug: 302675504
      Test: atest CtsUsageStatsTestCases
      Test: atest FrameworksCoreTests:android.app.usage.*
      Change-Id: I0bdd65d5ef1ed61ab5b8fdf4f1a3a257f1b37111
      69b56d9e
  11. Oct 16, 2023
    • Xin Guan's avatar
      Fix the breakage for the new REPORT_USAGE_STATS permission check · e734d06f
      Xin Guan authored
      Fall back to the previous behavior when the new REPORT_USAGE_STATS
      flag is default to ensure no app compact breakage.
      
      Bug: 305648037
      Test: share a picture in photo, make sure no crash.
            atest CtsUsageStatsTest
      Change-Id: I3311ed93bc66cf749092b1add4cf6cba36ecfdd2
      e734d06f
  12. Oct 14, 2023
    • Xin Guan's avatar
      Move user state change handling out of the android.bg · 992bb125
      Xin Guan authored
      The android.bg thread could be busy at other tasks and
      blocked the user state changing intent broadcasting.
      
      Bug: 303798680
      Test: atest CtsUsageStatsTestCases
      Change-Id: I185c76eb2211106b5debbe03fdd67ff82622d85b
      992bb125
  13. Oct 13, 2023
    • Varun Shah's avatar
      Update new permission logic to use flagging. · b47fc471
      Varun Shah authored
      - Add a new flag for the permission.
      - Add FlaggedApi annotation to new permission.
      - Update APIs to check flag enablement.
      
      Bug: 304478692
      Bug: 296056771
      Test: atest UsageStatsTest
      Change-Id: I59b0634d4cbc956ecfb5eb63dd1100515427d62f
      b47fc471
  14. Oct 06, 2023
    • Xin Guan's avatar
      Offload some processing to IoThread · 67b54235
      Xin Guan authored
      Use dedicated IoThread for bg/fg proc status updates and launch
      time prediction.
      Avoid holding the main lock for launch time prediction
      
      Bug: 302675504
      Test: atest CtsUsageStatsTestCases
      Test: atest FrameworksCoreTests:android.app.usage.*
      Change-Id: I88f8d3d160db6404282ea73374e6a2c8d05f05cf
      67b54235
    • Xin Guan's avatar
      Revert "Modify usagestats event processing thread" · 74a3c64b
      Xin Guan authored
      This reverts commit 66c56a0c.
      
      Reason for revert: boot time regression
      
      Bug: 303555768
      Change-Id: Id5b1c8be0575324f929b9d6f3b77606c1167caf1
      74a3c64b
  15. Oct 04, 2023
  16. Oct 03, 2023
    • Xin Guan's avatar
      Fix event validation check for CHOOSER_ACTION usage events · 260f75a9
      Xin Guan authored
      Revert back to the original parameter check for reportChooserSelection
      to ensure no application behavior breakage.
      
      Bug: 301564659
      Test: atest CtsUsageStatsTest
      Change-Id: If7f72724395a14222cf75c1281c078a2a85468a3
      260f75a9
    • Xin Guan's avatar
      Modify usagestats event processing thread · 66c56a0c
      Xin Guan authored
      Use a dedicated thread with default priority to handle
      the usage stats event processing.
      
      Also offload IOs to the dedicated IoThread and post processing
      the launch time estimation.
      
      Bug: 302675504
      Test: atest CtsUsageStatsTestCases
      Test: atest FrameworksCoreTests:android.app.usage.*
      Change-Id: Ib0bb490279c1dcbd71cabfc3a1f7d97c638eb9b6
      66c56a0c
  17. Sep 25, 2023
    • Xin Guan's avatar
      Don't load usage events into memory for usage statistic queries · 4d5a155c
      Xin Guan authored
      Avoid unnecessary IOs and additional memory overhead for usage
      statistica queries.
      
      Also dump the pending usage events for unlocked user(s).
      
      Bug: 301449929
      Test: atest CtsUsageStatsTestCases
            atest FrameworksCoreTests:android.app.usage.UsageStatsPersistenceTest
            atest FrameworksServicesTests:com.android.server.usage.UsageStatsDatabaseTest
      Change-Id: Ia68e78a96dd1f66d19744acfb85b74e890608df7
      4d5a155c
  18. Sep 21, 2023
    • Xin Guan's avatar
      Add trace support to usagestats · 1c60dd44
      Xin Guan authored
      Adding a few tracing point to the code paths related to
      the user unlocking.
      
      Bug: 300285947
      Test: verify it's available in the trace
      Change-Id: I2a1368c4022f174c115f0269ad6c100caa5e5817
      1c60dd44
  19. Sep 13, 2023
  20. Sep 08, 2023
  21. Aug 30, 2023
    • alukin's avatar
      Fix StorageStatsService#getTotalBytes · bdec6441
      alukin authored
      Fixing getTotalBytes by calling a new API in Vold.
      
      1. Returned the original implementation of rounding logic.
      Now it only rounds the bytes by increasing the size,
      and never by decreasing.
      2. Returned the original logic for all the device sizes <= 512GB  to
      prevent any potential regressions.
      3. For devices with larger capacities now calling vold (one-time call,
      then the value is stored in memory) to get the block device size. It's
      a very precise number of bytes, so only doing a small rounding (up to
      3GB) to try to bring the totalBytes to a nice-looking value, otherwise
      just return as is.
      
      Should be tested together with a Settings UI fix: I3dcc9698403612f961cf0de41925dcbcb43e260b
      
      Verified on multiple devices with storage <= 512GB: b/290892417#comment26.
      Also verified for 1TB devices: personally and in b/295265657#comment10
      
      Bug: 290892417
      Bug: 295358118
      Test: verified manually + manually verified calling of new API
      Test: atest FileUtilsTest
      Test: atest StorageHostTest
      Change-Id: I01d72ede6c3ac62198d04829866655ba5a92dc45
      (cherry picked from commit be2ec6d9)
      bdec6441
  22. Aug 25, 2023
    • Varun Shah's avatar
      Update certain APIs to require the REPORT_USAGE_STATS permission. · ad842da7
      Varun Shah authored
      Add requirement of either being the system or having the
      REPORT_USAGE_STATS permission in order to call any report events related
      APIs. This includes the reportChooserSelection and reportUserInteraction
      APIs.
      
      Also add the permission to Shell so the APIs can be tested via CTS.
      
      Bug: 296056771
      Bug: 218679369
      Test: atest CtsUsageStatsTest
      Change-Id: I3b28e00b9da73cd4bc051f3c5e03e29a734a1df0
      ad842da7
  23. Aug 22, 2023
    • alukin's avatar
      Fix StorageStatsService#getTotalBytes · be2ec6d9
      alukin authored
      Fixing getTotalBytes by calling a new API in Vold.
      
      1. Returned the original implementation of rounding logic.
      Now it only rounds the bytes by increasing the size,
      and never by decreasing.
      2. Returned the original logic for all the device sizes <= 512GB  to
      prevent any potential regressions.
      3. For devices with larger capacities now calling vold (one-time call,
      then the value is stored in memory) to get the block device size. It's
      a very precise number of bytes, so only doing a small rounding (up to
      3GB) to try to bring the totalBytes to a nice-looking value, otherwise
      just return as is.
      
      Should be tested together with a Settings UI fix: I3dcc9698403612f961cf0de41925dcbcb43e260b
      
      Verified on multiple devices with storage <= 512GB: b/290892417#comment26.
      Also verified for 1TB devices: personally and in b/295265657#comment10
      
      Bug: 290892417
      Bug: 295358118
      Test: verified manually + manually verified calling of new API
      Test: atest FileUtilsTest
      Test: atest StorageHostTest
      Change-Id: I01d72ede6c3ac62198d04829866655ba5a92dc45
      be2ec6d9
  24. Aug 09, 2023
    • Songchun Fan's avatar
      [StorageStats] support apps uninstalled with DELETE_KEEP_DATA · c3138f87
      Songchun Fan authored
      codePath can be null for apps uninstalled with DELETE_KEEP_DATA. The
      downstream code would crash if there's a null inside the codePaths
      array passed into Installer.getAppSize.
      
      Also makes sure that the correct storageUuid and data dir is preserved
      in the PackageInfo query result.
      
      BUG: 288142708
      Test: manually tested with test code and verified it doesn't crash
      Test: to be added in cts
      Change-Id: If7cb1c3cba7a66994780a65c7aa3884889e16c65
      c3138f87
  25. Aug 07, 2023
  26. Jul 22, 2023
  27. Jun 27, 2023
    • Suprabh Shukla's avatar
      Removing TimeSparseArray · 2c3dc9b1
      Suprabh Shukla authored
      The only added value in this subclass comes from the added methods to
      binary search on its keys. Pulling these methods up to the base class
      LongSparseArray so they can be useful for all its instances.
      
      Renamed variables and methods to be more generic and replaced the
      handwritten binary search with an equivalent call to
      Arrays.binarySearch to reduce maintenance overhead.
      
      All occurrences of TimeSparseArray have been replaced with
      LongSparseArray. No behavior change is expected.
      
      Test: Builds, boots.
      Test: atest FrameworksCoreTests:LongSparseArrayTest
      
      Bug: 282264041
      Change-Id: I6e87560ad5afe85118c9ffaac9ea8a506a181af0
      2c3dc9b1
  28. Jun 23, 2023
    • Kweku Adams's avatar
      Support test skipping when power save modes aren't enabled. · 1656f9a8
      Kweku Adams authored
      Some classes of devices will not have auto power save modes enabled. On
      those devices, we should skip tests that require the modes be enabled.
      
      Bug: 240108412
      Bug: 240630396
      Test: Manually go through CTS-V "Ignore Battery Optimizations Test"
      Test: atest CtsUsageStatsTestCases:UsageStatsTest
      Change-Id: Icc64fbe75213386a1f41fae258e50c4032920b0a
      (cherry picked from commit ba3b5d7e)
      Merged-In: Icc64fbe75213386a1f41fae258e50c4032920b0a
      1656f9a8
  29. Jun 19, 2023
  30. Jun 16, 2023
    • Varun Shah's avatar
      Remove UsageStats files older than 2 years. · 606a7f9a
      Varun Shah authored
      As a privacy improvement, do not store usage stats data that is older
      than 2 years. Previously, stats were kept for 3 years.
      
      This will also help reduce the storage taken up by stats and improve the
      performance of query stats API calls which require files to be read from
      disk since the number of files read are significantly less.
      
      Bug: 148524623
      Test: atest UsageStatsDatabaseTest
      Change-Id: I159914a87ba4137f0f3d869c69abf3b16ae77657
      606a7f9a
  31. May 16, 2023
  32. May 06, 2023
    • Varun Shah's avatar
      Ensure only valid events are reported. · 08a8c437
      Varun Shah authored
      When CHOOSER_ACTION events are reported via reportChooserSelection, make
      sure the package name is not null and is also a valid, installed package.
      
      Bug: 229633537
      Bug: 253403242
      Test: atest UsageStatsTest
      Change-Id: Ib28014f2d21b451d2f7f6e7136f500fc49d0779b
      08a8c437
  33. May 04, 2023
  34. May 03, 2023
  35. May 02, 2023
Loading