Commit Graph

14264 Commits

Author SHA1 Message Date
Stefano Tommasini
6f6e67bcce Merge "Add onCreate method to SystemBackup agent that receives UserHandle." 2018-10-15 12:45:38 +00:00
Stefanot
14bbdedec0 Add onCreate method to SystemBackup agent that receives UserHandle.
This is done for go/br-framework-multi-user.

Bug:117590564
Test: Builds.
Change-Id: I7af0f7c604979da03efc3d88dbed2b2c9631bace
2018-10-15 10:27:11 +01:00
Ricky Wai
6763d1f3fe Merge "Return app hidden details activity in launcher api" 2018-10-15 04:21:59 +00:00
TreeHugger Robot
018f47a2b0 Merge "Revert "Instantiate InputMethodManager for each display"" 2018-10-11 15:23:34 +00:00
Ricky Wai
cf134ebfb7 Return app hidden details activity in launcher api
If a normal app does not have launcher icon, launcher api
will return app details activity instead, so user will
be noticed that the app is still installed.

Bug: 111348460

Test: Installed an app without launcher activity, an app icon is being
shown in launcher allapps, and it forwards user to app details page.

Change-Id: I9c17f5edfdefe19727145e7176d7e113286c997d
2018-10-11 14:19:04 +00:00
Yohei Yukawa
1df32c5e5c Revert "Instantiate InputMethodManager for each display"
This reverts commit c53d78e992.

Reason for revert:
Caused performance regression in
LatencyTests#testExpandNotificationsLatency.

Fix: 117434607
Bug: 111364446
Bug: 115893206
Test: atest google/perf/app-transition/sysui-latency-test-trace
Change-Id: If0d7a1b8f6d126d5a7c384ec4c2ff44260b8c35f
2018-10-11 11:52:02 +00:00
Philip P. Moltmann
e5e217dac2 Merge "Change DevicePolicyManager APIs as requested" 2018-10-10 19:50:06 +00:00
Michael Groover
a28ad42768 Merge "Protect Device Identifiers behind priv permission and DO/PO checks" 2018-10-10 18:05:23 +00:00
Adam He
c472b0ac9e Merge "Added mAutofillFlags for parcelization, and new tests." 2018-10-10 17:31:47 +00:00
TreeHugger Robot
515de0d6c2 Merge "Fix and cleanup smart replies checking" 2018-10-10 11:10:33 +00:00
Tony Mak
638430e76e Fix and cleanup smart replies checking
1. We now apply smart replies to the first action button that has
   (freeform) remote input. For example, if the notification have
   both reply and reply all buttons, smart replies will be applied
   to the first button only.
2. Enforced getAllowGeneratedReplies check in system generated
   smart replies.
3. Fixed an bug that smartRepliesAdded is not called for system
   generated smart replies.

BUG: 111546109
BUG: 111406942

Test: atest com.android.server.notification.NotificationTest
Test: Check apps generated smart replies via Messenger
Test: Check system generated smart replies via Hangouts

Change-Id: I4db34f557f7e9988be612e4162347b86393d1faf
2018-10-10 10:12:16 +01:00
Adam He
df59684d8f Added mAutofillFlags for parcelization, and new tests.
Change-Id: Ib23ee7158020b5e41ccb7781279709fc3c6ef354
Fixes: 37567426
Test: atest app.assist.AssistStructureTest
Test: atest CtsAutoFillServiceTestCases
2018-10-09 15:42:32 -07:00
Cody Northrop
70687b7783 Merge "Add ANGLE_ENABLED_APP to CoreSettings" 2018-10-09 21:43:59 +00:00
Michael Groover
6d20d75e9e Protect Device Identifiers behind priv permission and DO/PO checks
Bug: 110099294
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.DeviceOwnerTest.testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.ManagedProfileTest#testGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Test: cts-tradefed run cts -m CtsPermissionTestCases -t android.permission.cts.TelephonyManagerPermissionTest

Change-Id: I3c82c53ec89cd17b34a61166ccc9e9747388efac
2018-10-09 13:44:02 -07:00
kopriva
c997fc62e0 Merge "docs: fixing errors found with lint check" into pi-dev am: 8c7d2142f6
am: 4d12f4c42b

Change-Id: I96a6dab05b6d4ea40950fe2ddc0948adf1b4e48f
2018-10-09 13:29:04 -07:00
kopriva
4d12f4c42b Merge "docs: fixing errors found with lint check" into pi-dev
am: 8c7d2142f6

Change-Id: Ief137b64e798b4b5bb6be5e6d25a35e08037abe5
2018-10-09 13:18:06 -07:00
Philip P. Moltmann
0ada0a6044 Change DevicePolicyManager APIs as requested
This requires RestrictedLockUtils to change which then causes further
changes.

I left the old APIs available for non-system-api customers.

Test: RunSettingsLibRoboTests
Bug: 116798569
Change-Id: Id5384ee074bb245e615012b7e0d5298b8bf27ba4
2018-10-09 12:38:23 -07:00
kopriva
a1a7848f83 docs: fixing errors found with lint check
This covers directories through /app.

removed unused import in KeyguardManager.java

Test: make ds-docs

Bug: 117494359

Change-Id: Ie2536676ae8d3ab9349aa43dc3e3248b618dd143
Exempt-From-Owner-Approval: Docs-only change
2018-10-09 10:27:35 -07:00
kopriva
dae6ec0db7 Merge "docs: fixing 'mange' instead of 'manage'" into pi-dev am: 14aa42cfda
am: 57adb99451

Change-Id: I477a610e0602e464847c1a1ccb13b21644ee1ae8
2018-10-08 19:30:00 -07:00
kopriva
57adb99451 Merge "docs: fixing 'mange' instead of 'manage'" into pi-dev
am: 14aa42cfda

Change-Id: Id461e2430301c62be5ee76f5046370069cb1a34c
2018-10-08 19:14:44 -07:00
kopriva
82c591b78b docs: fixing 'mange' instead of 'manage'
Test: make ds-docs

Bug: 117449040

Change-Id: I282a2e960bbf722bf3a72dd932e3bf685abb74e5
Exempt-From-Owner-Approval: Docs-only change
2018-10-08 15:57:00 -07:00
TreeHugger Robot
10efed0b49 Merge "Remove SMS access for apps other than current SMS handler" 2018-10-06 20:14:06 +00:00
TreeHugger Robot
ce10f9b15f Merge "Instantiate InputMethodManager for each display" 2018-10-06 17:19:58 +00:00
Wale Ogunwale
2f6c71d781 Merge "Moved startHomeActivity methods from AMS to ATMS (19/n)" 2018-10-06 13:45:13 +00:00
Wale Ogunwale
214f348ebb Moved startHomeActivity methods from AMS to ATMS (19/n)
Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie3354304ea800777bd9ca7a83885b379776704e2
2018-10-05 23:32:49 -07:00
Eugene Susla
9351985f7a Remove SMS access for apps other than current SMS handler
Bug: 110098858
Test: atest android.telephony.cts.SmsManagerTest#testContentProviderAccessRestrictions
Change-Id: I9da992565b04ca5fa2656801fd2cfe4b196ef9b4
2018-10-05 16:51:13 -07:00
Yohei Yukawa
c53d78e992 Instantiate InputMethodManager for each display
InputMethodManager has been a per-process singleton object. In order
to support behavior changes for multi-display support in Android Q,
however, InputMethodManager now needs to be per-display objects.

With this CL, context.getSystemService(InputMethodManager.class) will
start returning per-display InputMethodManager (IMM) instance.

  Why?

There are two major reasons.
 1. To support per-display focused window.
 2. To support more simplified API for multi-session IME.

Currently per-process InputMethodManager instance directly receives
callback from ViewRootImpl upon windowFocusChanged, then it keeps
track of which Window is focused by storing its root view into
InputMethodManager#mCurRootView.

This design assumes that (within the same process) at most one Window
can have window focus, which is no longer true once we start
supporting per-display focused window (Bug 111361570).

  Why we need to do this to support per-display focused window:

For traditional non multi-session IME cases (e.g. apps that use
Virtual Display APIs on phones), internal state of IMM can be easily
messed up once the system starts sending per-display
windowFocusChanged events to the same process, because IMM still
doesn't know that now each display has focused window. It is hard to
precisely predict what kind of issues we would see simply because such
a use case is most likely not expected in the original design.

  Why we need to do this for multi-session IME:

For multi-session IME scenarios, in addition to the above concern in
InputMethodManager, the current design allows at most one IME session
per process. This means that if a process X is showing Activities to 3
different displays, only one Activity can interact with the
multi-session IME at the same time. If we do not change the current
design, the only way to work around is to ask app developers to
explicitly use different processes for each Activity, which may
require a lot of work (e.g. SharedPreference is not optimized for
multi-process use cases). This would also make multi-session IME
development complicated because the IME cannot know on which display
the IME is interacting until startInputOrWindowGainedFocus() is
actually called, and needs to do all the preparation and cleanup tasks
whenever startInputOrWindowGainedFocus() is called for a different
display than it's currently interacting with.

  Alternative solutions considered:

Another possible approach is to update InputMethodManager singleton to
be able to maintain multiple mCurRootView and mServedView for each
display. This approach was abandoned because those fields and methods
are already marked as @UnsupportedAppUsage.  I concluded that touching
@UnsupportedAppUsage things would have bigger compatibility risks than
per-display instance model.

  Implementation note:

* Public APIs in IMM that take View instance as the first parameter
  will verify whether the given View and IMM are associated with the
  same display ID or not.  If there is a display ID mismatch, such an
  API call will be automatically forwarded to the correct IMM instance
  IMM with a clear warning in logcat which tells that app developers
  should use the correct IMM instance to avoid unnecessary performance
  overhead.

* As a general rule, system server process cannot trust display ID
  reported from applications.  In order to enable IMMS to verify the
  reported display ID, this CL also exposes display ID verification
  logic from WMS to other system components via WindowManagerInternal.

* isInputMethodClientFocus() in WindowManagerService (WMS) is updated
  to use top-focused-display to determine whether a given IME client
  has IME focus or not.  This is now necessary because with a recent
  change [1] each display can have focused window.  The previous logic
  to check all the displays that belong to the given pid/uid [2] no
  longer makes sense.

* Currently per-display InputMethodManager instances will not be
  garbage collected because InputMethodManager#sInstanceMap keeps
  holding strong references to them.  Freeing those instances is
  technically possible, but we need to be careful because multiple
  processes (app, system, IME) are involved and at least system
  process has a strict verification logic that lets the calling
  process crash with SecurityException.  We need to carefully
  implement such a cleanup logic to avoid random process crash due to
  race condition.  Bug 116699479 will take care of this task.

 [1]: I776cabaeaf41ff4240f504fb1430d3e40892023d
      1e5b10a217
 [2]: I8da315936caebdc8b2c16cff4e24192c06743251
      90120a8b5b

Bug: 111364446
Fix: 115893206
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Change-Id: I7242e765426353672823fcc8277f20ac361930d7
2018-10-05 15:54:41 -07:00
Cody Northrop
deb432823c Add ANGLE_ENABLED_APP to CoreSettings
The way we were checking Settings was invoking a 2ms hit.

Move ANGLE_ENABLED_APP to CoreSettings, which are already
available to the ActivityThread, eliminating the hit.

Test: Verify developer option works as expected
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test
Bug: 117107368
Bug: 80239516
Change-Id: I3df4c3c43489a338b3631484a8811b38c4eff2e6
2018-10-04 23:05:26 +00:00
Andrew Solovay
d10e384d6c resolve merge conflicts of a3e34fe9fe to pi-dev-plus-aosp
Bug: None
Test: Eyeballed (comment-only change).
Change-Id: Ia644cde66376b2bddeb27bb2a147b3266037aa2c
Exempt-From-Owner-Approval: Docs-only change
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 22:50:39 +00:00
Andrew Solovay
a3e34fe9fe Merge "docs: Replacing {#link with {@link" into pi-dev 2018-10-04 20:06:59 +00:00
Andrew Solovay
a44f2c075b docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

Staged to:

go/dac-stage/reference/android/app/Instrumentation.html
go/dac-stage/reference/android/bluetooth/BluetoothAdapter.html
go/dac-stage/reference/android/bluetooth/BluetoothDevice.html
go/dac-stage/reference/android/bluetooth/BluetoothServerSocket.html
go/dac-stage/reference/android/inputmethodservice/InputMethodService.html
go/dac-stage/reference/android/view/KeyCharacterMap.html
go/dac-stage/reference/android/view/KeyEvent.html
go/dac-stage/reference/android/media/AudioManager.html
go/dac-stage/reference/android/net/wifi/WifiConfiguration.html

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Exempt-From-Owner-Approval: Docs-only change
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 18:20:51 +00:00
Andrew Solovay
b577f20c23 Merge "cherry-pick from pi-dev docs: Replacing {#link with {@link" 2018-10-04 18:17:23 +00:00
Andrew Solovay
5c05dedda1 cherry-pick from pi-dev docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Original Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Exempt-From-Owner-Approval: Docs-only change
2018-10-04 18:17:05 +00:00
Neda Topoljanac
746a795b0f Merge "Add DevicePolicyManager constants for enterprise WiFi Provisioning with certificates" 2018-10-04 16:44:56 +00:00
TreeHugger Robot
427b75f8f8 Merge "Introduced ActivityServiceConnectionsHolder (18/n)" 2018-10-04 09:01:25 +00:00
Wale Ogunwale
c4e63a46a5 Introduced ActivityServiceConnectionsHolder (18/n)
Class for managing the connections to services on the AM side that
activities on the WM side bind with for things like oom score adjustment.

Bug: 80414790
Test: Existing tests pass.
Change-Id: I4ab5140dd7f888f448ce19107bda92c01066a3dc
2018-10-04 00:28:43 -07:00
kopriva
af5908b8a9 Merge "docs: bug 37126744, typos" into pi-dev am: 58c7bcf12e
am: d64ab297d5

Change-Id: I51431e6df33efdb59dcda7792cf435cbf513dd13
2018-10-03 18:33:16 -07:00
kopriva
d64ab297d5 Merge "docs: bug 37126744, typos" into pi-dev
am: 58c7bcf12e

Change-Id: I5a7b100cc186e92a16e1572a1cbee3f789e8df58
2018-10-03 18:22:41 -07:00
kopriva
762a08fe90 docs: bug 37126744, typos
fixing order of import statements to clear repo hooks

Test: make ds-docs

Bug: 37126744

Change-Id: I0ebb3d1d2599a411afd9b8ffd6f2497d821deb2b
Exempt-From-Owner-Approval: Docs-only change
2018-10-03 16:13:19 -07:00
Beverly Tai
64245b443c Merge "Fix potential NPE" 2018-10-03 18:27:33 +00:00
Makoto Onuki
8c7c5cc91e Persistent connection to SMS app 2/2 (main)
Bug: 109809543
Test: atest CtsAppBindingHostTestCases
Test: atest ${ANDROID_BUILD_TOP}/frameworks/base/services/tests/servicestests/src/com/android/server/am/PersistentConnectionTest.java
Change-Id: If927050fba5edea63137e10af5570c3450165237
2018-10-02 14:19:53 -07:00
Beverly
c629ee4d90 Fix potential NPE
Test: manual
Bug: 112753848
Change-Id: I741a93348b1d69b419527f5dd6983227c28bc9ca
2018-10-02 16:17:38 -04:00
TreeHugger Robot
3d82416e02 Merge changes from topic "am_launch_times"
* changes:
  AM: Update WaitResult parsing logic in AppLaunch
  AM: Use ActivityMetricsLogger to get app launch times
2018-10-02 15:30:52 +00:00
TreeHugger Robot
e1251df8eb Merge "Device-wide unknown sources block option for DPC." 2018-10-02 13:07:25 +00:00
Michael Wachenschwanz
03b9731830 Merge changes from topic "UsageStats2Proto"
* changes:
  Pool Package and Class names when writing UsageStats to disk
  Upgrade UsageStatsDatabase from XML to Protobuf
2018-10-01 21:20:56 +00:00
Irina Dumitrescu
4638edd79f Device-wide unknown sources block option for DPC.
This adds a new framework user restriction that can be used by the DPC
to block installs from unknown sources on all profiles of a device.

Test: Manual test, disallowing installs in TestDPC disables installing
unknown sources apps.
Bug: 111335021
Change-Id: Ib9fb672c5e5dea2ac63bf8cbd1b04484b12b4056
2018-10-01 21:45:00 +01:00
Fabian Kozynski
cca4ee0895 Merge "Fixes NPE when trying to expand QSPanel with wrong name of tile" 2018-10-01 20:16:35 +00:00
kopriva
28a83c8fb7 Merge "docs: bug 112769174, unclosed parentheses" into pi-dev am: 6ee6799c03
am: bfa9ed00e0

Change-Id: Ic43aa5f66b42fea13ccf1d881ff2c4707a7cc53d
2018-10-01 12:27:21 -07:00
kopriva
bfa9ed00e0 Merge "docs: bug 112769174, unclosed parentheses" into pi-dev
am: 6ee6799c03

Change-Id: I0d2c0adccb751909413f49c87238d12f4355558d
2018-10-01 11:52:43 -07:00
Fabian Kozynski
e3137e35a4 Fixes NPE when trying to expand QSPanel with wrong name of tile
Fixes promise of StatusBarManager#expandSettingsPanel to document what
happens on invalid tile name.

Added test to verify correct behavior.

Change-Id: I057210eb47411cf2a7dfefdd4efe49b96fd33f69
Fixes: 111128728
Test: runtest && manual
2018-10-01 12:21:30 -04:00