Commit Graph

11583 Commits

Author SHA1 Message Date
Xinyi Zhou
e0784e05bd Merge "Expose Conext.NEARBY_SERVICE as SystemApi" 2022-01-05 21:50:01 +00:00
Xinyi Zhou
1a07c53231 Expose Conext.NEARBY_SERVICE as SystemApi
Change-Id: Ie9fb547e166e6c881dfd04383050375a11f84a9b
Test: Built successfully
Bug: 189954300
2022-01-05 21:49:39 +00:00
Karishma Vakil
b66485f237 Merge "[SafetyCenter] Add broadcast action and extra constants for data refreshes" 2022-01-05 19:48:48 +00:00
Chun-Wei Wang
66b3b89f65 Merge "Move and rename some members (1/n)" 2022-01-05 10:23:03 +00:00
Sanjana Sunil
6a47a2ca39 Fix documentation on unbinding for bindServiceAsUser()
Similar to bindService(), even if bindServiceAsUser() returns false,
unbindService() must still be called to allow the service to shut down.
The documentation is updated to reflect this.

Bug: 212663289
Test: m ds-docs-java
Change-Id: I780d307f4a0ebf8bef508932181e580f168b5578
2021-12-30 11:34:15 +00:00
Karishma Vakil
f523f15028 [SafetyCenter] Add broadcast action and extra constants for data refreshes
Test: Will add when the constants are used in b/208624002.
Bug: 208623999
Bug: 210423417
Change-Id: I16482a7101c0f2429b79bac92e5b463f47b13a2d
2021-12-29 21:35:30 +00:00
Jeff Sharkey
e9a953fa2a Merge "Add a receiver exported flag to mark unaudited runtime receivers" 2021-12-22 21:24:08 +00:00
Xinyi Zhou
db2e52cc01 Merge "Revert "Add Neary feature to PackageManager"" 2021-12-22 20:20:59 +00:00
Michael Groover
7970fff4cd Add a receiver exported flag to mark unaudited runtime receivers
Android T allows apps to declare a runtime receiver as not exported
by invoking registerReceiver with a new RECEIVER_NOT_EXPORTED flag;
receivers registered with this flag will only receive broadcasts from
the platform and the app itself. However to ensure developers can
properly protect their receivers, all apps targeting T or later
registering a receiver for non-system broadcasts must specify either
the exported or not exported flag when invoking #registerReceiver;
if one of these flags is not provided, the platform will throw a
SecurityException. The platform and system apps have several locations
where a receiver is registered for non-system broadcasts that have
not yet been audited to determine if they should be exported. This
commit introduces a temporary flag that can be used to meet the
new requirement that a flag be specified while also marking the
receiver as needing an audit before the T release to determine
whether the receiver should be exported or not.

Bug: 161145287
Test: atest ContextTest
Change-Id: Ie9d1e2ad6e2d831c374437ed65d085711b7dc3b7
2021-12-21 16:42:47 -08:00
Amy Gu
eb9c1fb764 Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41 am: 379347b29a am: 9001310c40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I404a2ef9bdabcd5dba6529b4ca6f4b3463e31197
2021-12-21 19:19:04 +00:00
Amy Gu
9001310c40 Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41 am: 379347b29a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I9d0089997234826e6310d4fcda14cdf869ec5fdb
2021-12-21 19:06:21 +00:00
Amy Gu
379347b29a Merge "Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS" am: 73ded9f9df am: b5f0629d41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1858069

Change-Id: I7e00c46550eba9eb810d5b5112d6a4dd30d157cf
2021-12-21 18:53:01 +00:00
TreeHugger Robot
66eca70ab0 Merge "Change close guard logged messages" 2021-12-21 15:55:19 +00:00
Ioannis Ilkos
0bde67ab00 Change close guard logged messages
Unless we are looking at stack traces (e.g. from strict mode) it's not
possible to identify which type of object is not being closed (most
methods are 'close' or 'release). Change the logged text to clarify.

Change-Id: Ib90eac716f43c2c2caf8d8c6fb64a7bd90562da9
Test: manual
2021-12-21 11:46:10 +00:00
JW Wang
8c19110bee Move and rename some members (1/n)
This is a preliminary change to apply READY/FAILED/APPLIED to
non-staged sessions.

* Move mSession* fields to PackageInstallerSession as they
  will be useful to both staged and non-staged sessions.
* Rename some members as they will be applicable to both staged
  and non-staged sessions.

Bug: 210359798
Test: atest StagingManagerTest \
            PackageInstallerSessionTest \
            CtsStagedInstallHostTestCases

Change-Id: Ie1b09aa4c7cbc843712c731a1b903d26684b2e30
2021-12-21 13:37:59 +08:00
Amy Gu
d5451fb370 Specify two item limit for EXTRA_CHOOSER_TARGETS and EXTRA_INITIAL_INTENTS
Change-Id: If3fdaabf8456cc99f4cf7819ec89b3901a7c74c6
2021-12-21 01:21:52 +00:00
Hui Wang
c1183c038e Merge "Add new Telephony feature flags and update API annotations" 2021-12-20 15:50:57 +00:00
John Wu
7a6f2c8e23 Merge "Update system package broadcasts for app ID changes" 2021-12-17 01:31:04 +00:00
Evan Rosky
1b44d86802 Merge "Revert "Revert "Add XML configuration for density""" 2021-12-17 00:52:45 +00:00
Etienne Ruffieux
5251dfbc2a Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0 am: e5d5eefb16 am: 52dfe57f07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: I60fa5ecea7c9b1bffbd8bfaf0ed85cafb80fa5bc
2021-12-16 22:52:35 +00:00
John Wu
4776cdee49 Update system package broadcasts for app ID changes
Whenever a package's app ID has changed, the system broadcasts should
behave as if the package is fully uninstalled and then re-installed
subsequently. Additional extras are added to indicate the app ID change
to allow components to handle this case specifically.

Test: atest SharedUserMigrationTest#testDataMigration
Bug: 179284822
Change-Id: Ie00eaed1f0a704876ea76aa0e5ae2a1b21f199df
2021-12-16 14:48:56 -08:00
Etienne Ruffieux
52dfe57f07 Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0 am: e5d5eefb16
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: Id6bcfb0cca120540dd251dda22c713539c5c2b8c
2021-12-16 22:08:37 +00:00
Evan Rosky
ba816ea404 Revert "Revert "Add XML configuration for density""
This reverts commit 45c4562041.

Reason for revert: Seems like reverting didn't help.

Change-Id: Ic6ac4425646100a61a978b4e7388fab88d4d0ed1
2021-12-16 22:02:55 +00:00
Etienne Ruffieux
e5d5eefb16 Merge "Moved AttributionSource related APIs in AttributionSource" am: 70d456d06c am: 52ddc063b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922817

Change-Id: Id597191e675eca32c4d965fd4dc0e62dc2653283
2021-12-16 21:42:01 +00:00
Etienne Ruffieux
70d456d06c Merge "Moved AttributionSource related APIs in AttributionSource" 2021-12-16 21:16:58 +00:00
Joanne Chung
fcf3a92a1d Merge "Initial layout of selection toolbar." 2021-12-16 05:56:41 +00:00
Joanne Chung
41c4a0ac71 Initial layout of selection toolbar.
The initial selection toolbar related architecture. Render service
part and the implementation will be revised in the follow up changes.

Bug: 190030331
Bug: 205822301
Test: manual. Can boot to home and get manager successfully.
Ignore-AOSP-First: new file for T

Change-Id: Iab5d5f2e5e48e6258a63fb0c479194c958ea61e8
2021-12-16 11:35:23 +08:00
Yandry Perez Clemente
b9cd53b835 Merge "Fixes NullPointerException." 2021-12-15 23:30:57 +00:00
Etienne Ruffieux
770d50ed43 Moved AttributionSource related APIs in AttributionSource
Modified myAttributionSource() to check for global AS for
process in ActivityThread and fallback to building new AS
with PackageManager#getPackageForUid(myUid()) if null.

Tag: #feature
Bug: 210467846
Bug: 210468546
Test: build
Change-Id: I7aa75395469bf0bb806100420faaf98c52057355
CTS-Coverage-Bug: 210906055
2021-12-15 22:03:50 +00:00
Evan Rosky
373c8a1803 Merge "Revert "Add XML configuration for density"" 2021-12-15 21:06:22 +00:00
Evan Rosky
45c4562041 Revert "Add XML configuration for density"
This reverts commit a822ccd755.

Reason for revert: Broke a shell-transition CTS test (b/210902428)

Change-Id: I479a6152f94cc6aff30caa8f49932c53d420db1e
2021-12-15 21:02:58 +00:00
Bernardo Rufino
3d10fb4b83 Merge "Migrate unsafe parcel APIs in framework-minus-apex" 2021-12-15 19:15:58 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Yandry Perez Clemente
77b0bbb413 Fixes NullPointerException.
mPendingResult is not guaranteed to have been initialized at this point.

Test: Manual.
Bug: 210266601
Change-Id: I84287a068d03dd3aac2b046d1b8fdd8e6e52803f
2021-12-15 17:27:59 +00:00
Hui Wang
c47df7fd76 Add new Telephony feature flags and update API annotations
Bug: 206437821
Test: make
Test: atest CtsTelephonyTestCases FrameworksTelephonyTests
Change-Id: I511afb5afc52b859a37f8ae27ab671c2b8037527
2021-12-14 20:37:47 +00:00
Pinyao Ting
00276585c5 Merge "Include new api to exlude a shortcut from launcher" 2021-12-14 20:02:31 +00:00
Makoto Onuki
6bef72dbfe Merge changes from topic "per-process-app-class-2"
* changes:
  Support per-process Application class (AM and client side)
  Support per-process Application class (package parser)
  Support per-process Application class in <process> tag
2021-12-14 17:55:58 +00:00
Felka Chang
00964e9aea Dump theme inheritance information in UnsupportedOperationException
It isn't enough to only dump the theme id and name because there is
no whole theme inheritance map. Developers need the map to figure out
why the attribute value is so strange.

A theme is a kind of style. This patch creates an API to retrieve the
parent id for any style.  And, it dumps the whole inheritance between
themes until it can't find the parent style.

Test: manual test described in b/209708201#comment5
Bug: 209708201

Change-Id: I9de0e6e9aaeff7cb9fc89dc9b8a04925e84f975c
2021-12-14 11:42:30 +08:00
Makoto Onuki
236abad797 Support per-process Application class (package parser)
Now the <process> tag supports `android:name`, which takes a custom
Application class name. If omitted, the system defaults to the
class set in the <application> tag, or the default class which is
`android.app.Application`.

Bug: 197264681
Test: atest CtsProcessTest
Test: atest PackageManagerServiceUnitTests
Change-Id: Iaf336cc34fe950c4b3d8887de557857f8c23dc83
2021-12-13 16:28:32 -08:00
TreeHugger Robot
3cb6aeccbd Merge "Add theme information during throwing exception" 2021-12-13 07:20:16 +00:00
Pinyao Ting
338430cebb Include new api to exlude a shortcut from launcher
Include a new field in ShortcutInfo which serves as an indication of
whether a shortcut is exlucded from launcher. Shortcut marked as
excluded from launcher will not be included in the search result in
LauncherApps nor ShortcutManager. This generally means the shortcut
would not be displayed by a launcher app (e.g. Long-Press menu), while
remain visible in other surfaces such as assistant or
on-device-intelligence.

- setDynamicShortcuts/addDynamicShortcuts/pushDynamicShortcuts:
Shortcuts that are marked as hidden from launcher are ignored.

- updateShortcuts:
Similar to enabled/long-lived, developers cannot make shortcut hidden
from launcher by calling this api. An exception would be thrown when
updating a shortcut that is hidden from launcher.

- remove APIs:
Unchanged.

- reportShortcutUsed:
Unchanged.

- applyRestore:
Unchanged.

- disableShortcuts/enableShortcuts
Unchanged.

- requestPinShortcuts:
A shortcut cannot be pinned by launcher if it's hidden from launcher. An
exception would be thrown upon requesting to pin a shortcut that is
hidden from launcher.

Bug: 202335257
Test: manual enable feature flag for appsearch integration,
then run atest ShortcutManagerTest1

Change-Id: Ia0e5d31549c9d83efac9bc2a7ea894df425fd5cd
2021-12-11 04:30:18 +00:00
Jeremy Meyer
85c6cf1646 Merge "Don't update cached ApplicationInfo with old information" 2021-12-10 18:41:07 +00:00
Songchun Fan
5e303008b4 Merge "[pm] new APIs for ApplictaionInfo/PackageInfo/ComponentInfo/ResolveInfo flags" 2021-12-10 16:08:09 +00:00
Leon Scroggins
f96aa9e82b Merge changes from topics "GL_screen_decor", "VK_screen_decor"
* changes:
  Plumb support for rendering A8 in Vulkan
  Plumb through A8 for GL/EGL
  Add COLOR_MODE_A8/ColorMode::A8
  Treat AHARDWAREBUFFER_FORMAT_R8_UNORM as kAlpha_8_SkAlphaType
2021-12-10 13:49:39 +00:00
Artur Satayev
8029969f57 Merge "Add apex-system-service tag to AndroidManifest." 2021-12-10 13:08:42 +00:00
Jeremy Meyer
99a2847acb Don't update cached ApplicationInfo with old information
This adds a created timestamp to ApplicationInfo so that when an
instance is passed in to getPackageInfo() we can determine whether or
not we should update the cached version

Bug: 188059515
Test: Installed locally to verify behavior and appropriate log messages
Change-Id: Ie87781a9272ee89c5333f56d28da8c1d88feb78b
2021-12-10 00:16:33 +00:00
Leon Scroggins III
cbdbb66d8f Add COLOR_MODE_A8/ColorMode::A8
Currently unused. This will allow rending into A8 with HWUI

Bug: 193170859
Test: TODO
Change-Id: Ic1e1cb94dfa3dc08cbb174f0a38345d724570372
2021-12-09 12:12:26 -05:00
Felka Chang
dcd3a9cbe9 Add theme information during throwing exception
When an application defines themes that are not inherited from
android:style/Theme, it may cause UnsupportedOperationException.
The cause is that the attributes needed by the application are
defined in neither theme nor layout attribute set.

It takes really a long time to trace all of the themes applied.
This patch logs the basic information about themes to help the
developers to triage issues.

Test: manual test described in b/209708201#comment3

Bug: 209708201
Change-Id: I440aa18d9627adf5e35fd74d7adb1c895f0b169d
2021-12-09 14:44:05 +08:00
Xiaowen Lei
a676d9b3df Add callback registration mechanism for listening to communal state changes.
Design: go/communal-manager-api.

Note: this CL also removed "_MANAGER" from the communal service
constant, and "_manager" from the communal service name. When these
became unhidden, ApiLint.kt suggested the changes.
  - http://cs/android/tools/metalava/src/main/java/com/android/tools/metalava/ApiLint.kt;l=2369-2386;rcl=0ef26a465a89c45fcfd24d648883208cd0161fd2

Ignore-AOSP-First: tied to launch of new upcoming hardware.

Test: atest CtsAppTestCases:CommunalManagerTest
Test: atest FrameworksMockingServicesTests:CommunalManagerServiceTest

Bug: 206054365
Change-Id: I6d225d6ddb482d9cffb16d1f9a25a98abd0cc382
2021-12-08 23:45:42 +00:00
Naomi Musgrave
07cad8890e Merge "Introduce WindowManagerState field for sandboxing" into sc-v2-dev am: f5284f89be am: f6340cbbf3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16340536

Change-Id: If930f6fd7eca64bd02109f7d57077ea5cd418b75
2021-12-08 23:18:37 +00:00