Skip to content

Commit ce6bc5e

Browse files
author
android-build-team Robot
committed
Snap for 7252659 from 3c8e090 to rvc-qpr3-release
Change-Id: I063534d34426d65b69bb158a1cf3c6c2393f96ca
2 parents 4d3951d + 3c8e090 commit ce6bc5e

7 files changed

Lines changed: 32 additions & 54 deletions

File tree

core/java/android/hardware/display/DisplayManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public final class DisplayManager {
6161
* {@link #EXTRA_WIFI_DISPLAY_STATUS} extra.
6262
* </p><p>
6363
* This broadcast is only sent to registered receivers and can only be sent by the system.
64+
* </p><p>
65+
* {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission is required to
66+
* receive this broadcast.
6467
* </p>
6568
* @hide
6669
*/

core/java/android/widget/RemoteViews.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ public Resources.Theme getTheme() {
593593
public String getPackageName() {
594594
return mContextForResources.getPackageName();
595595
}
596+
597+
@Override
598+
public boolean isRestricted() {
599+
// Override isRestricted and direct to resource's implementation. The isRestricted is
600+
// used for determining the risky resources loading, e.g. fonts, thus direct to context
601+
// for resource.
602+
return mContextForResources.isRestricted();
603+
}
596604
}
597605

598606
private class SetEmptyView extends Action {

packages/CarSystemUI/res-keyguard/layout-land/keyguard_pin_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
android:gravity="center"
5656
android:orientation="vertical">
5757

58-
<com.android.systemui.car.keyguard.UnfocusablePasswordTextView
58+
<com.android.keyguard.PasswordTextView
5959
android:id="@+id/pinEntry"
6060
android:layout_width="@dimen/keyguard_security_width"
6161
android:layout_height="@dimen/pin_entry_height"

packages/CarSystemUI/res-keyguard/layout/keyguard_pin_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
android:gravity="center"
4343
android:orientation="vertical">
4444

45-
<com.android.systemui.car.keyguard.UnfocusablePasswordTextView
45+
<com.android.keyguard.PasswordTextView
4646
android:id="@+id/pinEntry"
4747
android:layout_width="@dimen/keyguard_security_width"
4848
android:layout_height="@dimen/pin_entry_height"

packages/CarSystemUI/src/com/android/systemui/car/keyguard/UnfocusablePasswordTextView.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ Notification.Action createShareAction(Context context, Resources r, Uri uri) {
283283
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
284284

285285
// cancel current pending intent (if any) since clipData isn't used for matching
286-
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context, 0,
287-
sharingChooserIntent, PendingIntent.FLAG_CANCEL_CURRENT, null, UserHandle.CURRENT);
286+
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
287+
context, 0, sharingChooserIntent,
288+
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
289+
null, UserHandle.CURRENT);
288290

289291
// Create a share action for the notification
290292
PendingIntent shareAction = PendingIntent.getBroadcastAsUser(context, requestCode,
@@ -296,7 +298,8 @@ Notification.Action createShareAction(Context context, Resources r, Uri uri) {
296298
mSmartActionsEnabled)
297299
.setAction(Intent.ACTION_SEND)
298300
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
299-
PendingIntent.FLAG_CANCEL_CURRENT, UserHandle.SYSTEM);
301+
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
302+
UserHandle.SYSTEM);
300303

301304
Notification.Action.Builder shareActionBuilder = new Notification.Action.Builder(
302305
Icon.createWithResource(r, R.drawable.ic_screenshot_share),
@@ -325,7 +328,7 @@ Notification.Action createEditAction(Context context, Resources r, Uri uri) {
325328
editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
326329

327330
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context, 0,
328-
editIntent, 0, null, UserHandle.CURRENT);
331+
editIntent, PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT);
329332

330333
// Make sure pending intents for the system user are still unique across users
331334
// by setting the (otherwise unused) request code to the current user id.
@@ -340,7 +343,8 @@ Notification.Action createEditAction(Context context, Resources r, Uri uri) {
340343
mSmartActionsEnabled)
341344
.setAction(Intent.ACTION_EDIT)
342345
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
343-
PendingIntent.FLAG_CANCEL_CURRENT, UserHandle.SYSTEM);
346+
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
347+
UserHandle.SYSTEM);
344348
Notification.Action.Builder editActionBuilder = new Notification.Action.Builder(
345349
Icon.createWithResource(r, R.drawable.ic_screenshot_edit),
346350
r.getString(com.android.internal.R.string.screenshot_edit), editAction);
@@ -362,7 +366,9 @@ Notification.Action createDeleteAction(Context context, Resources r, Uri uri) {
362366
.putExtra(GlobalScreenshot.EXTRA_SMART_ACTIONS_ENABLED,
363367
mSmartActionsEnabled)
364368
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND),
365-
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
369+
PendingIntent.FLAG_CANCEL_CURRENT
370+
| PendingIntent.FLAG_ONE_SHOT
371+
| PendingIntent.FLAG_IMMUTABLE);
366372
Notification.Action.Builder deleteActionBuilder = new Notification.Action.Builder(
367373
Icon.createWithResource(r, R.drawable.ic_screenshot_delete),
368374
r.getString(com.android.internal.R.string.delete), deleteAction);
@@ -403,7 +409,7 @@ private List<Notification.Action> buildSmartActions(
403409
PendingIntent broadcastIntent = PendingIntent.getBroadcast(context,
404410
mRandom.nextInt(),
405411
intent,
406-
PendingIntent.FLAG_CANCEL_CURRENT);
412+
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
407413
broadcastActions.add(new Notification.Action.Builder(action.getIcon(), action.title,
408414
broadcastIntent).setContextual(true).addExtras(extras).build());
409415
}

services/core/java/com/android/server/display/WifiDisplayAdapter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ final class WifiDisplayAdapter extends DisplayAdapter {
9191

9292
private boolean mPendingStatusChangeBroadcast;
9393

94+
private static final String[] RECEIVER_PERMISSIONS_FOR_BROADCAST = {
95+
android.Manifest.permission.ACCESS_FINE_LOCATION,
96+
};
97+
9498
// Called with SyncRoot lock held.
9599
public WifiDisplayAdapter(DisplayManagerService.SyncRoot syncRoot,
96100
Context context, Handler handler, Listener listener,
@@ -432,7 +436,8 @@ private void handleSendStatusChangeBroadcast() {
432436
}
433437

434438
// Send protected broadcast about wifi display status to registered receivers.
435-
getContext().sendBroadcastAsUser(intent, UserHandle.ALL);
439+
getContext().createContextAsUser(UserHandle.ALL, 0)
440+
.sendBroadcastWithMultiplePermissions(intent, RECEIVER_PERMISSIONS_FOR_BROADCAST);
436441
}
437442

438443
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {

0 commit comments

Comments
 (0)