Commit Graph

17106 Commits

Author SHA1 Message Date
Treehugger Robot
467ebb8379 Merge "Consolidate input OWNERS files" 2022-05-18 18:42:33 +00:00
Treehugger Robot
27e3cc6f2b Merge "Update OWNERS for appwidgets" 2022-05-18 15:51:45 +00:00
Pinyao Ting
12adb658a0 Update OWNERS for appwidgets
Test: manual
Change-Id: I2bb2ddc4bd94e9e80d606e5141f336550eab8c88
2022-05-17 22:59:24 +00:00
Hans Boehm
5ee3cfe147 Merge "Document VirtualRefBasePtr hazards" 2022-05-06 23:54:45 +00:00
Treehugger Robot
1e3e69212a Merge "Set an edit uri to data of ACTION_EDIT" 2022-05-06 20:38:05 +00:00
Hans Boehm
d72e472407 Document VirtualRefBasePtr hazards
Test: Treehugger
Change-Id: I6f364b4e0f73a2eb554f2902a67e774ef5890b00
2022-05-06 11:11:37 -07:00
Xin Li
fd1b1662e9 Merge SP2A.220505.002
Bug: 231319788
Merged-In: I7707d01be37582461227edcecf5d559f2019c8a5
Change-Id: I1dad245a352258f2a0017b85f14c99f305d8d660
2022-05-03 20:53:01 +00:00
Badhri Jagan Sridharan
b09d68a2ea Support IUsb AIDL interface
UsbPortManager is made to support both AIDL & HIDL interface until
HIDL is deprecated eventually. UsbPortHal abstract class is defined
which the UsbPortManager grabs an instance of from UsbPortHalInstance
method to talk to the Hal implementation process. UsbPortHalInstance
queries the underlying hal implementation and instantiates UsbPortHal
with either UsbPortHidl or UsbPortAidl based on the IUsb interface
implemented by HAL implementation.

go/iusb-aidl-migrate.

Bug: 200993386
Bug: 199357330
Bug: 211677613
Bug: 213312081
Bug: 199358576
Test: Manually tested through UI.
CTS-Coverage-Bug: 215019881
Change-Id: I246fd6e5bee8138d3ad3b6994665a1d4788c8789
Merged-In: I246fd6e5bee8138d3ad3b6994665a1d4788c8789
(cherry picked from commit bbfa92e694)
2022-04-26 16:04:13 +08:00
Albert Wang
cf8d3b0789 Add OWNERS coverage for dump methods for public USB classes
Bug: 229706413
Test: manual

Signed-off-by: Albert Wang <albertccwang@google.com>
Change-Id: I25c6c649f8fa42fe6a0d3062aa3ab75a4310df37
2022-04-21 08:32:15 +08:00
Koji Fukui
49c433e211 Set an edit uri to data of ACTION_EDIT
Symptom:
Can't transit to edit screen when "Edit" button on ShareSheet is
pressed.

Root cause:
ACTION_SEND intent for shared image is usually sent with image uri in
EXTRA_STREAM extra. But it not always has the uri in data.
ChooserActivity creates ACTION_EDIT intent for "Edit" button from the
ACTION_SEND intent. So it not always has the uri in data. Most of
image edit app suppose to get image uri from data. They usually don't
suppose to get it from EXTRA_STREAM extra. So image is not edited.

Solution:
Copy image uri from EXTRA_STREAM extra to data when ChooserActivity
creates ACTION_EDIT intent.

Bug: 220161786
Test: Take screenshot. Tap share. Tap Edit, which opens
      screenshot in Photos.
Change-Id: Id6ce93efacd54a86d870595ae32b4e6efcec0c04
2022-04-19 10:17:19 +09:00
Victor Hsieh
e3f86c0534 Update VerityUtils OWNERS to a more common file
Bug: None
Test: N/A
Change-Id: I4d4b9dd0832a6c1ff32e3205014660acd1eb19d4
2022-04-13 15:17:03 +00:00
Bill Yi
bbe0c62d66 Merge "Merge SP2A.220405.004 to aosp-master - DO NOT MERGE" 2022-04-08 18:08:24 +00:00
Bill Yi
95267eaf87 Merge SP2A.220405.004 to aosp-master - DO NOT MERGE
Merged-In: Iae1a66165221f45051be17c4d047b5bd5be3999b
Merged-In: I0c82fda5497bace30d49989b8e84ebc98250ca8c
Change-Id: I2c75988c023cec548e3a576cb0c3a1a13bb0016f
2022-04-07 18:40:59 -07:00
Eric Biggers
7e3c5382cc Merge changes Idc218e5f,I26c3fafc
* changes:
  Remove more FDE methods from StorageManager
  Drop FDE status checks from DevicePolicyManagerService
2022-04-08 00:09:30 +00:00
Eric Biggers
bd13f84152 Remove more FDE methods from StorageManager
Now that these methods are no longer called, and none of them are a
public API or have @UnsupportedAppUsage, they can be removed.

inCryptKeeperBounce() actually had one known app user via reflection,
despite the method not having @UnsupportedAppUsage.  However, that user
only made the call if Build.VERSION.SDK_INT < VERSION_CODES.P, so it is
not being used anymore.

Bug: 208476087
Change-Id: Idc218e5f355bb61257b07cf5b5b6df5f4c6ece11
2022-04-07 16:38:36 +00:00
Chiachang Wang
3cb07d737d Ignore other IKE options if IkeTunnelConnectionParams is set
Stop parsing the IKE options from the input IkeTunnelConnectionParams
if exists. The caller shuould get the relevant infortation the
params.

The field is also stored in the VpnProfile if it built from an
Ikev2VpnProfile.

Bug: 184750836
Test: atest FrameworksNetTests HostsideVpnTests
Test: build ; flash ; connect VPN successfully
Change-Id: Id05c17285915462c7a6cd51d5fb4ee5da7f465ba
2022-04-06 17:25:58 +08:00
Eric Biggers
54bdf65cb5 Remove FDE warning from AccessibilityShortcutChooserActivity
This encryption warning is never shown, since
StorageManager.isNonDefaultBlockEncrypted() is hard-coded to return
false, since FDE (Full Disk Encryption) is no longer supported.
Therefore, remove an unused TextView and string, and stop calling
StorageManager.isNonDefaultBlockEncrypted().

Remove the word "encryption" from the layout name
"accessibility_enable_service_encryption_warning", since this layout
is still used for other, non-encryption related warnings.

Bug: 208476087
Change-Id: Ic4e9024eadd602205516aa3ba4cc01887a2a7d34
2022-03-28 23:52:06 +00:00
Rambo Wang
aa1e3b0a67 Introduce CarrierPrivilegesCallback to replace CarrierPrivilegesListener
Add new interface in CarrierPrivilegesCallback to notify the registrants
that carrier service for current user has changed.

Reshape the parameters of onCarrierPrivilegesChanged callback with
both Set instead of List/Array.

CarrierPrivilegesListener is deprecated. Once all clients have migrated
to CarrierPrivilegesCallback, it will be throughly cleaned up.

Bug: 216549778
Test: atest CarrierPrivilegesTrackerTest CarrierServiceTest
Test: atest WifiCarrierInfoManagerTest TelephonyRegistryManagerTest
Test: atest TelephonySubscriptionTrackerTest

Change-Id: I18e443d91f1db951f1461511821c0f5f673da3a3
Merged-In: I38d03e3921112c313f3c1d204ed04f6e1756ff39
(cherry picked from commit b66e3e3aa8)
2022-03-22 20:45:05 -07:00
Eric Biggers
489ba5ac07 Merge "Stop using FDE-related constants from IVold" 2022-03-22 17:37:32 +00:00
Calvin Pan
6cac5b89c0 Add i18n Settings OWNER for system language settings
Change-Id: Ia3217df6478716ec51b891057ba57a4d53a716ca
2022-03-21 09:06:57 +00:00
Eric Biggers
8f359f022a Stop using FDE-related constants from IVold
IVold.ENCRYPTION_STATE_* and IVold.PASSWORD_TYPE_* are values returned
by or accepted by FDE-specific vold methods, which are no longer used.
Stop using these constants so that we can remove them from IVold.aidl.

Notes on specific constants:

- Some constants have @UnsupportedAppUsage.  There is no reason why a
  non-system app should have been using these.  However, to avoid
  possibly breaking apps I just left these with hardcoded values.

- StorageManager.CRYPT_TYPE_* are used by
  LockscreenCredential.getStorageCryptType().  However, the caller of
  this method was removed by an earlier CL, so just remove this method.

- StorageManager.CRYPT_TYPE_* also have a user in
  packages/apps/Settings, but it is obsolete code that I'm removing in
  another CL.

Bug: 208476087
Change-Id: I41c684b69a97dbafac65d8f55db2c284d7a8dd70
2022-03-21 05:11:28 +00:00
Matt Pietal
810d71245c Keyguard - Treat messsages to lock with priority
When switching users and attempting to lock the device, the sysui main
thread becomes overwhelmed with events, creating a significant lag
between the time a message is posted and processed on the main
thread. This can be dangerous when these events are critical for
security, such as calls coming from PhoneWindowManager#lockNow() that
call KeyguardViewMediator#doKeyguardTimeout(). On older devices with
slower CPUs and less memory, the delay in processing can be
significant (15 - 30s).

The result of not prioritizing these events leads to a window of time
where a guest user can switch back to the owner, and gain access to
the owner's homescreen without needing to unlock the device with the
owner's credentials.

As a mitigation, prioritize two events originating in two specific
methods to make sure the device locks as soon as possible as well as
have the system server preemptively update its local cache.

Bug: 151095871
Test: Very manual race condition - follow steps listed in bug
Change-Id: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
Merged-In: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
(cherry picked from commit 28c53ab8bc)
(cherry picked from commit f8023c9829)
(cherry picked from commit 256b5f08a8)
Merged-In: I7585a0a5eeb308e0e32a4f77f581556d883b5cda
2022-03-15 18:16:29 +00:00
Eric Biggers
f33dbe0540 Stop checking FDE password cache
Now that FDE is no longer supported, checking the FDE password cache
will never accomplish anything.  Remove this check from Keyguard, and
remove the supporting code from LockSettingsService.

Bug: 208476087
Change-Id: If1bb80dfcc015aeea19916a88c89a4067e6ada32
(cherry picked from commit e9b69111b2)
Merged-In: If1bb80dfcc015aeea19916a88c89a4067e6ada32
2022-03-14 23:03:52 +00:00
Prabir Pradhan
2f67512923 Consolidate input OWNERS files
Make all input OWNERS file point to frameworks/base/INPUT_OWNERS.

Bug: None
Test: upload
Change-Id: I8d6e10585faf7b83cef74cb3a0313c1d8f28efb4
2022-03-10 18:07:50 +00:00
Eric Biggers
d63d0e12cc Stop trying to update FDE password from LockSettingsService
Since FDE is no longer supported, updating the FDE password never does
anything.  Stop trying to do so.  Remove updateEncryptionPassword() from
ILockSettings, since its only caller outside of LockSettingsService
itself was in LockPatternUtils, and the previous CL removed that caller.

Bug: 208476087
Change-Id: I46c2a472177836f0c9084e4c3b4ed2e6c0ab61d5
(cherry picked from commit 3762ada110)
Merged-In: I46c2a472177836f0c9084e4c3b4ed2e6c0ab61d5
2022-03-09 05:11:10 +00:00
Eric Biggers
0a9389d296 Remove clearEncryptionPassword() from LockPatternUtils
Remove this method which cleared the FDE password, since is no longer
used.  It was only being used by the accessibility settings in the
Settings app, and that caller was removed by http://ag/16624515.

Bug: 208476087
Change-Id: If0c75774555d3503f21857e66cce527c5edfa586
(cherry picked from commit 8e265a9fd3)
Merged-In: If0c75774555d3503f21857e66cce527c5edfa586
2022-03-09 05:11:09 +00:00
Eric Biggers
77d147be49 Stop trying to get/set fields in FDE footer
Now that FDE is no longer supported, getting/setting FDE fields is
always a no-op, so there is no need to do so.

Bug: 208476087
Change-Id: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
(cherry picked from commit c6ce767e59)
Merged-In: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
2022-03-09 05:11:09 +00:00
Chiachang Wang
b8cda9d7e0 Merge "Set local routes exclusion in the networkAgent" am: 4734b5810b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978095

Change-Id: I03eaf7cf1ffc7237f267a85d2d1a25d93afe3896
2022-03-07 07:46:21 +00:00
Chiachang Wang
4734b5810b Merge "Set local routes exclusion in the networkAgent" 2022-03-07 07:25:52 +00:00
Chiachang Wang
68e528d468 Set local routes exclusion in the networkAgent
Add a field in the VpnConfig to store local route exclusion
bit from VpnProfile, and set the value into the networkAgent
of VPN network.

Bug: 184750836
Test: atest FrameworksNetTests HostsideVpnTests
Change-Id: I22b9a5990a3dab0418b44ec19d2996ead6529231
2022-03-07 04:26:52 +00:00
Andrei-Valentin Onea
8ceedbd375 Merge changes from topic "ignore-vendor-apex-allowlists" am: a22612eb94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926339

Change-Id: Ia43268fea619a0af6a39aef79cc52ed67e92ee99
2022-03-01 15:51:43 +00:00
Rhed Jao
e7be86fd15 Ignore prebuilt shared library if it doesn't exist on device am: 791eb6934d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926342

Change-Id: I63155e278047882b33af00e349d2a7a32099655c
2022-03-01 15:51:38 +00:00
Pedro Loureiro
be595a1cb7 Rename updatable-library to apex-library am: 1df9a1e8f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954037

Change-Id: I559fecd56edbc4fcf1047bb8ab9ec029e515e17f
2022-03-01 15:51:31 +00:00
Pedro Loureiro
7936aaf92e Parse new xml attributes used for updatable shared libraries am: 5c228ca3e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926341

Change-Id: I2255f2357f4786cb8931e83cb007a2818a3ba720
2022-03-01 15:51:26 +00:00
Alex Buynytskyy
1adacbf9d7 Create XML parser only once. am: 66fc1f1941
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926340

Change-Id: I83e8a593a251300aee1fa8d6d9002d22eabf6fc8
2022-03-01 15:51:14 +00:00
Andrei-Valentin Onea
a22612eb94 Merge changes from topic "ignore-vendor-apex-allowlists"
* changes:
  Ignore vendor apex priv-app permission allowlists
  Add test for parsing apex allowlists
  Ignore prebuilt shared library if it doesn't exist on device
  Rename updatable-library to apex-library
  Parse new xml attributes used for updatable shared libraries
  Create XML parser only once.
2022-03-01 15:15:56 +00:00
Treehugger Robot
a80c2cd027 Merge "Add a runtime check to ensure that system server jars are prefetched." am: 990ac01f71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925695

Change-Id: I90d1b85718c49e772107724aea59155dbe0bf8d1
2022-02-25 14:10:46 +00:00
Treehugger Robot
990ac01f71 Merge "Add a runtime check to ensure that system server jars are prefetched." 2022-02-25 13:44:34 +00:00
Jiakai Zhang
8db9757f08 Add a runtime check to ensure that system server jars are prefetched.
We prefetch standalone system server jars in ZygoteInit based on the
STANDALONE_SYSTEMSERVER_JARS environment variable, so that they can take
the advantage of AOT compilation. This CL adds a check to disallow jars
that are not prefetched, which reminds developers to make appropriate
changes so that their jars will be in the environment variable.

Bug: 203198541
Test: 1. Build a system image.
  2. The device boots.
Test: 1. Remove an entry from PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
  2. Build a system image.
  3. The device does not boot and encounters the following error:
     java.lang.RuntimeException: Creating a ClassLoader from /apex/com.android.wifi/javalib/service-wifi.jar is not allowed. Please make sure that the jar is listed in `PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS` in the Makefile and added as a `standalone_contents` of a `systemserverclasspath_fragment` in `Android.bp`.
Change-Id: I275d75ac37194a4d8fd491529b7cdb697dc04e37
Merged-In: I275d75ac37194a4d8fd491529b7cdb697dc04e37
(cherry picked from commit 418ab8212c)
2022-02-24 16:21:28 +00:00
Bernardo Rufino
ce09bba3fc Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: Iadab8b0106bf99b9c6fbdeca6cc020e1d909ae1a
2022-02-22 13:50:00 +00:00
Bernardo Rufino
cccb1b78d9 Add safer Bundle APIs and deprecated old ones
Add safer Bundle APIs that take an extra Class<T> argument that checks
that the type about to be deserialized is a child of the type passed in
parameter *before* actually deserializing it, while also deprecating old
APIs.

This allows use to reap the benefits of the new typed Parcel APIs and
enhances security.

Only the APIs that could involve custom object injection are modified.
So, besides the obvious ones that have that design (eg.
readParcelableList()), subtler cases such as readIntegerArrayList()
could result in custom object deserialization, and since it's all
generics, even the casting inside Bundle wouldn't fail, only after the
client unpacked the list items would it blow up. Now those are checked
beforehand.

Since Bundle always calls Parcel.readValue() under the hood (instead of
specialized APIs such as readParcelable() etc), we had to augment that
method (that's used by LazyValue when retrieving the item) to accept
item types now for containers, which I implemented as a vararg of
Class<?> parameters (this is all private/@hide). This way we could
retrieve a list of intents like readValue(.., List.class, Intent.class),
or a map of string to intents like readValue(.., Map.class,
String.class, Intent.class). For non-container items, we can just pass
no arguments for the vararg. This is explained in internal javadocs.

Inside readValue() now, we also check the container types before
calling the internal methods for deserialization. So, if the thing on
the wire is a VAL_MAP and we know the method we're about to call will
return a HashMap, we verify that the type passed in parameter is a super
type of that (if it's non-null, if it's null it means "perform no
check").

Now, LazyValue became a BiFunction<Class<?>, Class<?>[], Object> to
receive those extra "item types" for containers. The reason for
separating the first from the rest is that the first defines the return
type in the new APIs and inside Parcel, so we need the T from Class<T>
to ensure type-safety.

(I was torn here between using BiFunction or just exposing LazyValue as
@hide for Bundle since it feels like we're missing meaning/abstraction,
but end up leaving this way, advise if you'd prefer the other way)

There was a bit of a refactor in Parcel so readValue() could call
internal methods that accepted nullable Class<?> parameters with the
meaning that null = "no verification"  and non-null = "check against
type provided" (because the external APIs all require non-null
parameters).

Now we can return null in all cases when there is a type mismatch. Note
that the Bundle APIs catch ClassCastException to return null, but that
only works for non-generic types (eg. getSizeF()). For generic types
wrapping "return (T) o" with try-catch doesn't work because the type
gets erased to its bound at runtime, so the type mismatch escapes that
try-catch to the caller, potentially causing a crash. Now they happen
inside the getters, as the non-generic ones.

Test: Boots for now
Test: Working on CTS
Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
CTS-Coverage-Bug: 219980813
Change-Id: Ifcbeb34b4684d7de105756b9d414162a9205ffaa
2022-02-19 14:10:29 +00:00
Jeff Chang
e74a2a320b [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
(cherry picked from commit f36b7b9f80)
Merged-In:Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
2022-02-14 23:12:52 +00:00
Xin Li
2b87be68b8 Merge SP2A.220305.012
Bug: 219523960
Merged-In: I748fdd49626acaa0e986a9d8038039cada6faa60
Change-Id: I67693156d705f2488fe18149d2dd02d529f009ff
2022-02-14 20:06:38 +00:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Treehugger Robot
8bbb5be10e Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" 2022-02-10 18:04:39 +00:00
Junyu Lai
571e216af5 [MS70] Have BatteryStatsImpl use the public NetworkStats API
Test: BatteryStatsManagerTest
Bug: 204830222
  (cherry-picked from ag/16713581)
Change-Id: I35dd909b5da563cea27d8a81a81fe472c59e9b17
Merged-In: I35dd909b5da563cea27d8a81a81fe472c59e9b17
2022-02-09 22:04:45 +08:00
Ken Chen
f584f880ab Merge "Add system_server to net_admin group" 2022-02-09 09:42:29 +00:00
Jean Chalard
cbb2fa2f00 Merge "Allow VPN apps to ask for running the validation checks" 2022-02-09 06:03:45 +00:00
Ken Chen
5c5b682b6d Add system_server to net_admin group
This allows system_server to search/read skfilter BPF programs. Skfilter
BPF programs status were previously dumped by Netd. In Android T, the
related code are mainlined and dumped by system_server process.
system_server needs to be in net_admin group so that it can read program
status.

$ adb root; adb shell ls -l /sys/fs/bpf/
-r--r----- 1 root net_admin ... prog_netd_skfilter_allowlist_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_denylist_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_egress_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_ingress_xtbpf

Bug: 202086915
Test: test in Ib0e935ee2b714ac61daceba6d13fa7a20f97f68f
Change-Id: I8c48230a5da6873eee7d0ba183cb83e1d92cd8f6
2022-02-09 03:47:18 +00:00
Felipe Leme
0b6e3a959b Merge "Adds OWNERS to com.androd.internal.util.Dump*" 2022-02-08 18:14:23 +00:00