Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
b6b014c
Snap for 6645851 from a4b2b6a6548e33ec7cccc8dc93b19664195a7503 to rvc…
Jul 1, 2020
ee8d8fd
Snap for 6646601 from ffde9e22a8d9e279c8d551b0340bad0d13a0e8ea to rvc…
Jul 1, 2020
1a9ea6e
Snap for 6649874 from 884da7c336d73a5d69bd56762db290c6388119e3 to rvc…
Jul 2, 2020
a75d3a5
Snap for 6652088 from b492e87e840fb8ccb367b55cb685dd8652d25fbd to rvc…
Jul 3, 2020
36f7a0e
Snap for 6652889 from c3e102d5cb0c12812ff7caa3f6ef4a44ee4a0cb0 to rvc…
Jul 4, 2020
4d03bff
Snap for 6653776 from 1219b096a62f0ce18e6155c0669c00297e46095d to rvc…
Jul 5, 2020
27c4329
Snap for 6656546 from 81d4133de97fc5d0ff261ea142130517b01f332e to rvc…
Jul 6, 2020
59e3d29
Snap for 6659731 from 62b824a3f813a864b0feebad338607fc346dac72 to rvc…
Jul 7, 2020
91c6970
Snap for 6663666 from c0dee7a7c258449a5365c557eb1d8b0bc3de383b to rvc…
Jul 8, 2020
84204d1
Snap for 6667244 from dc26c091d975767c6cae98bef855c391687254d3 to rvc…
Jul 9, 2020
3e93ffd
Snap for 6670641 from 56ec0b95bce078b6d80130242152a2a9e8f5a20f to rvc…
Jul 10, 2020
d9f437b
Snap for 6672721 from f4e2405ad9ef043d7d08f5e54c7266481e825ba4 to rvc…
Jul 11, 2020
7ea9758
Snap for 6673543 from f9660d7e69fac4e0a1300cf1439f7b7140cee466 to rvc…
Jul 12, 2020
600e89c
Snap for 6676242 from e076abfa548e7560e576a7b1bbc011892ab354d1 to rvc…
Jul 13, 2020
aac2661
Snap for 6680110 from f8dd92c892be5ad2753c13e1aa6b1a518bdfbff5 to rvc…
Jul 14, 2020
8b1b4b6
Snap for 6683212 from 4c4973248f967a3b49769c7358a524f6a9b61759 to rvc…
Jul 15, 2020
e0b95e1
Snap for 6686801 from 076c246c260ac3e290232a6b88802bf1eb598e00 to rvc…
Jul 16, 2020
593890a
Snap for 6689685 from 647d9fb723457e216e24c15717bbb7f1dadafecf to rvc…
Jul 17, 2020
34ed339
Snap for 6691283 from 8cb95a922476c8c902d8d62dfea92e8c5bd88b80 to rvc…
Jul 18, 2020
8d68d67
Snap for 6692467 from daaf5ac3b988236f452bd72dcb681a723519bd67 to rvc…
Jul 19, 2020
76301de
Snap for 6694650 from cfeb7627b760ff0caf4c0f2746657bcbec54b2ed to rvc…
Jul 20, 2020
adca313
Snap for 6697958 from ccaa8826ebe3738883d799232e32a139a95f3b05 to rvc…
Jul 21, 2020
fbfab42
Snap for 6701292 from 2e6e7534e753cc29ead2cf036917c98143001c3d to rvc…
Jul 22, 2020
955f2b4
Snap for 6703926 from 9a85dc9c0a75ff0bb210db9b0712786b57ac5c61 to rvc…
Jul 23, 2020
97618ad
Snap for 6707956 from b8b8f1323b594faad64e702d887f5142316c18a8 to rvc…
Jul 24, 2020
a7b52f9
Snap for 6709207 from 486e4a47cdb9f1263727aada5b5bb0f7a88525e6 to rvc…
Jul 25, 2020
0ca6571
Snap for 6710268 from f1b82b20daae5c669fb732e4110961028379f40c to rvc…
Jul 26, 2020
e138c1f
Snap for 6712964 from 77d8407cb09cd7367e6f5a535d637de5d83d1240 to rvc…
Jul 27, 2020
df442ea
Snap for 6714637 from 5080b25002f20f4f97cb819d7020c0074fb2f8c5 to rvc…
Jul 28, 2020
658426a
Snap for 6720487 from 92ffd8ab349326ed5e000e299146a1d10c796f8c to rvc…
Jul 29, 2020
f0cdaf5
Snap for 6723788 from 5a187f3d19f7e9d1a6b6a1a834cb1eb30f4bafff to rvc…
Jul 30, 2020
5dda5b1
Snap for 6727488 from d53798ab4b5998863c3bbc420787ba96a0f0167e to rvc…
Jul 31, 2020
84fba97
Snap for 6729113 from 82abf1c4cd969bf0c227f686fc7915cd34aa8429 to rvc…
Aug 1, 2020
9cff028
Snap for 6732780 from ed199955080f1a6d07b99dd49deeb0c7f2def9d7 to rvc…
Aug 3, 2020
4708849
Snap for 6736586 from e2a535da8ae862286b6e693d76474b24a16ae806 to rvc…
Aug 4, 2020
23e3db4
Snap for 6740034 from b0c1ac5b2efdf26733ef2182e1ba8c2143b8fa55 to rvc…
Aug 5, 2020
429a1dd
Snap for 6743184 from 484f9ac99f3848468afd542473cd50b3860a56fe to rvc…
Aug 6, 2020
7a2cc11
Snap for 6746904 from 4eb63b672f77883b088901aea584e795ecfa247c to rvc…
Aug 7, 2020
c88709c
Snap for 6748432 from 607893c94ac6161b4e13b1fa92905904d4235f7e to rvc…
Aug 8, 2020
4ff4297
Snap for 6749401 from 9a31626797da096ff87f1065deb92a897d701287 to rvc…
Aug 9, 2020
8662277
Snap for 6751875 from afe934fbfbc40d1614445d1d5af982833854a952 to rvc…
Aug 10, 2020
267f3c2
Snap for 6755001 from ac81a5725d4bf8115909a59a45bd1403dce46717 to rvc…
Aug 11, 2020
aa26b42
Snap for 6758226 from ca28a90bec0180c09ab215442e6edb9bf5e9d217 to rvc…
Aug 12, 2020
b0d7023
Snap for 6761348 from c6cf6ba1ab3a215b89c7c4afb654d35b4757987a to rvc…
Aug 13, 2020
73b8335
Snap for 6764940 from e2ea331b608dd55f3c70a2051a8faee7baeba1aa to rvc…
Aug 14, 2020
ecca488
Snap for 6766785 from f237648d358a59848ce75db1838e46fbc7d19ff6 to rvc…
Aug 15, 2020
350c832
Snap for 6770235 from be05cd4b4032c1ad158c988b4c94e968cb3afd7e to rvc…
Aug 17, 2020
04bae13
Snap for 6773961 from 3743d5526ac7a43d486a109b521dafa7a8a87874 to rvc…
Aug 18, 2020
380c63a
Snap for 6777077 from 1706f9c22fc66763aba2adeddefdb1ca93772310 to rvc…
Aug 19, 2020
ac37bd0
Snap for 6780056 from ff2866cfd6708ee076dd4e34d64b74dfab1f0844 to rvc…
Aug 20, 2020
c2ea2f4
Snap for 6782765 from 8293d8aba7f5d88623e5533e29347e9a147946c0 to rvc…
Aug 21, 2020
35a038c
Snap for 6784103 from 8c5cf4e79ad5cc788a9264271a5756cf9b22d9cb to rvc…
Aug 22, 2020
5cd50bf
Snap for 6785130 from 13603052315f0463d6b9450291e2451a738369f0 to rvc…
Aug 23, 2020
8fd233b
Snap for 6787280 from 70c2974749a6b1f9c05a3e40e6c2c868694feb64 to rvc…
Aug 24, 2020
d2aba2f
Snap for 6790172 from 45c1b35d205f1e473059c8ec6d31e38107022182 to rvc…
Aug 25, 2020
e728ad1
Snap for 6793271 from 31033289f76f980f66b23ee1565c12048d8c3e65 to rvc…
Aug 26, 2020
aec8ca1
Snap for 6796148 from e959f09461d467eee1f0d284a3cefc72f23ec8db to rvc…
Aug 27, 2020
eafbbb0
Snap for 6799200 from b9a7e3ae9409520fa24b4d4481d6ec156a056dd2 to rvc…
Aug 28, 2020
547580b
Snap for 6800518 from 5141d72634bda76c9144ec72f25535ec1df7a559 to rvc…
Aug 29, 2020
196aa40
Snap for 6803753 from 0ac2f4e4f7bd289274276f1222d9e81aa386e82f to rvc…
Aug 31, 2020
5faa3e8
Snap for 6806651 from a918ea54ccec2ec743bd7678d13371bdb9961043 to rvc…
Sep 1, 2020
df091bc
Snap for 6809626 from 65f41278ee2aa400584db16a37695d817bbb5a94 to rvc…
Sep 2, 2020
f999fa6
Snap for 6812348 from a1603bbd9ffd999dad0e313a0f8b18d4e806a6cd to rvc…
Sep 3, 2020
a22a430
Snap for 6814464 from 854710d0f36d47666ed8f8b86b23e254fc44ab67 to rvc…
Sep 4, 2020
c2a3de9
Snap for 6818149 from decfef24ccdce911e8d710548d27d5f6dd10bfb2 to rvc…
Sep 7, 2020
511edc7
Snap for 6820514 from 71f959be7ea231dbcbc012990734259fe289a0ee to rvc…
Sep 8, 2020
df12089
Snap for 6823548 from 11762798d46f6cf88acd2a447d8adffb0577c417 to rvc…
Sep 9, 2020
a4a0444
Snap for 6826141 from f7de20634cb6b64ddb83445d025c2accd317f506 to rvc…
Sep 10, 2020
202ea82
Snap for 6828801 from a2da145ff6cdf0767b91998c17d33d0c601c543c to rvc…
Sep 11, 2020
5d297a6
Snap for 6831956 from 5656705d6de9ffe197af5edc2fac3c9a5f337d38 to rvc…
Sep 13, 2020
7c5a650
Snap for 6834531 from ea029eeb8d97a501b29b35dd7aaad0256668c701 to rvc…
Sep 14, 2020
febe4a2
Snap for 6838106 from 6c6907db9d11129769dc6fbd8b94d806a6a58a20 to rvc…
Sep 15, 2020
f2a81c5
Snap for 6841706 from 933f16e52490e637c4afbd80d7235ab9d0989ee1 to rvc…
Sep 16, 2020
7d6c286
Snap for 6844997 from acbb253b9d61fdc97b3e7f65ad18114a12afd8a8 to rvc…
Sep 17, 2020
4a75a50
Snap for 6847696 from c6095a415b4fb136ef32713f94c664678122ed07 to rvc…
Sep 18, 2020
3e2cd42
Snap for 6849206 from ab64b3236052feb6ce6f039bf8c04abaacac2c97 to rvc…
Sep 19, 2020
6a902b9
Snap for 6850254 from 5835eaa4ab48e5def924218db840a896e471dc00 to rvc…
Sep 20, 2020
f668704
Snap for 6852881 from 1989311276e851a2e9c8dadc44481a665b2bf39d to rvc…
Sep 21, 2020
5c4e69c
Snap for 6855963 from 79a1219925b2c8d7a12cc63a95bbffb914484cbe to rvc…
Sep 22, 2020
aa3e4d5
Snap for 6859016 from c4f7aa4577d9361df5f97b0e3990aa448534b06e to rvc…
Sep 23, 2020
6cb400d
Snap for 6862191 from 711cdc2220efb31eb41f5e66ab453b2f5e885279 to rvc…
Sep 24, 2020
16a691f
Don't dump binder proxies with the lock held.
Sep 24, 2020
bdd5f02
Merge cherrypicks of [12698973] into rvc-qpr1-release
Sep 25, 2020
0387064
Snap for 6864616 from 85f5802bec377a36b59efde1ca14be6d00cd52e3 to rvc…
Sep 25, 2020
187e505
Snap for 6866310 from 9195b3905e34db7ef724e95a51714476fd8dbd34 to rvc…
Sep 26, 2020
f7de870
Snap for 6867210 from b381de4cd0141c56135e7a36cfd047dca7175852 to rvc…
Sep 27, 2020
e6e9ce7
Snap for 6869386 from f54a2f3e49ce55e2287240105a4858695940ab4a to rvc…
Sep 28, 2020
f5a8542
Snap for 6872792 from 2ca98d205756ab6d944558c20ee4d950717ac472 to rvc…
Sep 29, 2020
8b40176
Snap for 6875707 from 0c52a7600f6cb1c35ab047d4ca78747693c52eda to rvc…
Sep 30, 2020
2ed2c83
Snap for 6880396 from 467128aef528e1314f144d4e1d3be58202723f30 to rvc…
Oct 2, 2020
11725e1
Require permission to create trusted displays
Aug 1, 2020
cdb9134
Validate user-supplied URIs in DocumentsProvider calls
Aug 13, 2020
0b4cd45
Validate user-supplied tree URIs in DocumentsProvider calls
Aug 12, 2020
af35aa5
[BACKPORT] Improve location checks in TelephonyRegistry
May 27, 2020
a13cfc0
Protect bluetooth.device.action.ALIAS_CHANGED
myles-android Jul 31, 2020
61b620a
Fix storing the wrong value of mLockdown in setting
Oct 5, 2020
cf9d5d5
Fix out of bound error of IncidentService
Aug 19, 2020
1a6f1fb
Do not re-initialize synthetic password
Sep 16, 2020
a37060d
Use shared libdrmframeworkcommon.
Sep 29, 2020
47b8faf
Merge cherrypicks of [12820899, 12820921, 12820267, 12820924, 1282069…
Oct 13, 2020
11d7861
DO NOT MERGE: Revert "Don't let IME window fit status bar"
Oct 14, 2020
e0b64f1
Merge cherrypicks of [12841496, 12841515, 12841186, 12841100, 1284149…
Oct 14, 2020
a185996
Fix the issue provider can be wrong when requesting slice permission
pinyaoting Jul 16, 2020
9ac71ec
Enforce permission checks in getting app exit reasons
Aug 28, 2020
9588cd7
DO NOT MERGE Check fingerprint client against top activity in auth ca…
curtislb Oct 2, 2020
e237a83
remove sensitive pii from safetynet logging
pinyaoting Oct 8, 2020
0c17049
RESTRICT AUTOMERGE
Oct 12, 2020
03da463
Ensure permissions are revoked on state changes
Oct 14, 2020
c4ce178
Revoke permission on non-runtime -> runtime upgrade
moltmann Nov 3, 2020
90cfe17
Hide overlays over uninstall confirm dialog
moltmann Oct 28, 2020
828fe0b
Protect GrantCredentialsPermissionActivity against overlay.
Nov 10, 2020
0b610a2
Ignore GrantCredentials call with unexpected calling uid.
Nov 11, 2020
513c3b5
Merge cherrypicks of [13083486, 13083716, 13083431, 13083573, 1308354…
Nov 18, 2020
714ee76
Add support for app signature spoofing
kdrag0n Oct 5, 2020
d49f263
add Seedvault as backup provider
dslul Feb 3, 2021
d89397c
Set backup transport programmatically
dslul Feb 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ package android {
field public static final String DUMP = "android.permission.DUMP";
field public static final String EXPAND_STATUS_BAR = "android.permission.EXPAND_STATUS_BAR";
field public static final String FACTORY_TEST = "android.permission.FACTORY_TEST";
field public static final String FAKE_PACKAGE_SIGNATURE = "android.permission.FAKE_PACKAGE_SIGNATURE";
field public static final String FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE";
field public static final String GET_ACCOUNTS = "android.permission.GET_ACCOUNTS";
field public static final String GET_ACCOUNTS_PRIVILEGED = "android.permission.GET_ACCOUNTS_PRIVILEGED";
Expand Down Expand Up @@ -182,6 +183,7 @@ package android {
field public static final String CALL_LOG = "android.permission-group.CALL_LOG";
field public static final String CAMERA = "android.permission-group.CAMERA";
field public static final String CONTACTS = "android.permission-group.CONTACTS";
field public static final String FAKE_PACKAGE = "android.permission-group.FAKE_PACKAGE";
field public static final String LOCATION = "android.permission-group.LOCATION";
field public static final String MICROPHONE = "android.permission-group.MICROPHONE";
field public static final String PHONE = "android.permission-group.PHONE";
Expand Down
4 changes: 4 additions & 0 deletions cmds/incidentd/src/IncidentService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ status_t IncidentService::command(FILE* in, FILE* out, FILE* err, Vector<String8
return NO_ERROR;
}
if (!args[0].compare(String8("section"))) {
if (argCount == 1) {
fprintf(out, "Not enough arguments for section\n");
return NO_ERROR;
}
int id = atoi(args[1]);
int idx = 0;
while (SECTION_LIST[idx] != NULL) {
Expand Down
37 changes: 31 additions & 6 deletions core/java/android/accounts/GrantCredentialsPermissionActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@
package android.accounts;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.LinearLayout;
import android.view.View;
import android.view.LayoutInflater;
import android.app.ActivityTaskManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.internal.R;

import java.io.IOException;
Expand All @@ -42,11 +49,15 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
private Account mAccount;
private String mAuthTokenType;
private int mUid;
private int mCallingUid;
private Bundle mResultBundle = null;
protected LayoutInflater mInflater;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addSystemFlags(
android.view.WindowManager.LayoutParams
.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
setContentView(R.layout.grant_credentials_permission);
setTitle(R.string.grant_permissions_header_text);

Expand Down Expand Up @@ -74,6 +85,20 @@ protected void onCreate(Bundle savedInstanceState) {
return;
}

try {
IBinder activityToken = getActivityToken();
mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
} catch (RemoteException re) {
// Couldn't figure out caller details
Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
}

if (!UserHandle.isSameApp(mCallingUid, Process.SYSTEM_UID) && mCallingUid != mUid) {
setResult(Activity.RESULT_CANCELED);
finish();
return;
}

String accountTypeLabel;
try {
accountTypeLabel = getAccountLabel(mAccount);
Expand Down
15 changes: 13 additions & 2 deletions core/java/android/app/ActivityView.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,31 @@ public ActivityView(Context context, AttributeSet attrs, int defStyle,
public ActivityView(
@NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
boolean singleTaskInstance, boolean usePublicVirtualDisplay) {
this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay, false);
this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay,
false /* disableSurfaceViewBackgroundLayer */);
}

/** @hide */
public ActivityView(
@NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
boolean singleTaskInstance, boolean usePublicVirtualDisplay,
boolean disableSurfaceViewBackgroundLayer) {
this(context, attrs, defStyle, singleTaskInstance, usePublicVirtualDisplay,
disableSurfaceViewBackgroundLayer, false /* useTrustedDisplay */);
}

// TODO(b/162901735): Refactor ActivityView with Builder
/** @hide */
public ActivityView(
@NonNull Context context, @NonNull AttributeSet attrs, int defStyle,
boolean singleTaskInstance, boolean usePublicVirtualDisplay,
boolean disableSurfaceViewBackgroundLayer, boolean useTrustedDisplay) {
super(context, attrs, defStyle);
if (useTaskOrganizer()) {
mTaskEmbedder = new TaskOrganizerTaskEmbedder(context, this);
} else {
mTaskEmbedder = new VirtualDisplayTaskEmbedder(context, this, singleTaskInstance,
usePublicVirtualDisplay);
usePublicVirtualDisplay, useTrustedDisplay);
}
mSurfaceView = new SurfaceView(context, null, 0, 0, disableSurfaceViewBackgroundLayer);
// Since ActivityView#getAlpha has been overridden, we should use parent class's alpha
Expand Down
1 change: 1 addition & 0 deletions core/java/android/app/slice/SliceProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public abstract class SliceProvider extends ContentProvider {
*/
public static final String EXTRA_PKG = "pkg";
/**
* @Deprecated provider pkg is now being extracted in SlicePermissionActivity
* @hide
*/
public static final String EXTRA_PROVIDER_PKG = "provider_pkg";
Expand Down
26 changes: 15 additions & 11 deletions core/java/android/inputmethodservice/InputMethodService.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package android.inputmethodservice;

import static android.graphics.Color.TRANSPARENT;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.ViewRootImpl.NEW_INSETS_MODE_NONE;
import static android.view.WindowInsets.Type.navigationBars;
import static android.view.WindowInsets.Type.statusBars;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;

import static java.lang.annotation.RetentionPolicy.SOURCE;
Expand Down Expand Up @@ -69,6 +69,7 @@
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsets.Side;
import android.view.WindowManager;
import android.view.animation.AnimationUtils;
Expand Down Expand Up @@ -1202,22 +1203,25 @@ public boolean enableHardwareAcceleration() {
Context.LAYOUT_INFLATER_SERVICE);
mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState,
WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false);
mWindow.getWindow().getAttributes().setFitInsetsTypes(navigationBars());
mWindow.getWindow().getAttributes().setFitInsetsTypes(statusBars() | navigationBars());
mWindow.getWindow().getAttributes().setFitInsetsSides(Side.all() & ~Side.BOTTOM);
mWindow.getWindow().getAttributes().setFitInsetsIgnoringVisibility(true);

// Our window will extend into the status bar area no matter the bar is visible or not.
// We don't want the ColorView to be visible when status bar is shown.
mWindow.getWindow().setStatusBarColor(TRANSPARENT);

// Automotive devices may request the navigation bar to be hidden when the IME shows up
// (controlled via config_automotiveHideNavBarForKeyboard) in order to maximize the visible
// screen real estate. When this happens, the IME window should animate from the bottom of
// the screen to reduce the jank that happens from the lack of synchronization between the
// bottom system window and the IME window.
// IME layout should always be inset by navigation bar, no matter its current visibility,
// unless automotive requests it. Automotive devices may request the navigation bar to be
// hidden when the IME shows up (controlled via config_automotiveHideNavBarForKeyboard)
// in order to maximize the visible screen real estate. When this happens, the IME window
// should animate from the bottom of the screen to reduce the jank that happens from the
// lack of synchronization between the bottom system window and the IME window.
if (mIsAutomotive && mAutomotiveHideNavBarForKeyboard) {
mWindow.getWindow().setDecorFitsSystemWindows(false);
}
mWindow.getWindow().getDecorView().setOnApplyWindowInsetsListener(
(v, insets) -> v.onApplyWindowInsets(
new WindowInsets.Builder(insets).setInsets(
navigationBars(),
insets.getInsetsIgnoringVisibility(navigationBars()))
.build()));

// For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set
// by default (but IME developers can opt this out later if they want a new behavior).
Expand Down
42 changes: 30 additions & 12 deletions core/java/android/provider/DocumentsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,15 @@ public boolean isChildDocument(String parentDocumentId, String documentId) {
}

/** {@hide} */
private void enforceTree(Uri documentUri) {
if (isTreeUri(documentUri)) {
private void enforceTreeForExtraUris(Bundle extras) {
enforceTree(extras.getParcelable(DocumentsContract.EXTRA_URI));
enforceTree(extras.getParcelable(DocumentsContract.EXTRA_PARENT_URI));
enforceTree(extras.getParcelable(DocumentsContract.EXTRA_TARGET_URI));
}

/** {@hide} */
private void enforceTree(@Nullable Uri documentUri) {
if (documentUri != null && isTreeUri(documentUri)) {
final String parent = getTreeDocumentId(documentUri);
final String child = getDocumentId(documentUri);
if (Objects.equals(parent, child)) {
Expand All @@ -232,6 +239,10 @@ private void enforceTree(Uri documentUri) {
}
}

private Uri validateIncomingNullableUri(@Nullable Uri uri) {
return uri == null ? null : validateIncomingUri(uri);
}

/**
* Create a new document and return its newly generated
* {@link Document#COLUMN_DOCUMENT_ID}. You must allocate a new
Expand Down Expand Up @@ -1076,11 +1087,21 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
final Context context = getContext();
final Bundle out = new Bundle();

// If the URI is a tree URI performs some validation.
enforceTreeForExtraUris(extras);

final Uri extraUri = validateIncomingNullableUri(
extras.getParcelable(DocumentsContract.EXTRA_URI));
final Uri extraTargetUri = validateIncomingNullableUri(
extras.getParcelable(DocumentsContract.EXTRA_TARGET_URI));
final Uri extraParentUri = validateIncomingNullableUri(
extras.getParcelable(DocumentsContract.EXTRA_PARENT_URI));

if (METHOD_EJECT_ROOT.equals(method)) {
// Given that certain system apps can hold MOUNT_UNMOUNT permission, but only apps
// signed with platform signature can hold MANAGE_DOCUMENTS, we are going to check for
// MANAGE_DOCUMENTS or associated URI permission here instead
final Uri rootUri = extras.getParcelable(DocumentsContract.EXTRA_URI);
final Uri rootUri = extraUri;
enforceWritePermissionInner(rootUri, getCallingPackage(), getCallingAttributionTag(),
null);

Expand All @@ -1090,7 +1111,7 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
return out;
}

final Uri documentUri = extras.getParcelable(DocumentsContract.EXTRA_URI);
final Uri documentUri = extraUri;
final String authority = documentUri.getAuthority();
final String documentId = DocumentsContract.getDocumentId(documentUri);

Expand All @@ -1099,14 +1120,11 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
"Requested authority " + authority + " doesn't match provider " + mAuthority);
}

// If the URI is a tree URI performs some validation.
enforceTree(documentUri);

if (METHOD_IS_CHILD_DOCUMENT.equals(method)) {
enforceReadPermissionInner(documentUri, getCallingPackage(),
getCallingAttributionTag(), null);

final Uri childUri = extras.getParcelable(DocumentsContract.EXTRA_TARGET_URI);
final Uri childUri = extraTargetUri;
final String childAuthority = childUri.getAuthority();
final String childId = DocumentsContract.getDocumentId(childUri);

Expand Down Expand Up @@ -1173,7 +1191,7 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
revokeDocumentPermission(documentId);

} else if (METHOD_COPY_DOCUMENT.equals(method)) {
final Uri targetUri = extras.getParcelable(DocumentsContract.EXTRA_TARGET_URI);
final Uri targetUri = extraTargetUri;
final String targetId = DocumentsContract.getDocumentId(targetUri);

enforceReadPermissionInner(documentUri, getCallingPackage(),
Expand All @@ -1197,9 +1215,9 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
}

} else if (METHOD_MOVE_DOCUMENT.equals(method)) {
final Uri parentSourceUri = extras.getParcelable(DocumentsContract.EXTRA_PARENT_URI);
final Uri parentSourceUri = extraParentUri;
final String parentSourceId = DocumentsContract.getDocumentId(parentSourceUri);
final Uri targetUri = extras.getParcelable(DocumentsContract.EXTRA_TARGET_URI);
final Uri targetUri = extraTargetUri;
final String targetId = DocumentsContract.getDocumentId(targetUri);

enforceWritePermissionInner(documentUri, getCallingPackage(),
Expand All @@ -1225,7 +1243,7 @@ private Bundle callUnchecked(String method, String arg, Bundle extras)
}

} else if (METHOD_REMOVE_DOCUMENT.equals(method)) {
final Uri parentSourceUri = extras.getParcelable(DocumentsContract.EXTRA_PARENT_URI);
final Uri parentSourceUri = extraParentUri;
final String parentSourceId = DocumentsContract.getDocumentId(parentSourceUri);

enforceReadPermissionInner(parentSourceUri, getCallingPackage(),
Expand Down
9 changes: 8 additions & 1 deletion core/java/android/window/VirtualDisplayTaskEmbedder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC;
import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_TRUSTED;
import static android.view.Display.INVALID_DISPLAY;

import android.app.ActivityManager;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
private int mDisplayDensityDpi;
private final boolean mSingleTaskInstance;
private final boolean mUsePublicVirtualDisplay;
private final boolean mUseTrustedDisplay;
private VirtualDisplay mVirtualDisplay;
private Insets mForwardedInsets;
private DisplayMetrics mTmpDisplayMetrics;
Expand All @@ -77,10 +79,12 @@ public class VirtualDisplayTaskEmbedder extends TaskEmbedder {
* only applicable if virtual displays are used
*/
public VirtualDisplayTaskEmbedder(Context context, VirtualDisplayTaskEmbedder.Host host,
boolean singleTaskInstance, boolean usePublicVirtualDisplay) {
boolean singleTaskInstance, boolean usePublicVirtualDisplay,
boolean useTrustedDisplay) {
super(context, host);
mSingleTaskInstance = singleTaskInstance;
mUsePublicVirtualDisplay = usePublicVirtualDisplay;
mUseTrustedDisplay = useTrustedDisplay;
}

/**
Expand All @@ -103,6 +107,9 @@ public boolean onInitialize() {
if (mUsePublicVirtualDisplay) {
virtualDisplayFlags |= VIRTUAL_DISPLAY_FLAG_PUBLIC;
}
if (mUseTrustedDisplay) {
virtualDisplayFlags |= VIRTUAL_DISPLAY_FLAG_TRUSTED;
}

mVirtualDisplay = displayManager.createVirtualDisplay(
DISPLAY_NAME + "@" + System.identityHashCode(this), mHost.getWidth(),
Expand Down
17 changes: 16 additions & 1 deletion core/res/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<protected-broadcast android:name="android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED" />
<protected-broadcast android:name="android.bluetooth.device.action.UUID" />
<protected-broadcast android:name="android.bluetooth.device.action.MAS_INSTANCE" />
<protected-broadcast android:name="android.bluetooth.action.ALIAS_CHANGED" />
<protected-broadcast android:name="android.bluetooth.device.action.ALIAS_CHANGED" />
<protected-broadcast android:name="android.bluetooth.device.action.FOUND" />
<protected-broadcast android:name="android.bluetooth.device.action.CLASS_CHANGED" />
<protected-broadcast android:name="android.bluetooth.device.action.ACL_CONNECTED" />
Expand Down Expand Up @@ -2829,6 +2829,21 @@
android:description="@string/permdesc_getPackageSize"
android:protectionLevel="normal" />

<!-- Dummy user-facing group for faking package signature -->
<permission-group android:name="android.permission-group.FAKE_PACKAGE"
android:label="@string/permgrouplab_fake_package_signature"
android:description="@string/permgroupdesc_fake_package_signature"
android:request="@string/permgrouprequest_fake_package_signature"
android:priority="100" />

<!-- Allows an application to change the package signature as
seen by applications -->
<permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
android:permissionGroup="android.permission-group.UNDEFINED"
android:protectionLevel="dangerous"
android:label="@string/permlab_fakePackageSignature"
android:description="@string/permdesc_fakePackageSignature" />

<!-- @deprecated No longer useful, see
{@link android.content.pm.PackageManager#addPackageToPreferred}
for details. -->
Expand Down
2 changes: 2 additions & 0 deletions core/res/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,8 @@
<string-array name="config_locationProviderPackageNames" translatable="false">
<!-- The standard AOSP fused location provider -->
<item>com.android.location.fused</item>
<!-- Google Play Services or microG (free reimplementation) location provider -->
<item>com.google.android.gms</item>
</string-array>

<!-- This string array can be overriden to enable test location providers initially. -->
Expand Down
Loading