Commit Graph

14234 Commits

Author SHA1 Message Date
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
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
TreeHugger Robot
45fda27211 Merge "Fixed when the CompatibilityBridge is attached to an activity." into pi-dev 2018-09-24 22:04:27 +00:00
TreeHugger Robot
ba940c4279 Merge changes from topic "biometric-op"
* changes:
  Check AppOps in BiometricService
  Rename OP_USE_FACE to OP_USE_BIOMETRIC
2018-09-24 20:37:16 +00:00
Julia Reynolds
34560ec27d Merge "Fix potential NPE" 2018-09-24 13:11:00 +00:00
Nan Zhang
fcc578e118 Merge "Fix the unresolved link/see tag error for framework docs" into pi-dev am: 98d747e7f3
am: d837987639

Change-Id: Ief6003b003582711771a5f239acd4cdc6cab42b9
2018-09-23 03:01:35 -07:00
Nan Zhang
d837987639 Merge "Fix the unresolved link/see tag error for framework docs" into pi-dev
am: 98d747e7f3

Change-Id: Idf0fadc2d62c872c9bc82388f4d8fbcd58694e83
2018-09-23 02:50:22 -07:00
TreeHugger Robot
98d747e7f3 Merge "Fix the unresolved link/see tag error for framework docs" into pi-dev 2018-09-23 09:34:23 +00:00
Yohei Yukawa
e2fa39ec3d Use PooledLambda.obtainMessage() when possible
As its JavaDoc says, in most of cases PooledLambda.obtainMessage() is
a better choice than PooledLambda.obtainRunnable().

If PooledLambda.obtainRunnable() is really necessary, let's make sure
to call recycleOnUse() whenever possible.

Test: presubmit
Change-Id: I3dbe500f49c0df187f2ffefd11c71836696dfd4e
2018-09-22 13:13:10 -07:00
Yunfan Chen
75157d7791 Introduce process configuration to WindowProcessController
Introduced the process config and adjusted mergedconfiguration
related calls. Such that we can override configuration for a process
when need to.

The potential use cases include:
1. Maintain process window bounds for the latest activity to override
the display info for legacy apps;
2. Override the display info for IME process to make sure the IME can be
shown with the correct display metrics.

ActivityManagerService:
- Use process configuration instead of the global configuration when
  it's for app.

ActivityStackSupervisor:
- Use process configuration when start activity.

WindowProcessController:
- Make it a ConfigurationContainer.

ActivityTaskManagerService:
- Add interface to get configuration for a process. If the process is a
  system process or non-existing process, return the global
  configuration.
- Return device configuration related to the process.
- Propagate configuration updates from Global to Process.

ActivityTaskManagerInternal:
- API to update configuration for IME process.

WindowManagerService/WindowManagerInternal:
- Propagate the process configuration change to wm.

WindowState:
- Use process configuration instead of global.

Test: go/wm-smoke
Test: servicestests will remain the same result as without this patch.
Bug: 113253755

Change-Id: I3660723352d2e8779d40528ae92d71f59ddbf1f1
2018-09-22 15:35:35 +09:00
Kevin Chyn
b3c05aaa4f Rename OP_USE_FACE to OP_USE_BIOMETRIC
All future biometrics share the same USE_BIOMETRIC permission.

Bug: 116340012
Test: BiometricPromptDemo works

Change-Id: I6e5af4d6dc1b467e67957c0aec90f6c0a67028a7
2018-09-21 17:08:54 -07:00
Kevin Chyn
05c21508fd 3/n: Add BiometricManager, hasEnrolledBiometrics()
Fixes: 112570477

Test: BiometricPromptDemo works
Test: Able to get/use BiometricManager
Test: Tested with enrolled and non-enrolled biometrics

Change-Id: I26231894eccc87c42b5b3007aa0b7c6f09830452
2018-09-21 17:08:49 -07:00
Nan Zhang
99adf3cb76 Fix the unresolved link/see tag error for framework docs
Synced with alanv@ that doc weren't federated against AndroidX yet, use
this v7 reference until they migrate the docs to AndroidX.

Test: m -j offline-sdk-docs
Bug: b/116163454
Change-Id: Ib5167c4815708d159945ce6db239f8debdf8f865
2018-09-21 14:58:26 -07:00
Yohei Yukawa
6c07572f16 Deprecate InputMethodManager#getInstance()
With this CL, no one in the Framework is using
InputMethodManager#getInstance() directly or indirectly.  It is time
to mark this method deprecated.

For applications that still call InputMethodManager#getInstance()
directly or indirectly via reflection, they will start seeing warnings
with stacktrace in logcat.

Except for that explict warnings in logcat, there is no behavior
change in this CL.  Added a new test to make sure that
InputMethodManager#getInstance() and InputMethodManager#peekInstance()
are still working in a way we expected for such applications.

Fix: 115891476
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Ib393086d921f91993395b5f0007b725a5db7bf22
2018-09-21 14:52:12 -07:00
Julia Reynolds
34a80841cb Fix potential NPE
Test: manual
Change-Id: I8f6ed47e5c51ca138f4c0b57eccab41336984548
Fixes: 67716207
2018-09-21 13:01:36 -04:00
NedaTopoljanac
0296597d16 Add DevicePolicyManager constants for enterprise WiFi Provisioning with certificates
Adding extras to support connecting to WiFi with certificates from QR
code.

More is described in proposal doc: http://go/enterprise-wifi-proposal

Test: none
Bug: 111384818
Change-Id: I5acb31fbed4fb22bd610cf8a24ff0566f487107c
Fixes: 111384818
2018-09-21 10:12:39 +01:00