Commit Graph

97390 Commits

Author SHA1 Message Date
allenwtsu
f63b644cbe Add new intent ACTION_REPORT_RADIO_BUG and setting for radio error
Add an intent ACTION_REPORT_RADIO_BUG for reporting radio error
Also add new settings for radio error detection

Bug: 113635050
Test: Build pass
Change-Id: I060db9b11776a67ce4da1c3142b2e6cdc23f38cf
2019-01-14 10:33:38 +08:00
Philip P. Moltmann
5e5c41e549 Have app global connection as to other managers
Regular ...Manager-s connect to the system server hence there is no
problem establishing a permanent connection via
ServiceManager.getServiceOrThrow.

(1)
PermissionControllerManager connects to an app, hence the binding has to
be dynamic. This is done my using the local RemoteService class.

(2)
...Manager-s are per context. Hence when the context goes away all
service connection started for this service are supposed to also be
cleaned up. There is no callback when the context goes away.

(1) and (2) lead to RemoteService connection to still be bound while the
context goes away which causes a service connection leak.

This change emulates the behavior of regular managers by creating a
permanent RemoteService tied to the application context. Of course
interanlly RemoteService itself binds and unbinds dynamically. Still,
now the RemoteService is not bound to a context that goes away and no
connection is leaked.

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
      (this test failed before as settings was crashing due to leaked
      remote service connections)
Change-Id: I5b8a4c62070fcce6e390897d046c4b28998e3952
2019-01-13 11:07:26 -08:00
Philip P. Moltmann
339ecba542 Merge "Automatically unbind for AbstractRemoteService" 2019-01-12 19:13:39 +00:00
Philip P. Moltmann
883ff1a65d Automatically unbind for AbstractRemoteService
No need for services to think about unbinding anymore. Now the
AbstractRemoteService counts how many requests are not yet finished and
once the number of unfinished requests drops to zero, schedules an
unbind.

Bug: 117779333
Test: - Started settings which makes many calls to
        PermissionControllerManager. Saw the automatic unbind to eventually
        happen.
      - atest CtsContentCaptureServiceTestCases (with content capture
        enabled and with content capture disabled)
      - atest CtsAutoFillServiceTestCases (4 tests out of WebViewActivityTest fail without and with this change)
Change-Id: Ief2f3512df5a1c55694c0c6b449079a49089bcde
2019-01-12 19:13:28 +00:00
qinyige
e8754b4652 Merge "Avoid adding node itself as child node." am: e0a34bf17f am: 234076ca37
am: fb9e440baf

Change-Id: Ic682f24666614f9d683fab5c0206540c224888db
2019-01-12 08:24:39 -08:00
qinyige
fb9e440baf Merge "Avoid adding node itself as child node." am: e0a34bf17f
am: 234076ca37

Change-Id: I6f395d4c831a0a7ef60c7704461a071a9ce404f6
2019-01-12 08:14:37 -08:00
qinyige
234076ca37 Merge "Avoid adding node itself as child node."
am: e0a34bf17f

Change-Id: I5b86189d3ad1e3ead4b24f0c15c44d6beb2a0a4b
2019-01-12 07:50:12 -08:00
Treehugger Robot
e0a34bf17f Merge "Avoid adding node itself as child node." 2019-01-12 15:37:43 +00:00
Michal Karpinski
ceeadaed26 Merge "Temporarily whitelist processes to open activities from background when service-based PendingIntent was whitelisted" 2019-01-12 14:20:38 +00:00
Shubang Lu
9af8f281d0 Merge changes I7bfdcbaf,I260b354b,I42ca55eb,If38d5443,I3fbc3368, ...
* changes:
  Atom: initPortInfo when receive hotplug from tx for audiosystem device[1/3]
  handle manual port switching
  Claim Active Source during System Audio Mode init by AVR when the device also has playback type and can't get Active Source.
  Switch away from ARC input when ARC is terminated.
  Request Active Source when ARC is enabled in ArcInitiationActionFromAvr.
  Refactor the Active Source updating logic in CEC devices.
  Fix tests failure on com.android.server.hdmi
  Making functions visible for testing com.android.server.hdmi
  Back out unneeded ag/4808863. Standby has been handled in ag/4881453.
2019-01-12 07:55:38 +00:00
TreeHugger Robot
11d70db8d5 Merge "Update Active Group before creating AuthClient" 2019-01-12 05:13:44 +00:00
TreeHugger Robot
fd1e036205 Merge "Add EXTRA_PERMISSION_GROUP_NAME" 2019-01-12 04:29:33 +00:00
TreeHugger Robot
7fe83b90f7 Merge "Add home and emergency role names." 2019-01-12 04:28:40 +00:00
TreeHugger Robot
dd82865e45 Merge "Prepare to unhide SurfaceControl" 2019-01-12 02:07:01 +00:00
Kevin Chyn
747e29ba94 Update Active Group before creating AuthClient
Change-Id: Ic41c97ca2735eb03629610ef725e0dd5691cfd4e
Fixes: 122582871
Test: follow comment #11 in bug linked above
2019-01-11 17:26:23 -08:00
Hai Zhang
85b762c9c8 Add home and emergency role names.
This change adds the names of the home and emergency roles, which will
be used by Settings.

Bug: 110557011
Test: build
Change-Id: I40bb0e021232acff62a32e0bdc24a04ff9ec6ba8
2019-01-11 14:35:10 -08:00
Robert Carr
a7827f7b5e Prepare to unhide SurfaceControl
Bug: 111297488
Test: Builds
Change-Id: Ieb38ee12153241e94fcebf6b818be5e12cdd8228
2019-01-11 13:38:56 -08:00
Eugene Susla
40335c1be9 Merge "Mirgate default SMS app handling to RoleManager" 2019-01-11 21:23:34 +00:00
Christine Franks
cf42497af1 Merge "Move global grayscale to ColorDisplayService" 2019-01-11 20:35:09 +00:00
Winson Chung
fb922e9bac Merge changes from topic "prediction_suggestion_services"
* changes:
  Initial commit of Content Suggestions (overview long press) Manager.
  Adding initial implementation of Prediction client/service API
2019-01-11 20:21:19 +00:00
TreeHugger Robot
e433ab6ee8 Merge "Add ApplicationInfo.isEncrpytionAware() as a system API." 2019-01-11 19:57:48 +00:00
Kweku Adams
21909c112b Merge "Moving BatterySaverPolicy into batterysaver directory." 2019-01-11 19:41:14 +00:00
Svetoslav Ganov
9a788837ef Merge "Historical app ops." 2019-01-11 18:48:55 +00:00
Amy
85bff85f2c Back out unneeded ag/4808863.
Standby has been handled in ag/4881453.

ag/5112445

Bug: 113288856

Test: local test.
Change-Id: I2dd4a8fe8478cc35f21de8a1890d6d92b8010455
2019-01-11 10:27:03 -08:00
Christine Franks
09c229e6bb Move global grayscale to ColorDisplayService
Bug: 111215474
Test: atest FrameworksServicesTests:ColorDisplayServiceTest
Change-Id: I9b72d53b2614f225422f15f3b4018383d75071cd
2019-01-11 09:36:48 -08:00
Dianne Hackborn
5d55a4c907 Merge "Fix issue #122615120: Add bind flag to require associations" 2019-01-11 17:09:10 +00:00
Garfield Tan
0c81667a08 Merge "Drop stale activity configuration updates." 2019-01-11 17:06:39 +00:00
Zhi An Ng
a8f68e24b1 Merge "Do not load xml metadata for unchanged packages in RegisteredServicesCache" 2019-01-11 17:05:47 +00:00
Nandana Dutt
5adab037d7 Merge "Add a privileged API for capturing and consuming bugreports" am: c2b8bc0a7d
am: 98eef9a909

Change-Id: Ic2cc853f1566bdb5796c233538792cb0618ef1bc
2019-01-11 07:46:45 -08:00
Nandana Dutt
98eef9a909 Merge "Add a privileged API for capturing and consuming bugreports"
am: c2b8bc0a7d

Change-Id: Ic7fa25d628b95b9cce862bb2728441623de6c70b
2019-01-11 07:33:11 -08:00
TreeHugger Robot
2a68b63aa6 Merge "Add secure setting for custom clock face selection." 2019-01-11 14:54:26 +00:00
Alexey Kuzmin
b0e7c48c8b Merge "Split ring and notification vibration settings" 2019-01-11 13:51:16 +00:00
Nandana Dutt
3386fb7172 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
Merged-In: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-11 13:29:09 +00:00
TreeHugger Robot
cbdbc4d9c6 Merge "Add a privileged API for capturing and consuming bugreports" 2019-01-11 12:37:33 +00:00
Chalard Jean
fc758be231 Merge changes from topic "IPMS1" am: 3627deac88 am: 54d91e605c
am: 2304c7c508

Change-Id: I6908f68b1b9e7079384c4cc9f11c4e46cce694ce
2019-01-11 04:13:38 -08:00
Chalard Jean
2304c7c508 Merge changes from topic "IPMS1" am: 3627deac88
am: 54d91e605c

Change-Id: I2541996b9bfe338acabac858fdea0ad89d55df5b
2019-01-11 03:53:57 -08:00
Jorim Jaggi
d345052a8f Merge "Fix return value for comment consistency in getDetachWallpaper" 2019-01-11 11:50:21 +00:00
Chalard Jean
54d91e605c Merge changes from topic "IPMS1"
am: 3627deac88

Change-Id: I80fc9437a041de68ce16ae5e85189b5d48fe1c97
2019-01-11 03:44:45 -08:00
Wu Ahan
1153b78033 Merge "Enable AOD image wallpaper and apply aod mask view." 2019-01-11 08:21:59 +00:00
TreeHugger Robot
3bf407f536 Merge "Add classification to MotionEvent" 2019-01-11 06:28:13 +00:00
Kevin Chyn
ad011b67d3 Merge "Add setting for always requiring confirmation" 2019-01-11 06:14:47 +00:00
Chalard Jean
f89d7bee9e [MS02] Write the skeleton for the IP memory store.
This implements a minimal contract for the IP Memory Store
feature.

Test: Created new tests for parcelable code. For the rest, created
      empty tests, but there is no logic, it's boilerplate day
Bug: 116512211
Change-Id: I15dc6275b370d671385ddfdb058a8b8d39952d6e
2019-01-11 15:01:00 +09:00
Chalard Jean
8c141bdb8f [MS01] Add the IP memory store service.
Bug: 116512211
Test: Added initial tests
Change-Id: I9d9af4097e3e2d7afd9956b9cbfa29a9f9558ae0
2019-01-11 15:00:36 +09:00
Remi NGUYEN VAN
7e425036a6 Merge "Move NetworkMonitor to NetworkStack" am: 81552d610a am: 8ecc6c9e32
am: 935a491a59

Change-Id: Ia5d742bd5186e92b8a45bb72fb414b9dbdd38f78
2019-01-10 21:39:06 -08:00
Remi NGUYEN VAN
935a491a59 Merge "Move NetworkMonitor to NetworkStack" am: 81552d610a
am: 8ecc6c9e32

Change-Id: I438b95e135d0d86be53ea3a8ab61105a886e2a2e
2019-01-10 21:29:38 -08:00
Remi NGUYEN VAN
8ecc6c9e32 Merge "Move NetworkMonitor to NetworkStack"
am: 81552d610a

Change-Id: If5c2c104bc53a565e89e625b1edce0b976a295f3
2019-01-10 21:15:28 -08:00
Remi NGUYEN VAN
81552d610a Merge "Move NetworkMonitor to NetworkStack" 2019-01-11 05:08:52 +00:00
Yohei Yukawa
a878b9500e Support per-profile IME behind the flag
In order to support BYOD (Bring your own device) use cases, Android
phones can associate multiple users into a single profile group so
that other system components such as launcher can help users
seamlessly switch user identity without doing a heavy-weight
device-level user switching.

For instance, an Android device can be configured to work for two
different users Alice and Bob, while Alice also has two different
identities: one as her private account and the other for her
work-related account.

  Profile group X == Alice:
    Parent user X (user id: 0)
      for personal account, under her control.
    Child user 1 (user id: 10)
      for work-related account, partly under system-admin's control.
  Profile group Y == Bob:
    Parent user Y (user id: 11)
      private account, under his control.

The above configuration allows system-level data separation not only
between Alice (user 0) and Bob (user 11) but also between Alice's
personal account (user 0) and Alice's work-related account
(user 10). For instance, Calendar app that runs under user 0 cannot
see any data for other users including user 10.

IME is one of known exceptions in the above design. For instance, when
Alice is using the device, the system launches InputMethodService,
which is the code-level representation of IMEs, only for the user 0
then gives it a special ability to interact with all the applications
that run under the same profile group.

  Profile group X == Alice:
    IME works as user 0 but interacts with apps that run under
    user 0 and 10.
  Profile group Y == Bob:
    IME works as user 11 and interacts with apps that run under
    user 11.

Of course there are non-trivial imprications by sharing the same
instance of InputMethodService across profiles but this was basically
the only option when we initially introduced in Android 5.0 [1]
because of multiple challenges (schedule, complexity, performance
concerns, and so on). To to mitigate the risk, we also introduced APIs
that allow system administrators to whitelist what IMEs can be enabled
for the entire profile [2].  Even with such a whitelist feature, we
have received multiple feature requests to completely separate IME
instances by profile boundaries, like other applications behave.

This is why this CL was authored.

With this CL, a new runtime mode "per-profile IME" is introduced
behind the flag.  When the flag is enabled:

  * InputMethodManagerService (IMMS) may calls IMMS#switchUserLocked()
    from IMMS#startInputOrWindowGainedFocus() every time when a
    different profile's IME client gains IME focus.
  * SpellCheckerService also enables per-user mode, which has been
    temporarily disabled [3].
  * DevicePolicyManagerService no longer disable packages that contain
    system IMEs when creating a new profile user.
  * Following IME APIs start returning result based on the caller's
    user (profile) ID.
     * InputMethodManager#getInputMethodList()
     * InputMethodManager#getEnabledInputMethodList()
     * InputMethodManager#getEnabledInputMethodSubtypeList()

There are still multiple known issues though. Hopefully we can address
those issues in subsequent CLs.

 * Inline-reply from non-primary profiles is still dispatched to the
   main profile's IME because SysUI is always running under main
   profile (Bug 120744418).  This probably can be addressed by
   allowing the IME clients that have INTERACT_ACROSS_USERS_FULL to
   specify the target user ID in some @hide parameter.
 * IMMS#switchUserLocked() is not yet fully optimized (Bug 28750507).
   New client app's UI thread can be blocked more than 100ms,
   depending on the number of installed IMEs and the number of IME
   subtypes implemented by those IMEs.
 * Even after IMMS#switchUserLocked() is fully optimized, IMEs'
   cold-startups are known to be slow.  One way to optimize this is
   keeping binding to those IMEs, but doing so would require 1)
   non-trivial amount of code changes and 2) doubles RAM consumption.
 * Virtual keyboard settings page for profile users are not yet
   available (Bug 120748696).
 * Migration from shared-profile IME mode to per-profile IME mode is
   not yet supported (Bug 121348796).  By default, IME packages will
   be automatically disabled when a profile user is created.  This
   means if the device switches from shared-profile IME mode to
   per-profile IME mode, IME packages continue to be disabled hence
   the user cannot type anything for those profiles.

Anyway, there should be no behavior change unless the debug flag is
explicitly flipped.

 [1]: I3bd87b32aec69c3f8d470c8b29b144f4e849c808
      734983fff3
 [2]: I921888660d29a5370395db87adf75d4d106660c9
      9c9cbac5b71a23ed0dbab0f44cb78a820514cfc6
 [3]: Ic046f832f203115106409a53418a5746eb6d4939
      3f8c568883

Fix: 120709962
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: Made sure that there is no behavior change if the debug flag is
      not set as follows.
  1. Install Test DPC
  2. Enable managed profile with Test DPC
  3. make -j EditTextVariations
  4. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  5. Open two EditTextVariations instances in split-screen mode
   5.1. One is for the main profile
   5.2. The other is for the managed profile
  6. Make sure that main profile's instance of AOSP Keyboard is used
     for both applications.
  7. Make sure that main profile's instance of Android Spell Checker
     is used for both applications.
  8. adb shell ime list -a -s --user all
      -> Only "com.android.inputmethod.latin/.LatinIME" is shown.
  9. adb shell dumpsys textservices
      -> Only result for user #0 is shown.
Test: Made sure that basic text input can be done with
      "per-profile IME" mode enabled as follows.
  1. adb root
  2. adb shell setprop persist.debug.per_profile_ime 1
  3. adb reboot
  4. Install Test DPC
  5. Enable managed profile with Test DPC
  6. make -j EditTextVariations
  7. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  8. Open two EditTextVariations instances in split-screen mode
   8.1. One is for the main profile
   8.2. The other is for the managed profile
  9. Make sure that AOSP Keyboard will be re-launched to correspond to
     the focused IME client's user profile.
   9.1 When EditTextVariations for the main profile is focused,
       AOSP Keyboard for the main profile is shown.
   9.2 When EditTextVariations for the work profile is focused,
       AOSP Keyboard for the work profile is shown.
 10. Make sure that different instances of Android Spell Checker are
     used based on target application's profile
 11. adb shell ime list -a -s --user all
      -> "com.android.inputmethod.latin/.LatinIME" is shown for both
         user #0 and user #10.
 12. adb shell dumpsys textservices
      -> Both user #0 and user #10 have results.
Test: atest DevicePolicyManagerTest#testSetPermittedInputMethods_failIfNotProfileOwner
Test: atest com.android.server.devicepolicy.OverlayPackagesProviderTest
Change-Id: Ied99664d3dc61b97c919b220c601f90b29761b96
2019-01-10 19:36:24 -08:00
Svet Ganov
8455ba2341 Historical app ops.
This change is the main check in for the historical app op feature.
The idea is to store a historical data about past app op rejections,
accesses, and durations per op for any UID state indefinitely.

Keeping all operations on record is not practical as app ops are
very frequently performed. To address this we are storing aggregated
data as snapshots where we store for every UID and its packages
how many times each op was accessed, rejected, lasted as an aggregate.

To allow history scaling indefinitely we are taking a logarithmic
approach with only the most recent state stored in memory and all
preceding state stored on disk. State on disk is stored in separate
files where each preceding file, i.e. for an older period, would
cover X times longer period with X number of snapshots covering
X times longer period. Initially X is ten but can be tweaked. For
example, the first file could contain data for ten days with daily
snapshots, while the file for older period would have data
for a hundred days with snapshots every ten days, etc.

The implementation is optimized for fast history update and no impact
on system runtime performance and minimizing memory footprint. We
are lazily persisting state to disk on a dedicated thread as this is
slow. We are also reading the relevant historical files on a query
as this is very rare as opposed to state updates.

The base snapshot interval, i.e. snapshot time span, in the initial
iteration and the logarithmic step are configurable. These can be
changed dynamically and the history would be rewriten to take this
into account.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I55c32c79911ba12b2ace58d2a782b8df1e6bff60
2019-01-10 19:31:31 -08:00
Kevin Chyn
314028331b Add setting for always requiring confirmation
Bug: 122119972

Test: Secure settings changes biometric service behavior appropriately
Change-Id: Ic2915d8ab37de22a58b1b61f34f59ad7ada0cd29
2019-01-10 19:16:00 -08:00