Commit Graph

10204 Commits

Author SHA1 Message Date
Orion Hodson
1bd83da389 Merge "Add post fork hook for System Server" am: f2a342b3ab am: a58c2a07c1
am: 4bff3b4fb6

Change-Id: Ia97204dbf4aeaa97d08601aab6bd761cd5cfcea3
2018-10-31 08:19:45 -07:00
Orion Hodson
4bff3b4fb6 Merge "Add post fork hook for System Server" am: f2a342b3ab
am: a58c2a07c1

Change-Id: I15b3a4ee67b4f78a6903315358f8349f3bd4aa4a
2018-10-31 08:06:24 -07:00
Orion Hodson
46724e7370 Add post fork hook for System Server
Adds a post fork hook for System Server that is used to enable JIT.

Bug: 62356545
Bug: 66095511
Test: device boots, no permission errors
Change-Id: I963e8c4903fb20fd0b5a207fdc6746035b69c569
2018-10-31 06:32:13 +00:00
Junyu Lai
74d5f7f24a Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2 am: d62c2baa6d
am: cadfe44e05

Change-Id: I9d0d8b67ed0159ba2a71059620ebe5698eb79ccb
2018-10-30 19:56:01 -07:00
Junyu Lai
cadfe44e05 Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." am: 0d63da86e2
am: d62c2baa6d

Change-Id: I3ee791e4b6fdd9d508807810183dc02c69bd2c0b
2018-10-30 19:46:18 -07:00
junyulai
c33ac0d43b Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
2018-10-30 21:23:38 +08:00
Misha Wagner
566903ab47 Add class to read per-thread CPU usage from proc filesystem
Reads all thread CPU usage for the current process. This traverses
"/proc/self/task/*/time_in_state" to gather the thread ID and CPU usage
of each child thread. Process name, thread name, and UID are also read from
"/proc" for interpretable data.

Bug: 111534779
Test: Unit test in CpuThreadProcReaderTest

Change-Id: I6c71dde1dfcc9bbb87d95baf0886f9da7a782299
2018-10-30 10:48:27 +00:00
Olivier Gaillard
91559181e4 Merge "Update BinderCallsStats perf tests to use a more realistic workload." 2018-10-26 14:16:48 +00:00
TreeHugger Robot
0e93685da4 Merge "Update BinderCallsStats to use the worksource." 2018-10-26 11:21:31 +00:00
TreeHugger Robot
4807b6b226 Merge "Fix 2 graphical issues for drag resizing." 2018-10-26 08:41:35 +00:00
Olivier Gaillard
88de48f78e Update BinderCallsStats to use the worksource.
We update UidEntry to use the worksource when it is set.

Test: unit test
Change-Id: I7ddfcfcd87de21e6e0ded94a943ae71f1980a5ce
2018-10-26 08:08:28 +00:00
TreeHugger Robot
b99853ce3a Merge "Allow all system configs in /product_services" 2018-10-26 05:46:36 +00:00
Hans Boehm
c18cd05c6f Merge "Remove NotificationVisibility storage pool" am: 24141e8124 am: cd2a7fb3b6
am: 8e96fe2c7f

Change-Id: I48d179b2e44b55541a5fe7b89d2daa1f7eeb5dd4
2018-10-25 17:51:50 -07:00
Garfield Tan
fbd8ea649f Fix 2 graphical issues for drag resizing.
1. There used to be double offset from the origin.

This is because we used to (in NYC) make the surface position to display
origin and draw content with a offset in the surface. However we lately
let the surface position be inherited from task surface position, so
there will be an offset from surface position and an offset from drawing
content in that surface.

To fix the bug I removed the offset in drawing content. That offset is
provided by WindowState#getBackdropFrame() so it just solved the issue
by moving frame to the origin.

2. Window quickly jumps when user starts drag resizing a window.

The reason is out of synchronization between surface insets change and
graphical buffer update. When user is drag resizing, we suppress window
shadow to save some graphical resources, which will consequently change
surface insets. Change in surface insets will cause the surface being
repositioned to reflect the new surface insets because window frame
doesn't change. However the content is still drawn at old location with
old surface insets for the first a few frames, so the content jumps to a
wrong location for a split second. This also happens when users stop
drag resizing.

I kept the old surface insets when user is resizing so there won't be
surface reposition at the beginning and end of drag resizing, but still
suppress the shadow by adjusting the elevation of DecorView.

Also fixed a synchronization issue we found in BackdropFrameRenderer,
and cleaned up code in it.

Bug: 113254346
Test: Manual tests show drag resizing for both freeform and split screen
works.
Change-Id: I42349f88f14af35fac7c65e784462b5f2e1a71c7
2018-10-25 11:24:35 -07:00
Olivier Gaillard
8a3e20a76c Update BinderCallsStats perf tests to use a more realistic workload.
Test: this is a test
Change-Id: I6dc7151c3df2a1e488db7d1b703ca29049b2e01a
2018-10-25 16:46:59 +01:00
Hung-ying Tyan
01ab87764e Allow all system configs in /product_services
Bug: 110072687
Test: build pass

Change-Id: I5629d8b984eeb2f9f6c80c931231de6ed35fe707
2018-10-25 10:11:12 +00:00
Nathan Harold
41e2d7494f Merge "Move some members to the "Q blacklist"." am: f5cf9f24ed
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e
2018-10-24 16:14:06 -07:00
Hans Boehm
8e96fe2c7f Merge "Remove NotificationVisibility storage pool" am: 24141e8124
am: cd2a7fb3b6

Change-Id: Ice97927d55a7c6bf867bcb136bf661243b572c19
2018-10-24 15:19:58 -07:00
Lucas Dupin
f84fa0052e Make pattern animation a little faster
Test: visual
Bug: 74259090
Change-Id: I49bb13621542c9dae015c76320cb2d1d2cde5e7e
2018-10-24 22:04:01 +00:00
TreeHugger Robot
2a7854addd Merge "Add collection start time to LooperStats dumpsys output" 2018-10-24 12:14:29 +00:00
Michael Dooley
0bf1666c51 Merge changes from topic "getmodelstate-redo"
* changes:
  Rolling forward with indentation fix.
  Revert "Revert "Adding getModelState API to sound trigger""
2018-10-24 06:04:42 +00:00
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
John Reck
8884cfc13e Merge "Rename & package shuffle" 2018-10-23 20:02:00 +00:00
Michael Dooley
291751e510 Revert "Revert "Adding getModelState API to sound trigger""
This reverts commit 81f71f1c27.

Reason for revert: rolling forward with fix

Change-Id: Ifc0c53581ac567cb968d91993f453220f8253aec
2018-10-23 07:44:51 +02:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
Yohei Yukawa
530dd76fde Remove IInputMethodSession#finishInput(), which is called nowhere
Currently IInputMethodSession#finishInput() is called nowhere.

Let's remove this IPC method exposed from InputMethodService to IME
client for now until we fully understand what is the right approach on
how and when InputMethodService#finishInput() should be called.

Note that we cannot simply remove InputMethodSession#finishInput()
because it is already published as a public API.  In Bug 9216494
hopefully we can also discuss whether InputMethodSession#finishInput()
should be deprecated or can be reused for some actual use cases.

Bug: 9216494
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I9e378111c9df40cb6821583d1e6ae8f9fe38f2b1
2018-10-22 15:05:47 -07:00
Hans Boehm
24141e8124 Merge "Remove NotificationVisibility storage pool" 2018-10-22 20:20:38 +00:00
Yohei Yukawa
b7526456ce Remove redundant prefix from UnbindReason
This is the last step to split InputMethodClient into multiple
classes.

Now that all the integer constants for UnbindReason are defined inside
UnbindReason, "UNBIND_REASON_" prefix is just redundant.

This is a mechanical refactoring. There should be no user-visible
behavior change.

Fix: 118040692
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/java/com/android/internal/inputmethod/UnbindReason.java
Change-Id: Iafce68b614dd85392d06af8726525a18b014dba0
2018-10-21 20:15:17 -07:00
Yohei Yukawa
499e3f764e Extract UnbindReason from InputMethodClient
This is another step to split InputMethodClient into multiple classes.

With this CL, InputMethodClient is completely removed.

This is a mechanical refactoring. There should be no user-visible
behavior change.

Bug: 118040692
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/java/com/android/internal/inputmethod/UnbindReason.java
Change-Id: I3b96a351413025338776f6c87cbaa8cf28c3a44f
2018-10-21 20:15:11 -07:00
Yohei Yukawa
4219422bb3 Remove redundant prefix from StartInputReason
This is another step to split InputMethodClient into multiple classes.

Now that all the integer constants for StartInputReason are defined
inside StartInputReason, "START_INPUT_REASON_" prefix is just
redundant.

This is a mechanical refactoring. There should be no user-visible
behavior change.

Bug: 118040692
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/java/com/android/internal/inputmethod/StartInputReason.java
Change-Id: Ic2476c3d588211e6c61180cde7df4c6b79039ede
2018-10-21 20:14:40 -07:00
Yohei Yukawa
c6632df9e7 Extract StartInputReason from InputMethodClient
This is another step to split InputMethodClient into multiple classes.

With this CL, StartInputReason will be extracted from
InputMethodClient.java into a dedicated file.

This is a mechanical refactoring. There should be no user-visible
behavior change.

Bug: 118040692
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/java/com/android/internal/inputmethod/StartInputReason.java
Change-Id: I0cc2588c97239a004720f74cbf356bda4c735d53
2018-10-21 11:47:16 -07:00
Yohei Yukawa
a468d70e5f Move some methods from InputMethodClient to InputMethodDebug
This is the first step to split InputMethodClient into multiple
classes.

With this CL, utility methods to convert integer constants to String
messages will be moved from InputMethodClient to InputMethodDebug,
which I believe is a bit more descriptive class name than
InputMethodClient.

This is a mechanical refactoring. There should be no user-visible
behavior change.

Bug: 118040692
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/java/com/android/internal/inputmethod/InputMethodDebug.java
Change-Id: I83f4795e95bc2e8ae325ad6e28d3a42317414e8d
2018-10-21 11:42:34 -07:00
Hans Boehm
2aa911c01e Remove NotificationVisibility storage pool
Based on recent measurements, storage pools of small objects are
generally not useful.

We ran into this because growing ArrayDeques are potentially very
unfriendly towards a generational GC, and racing recycle calls
can cause it it grow beyond MAX_POOL_SIZE. This isn't a big deal,
but there's no reason we should even be thinking about it.

Test: Build and boot AOSP

Change-Id: Icbda95e472e206c54f141129cc36ddc6d163b095
2018-10-19 18:35:29 -07:00
zhouwenjie
89a47cf154 Trim whitespace in kernel wakelock name.
Bug: 117991062
Test: Manual tested with an emulator
Change-Id: Ic80a302afc2327ecad048537af8ca5b7d5329f72
2018-10-19 21:33:06 +00:00
Marcin Oczeretko
d464bcf582 Add collection start time to LooperStats dumpsys output
Test: called adb shell cmd looper_stats dump
Bug: 113651685
Change-Id: Iccd224b1b50a9ba31a9de254f251fac26fee2171
2018-10-19 10:46:21 +01:00
Dan Sandler
134e4b284b resolve merge conflicts of aad998c0b4 to pi-dev-plus-aosp
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Icf172daeb848f746c81acd25a4406decc00ed875
Merged-In: Ib32dafbd3c6fcbe11186dc8ecab6b09c9b734067
2018-10-18 13:44:22 +00:00
Steve Elliott
730d1d5cd3 DO NOT MERGE: Add configurable default setting for assistant componentname
By requiring an explicit default setting, it eliminates all ambiguous
states where a disambiguation would normally be shown. With this
change in place, at no point should a disambiguation be shown.

Test: manual
Bug: 111603898
Change-Id: Ib32dafbd3c6fcbe11186dc8ecab6b09c9b734067
2018-10-17 17:46:28 +00:00
Yohei Yukawa
e48d0ae661 Remove IInputMethodManager#finishInput(), which is NOP
Currently InputMethodManagerService#finishInput() does nothing. Until
we fully understand what is the right approach on how and when
InputMethodService#finishInput() (Bug 9216494), let's remove this
unnecessary IPC from the IME client to InputMethodManagerService.

Bug: 9216494
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Change-Id: I614050d20f4a7d9611dc0502e55e6ca3458a836e
2018-10-17 16:14:34 +08:00
Steve Elliott
5269abcf95 Merge "Add configurable default setting for assistant componentname" 2018-10-16 21:05:23 +00:00
TreeHugger Robot
1728c04cae Merge "Instantiate InputMethodManager for each display (2nd try)" 2018-10-16 08:02:49 +00:00
TreeHugger Robot
02f2a315d7 Merge "Add Context.getDisplayId() to avoid possible IPC" 2018-10-16 00:20:52 +00:00
TreeHugger Robot
bc9ebba7e5 Merge "Suspending app can customize intercepting dialog" 2018-10-15 21:51:52 +00:00
Steve Elliott
433c83dc81 Add configurable default setting for assistant componentname
By requiring an explicit default setting, it eliminates all ambiguous
states where a disambiguation would normally be shown. With this
change in place, at no point should a disambiguation be shown.

Test: manual
Bug: 111603898
Change-Id: Ib32dafbd3c6fcbe11186dc8ecab6b09c9b734067
2018-10-15 15:30:58 -04:00
Yohei Yukawa
4052a10f29 Instantiate InputMethodManager for each display (2nd try)
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.

Also to make sure that the performance regression (Bug 117434607) we
observed after my initial attempt [3] no longer exists, here are the
benchmark results with and without this CL.

  testExpandNotificationsLatency on taimen-userdebug
    without this CL:
      results=[55, 46, 61, 67, 50, 48, 57, 50, 55, 63]
      min:46.0, max:67.0, avg:55.2, median:55.0, std_dev:6.539
    with this CL:
      results=[45, 55, 58, 57, 47, 60, 59, 60, 56, 53]
      min:45.0, max:60.0, avg:55.0, median:56.5, std_dev:4.980

 [1]: I776cabaeaf41ff4240f504fb1430d3e40892023d
      1e5b10a217
 [2]: I8da315936caebdc8b2c16cff4e24192c06743251
      90120a8b5b
 [3]: I7242e765426353672823fcc8277f20ac361930d7
      c53d78e992

Bug: 111364446
Fix: 115893206
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Test: No perf regression in LatencyTests#testExpandNotificationsLatency()
Change-Id: I78ad7cccb9586474c83f7e2f90c0bcabb221c47b
2018-10-15 15:35:55 +08:00
Yohei Yukawa
5281b6b4c0 Add Context.getDisplayId() to avoid possible IPC
ContextImpl has an internal rule that when ContextImpl#mDisplay is
null the Context is associated with the default display.  The problem
is that, as discussed in Bug 117709581, when ContextImpl#mDisplay is
null ContextImpl#getDisplay() tries to get some non-null Display
object by making an IPC to the system server, which is redundant when
the display ID is the only thing that the caller wants to know.

By having an @hide method Context.getDisplayId(), we can ensure that
display ID can be obtained without any IPC.  This enables us to
re-submit my CL [1] that aimed to instantiate InputMethodManager (IMM)
for each display but then got reverted due to a performance regression
(Bug 117434607).

There should be no developer-observable behavior change.

 [1]: I7242e765426353672823fcc8277f20ac361930d7
      c53d78e992

Fix: 117712745
Test: atest FrameworksCoreTests:android.content.ContextTest
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/tests/coretests/src/android/content/ContextTest.java
Change-Id: I2534530a5ce90e2620c5039d793a6454a0a1e154
2018-10-15 07:38:25 +08:00
Tobias Thierer
0d0dd506ac Merge "Remove unused imports of libcore.io.Libcore." am: 2a520365da am: abe7a32c67
am: 320e38309b

Change-Id: I2f8069235c4e8c298b0e092928a23d15cbe30520
2018-10-12 19:24:25 -07:00
Tobias Thierer
320e38309b Merge "Remove unused imports of libcore.io.Libcore." am: 2a520365da
am: abe7a32c67

Change-Id: I57d7d317f5827a54346e287db3f6f2d625e0aebc
2018-10-12 19:13:38 -07:00
Tobias Thierer
abe7a32c67 Merge "Remove unused imports of libcore.io.Libcore."
am: 2a520365da

Change-Id: I79c4679d483e0e8ea2e434237bd61d75f129da0f
2018-10-12 18:59:21 -07:00
Treehugger Robot
2a520365da Merge "Remove unused imports of libcore.io.Libcore." 2018-10-13 00:47:45 +00:00
Suprabh Shukla
389cb6f54a Suspending app can customize intercepting dialog
The suspending app has more context about why a particular app was
suspended by the user, but we do not want to delegate the interception
of the suspended activity out of the system.
Hence allowing it further customizations to the dialog to make
it clearer.

Test: atest com.android.server.pm.SuspendDialogInfoTest \
com.android.server.pm.SuspendPackagesTest \
com.android.server.pm.PackageUserStateTest \
com.android.server.pm.PackageManagerSettingsTests \
com.android.server.am.ActivityStartInterceptorTest

atest GtsSuspendAppsPermissionTestCases GtsSuspendAppsTestCases

Bug: 112486945
Bug: 113150060
Change-Id: If9f4d14587a2b75bb572e7984a90e300a2c72d16
2018-10-12 16:02:53 -07:00