Commit Graph

16403 Commits

Author SHA1 Message Date
Satakshi Rana
70694b005d Merge "Allow passing the bitmap to ContentSuggestionsService via the extras Bundle" 2019-10-25 14:59:15 +00:00
TreeHugger Robot
878b4cef85 Merge "Correctly parcel LongSparseArray<String>" 2019-10-24 20:51:27 +00:00
Philip P. Moltmann
badc09c7a5 Correctly parcel LongSparseArray<String>
Before we just cast Object[] to String[]. This crashes. Now we are
casting the individual objects->strings.

Test: Parceled LongSparseArray
Change-Id: I24883a1dad49c0682977da1aea2370eddb001173
2019-10-24 12:19:31 -07:00
Christopher Tate
b909c4d55a Move UsageStatsManagerInternal to services.jar
UsageStatsManagerInternal is also no longer an API surface for
registration of app idle state change listeners.  AppStandbyInternal has
become a proper LocalService and interested clients can just use that
directly.

Bug: 140833849
Test: boot & run normally
Test: verify system package backup
Change-Id: Ie63f438f129cd8f41169778a3045d131ca7322fb
2019-10-24 18:28:52 +00:00
Satakshi
c45d86fc15 Allow passing the bitmap to ContentSuggestionsService via the extras Bundle
This change creates a constant in ContentSuggestionsManager, which will
be used to pass a hardware bitmap to ContentSuggestionsService.
In the presence of this key in the request extras, we skip taking a
snapshot in ContentSuggestionsPerUserService.
Bitmap is extracted from reading this value from extras in
ContentSuggestionsService.

Test: Manually tested this code in the debugger to verify that snapshot
is not taken when constant is provided in extras.

Change-Id: I4a464d5188bd3eac9afb4ac223611dccab01510f
2019-10-24 17:46:22 +00:00
Mathieu Chartier
15eebad6c1 Merge "Adjust reportFullyDrawn documentation" 2019-10-24 02:59:35 +00:00
Mathieu Chartier
7fe953e729 Adjust reportFullyDrawn documentation
Since Q, this API affects how the application is optimized.

Bug: 117575269
Test: manual
Change-Id: I0a448b8a59df4544775739505e50e401b43ba965
2019-10-23 15:19:56 -07:00
Soonil Nagarkar
2da6b815d6 Merge "Add new DPM API for setting location enabled" 2019-10-22 16:56:15 +00:00
TreeHugger Robot
4d77a3e195 Merge changes from topics "lockscreen-pin", "locksettings-aidl"
* changes:
  Introduce Lockscreen PIN credential as first-class citizen
  Introduce LockscreenCredential to LockSettingsService
2019-10-22 09:28:39 +00:00
Neil Fuller
8dbb49d397 Merge "Make TimeDetectorService more aware of origin" am: 4ef2551dfa am: 3150e58082 am: 84c6981a8f
am: a4783a8a28

Change-Id: I5fbb8544613475f750f59adafc784a0ad625ea1a
2019-10-21 13:21:54 -07:00
Neil Fuller
a4783a8a28 Merge "Make TimeDetectorService more aware of origin" am: 4ef2551dfa am: 3150e58082
am: 84c6981a8f

Change-Id: Ica76e3630488a31c42ecd3b654d1a47a453e8bde
2019-10-21 13:08:40 -07:00
Neil Fuller
84c6981a8f Merge "Make TimeDetectorService more aware of origin" am: 4ef2551dfa
am: 3150e58082

Change-Id: Ia70f69e226a7800e82e29dd504351aef65048ed3
2019-10-21 12:04:05 -07:00
Neil Fuller
3150e58082 Merge "Make TimeDetectorService more aware of origin"
am: 4ef2551dfa

Change-Id: I27866cf74b779bb0040f4ace384207047ca6838f
2019-10-21 11:53:20 -07:00
TreeHugger Robot
5df072b6ae Merge changes from topic "usagestats-obfuscation"
* changes:
  Do not retain UsageStats for uninstalled packages.
  Catch exceptions in UsageStatsService on bad data.
  Obfuscate usage stats data stored on disk.
2019-10-21 17:53:38 +00:00
Rubin Xu
5e891bcc04 Introduce Lockscreen PIN credential as first-class citizen
* Add CREDENTIAL_TYPE_PIN as the fourth credential type.
* Rename existing CREDENTIAL_TYPE_PASSWORD
  to CREDENTIAL_TYPE_PASSWORD_OR_PIN which is still referenced
  by password data persisted on disk.
* No longer store quality for new credentials (PASSWORD_TYPE_KEY).
  Credential type stored in synthetic password blob is now the single
  source of truth on what credential (None/Pin/Pattern/Password) the
  device currently has.
* Adapt lockscreen FRP to work on a similar fashion (no more quality
  being passed around and stored)
* Adapt RecoverableKeystore to use the new PIN credential type.
* Fix existing unit tests
* Add new unit tests for lockscreen FRP.

Upgrade path:
* Existing credentials will have CREDENTIAL_TYPE_PASSWORD_OR_PIN, and when
  LSS sees this, it will further consult PASSWORD_TYPE_KEY to distinguish
  between PIN and Pattern. The credential will stay this way until the next
  password change i.e. no automatic credential upgrade.
* Existing FRP credential will have CREDENTIAL_TYPE_PASSWORD_OR_PIN, and
  when LSS sees this, it will further consult the saved quality
  PersistentData.qualityForUi to make that distinction.
* Normal and FRP credential enrolled after this CL will store
  CREDENTIAL_TYPE_PIN to indicate this is a numeric PIN.

Bug: 65239740
Test: atest com.android.server.locksettings
Test: atest com.android.internal.widget.LockscreenCredentialTest
Test: atest com.android.internal.util.LockPatternUtilsTest
Test: atest LockSettingsShellCommandTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest FrameworksCoreTests:PasswordMetricsTest
Test: atest FrameworksCoreTests:PasswordPolicyTest
Test: atest MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Test: flash an old build, enroll password and flash to new build.
      Verify everything still works.
Test: manually set an PIN/Pattern/Password; then change to
      PIN/Pattern/Password; finally remove password
Test: manually create a work profile; try unify and ununify work
      challenge.
Test: manually test lockscreen FRP flow (change password via Settings /
      DPC)

Change-Id: I781cea4c32d567aac4af692697c4569161580102
2019-10-21 15:49:53 +01:00
Neil Fuller
af3eeaf431 Make TimeDetectorService more aware of origin
Make TimeDetectorService more aware of a time signal's origin by making
the time signal from telephony less generic.

When TimeDetectorService was written it was assumed that the TimeSignal
could be generic and there would just be a String source identifier to
indicate origin.

With multiple SIMs / phones on a device it makes sense to keep track of
the originating phone of the signal so that the time detector service
could implement stickiness if it wanted. This would avoid a device
alternating back and forth between two signals and help with debugging.

As new signals are added, new "suggestXxxxTime()" methods will be added
to TimeDetectorService. That is the point at which the strategy for
ranking different sources can be decided. e.g. should NTP always rank
higher than NITZ?

The main change here is that TimeSignal is renamed to
PhoneTimeSuggestion to indicate it's only for use by signals from
telephony, sourceId has been removed and it has been given a phoneId
instead. Extra free-form metadata (mDebugInfo) has been added to assist
with logging / debugging.

Bug:140712361
Test: atest android.app.timedetector
Test: atest com.android.server.timedetector
Change-Id: I5305c34516e5f4e254309193183f00e054801a46
2019-10-21 08:42:50 +01:00
George Mount
1380583cc7 Merge "Clear the EnterTransitionCoordinator only after onResume." 2019-10-18 23:11:16 +00:00
Soonil Nagarkar
8b274a9055 Add new DPM API for setting location enabled
Test: manual
Bug: 117835097
Change-Id: I77f07752b66fb5f24e213b23b9eaf87e406a01d5
2019-10-18 12:34:50 -07:00
Pinyao Ting
078293aeaf Merge "fix the issue slice cannot be triggered from uri" into qt-qpr1-dev
am: 9d7a54238c

Change-Id: If2fd2170471c0a0a4ff029c07a0bd84b2a35da2b
2019-10-18 09:31:47 -07:00
Pinyao Ting
8deca19926 fix the issue slice cannot be triggered from uri
Bug: 122879432
Change-Id: Id36a45bbbdb858b5b8d9fd6f1b3f5f97eb84e9fd
Test:
1. install SliceViewer (https://github.com/android/user-interface-samples/releases)
2. adb shell am start -d "slice-https://sliceviewer.android.example.com/hello"
(cherry picked from commit 09b91e6027)
2019-10-18 16:12:47 +00:00
Eran Messeri
111dfdfdae Merge "Documentation: Indicate DPM method does I/O" 2019-10-18 13:10:51 +00:00
TreeHugger Robot
1ea7ca442d Merge "Fix grammatical error in DPM" 2019-10-18 12:45:48 +00:00
Eran Messeri
128703b70d Documentation: Indicate DPM method does I/O
Document that the addPersistentPreferredActivity method does Disk I/O
and so should not be called on the main thread.

Bug: 142648455
Test: m docs
Change-Id: Iadf2ab82f4f573e53ff68cad0b981494acf6f9b6
2019-10-18 12:24:43 +01:00
Philip P. Moltmann
c9bb90c0e0 Merge "Add feature context" 2019-10-18 02:26:08 +00:00
Louis Chang
95a5e431d2 Merge "Add public API for converting activity translucency" 2019-10-18 01:07:50 +00:00
TreeHugger Robot
7780ab30db Merge "Merge AppWindowToken into ActivityRecord" 2019-10-17 22:54:07 +00:00
George Mount
c8fe362832 Clear the EnterTransitionCoordinator only after onResume.
Fixes: 141875256
Fixes: 142224519

In ActivityTransitionState, the mEnterTransitionCoordinator
was being set to null as soon as the transition finished. In
tests, transitions were being finished immediately and the
mEnterTransitionCoordinator was being set to null immediately.
That left time for the same transition to be started again
at a later time.

This waits until the onResume() is called before potentially
clearing the mEnterTransitionCoordinator. This means that all
potential other times where a new EnterTransitionCoordinator
may have been created have already passed and it is safe to
clear the mEnterTransitionCoordinator.

Test: ran ActivityTransition tests
Change-Id: I91978a3c992b533b9074409f05c006fe700d7983
2019-10-17 14:24:04 -07:00
Philip P. Moltmann
59076d8957 Add feature context
Currently only used by app-ops, but can be used by other modules too.

AppOps will collect app-ops based on feature. Only the most basic
parts of app-ops are supporting features yet. The rest will be added
later.

Test: atest CtsAppOpsTestCases
      atest RunSettingsLibRoboTests
      atest com.android.server.wm.ActivityStarterTests
      m -j doc-comment-check-docs
Bug: 136595429
Change-Id: Ia664f4ff1c1c2ceea721d76dc491ec50c237e9ce
2019-10-17 14:15:07 -07:00
TreeHugger Robot
6993d89fca Merge "Remove legacy bugreport flow code" 2019-10-17 18:46:41 +00:00
Chen Xu
3321171cc7 Merge "non-mainline telephony related AIDL refactor/decoupling" 2019-10-17 18:27:13 +00:00
Garfield Tan
e8d84ab020 Merge AppWindowToken into ActivityRecord
This change kept AppWindowTokenTests as it's originally based on top of
WindowTestBase, and merging that into ActivityRecordTests needs to
change the base class to ActivityTestBase, which requires additional
work and may change test behaviors. Therefore delay that to
follow-up CL.

Bug: 80414790
Test: Existing tests pass.
Change-Id: I6d73975ee77be9817c41b297f067de2d92a68499
2019-10-17 11:10:02 -07:00
Abhijeet Kaur
8cd863bf7e Remove legacy bugreport flow code
* Remove USE_BUGREPORT_API check that enabled us to switch between
  legacy bugreport flow and API workflow.
* Undeprecate requestBugReport flavors as these will not be deprecated.
  Initially it was aimed to remove these methods and use the API
  directly. But now these methods have all been migrated to
  use bugreport API.
* Add @BugreportParams annotation for requestBugReport function.
* Title and Description are communicated via the broadcast instead of
  setting system properties.
* Description is not a system property anymore, so add a check on its
  length by defining MAX_BUGREPORT_DESCRIPTION_SIZE.

Bug: 137825297
Test: Takes interactive and full bugreport as expected
Change-Id: Ib96ad774f5e21491c0dad82cb2292960aa45d6d0
2019-10-17 17:35:36 +01:00
Jay Aliomer
790ac66e94 Merge "Typo in javadoc of NotificationManager#addAutomaticZenRule" 2019-10-17 16:15:34 +00:00
Eran Messeri
a6b775842a Fix grammatical error in DPM
The documentation for the setPermittedAccessibilityServices method
attempted to explain that system accessibility services cannot be
disabled but the sentence did not make sense.

Bug:
Test: m update-api && m javadoc
Change-Id: I84d27a8c281551bbd8a82621234cd49e205956a7
2019-10-17 13:19:45 +01:00
TreeHugger Robot
4446634572 Merge "Add @NonNull to some generated methods' args" 2019-10-17 00:15:05 +00:00
Chen Xu
1f6cfa5399 non-mainline telephony related AIDL refactor/decoupling
1. decouple IOnSubscriptionChangedListener AIDL from telephonyMainline
2. other refactor. moving APIs which will not be included in
telephony mainline to frameworks/base/core/java/android/telephony.
Moving internal classes like AIDL which will not be included in
telephony mainline to
framework/base/core/java/com/android/internal/telephony

Bug: 140908357
Test: Build & unit test
Change-Id: I9413ef758cceadd251d03f3b5ea1054cc48ef044
2019-10-16 15:30:24 -07:00
Eugene Susla
1bfb5e7097 Add @NonNull to some generated methods' args
Test: . frameworks/base/tests/Codegen/runTest.sh
Fixes: 142783758
Change-Id: I7303d420efd59389c324b3e399fcb3532b5d6c37
2019-10-16 14:29:58 -07:00
Kweku Adams
df33ae1b0b Removing periodic parole window.
The periodic parole window is the 10 minute window that occurs every
24 hours to let RARE apps run. Now that we have the quota system in
place, there's no need to have the periodic parole window. Alarms and
jobs will still be allowed to run when charging. Network will continue
to be restricted for RARE apps even when charging. JobScheduler requests
an exception for RARE jobs in quota, so they will still be able to run.

Bug: 136184981
Test: atest AppStandbyControllerTests
Test: atest CtsAlarmManagerTestCases
Test: atest NetworkPolicyManagerServiceTest
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Test: atest com.android.server.AlarmManagerServiceTest
Test: atest com.android.server.AppStateTrackerTest
Test: atest com.android.server.job.controllers.QuotaControllerTest
Test: atest com.android.server.net.ConnOnActivityStartTest
Change-Id: Ide382ad7fb9c7441f0a5232833ad39bf8c3a1e94
2019-10-16 13:04:06 -07:00
Jay Aliomer
8e3aac52ee Typo in javadoc of NotificationManager#addAutomaticZenRule
* <p>
     * Throws a SecurityException if policy access is granted to this package.
     * See {@link #isNotificationPolicyAccessGranted}.

The security exception should be thrown when policy access is NOT granted
Test: no test required. documentation change only
Fix: 138459179
Change-Id: I980392104cb38e921b6eafd1a8897b374e73b83c
2019-10-16 17:55:19 +00:00
Pavel Grafov
76621cf279 Merge "Password constraints cleanup." 2019-10-16 17:49:12 +00:00
Pavel Grafov
6f334843a8 Password constraints cleanup.
1. PasswordMetrics now doesn't have 'quality', it is only used inside DPMS.
   This allows easier and unambiguous comparisons.
2. Password complexity code reworked.

Future work: factor validation code into a android.app.PasswordPolicy class
to make PasswordMetrics just represent metrics. It is still used in two ways:
specifying an actual metrics and specifying a minimum metrics for comparison,
this will be addressed later.

Test: atest com.android.cts.devicepolicy.PasswordComplexityTest
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testResetPasswordWithToken
Test: atest FrameworksCoreTests:PasswordMetricsTest
Test: atest FrameworksCoreTests:PasswordPolicyTest
Test: atest com.android.cts.devicepolicy.ManagedProfilePasswordTest
Bug: 138375712
Change-Id: I8ad55f373712ac1dc8343f8cbae23ebb1efe78b9
2019-10-16 16:10:36 +01:00
TreeHugger Robot
d9294a0a43 Merge "unhide getConsolidatedNotificationPolicy" 2019-10-16 05:10:10 +00:00
TreeHugger Robot
6b905bca2f Merge "Explicitly take flags in createContextAsUser()" 2019-10-15 04:11:04 +00:00
TreeHugger Robot
dead70a0a0 Merge "Lock on ResourcesManager when cleaning references" 2019-10-14 23:01:58 +00:00
TreeHugger Robot
9011d90f6b Merge "fix the issue slice cannot be triggered from uri" 2019-10-14 22:18:27 +00:00
Neil Fuller
2505d7580c Merge "Make TimestampedValue Parcelable" am: 81a705690b am: 209c74f8b6 am: 4055cdd965
am: bfe51f8b64

Change-Id: Ied15954c16a1661db7b0d379e1ca71fa7e2c5694
2019-10-14 12:03:18 -07:00
Neil Fuller
bfe51f8b64 Merge "Make TimestampedValue Parcelable" am: 81a705690b am: 209c74f8b6
am: 4055cdd965

Change-Id: I2e507f9cef730c1032767500d36dc0397499c310
2019-10-14 11:56:20 -07:00
Neil Fuller
4055cdd965 Merge "Make TimestampedValue Parcelable" am: 81a705690b
am: 209c74f8b6

Change-Id: I4d9afe91fdea9c5819e4d3d744ac784304abcd19
2019-10-14 11:49:47 -07:00
Neil Fuller
209c74f8b6 Merge "Make TimestampedValue Parcelable"
am: 81a705690b

Change-Id: I68edcf15ec9bef69a26267d9bf0c036e38ce93d4
2019-10-14 11:43:18 -07:00
Treehugger Robot
81a705690b Merge "Make TimestampedValue Parcelable" 2019-10-14 18:33:43 +00:00