diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-09-10 03:01:35 +0000 |
---|---|---|
committer | Anis Assi <anisassi@google.com> | 2021-10-01 19:57:34 +0000 |
commit | 2b65ceda5b001f232527a67aadeaac474799ad90 (patch) | |
tree | 65d426cd3cc06bca50bab1718da770d023ed4af3 | |
parent | 5f889a0c4b8c9587efb4fbd0827f056bf468f1de (diff) | |
parent | f40bca9a60e4dd1c9b68327d6459118c4fa61da1 (diff) | |
download | base-android-security-10.0.0_r60.tar.gz |
Merge cherrypicks of [15800897, 15800899, 15800901, 15800903, 15800905, 15801007, 15800676, 15800678, 15800969, 15800800] into security-aosp-qt-releaseandroid-security-10.0.0_r60
Change-Id: I53bc552cdf99f2c28954c37db6b4c8bb70b8c51f
8 files changed, 20 insertions, 36 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 388161d76308..362727731c9f 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1059,7 +1059,14 @@ public final class BluetoothDevice implements Parcelable { return null; } try { - return service.getRemoteAlias(this); + String alias = service.getRemoteAlias(this); + if (alias == null) { + return getName(); + } + return alias + .replace('\t', ' ') + .replace('\n', ' ') + .replace('\r', ' '); } catch (RemoteException e) { Log.e(TAG, "", e); } diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java index 226b8e549a9e..c062f8c13d75 100644 --- a/core/java/android/hardware/camera2/params/OutputConfiguration.java +++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java @@ -631,13 +631,7 @@ public final class OutputConfiguration implements Parcelable { new Parcelable.Creator<OutputConfiguration>() { @Override public OutputConfiguration createFromParcel(Parcel source) { - try { - OutputConfiguration outputConfiguration = new OutputConfiguration(source); - return outputConfiguration; - } catch (Exception e) { - Log.e(TAG, "Exception creating OutputConfiguration from parcel", e); - return null; - } + return new OutputConfiguration(source); } @Override diff --git a/core/java/android/hardware/camera2/params/SessionConfiguration.java b/core/java/android/hardware/camera2/params/SessionConfiguration.java index 555ff9aff184..001110ac8b84 100644 --- a/core/java/android/hardware/camera2/params/SessionConfiguration.java +++ b/core/java/android/hardware/camera2/params/SessionConfiguration.java @@ -138,13 +138,7 @@ public final class SessionConfiguration implements Parcelable { new Parcelable.Creator<SessionConfiguration> () { @Override public SessionConfiguration createFromParcel(Parcel source) { - try { - SessionConfiguration sessionConfiguration = new SessionConfiguration(source); - return sessionConfiguration; - } catch (Exception e) { - Log.e(TAG, "Exception creating SessionConfiguration from parcel", e); - return null; - } + return new SessionConfiguration(source); } @Override diff --git a/core/java/android/hardware/camera2/params/VendorTagDescriptor.java b/core/java/android/hardware/camera2/params/VendorTagDescriptor.java index 4845ec3e3bd8..c62f6da012c1 100644 --- a/core/java/android/hardware/camera2/params/VendorTagDescriptor.java +++ b/core/java/android/hardware/camera2/params/VendorTagDescriptor.java @@ -36,13 +36,7 @@ public final class VendorTagDescriptor implements Parcelable { new Parcelable.Creator<VendorTagDescriptor>() { @Override public VendorTagDescriptor createFromParcel(Parcel source) { - try { - VendorTagDescriptor vendorDescriptor = new VendorTagDescriptor(source); - return vendorDescriptor; - } catch (Exception e) { - Log.e(TAG, "Exception creating VendorTagDescriptor from parcel", e); - return null; - } + return new VendorTagDescriptor(source); } @Override diff --git a/core/java/android/hardware/camera2/params/VendorTagDescriptorCache.java b/core/java/android/hardware/camera2/params/VendorTagDescriptorCache.java index 450b70bcdcdc..8d7615c98662 100644 --- a/core/java/android/hardware/camera2/params/VendorTagDescriptorCache.java +++ b/core/java/android/hardware/camera2/params/VendorTagDescriptorCache.java @@ -36,13 +36,7 @@ public final class VendorTagDescriptorCache implements Parcelable { new Parcelable.Creator<VendorTagDescriptorCache>() { @Override public VendorTagDescriptorCache createFromParcel(Parcel source) { - try { - VendorTagDescriptorCache vendorDescriptorCache = new VendorTagDescriptorCache(source); - return vendorDescriptorCache; - } catch (Exception e) { - Log.e(TAG, "Exception creating VendorTagDescriptorCache from parcel", e); - return null; - } + return new VendorTagDescriptorCache(source); } @Override diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java index 7bc9993751d4..bca667db0ab7 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java @@ -64,8 +64,8 @@ public class DeviceChooserActivity extends Activity { final DeviceFilterPair selectedDevice = getService().mDevicesFound.get(0); setTitle(Html.fromHtml(getString( R.string.confirmation_title, - getCallingAppName(), - selectedDevice.getDisplayName()), 0)); + Html.escapeHtml(getCallingAppName()), + Html.escapeHtml(selectedDevice.getDisplayName())), 0)); mPairButton = findViewById(R.id.button_pair); mPairButton.setOnClickListener(v -> onDeviceConfirmed(getService().mSelectedDevice)); getService().mSelectedDevice = selectedDevice; @@ -74,7 +74,8 @@ public class DeviceChooserActivity extends Activity { setContentView(R.layout.device_chooser); mPairButton = findViewById(R.id.button_pair); mPairButton.setVisibility(View.GONE); - setTitle(Html.fromHtml(getString(R.string.chooser_title, getCallingAppName()), 0)); + setTitle(Html.fromHtml(getString(R.string.chooser_title, + Html.escapeHtml(getCallingAppName())), 0)); mDeviceListView = findViewById(R.id.device_list); final DeviceDiscoveryService.DevicesAdapter adapter = getService().mDevicesAdapter; mDeviceListView.setAdapter(adapter); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java index 4d7cf2715f9c..5934974b119f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java @@ -399,7 +399,8 @@ public class NavigationModeController implements Dumpable { .setStyle(new Notification.BigTextStyle()) .setSmallIcon(R.drawable.ic_info) .setAutoCancel(true) - .setContentIntent(PendingIntent.getActivity(context, 0, new Intent(), 0)); + .setContentIntent(PendingIntent.getActivity(context, 0, new Intent(), + PendingIntent.FLAG_IMMUTABLE)); context.getSystemService(NotificationManager.class).notify(TAG, 0, builder.build()); } diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 057b53e6232f..20a6cf4f60f6 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -1981,10 +1981,9 @@ public final class TvInputManagerService extends SystemService { public void requestChannelBrowsable(Uri channelUri, int userId) throws RemoteException { final String callingPackageName = getCallingPackageName(); + final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), + Binder.getCallingUid(), userId, "requestChannelBrowsable"); final long identity = Binder.clearCallingIdentity(); - final int callingUid = Binder.getCallingUid(); - final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid, - userId, "requestChannelBrowsable"); try { Intent intent = new Intent(TvContract.ACTION_CHANNEL_BROWSABLE_REQUESTED); List<ResolveInfo> list = getContext().getPackageManager() |