Commit Graph

14248 Commits

Author SHA1 Message Date
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
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
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
kopriva
fdb0bffb0b docs: bug 112769174, unclosed parentheses
Test: make ds-docs

Bug: 112769174

Change-Id: I3322e06bf3b4624a7ed09dc476bdfe715ea0a27a
Exempt-From-Owner-Approval: Docs-only change
2018-09-29 15:22:41 -07:00
Michael Wachenschwanz
c8c26365a4 Upgrade UsageStatsDatabase from XML to Protobuf
Add the relevant methods to read from ProtoInputStream to
various classes.

Also add some framework to handle version changes in
UsageStatsDatabase. There is some risk of users losing all their current
UsageStats data, if something goes horribly wrong. The debug flag and a
keep backup files flag are temporarily set in UsageStatsDatabase with
this change. They will both be unset in the future before the Q release.

Some rough number on the impact of this change:
Proto file size on disk reduces to ~47% of XML file size :)
Proto file read time reduces to ~55% of XML file read :)
Proto file write time increases ~17% over the XML file write :(

There will be a follow up CL to address the file write time regression

Bug: 111422946
Fixes: 111449927
Test: atest UsageStatsDatabaseTest
Change-Id: I084aea796ed2163c42947d52396a36cc7c5562a2
2018-09-28 16:48:23 -07:00
Vishnu Nair
132ee83808 AM: Use ActivityMetricsLogger to get app launch times
- Make ActivityMetricsLogger the single source of truth for activity metrics and
use it to provide data for Tron, logcat, event logs and {@link android.app.WaitResult}
- Remove LaunchTimeTracker
- Remove workaround added for b/80084651
- Remove thisTime from WaitResult and logs
- Remove am_activity_fully_drawn_time EventLog Tag

Compatibility Changes:
- thisTime removed from logcat and eventlog. Only totalTime will be displayed.
- Change in activity visiblity during launch will invalidate totalTime. am start -w
  will only report WaitTime in this case.
- am_activity_fully_drawn_time is removed from event log.

Bug: 67683350
Test: atest CtsActivityManagerDeviceTestCases:ActivityMetricsLoggerTests

Change-Id: Ib033594b961be9227256eba2a519dd6c2e3db573
2018-09-28 15:00:05 -07:00
TreeHugger Robot
23ca916dca Merge "No color spans in notifications when night mode" 2018-09-27 23:01:32 +00:00
Lucas Dupin
d3c9932312 No color spans in notifications when night mode
Apps might use color spans to express hierarchy in their
notifications but they aren't really tuned for dark mode.
This may cause compatibility issues with Q.

Test: visual
Change-Id: Ia7e2a29907f29c4142dc7c873354d16d247ae069
Fixes: 115813048
2018-09-27 10:22:29 -07:00
TreeHugger Robot
02dd9e2556 Merge "Add pre and post callbacks to ActivityLifecycleCallbacks" 2018-09-27 16:09:00 +00:00
Makoto Onuki
8426a06516 Merge "Add API surface for "keep SMS app running"." 2018-09-27 14:30:41 +00:00
Wale Ogunwale
39a6834c6e Merge "Introducing PendingIntentController (17/n)" 2018-09-26 23:15:29 +00:00
Makoto Onuki
df7e481b20 Add API surface for "keep SMS app running".
Bug: 109809543
Test: build & boot
Change-Id: Ie9ebf1f34052394a92c3f260413c18596709d3a3
2018-09-26 11:51:06 -07:00
Rafal Slawik
aaf608959c Read RSS high watermark
The value is read from /proc/PID/status or memory.max_usage_in_bytes (for devices with per-app memcg enabled).

Reading the value takes about 2ms per process.
Full snapshot taken by statsd is around 300ms.

Results: https://docs.google.com/spreadsheets/d/1vG9ku8Uu8104CmKbO4cNeEKVeeByvHY--p0_dK1GAdA/edit?usp=sharing

Bug: 115477992
Test: atest FrameworksServicesTests
Change-Id: I87995cbd85085375ade685f29e986ba173f9693e
2018-09-26 09:25:01 +00:00
Wale Ogunwale
ee6eca1cf2 Introducing PendingIntentController (17/n)
Added PendingIntentController and centralize pending intent handling
in that class. Pending intents are used by activities and other components
like services and broadcasts. Since, activity handling is going to be moving
to the wm package, we need a way to access pending intents from both am and
wm packages. The PendingIntentController allows this to by not holding any
service level locks.

Bug: 80414790
Test: Existing tests pass.
Change-Id: I52f6f233b24e62839a85067556f3560dec27f0c7
2018-09-25 20:04:42 -07:00
Ian Lake
b1294597c6 Add pre and post callbacks to ActivityLifecycleCallbacks
For each lifecycle event exposed in
ActivityLifecycleCallbacks, an additional pair of
methods have been added to give developers a reliable
callback before and after each lifecycle event.

The existing callbacks cannot be used for this as they
are called as part of the super implementation and
therefore can run at any point in relation to the
other code in the Activity.

Test: manual
BUG: 116118635
Change-Id: If91f3f3248f9d7cf14aac2fe24ce14d92b8d05d3
2018-09-25 14:07:26 -07:00
Philip P. Moltmann
039678e13f Add PermissionManager exposing SPLIT_PERMISSIONS
The Permission Controller app (a mainline module) needs to be able to
read the SPLIT_PERMISSIONS. Hence this array needs to be exposed at
least as system-api. We need to make sure that the PackageParser,
PackageManager and Permission Controller app agree on which permissions
are split, hence it is best to define them at a single location.

I think exposing the split permissions to developers is useless and
potentially confusing. The app should never request a permission that
was split. The app should just behave as if split permissions do not
exist. The Permission Controller / Package Manager deal with the
split permissions and add them when needed. Hence I don't think we
should expose this data to 3rd parties.

Bug: 110953302
Test: requested permissions
Change-Id: I6951c52979c89ee5c13a4a14da125e1a01f2e234
2018-09-25 13:48:11 -07:00
Rafal Slawik
5c1263e1b3 Cleanup: make ProcessMemoryState fields final, reformat imports of ActivityMetricsLogger
Test: cleanup CL, existing tests pass
Change-Id: I6307ddf6d18530c908a5f92f9bc497f6f8b00e19
2018-09-25 09:09:54 +00:00
TreeHugger Robot
fd74da1573 Merge "Deprecate InputMethodManager#getInstance()" 2018-09-24 22:41:07 +00:00
Felipe Leme
bc75159db6 Merge "Fixed when the CompatibilityBridge is attached to an activity." into pi-dev
am: 45fda27211

Change-Id: I420b0392602e0889862c7d77e62b614e2c5617bf
2018-09-24 15:22:37 -07:00