Commit Graph

10385 Commits

Author SHA1 Message Date
TreeHugger Robot
998b52ba83 Merge "Introduce multi-client IME for special form factors" 2018-11-13 03:43:48 +00:00
Yohei Yukawa
bae5bea23c Introduce multi-client IME for special form factors
An advanced multi-display support is requested for certain Android
form-factors so that user(s) can type text on each display at the same
time without losing software keyboard focus in other displays. This is
not possible in existing Android IMEs that are built on top of
InputMethodService class, because the assumption that a single IME
client can be focused at the same time was made before Android IME
APIs were introduced in Android 1.5 and many public APIs in
InputMethodService have already relied heavily on that
assumption. Updating InputMethodService class to support multi-client
scenario is, however, quite challenging because:

 1. doing so would introduce an unacceptable amount of complexity into
    InputMethodService, which is already hard to maintain,

 2. IME developers still need to update their implementation to be
    able to support parallel requests from multiple focused IME
    client, which may require non-trivial redesign in their side
    (e.g. input decoder, typing history database, ...), and

 3. actual use cases for multi IME clients are expected to be evolved
    rapidly hence the new protocol is not yet stable and not yet ready
    to be exposed as public APIs.

This is why a new type of IME needs to be designed and developed
specifically for such special multi-display environments, rather than
reusing existing InputMethodService public class.

Note that there must be no behavior change unless multi-client IME is
explicitly enabled with 'adb shell setprop', which requires root
permission.

See multi-client-ime.md for details.

Fix: 114662040
Test: Manually verified as follows:
  1. make -j MultiClientInputMethod
  2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
  3. adb root
  4. adb shell setprop persist.debug.multi_client_ime \
       com.example.android.multiclientinputmethod/.MultiClientInputMethod
  5. adb reboot
  6. Try multiple text input scenario
Change-Id: I41dfe854557b178d8af740bc2869c936fc88608b
2018-11-12 15:20:20 -08:00
Mike Ma
64fdbf5ff7 Merge "An efficient proc file reader" 2018-11-12 22:51:38 +00:00
Michael Dooley
4d75ccd328 Merge "Converting sound trigger v2.2 getModelState to be asynchronous" 2018-11-12 19:27:39 +00:00
Alison Cichowlas
69f39989c2 Merge changes from topic "sharesheet-refactor"
* changes:
  Add URI shared by screenshot into extras.
  Re-patching in Sharesheet security model changes.
2018-11-12 15:19:11 +00:00
Misha Wagner
78b0211117 Merge "Reduce amount of logging on failed proc file reading" 2018-11-12 11:20:33 +00:00
Adam He
84d49aa8c8 Merge "Added 7th argument to pooled lambdas" 2018-11-09 23:56:03 +00:00
Mike Ma
fa2534351f An efficient proc file reader
A less resource hogging reader for reading proc files in string
format. It is singleton and thread-safe, so all downstream clients
share the same instance to avoid duplicate allocation. It reads
the entire proc file all at once (to mimimize the impact to the
kernel) into a reusable char[] buffer (to prevent frequent GC). A
read lock is automatically held for the client when a valid file
iterator is returned. Client MUST call close() to unlock it or take
advantage of try-with-resources.

The reader keeps an error counter. It rejects further requests if it
has accumulated 5 errors, to prevent log spam. The reader also has
a 500ms cache, which can be bypassed with a parameter.

Bug: 111216804
Test: atest FrameworksCoreTests:com.android.internal.os.KernelCpuProcStringReaderTest
Change-Id: Ifa5213a5c7baf95d62f74486815030d9aa54ca28
2018-11-09 11:21:23 -08:00
Alison Cichowlas
3e34050a42 Re-patching in Sharesheet security model changes.
Previously reverted due to b/72554856, fix for that in topic.

Original commit message:

Security model for moving sharesheet to systemui

ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: Ia50e21e2f8c6b6d0ed7207625e3b5aef214396bb
2018-11-09 11:01:54 -05:00
mike dooley
b2ab04aefd Converting sound trigger v2.2 getModelState to be asynchronous
Test: built android with checkbuild flag

Change-Id: I4c6f2388c93b6e577113fc7f2cd19242628ee50f
Bug-Id: 70206501
2018-11-09 08:36:15 +01:00
Adam He
c4f03f3a94 Added 7th argument to pooled lambdas
Bug: 118681526
Test: atest CtsAutoFillServiceTestCases
Change-Id: I972e2f4114f3f7c2dd31de3169e0c8216af09892
2018-11-08 10:33:44 -08:00
Jorim Jaggi
05ac00c630 Merge changes from topic "windowinsets-api"
* changes:
  WindowInsets: Annotate nullability
  WindowInsets: Add Builder
  WindowInsets: reimplement WindowInsets on top of Insets
  WindowInsets: make WindowInsets.inset() public
2018-11-07 16:35:06 +00:00
Misha Wagner
cf7a07d0f4 Reduce amount of logging on failed proc file reading
We expect some proc file reading to fail when processes or threads
finish execution while we traverse their proc files. We should not
pollute logs when this traversal fails.

Test: Inspected `adb logcat`
Change-Id: Id811a1e6b5084a8a3a903a892a99e317d1e3ac7f
2018-11-07 12:42:13 +00:00
TreeHugger Robot
8f126e98b7 Merge "Make pattern fade slower" 2018-11-06 06:10:52 +00:00
TreeHugger Robot
891aa9edc9 Merge "Fix "Tracking association..." logspam." 2018-11-06 03:15:27 +00:00
Lucas Dupin
31c0022caa Make pattern fade slower
We went a little too far...

Bug: 74259090
Test: visual
Change-Id: Icdc05a445ecf79689b47bde829bc02164469f370
2018-11-05 18:13:54 -08:00
Makoto Onuki
3a8e5c50bc Fix "Tracking association..." logspam.
In the previous code, updateTrackingAssociationsLocked() was called too early.
There's still code that changes procstates, so let's move
updateTrackingAssociationsLocked() to the end of updateOomAdjLocked().

Also change Slog.w() to Slog.wtf() so we can monitor it on APR.

Also rate limit the WTF to at most one in ten seconds.

Bug: 118826162
Test: Boot with and without the fix and make sure the number of the warnings
reduces.
(We still have a couple WTFs from during a boot with this CL, which requires
further investigation.)

Change-Id: Ifa1fe85de82fa1d1d8f843372c54c1248966a62a
2018-11-05 16:01:09 -08:00
Junyu Lai
e914f1e453 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117 am: 7a782be65d
am: 556ae82025

Change-Id: I50ef791009b0e9301ba10d8e52c3fd6c15e6b938
2018-11-04 21:05:47 -08:00
Junyu Lai
556ae82025 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117
am: 7a782be65d

Change-Id: Ic1b35f2b02dc60e301d39e89008617b341194382
2018-11-04 20:54:14 -08:00
Junyu Lai
89eb3e6117 Merge "Extend onDnsEvent callback to report more fields." 2018-11-05 04:29:47 +00:00
Svetoslav Ganov
79eba743ca Merge "Historical app op APIs - initial check in." 2018-11-03 04:49:45 +00:00
TreeHugger Robot
36a8b7dda0 Merge "System Alerts show follow dark theme" 2018-11-02 22:32:39 +00:00
Svet Ganov
ad0a49bc42 Historical app op APIs - initial check in.
This change adds new APIs for querying historical app ops
for a time period in the past. Since app ops are performed
quite often in some cases keeping track of every app op is
prohibitively inefficient. Therefore, we are exposing
aggregated counts for past ops.

Test: atest android.permission.cts.AppOpsTest

bug:111061782

Change-Id: I59bbf906d62cd6dcd751f2e8089242dcecd55a6c
2018-11-02 13:00:07 -07:00
TreeHugger Robot
c0f94f4189 Merge "Grant split permission from config" 2018-11-02 01:10:46 +00:00
Kevin Chyn
838df2502f Merge "Update LockPatternUtils for consistency" 2018-11-02 00:37:24 +00:00
Beth Thibodeau
5898ac47b2 Adding screen recording function.
Screen recording can be launched via long press on screenshot in
the global actions menu if the local feature flag is enabled.
Otherwise, long press on screenshot will also trigger a screenshot.

Demo videos: https://drive.google.com/open?id=1oJzfzJb8aGXSUqn4CZ_Yn7qWmJ2dvRd5

Test: manual
Change-Id: I373d38ad86291ff6f26f7dca3195001bd8f5ee16
Bug: 111395687
Bug: 118826991
2018-11-01 15:56:39 -04:00
Zimuzo
cc2932fd81 Grant split permission from config
Instead of defining split permissions in Java file, we now move them to XML allowing us define vendor specific split permissions.

Test: Activity recognition is split correctly and auto granted when below split targetSdk.
Bug: 111411340
Change-Id: Ia5b3f47b73c9feea924373268a4eee142f555091
2018-11-01 16:08:27 +00:00
TreeHugger Robot
1b11fcc9c9 Merge "Extract IMM internal flags into StartInputFlags" 2018-11-01 09:09:15 +00:00
Yohei Yukawa
35fa6d581e Extract IMM internal flags into StartInputFlags
This is a mechanical refactoring like we did to split
InputMethodClient for Bug 118040692.

So-called "controlFlags" in InputMethodManager (IMM) was originally
introduced for IMM#startInput()/windowGainedFocus() [1] to carry
additional client information then reused when we unify startInput()
and windowGainedFocus() into startInputOrWindowGainedFocus() [2].

This CL mechanically moves the location where those flags are defined,
from InputMethodManager.java to a newly created file
StartInputFlags.java.

This is still just a mechanical refacotring / renaming.  There should
be no user-visible behavior change.

 [1]: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
      7663d80f6b
 [2]: I56934f18e30d90fcdf77bcbb0c35a92a5feb1b82
      05c25f8a3a

Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodDebugTest
Change-Id: If5a4810dece852edcff0d1119463711249bb7ef2
2018-10-31 22:56:41 -07:00
TreeHugger Robot
dd7ea7069d Merge "Use StringJoiner in InputMethodDebug" 2018-11-01 05:48:05 +00:00
Yohei Yukawa
5e46a66c6d Use StringJoiner in InputMethodDebug
This is a follow up CL to my previous CL [1], which added
InputMethodDebug#softInputModeToString().

It turns out that there is already a nice utility class
java.util.StringJoiner that can deal with delimiter when joining
multiple string tokens.

This CL also adds some simple unit tests for InputMethodDebug.

 [1]: I83f4795e95bc2e8ae325ad6e28d3a42317414e8d
      a468d70e5f

Bug: 118040692
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodDebugTest
Change-Id: I55fcdecee108b3e56bf7fd480d6f71de580dcbf6
2018-10-31 14:45:52 -07:00
Lucas Dupin
250c61c860 System Alerts show follow dark theme
Test: visual
Change-Id: I2a70b16e6e5e524f0e343fbf72b322c3b3a79383
Fixes: 117979139
2018-10-31 09:49:31 -07:00
Misha Wagner
7b1bb62f25 Merge "Add unit tests for ProcStatsUtil and ProcTimeInStateReader" 2018-10-31 16:20:23 +00:00
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
junyulai
4c2d2d5461 Extend onDnsEvent callback to report more fields.
When native layer reports onDnsEvent, netId, eventType and
returnCode are available only in NetdEventListenerService, but
not for the clients who register event on it.

Thus, extend the callback to give clients more detail on the
network the look up was performed on and the result of the
lookup.

Bug: 113916551
Test: 1. runtest frameworks-net
      2. runtest frameworks-services -c com.android.server. \
         net.watchlist.NetworkWatchlistServiceTests
Change-Id: If7beecea50e1baf18cb5c6775ad3ecb1a60b312a
2018-10-31 21:22:45 +08: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
Adrian Roos
60f59298c7 WindowInsets: reimplement WindowInsets on top of Insets
Bug: 111829774
Test: atest WindowInsetsTest
Change-Id: Ic01c6cd46981af2e457c740c35b17c8cc9c8d25a
2018-10-30 19:09:03 +01:00
Misha Wagner
f268f1bda3 Add unit tests for ProcStatsUtil and ProcTimeInStateReader
Test: This is a test

Change-Id: I5d3b7150414572c7ffcdc891a13234ed2cf3e0e7
2018-10-30 15:34:07 +00: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
Kevin Chyn
b17d409095 Update LockPatternUtils for consistency
Bug: 111461540

Test: builds
Change-Id: I2413b6d3c4c9d39d1039336b1f2546fafaddeaa7
2018-10-29 15:53:39 -07: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