Commit Graph

86751 Commits

Author SHA1 Message Date
TreeHugger Robot
316902da9b Merge "Add get/setExtras to TextClassification" 2018-10-31 12:24:30 +00:00
Tony Mak
1bae53ccc7 Merge "Introduce TextClassifier.suggestConversationActions" 2018-10-31 11:46:36 +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
Junyu Lai
0d63da86e2 Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on." 2018-10-31 02:20:57 +00:00
Michael Wachenschwanz
6b5d06fe4d Merge changes from topic "UsageSessionTimers"
* changes:
  Add SystemApi for registering Usage Session Observers in UsageStats
  Refactor AppTimeLimitController for Session Observers
2018-10-31 00:35:39 +00:00
Eugene Susla
f4bebfea9f Merge "Adjust default app op behavior based on feature state" 2018-10-30 22:11:24 +00:00
sqian
bf916cd022 Merge "Change package to component for Setting's default call redirection service" am: f67ece13ad am: a6bf55bcc6
am: 5cfa939ba0

Change-Id: Ic799f4b0e42aad5f9446478a1954555b9afbc689
2018-10-30 13:25:37 -07:00
sqian
5cfa939ba0 Merge "Change package to component for Setting's default call redirection service" am: f67ece13ad
am: a6bf55bcc6

Change-Id: Ia1d7455d2663c2942dfb298e9222e6c2b8d98529
2018-10-30 13:10:46 -07:00
Phil Weaver
1b4ea3a11a Merge "Make performAccessibilityShortcut a SystemAPI" 2018-10-30 20:05:28 +00:00
Treehugger Robot
f67ece13ad Merge "Change package to component for Setting's default call redirection service" 2018-10-30 19:06:55 +00:00
Tony Mak
d6f3fb46c6 Add get/setExtras to TextClassification
Test: TextClassificationTest / TextClassifierValueObjectsTest

BUG: 118690735

Change-Id: I19dba3a3f6c1b14a871b33b9ffb94e0f4de58ac2
2018-10-30 18:38:50 +00:00
Haoyu Zhang
9b74c07517 Merge "Fix getLineRight()/getLineLeft() may compute leadingMargin twice" 2018-10-30 18:16:44 +00:00
Phil Weaver
27beee50d3 Make performAccessibilityShortcut a SystemAPI
Also create a new MANAGE_ACCESSIBILITY permission to
perform the shortcut.

Bug: 116118615
Test: make, activate accessibility shortcut
Change-Id: Ic65a0cdf7393429e14cb98f4fb0734d20069b05a
2018-10-30 10:10:41 -07:00
Jon Boekenoogen
adb49c0031 Merge "Fix ClassCastException in 2nd phase resolution." 2018-10-30 17:08:42 +00:00
Jeff Sharkey
b8affbd14f Merge "Converge towards consistent modes API." 2018-10-30 16:56:35 +00:00
Tony Mak
c9d31e2752 Introduce TextClassifier.suggestConversationActions
Example usage:
// App side
ConversationAction.TypeConfig typeConfig =
            new ConversationAction.TypeConfig.Builder().setIncludedTypes(
                    Collections.singletonList(ConversationAction.TYPE_TEXT_REPLY)).build();
ConversationAction.Message message =
        ConversationAction.Message.Builder().setText("How are you?").build();
ConversationAction.Request request =
        new ConversationAction.Request.Builder(
                Collections.singletonList(message), HINT_FOR_IN_APP)
                .setTypeConfig(typeConfig)
                .build();
List<ConversationAction> conversationActions =
        textClassifier.suggestConversationActions(request).getConversationActions();
for (ConversationAction conversationAction : conversationActions) {
    // 1. Use the RemoteAction directly (if available)
    RemoteAction actions= conversationAction.getActions();

    // 2. Use the parsed action types and entities.
    String type = conversationAction.getType();
    ConversationAction.Entities entities = conversationAction.getEntities();
}

// In the TextClassificationService side:
ConversationAction.Entities entities = new ConversationAction.Entities.Builder().setReplies(Arrays.asList("I am good.", ":(", ":)")).build();

ConversationAction conversationAction = new ConversationAction.Builder(
        ConversationAction.TYPE_TEXT_REPLY).setEntities(entities).build();

BUG: 111437455
BUG: 111406942

Test: atest cts/tests/tests/view/src/android/view/textclassifier/cts/*cts/tests/tests/view/src/android/view/textclassifier/cts/TextClassificationManagerTest.java
Test: cts/tests/tests/view/src/android/view/textclassifier/cts/ConversationActionsTest.java

Change-Id: Ie8639f93f88336ecdfda602ce14cd8ca578c092a
2018-10-30 14:50:28 +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
Olivier Gaillard
78ecd34d29 Merge changes I02e88c93,Id0a2f52c
* changes:
  Use the BinderProxy#TransactListener to propagate the UID.
  Adds a mechanism to listen to proxy transact method calls.
2018-10-30 10:27:23 +00:00
TreeHugger Robot
64f878e0a9 Merge "Add RoleManager into the system." 2018-10-30 10:03:39 +00:00
TreeHugger Robot
120754b2fa Merge "Default enable EMERGENCY_DIAL_SHORTCUTS feature" 2018-10-30 06:59:27 +00:00
weichinweng
53df942469 Merge "Add CACHED_NAME into call history database when the add call." am: 568faa8ed9 am: 66d504697d
am: aec23b71d6

Change-Id: I7abbb2504d5e228e537ef7562b561674258c7017
2018-10-29 22:56:42 -07:00
weichinweng
aec23b71d6 Merge "Add CACHED_NAME into call history database when the add call." am: 568faa8ed9
am: 66d504697d

Change-Id: Iff5bc13cca9b35c311e05fa71b359702a4f9f556
2018-10-29 22:45:54 -07:00
Treehugger Robot
568faa8ed9 Merge "Add CACHED_NAME into call history database when the add call." 2018-10-30 04:44:35 +00:00
Tony Zhu
a51294bc9e Merge "[Call Screening]Default call screening app setting storage." am: 371786f6b0 am: 56b75cb498
am: 5b3b0ea44b

Change-Id: I32d514581e8fa9403d8412d2cd23fef41860d075
2018-10-29 20:54:24 -07:00
Tony Zhu
5b3b0ea44b Merge "[Call Screening]Default call screening app setting storage." am: 371786f6b0
am: 56b75cb498

Change-Id: I98ac08b917aef63202b006b7440bee4c75ff665f
2018-10-29 20:45:18 -07:00
yuanjiahsu
8d09dd4285 Default enable EMERGENCY_DIAL_SHORTCUTS feature
Set feature flag default value to be true so that this feature will be
enabled by default.

Test: Manually
Bug: 113539598
Change-Id: I3caec4f437a5c574763215a31efd0df1be40ab6e
2018-10-30 11:31:04 +08:00
sqian
28f8a2545d Change package to component for Setting's default call redirection service
Bug: 64959558
Test: Compile
Change-Id: I503b34812869e2b5897033ca765c85fcd4474101
2018-10-29 19:54:13 -07:00
Tony Zhu
371786f6b0 Merge "[Call Screening]Default call screening app setting storage." 2018-10-30 02:43:52 +00:00
Jeff Sharkey
92e9caf7ef Converge towards consistent modes API.
Bug: 111268862
Test: manual
Change-Id: I52e015685cfb424c15fd0266d9f19fd3bfdab971
2018-10-29 18:35:32 -06:00
Jeff Sharkey
00e3e1b203 Merge "Force apps to request permissions for teamfooding." 2018-10-30 00:19:57 +00:00
TreeHugger Robot
07e23a0e52 Merge "Remove obsolete lock screen UI" 2018-10-29 23:55:31 +00:00
Michael Wachenschwanz
641e338f8d Add SystemApi for registering Usage Session Observers in UsageStats
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java#testAppUsageObserver
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermission
Bug: 111465038
Change-Id: I70a7a5729117f8e9651a2e4ea732156537d2f3c1
2018-10-29 16:21:35 -07:00
Michael Wachenschwanz
0f47284af3 Refactor AppTimeLimitController for Session Observers
Introducing the concept of Usage Session Observers to UsageStats. A
session observer monitors usage within individual "continuous" sessions
(brief gaps of non usage may be allowed in a session and still be
considered continuous)

The new session observer in AppTimeLimitController are both similar and
different enough from the current app usage observer to warrant
refactoring TimeLimitGroup into an OOP friendly abstract base class.

Added some Observer App handling to avoid clash between registered
observers from multiple apps.

Reworded packages to observed and usage entities to accomodate future
changes, where usage may come from more than just app usage.

Reworded moveToForeground/Background to generic usage and allow multiple
usage entities to be active at the same time to accomodate future
changes, where more than just the foreground app can be considered used.

Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Bug: 111465038
Change-Id: I63aebf8b0aa5516111bd6d5e142525d0bee6ef58
2018-10-29 16:21:24 -07:00
TreeHugger Robot
fd10da4597 Merge "More robust display ID mismatch detection in IMM" 2018-10-29 23:20:23 +00:00
Jon Boekenoogen
2cd92e9768 Fix ClassCastException in 2nd phase resolution.
This has been broken since the original Oreo implementation was added
https://android.googlesource.com/platform/frameworks/base/+/android-8.0.0_r1/core/java/android/app/InstantAppResolverService.java#118

Bug: 118635643
Test: Manual build and run locally.
Change-Id: Ie3f2ca2d0baf4ebcedbf75753cc2cdbcfa4b3e1b
2018-10-29 15:21:31 -07:00
Joseph Johnson
367d14a1b5 Merge "Make LAST_SETUP_SHOWN a SystemApi" 2018-10-29 22:03:54 +00:00
TreeHugger Robot
675a74bffc Merge "Add a feature flag for new version of Network and internet settings page" 2018-10-29 22:02:13 +00:00
TreeHugger Robot
7cc7662d6f Merge "Reuse overlay view between two Visibility transitions" 2018-10-29 21:28:04 +00:00
TreeHugger Robot
2f9e50d95b Merge "fix spelling typo in comment" 2018-10-29 21:08:01 +00:00
Jeff Sharkey
669e6b1178 Force apps to request permissions for teamfooding.
To support teamfooding of the new storage privacy features coming
in Q, we need apps to request new AUDIO/VIDEO/IMAGES permissions, but
most of those apps are prebuilts that won't land updates until
several months in the future.

So add system properties so teamfooders can "force" apps to request
these permissions, making them work on Q builds.  Only takes effect
when isolated feature is enabled, and guarded with STOPSHIP to ensure
we remove it.

Here's a typical set of commands to use with this CL:

    adb shell setprop persist.fw.force_legacy 1
    - or -
    adb shell setprop persist.fw.force_audio com.google.android.music
    adb shell setprop persist.fw.force_video com.google.android.apps.photos
    adb shell setprop persist.fw.force_images com.google.android.apps.photos,com.google.android.apps.messaging
    - then -
    adb shell setprop persist.sys.isolated_storage 1
    adb reboot

Bug: 118504670
Test: manual
Change-Id: I631819648334994255256b6046bb4c8aec07ce3a
2018-10-29 15:03:28 -06:00
TreeHugger Robot
84f970c840 Merge "Moved LayoutInflater#mContext to dark grey list" 2018-10-29 19:51:48 +00:00
Zhi An Ng
1c866f4f5a Merge "Add new queue to offload slow broadcasts" 2018-10-29 18:57:28 +00:00
Lucas Dupin
ed00262486 Remove obsolete lock screen UI
Removes obsolete KeyguardSliceView title area and adds doze callbacks
necessary to support new lock screen design.

Bug: 111405682
Test: manual
Test: atest KeyguardSliceViewTest
Change-Id: I07e96dbde68d4e5e38e1371526bedf59fc925b86
2018-10-29 11:07:00 -07:00
Olivier Gaillard
def1b90dec Use the BinderProxy#TransactListener to propagate the UID.
PropagateWorkSourceTransactListener intercepts outgoing calls and calls
Binde#setThreadWorkSource.

Also install the listener to system server to propagate the worksource
through binder calls.

Test: manual
Change-Id: I02e88c93eebdf200691dd72b79aa7648f4d85bcb
2018-10-29 17:19:31 +00:00
Olivier Gaillard
510cdfc32c Adds a mechanism to listen to proxy transact method calls.
There are multiple use cases for it:

1) Make it easy for another process to set the worksource. The
worksource can be propagated in a thread local - this is how gmscore and soon
system server works -  the worksource can then be set for all binder
calls using

Object transactStarted() {
    Binder.setWorkSource(ThreadLocalWorkSourceUid.get());
    return null;  // No token needed.
}

void transactEnded() {
    Binder.setWorkSource(null);
}

This will be used by system process and gmscore.

2) SystemUI team was interested in detecting binder calls done from the
main thread in dogfood/tests. This listener will make it easy to figure
out which thread is used.

Performance impact of transact method:
    - With current code: 45ns per call
    - With this code: 57ns per call
This is not significant compared to the total binder call time which is
10-100s of microseconds.

Test: unit test
Change-Id: Id0a2f52cba33b390ff83f703284b79471cc80b1c
2018-10-29 17:19:31 +00:00
Branden Archer
ea3bcb762d fix spelling typo in comment
Test: typo in comment, no test necessary

Change-Id: I5a56c289e1e29a8eca33d55a77c52e87efa446a2
2018-10-29 08:49:55 -07:00
Rafal Slawik
bf67d07be2 Record process start time for native processes
Process start time is recorded to detect whether two memory samples
come from the same process and how long the process was alive.

Bug: 118249210
Test: atest MemoryStatUtilTest and manually verified that data is in
statsd report

Change-Id: I7f49cd8bfc81c5e7e70e4f8b49729632eeec5798
2018-10-29 14:36:37 +00:00
Luke Huang
8c12dcd11a Merge "Refactor UidRange by using stable aidl structure" am: d1d3b374b7 am: 53c8b8a939
am: 68f4bd92bc

Change-Id: I82e06fe93a3ed88368b649ef8d3283322191ffe7
2018-10-28 18:06:15 -07:00