diff options
| -rw-r--r-- | StubLibraries.bp | 4 | ||||
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/bluetooth/le/AdvertiseData.java | 54 | ||||
| -rw-r--r-- | core/java/android/bluetooth/le/BluetoothLeAdvertiser.java | 27 | ||||
| -rw-r--r-- | core/java/android/net/NetworkSpecifier.java | 8 | ||||
| -rw-r--r-- | core/java/android/uwb/UwbManager.java | 269 | ||||
| -rw-r--r-- | non-updatable-api/current.txt | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 1 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/EnsureActivitiesVisibleHelper.java | 9 | ||||
| -rwxr-xr-x | telecomm/java/android/telecom/Call.java | 8 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/CallScreeningService.java | 52 | ||||
| -rw-r--r-- | telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl | 7 |
14 files changed, 423 insertions, 28 deletions
diff --git a/StubLibraries.bp b/StubLibraries.bp index 50925a37d12b..4e1de0ecf9d4 100644 --- a/StubLibraries.bp +++ b/StubLibraries.bp @@ -308,6 +308,10 @@ droidstubs { api_file: "non-updatable-api/module-lib-current.txt", removed_api_file: "non-updatable-api/module-lib-removed.txt", }, + last_released: { + api_file: ":android-non-updatable.api.module-lib.latest", + removed_api_file: ":android-non-updatable-removed.api.module-lib.latest", + }, api_lint: { enabled: true, new_since: ":android-non-updatable.api.module-lib.latest", diff --git a/api/current.txt b/api/current.txt index 8ffbc712e2c4..27a035e3474a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -9126,6 +9126,7 @@ package android.bluetooth.le { method public boolean getIncludeTxPowerLevel(); method public android.util.SparseArray<byte[]> getManufacturerSpecificData(); method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData(); + method @Nullable public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids(); method public java.util.List<android.os.ParcelUuid> getServiceUuids(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseData> CREATOR; @@ -9135,6 +9136,7 @@ package android.bluetooth.le { ctor public AdvertiseData.Builder(); method public android.bluetooth.le.AdvertiseData.Builder addManufacturerData(int, byte[]); method public android.bluetooth.le.AdvertiseData.Builder addServiceData(android.os.ParcelUuid, byte[]); + method @NonNull public android.bluetooth.le.AdvertiseData.Builder addServiceSolicitationUuid(@NonNull android.os.ParcelUuid); method public android.bluetooth.le.AdvertiseData.Builder addServiceUuid(android.os.ParcelUuid); method public android.bluetooth.le.AdvertiseData build(); method public android.bluetooth.le.AdvertiseData.Builder setIncludeDeviceName(boolean); diff --git a/core/java/android/bluetooth/le/AdvertiseData.java b/core/java/android/bluetooth/le/AdvertiseData.java index 5fd825837647..573b93232642 100644 --- a/core/java/android/bluetooth/le/AdvertiseData.java +++ b/core/java/android/bluetooth/le/AdvertiseData.java @@ -16,6 +16,7 @@ package android.bluetooth.le; +import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; import android.os.ParcelUuid; @@ -43,17 +44,22 @@ public final class AdvertiseData implements Parcelable { @Nullable private final List<ParcelUuid> mServiceUuids; + @Nullable + private final List<ParcelUuid> mServiceSolicitationUuids; + private final SparseArray<byte[]> mManufacturerSpecificData; private final Map<ParcelUuid, byte[]> mServiceData; private final boolean mIncludeTxPowerLevel; private final boolean mIncludeDeviceName; private AdvertiseData(List<ParcelUuid> serviceUuids, + List<ParcelUuid> serviceSolicitationUuids, SparseArray<byte[]> manufacturerData, Map<ParcelUuid, byte[]> serviceData, boolean includeTxPowerLevel, boolean includeDeviceName) { mServiceUuids = serviceUuids; + mServiceSolicitationUuids = serviceSolicitationUuids; mManufacturerSpecificData = manufacturerData; mServiceData = serviceData; mIncludeTxPowerLevel = includeTxPowerLevel; @@ -69,6 +75,14 @@ public final class AdvertiseData implements Parcelable { } /** + * Returns a list of service solicitation UUIDs within the advertisement that we invite to connect. + */ + @Nullable + public List<ParcelUuid> getServiceSolicitationUuids() { + return mServiceSolicitationUuids; + } + + /** * Returns an array of manufacturer Id and the corresponding manufacturer specific data. The * manufacturer id is a non-negative number assigned by Bluetooth SIG. */ @@ -102,8 +116,8 @@ public final class AdvertiseData implements Parcelable { */ @Override public int hashCode() { - return Objects.hash(mServiceUuids, mManufacturerSpecificData, mServiceData, - mIncludeDeviceName, mIncludeTxPowerLevel); + return Objects.hash(mServiceUuids, mServiceSolicitationUuids, mManufacturerSpecificData, + mServiceData, mIncludeDeviceName, mIncludeTxPowerLevel); } /** @@ -119,6 +133,7 @@ public final class AdvertiseData implements Parcelable { } AdvertiseData other = (AdvertiseData) obj; return Objects.equals(mServiceUuids, other.mServiceUuids) + && Objects.equals(mServiceSolicitationUuids, other.mServiceSolicitationUuids) && BluetoothLeUtils.equals(mManufacturerSpecificData, other.mManufacturerSpecificData) && BluetoothLeUtils.equals(mServiceData, other.mServiceData) @@ -128,7 +143,8 @@ public final class AdvertiseData implements Parcelable { @Override public String toString() { - return "AdvertiseData [mServiceUuids=" + mServiceUuids + ", mManufacturerSpecificData=" + return "AdvertiseData [mServiceUuids=" + mServiceUuids + ", mServiceSolicitationUuids=" + + mServiceSolicitationUuids + ", mManufacturerSpecificData=" + BluetoothLeUtils.toString(mManufacturerSpecificData) + ", mServiceData=" + BluetoothLeUtils.toString(mServiceData) + ", mIncludeTxPowerLevel=" + mIncludeTxPowerLevel + ", mIncludeDeviceName=" @@ -143,6 +159,8 @@ public final class AdvertiseData implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeTypedArray(mServiceUuids.toArray(new ParcelUuid[mServiceUuids.size()]), flags); + dest.writeTypedArray(mServiceSolicitationUuids.toArray( + new ParcelUuid[mServiceSolicitationUuids.size()]), flags); // mManufacturerSpecificData could not be null. dest.writeInt(mManufacturerSpecificData.size()); @@ -174,6 +192,11 @@ public final class AdvertiseData implements Parcelable { builder.addServiceUuid(uuid); } + ArrayList<ParcelUuid> solicitationUuids = in.createTypedArrayList(ParcelUuid.CREATOR); + for (ParcelUuid uuid : solicitationUuids) { + builder.addServiceSolicitationUuid(uuid); + } + int manufacturerSize = in.readInt(); for (int i = 0; i < manufacturerSize; ++i) { int manufacturerId = in.readInt(); @@ -198,6 +221,8 @@ public final class AdvertiseData implements Parcelable { public static final class Builder { @Nullable private List<ParcelUuid> mServiceUuids = new ArrayList<ParcelUuid>(); + @Nullable + private List<ParcelUuid> mServiceSolicitationUuids = new ArrayList<ParcelUuid>(); private SparseArray<byte[]> mManufacturerSpecificData = new SparseArray<byte[]>(); private Map<ParcelUuid, byte[]> mServiceData = new ArrayMap<ParcelUuid, byte[]>(); private boolean mIncludeTxPowerLevel; @@ -207,17 +232,31 @@ public final class AdvertiseData implements Parcelable { * Add a service UUID to advertise data. * * @param serviceUuid A service UUID to be advertised. - * @throws IllegalArgumentException If the {@code serviceUuids} are null. + * @throws IllegalArgumentException If the {@code serviceUuid} is null. */ public Builder addServiceUuid(ParcelUuid serviceUuid) { if (serviceUuid == null) { - throw new IllegalArgumentException("serivceUuids are null"); + throw new IllegalArgumentException("serviceUuid is null"); } mServiceUuids.add(serviceUuid); return this; } /** + * Add a service solicitation UUID to advertise data. + * + * @param serviceSolicitationUuid A service solicitation UUID to be advertised. + * @throws IllegalArgumentException If the {@code serviceSolicitationUuid} is null. + */ + @NonNull + public Builder addServiceSolicitationUuid(@NonNull ParcelUuid serviceSolicitationUuid) { + if (serviceSolicitationUuid == null) { + throw new IllegalArgumentException("serviceSolicitationUuid is null"); + } + mServiceSolicitationUuids.add(serviceSolicitationUuid); + return this; + } + /** * Add service data to advertise data. * * @param serviceDataUuid 16-bit UUID of the service the data is associated with @@ -279,8 +318,9 @@ public final class AdvertiseData implements Parcelable { * Build the {@link AdvertiseData}. */ public AdvertiseData build() { - return new AdvertiseData(mServiceUuids, mManufacturerSpecificData, mServiceData, - mIncludeTxPowerLevel, mIncludeDeviceName); + return new AdvertiseData(mServiceUuids, mServiceSolicitationUuids, + mManufacturerSpecificData, mServiceData, mIncludeTxPowerLevel, + mIncludeDeviceName); } } } diff --git a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java index 13c5ff690973..5f166f4a41da 100644 --- a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java +++ b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java @@ -507,6 +507,33 @@ public final class BluetoothLeAdvertiser { + num128BitUuids * BluetoothUuid.UUID_BYTES_128_BIT; } } + if (data.getServiceSolicitationUuids() != null) { + int num16BitUuids = 0; + int num32BitUuids = 0; + int num128BitUuids = 0; + for (ParcelUuid uuid : data.getServiceSolicitationUuids()) { + if (BluetoothUuid.is16BitUuid(uuid)) { + ++num16BitUuids; + } else if (BluetoothUuid.is32BitUuid(uuid)) { + ++num32BitUuids; + } else { + ++num128BitUuids; + } + } + // 16 bit service uuids are grouped into one field when doing advertising. + if (num16BitUuids != 0) { + size += OVERHEAD_BYTES_PER_FIELD + num16BitUuids * BluetoothUuid.UUID_BYTES_16_BIT; + } + // 32 bit service uuids are grouped into one field when doing advertising. + if (num32BitUuids != 0) { + size += OVERHEAD_BYTES_PER_FIELD + num32BitUuids * BluetoothUuid.UUID_BYTES_32_BIT; + } + // 128 bit service uuids are grouped into one field when doing advertising. + if (num128BitUuids != 0) { + size += OVERHEAD_BYTES_PER_FIELD + + num128BitUuids * BluetoothUuid.UUID_BYTES_128_BIT; + } + } for (ParcelUuid uuid : data.getServiceData().keySet()) { int uuidLen = BluetoothUuid.uuidToBytes(uuid).length; size += OVERHEAD_BYTES_PER_FIELD + uuidLen diff --git a/core/java/android/net/NetworkSpecifier.java b/core/java/android/net/NetworkSpecifier.java index 160259e39813..6ef496b1f6fe 100644 --- a/core/java/android/net/NetworkSpecifier.java +++ b/core/java/android/net/NetworkSpecifier.java @@ -22,10 +22,14 @@ import android.annotation.SystemApi; /** * Describes specific properties of a requested network for use in a {@link NetworkRequest}. * - * Applications cannot instantiate this class by themselves, but can obtain instances of - * subclasses of this class via other APIs. + * This as an abstract class. Applications shouldn't instantiate this class by themselves, but can + * obtain instances of subclasses of this class via other APIs. */ public abstract class NetworkSpecifier { + /** + * Create a placeholder object. Please use subclasses of this class in a {@link NetworkRequest} + * to request a network. + */ public NetworkSpecifier() {} /** diff --git a/core/java/android/uwb/UwbManager.java b/core/java/android/uwb/UwbManager.java new file mode 100644 index 000000000000..8097dc6dca11 --- /dev/null +++ b/core/java/android/uwb/UwbManager.java @@ -0,0 +1,269 @@ +/* + * Copyright 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.uwb; + +import android.annotation.IntDef; +import android.annotation.NonNull; +import android.annotation.SuppressLint; +import android.os.PersistableBundle; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Executor; + +/** + * This class provides a way to perform Ultra Wideband (UWB) operations such as querying the + * device's capabilities and determining the distance and angle between the local device and a + * remote device. + * + * <p>To get a {@link UwbManager}, call the <code>Context.getSystemService(UwbManager.class)</code>. + * + * @hide + */ +public final class UwbManager { + /** + * Interface for receiving UWB adapter state changes + */ + public interface AdapterStateCallback { + @Retention(RetentionPolicy.SOURCE) + @IntDef(value = { + STATE_CHANGED_REASON_SESSION_STARTED, + STATE_CHANGED_REASON_ALL_SESSIONS_CLOSED, + STATE_CHANGED_REASON_SYSTEM_POLICY, + STATE_CHANGED_REASON_SYSTEM_BOOT, + STATE_CHANGED_REASON_ERROR_UNKNOWN}) + @interface StateChangedReason {} + + /** + * Indicates that the state change was due to opening of first UWB session + */ + int STATE_CHANGED_REASON_SESSION_STARTED = 0; + + /** + * Indicates that the state change was due to closure of all UWB sessions + */ + int STATE_CHANGED_REASON_ALL_SESSIONS_CLOSED = 1; + + /** + * Indicates that the state change was due to changes in system policy + */ + int STATE_CHANGED_REASON_SYSTEM_POLICY = 2; + + /** + * Indicates that the current state is due to a system boot + */ + int STATE_CHANGED_REASON_SYSTEM_BOOT = 3; + + /** + * Indicates that the state change was due to some unknown error + */ + int STATE_CHANGED_REASON_ERROR_UNKNOWN = 4; + + /** + * Invoked when underlying UWB adapter's state is changed + * <p>Invoked with the adapter's current state after registering an + * {@link AdapterStateCallback} using + * {@link UwbManager#registerAdapterStateCallback(Executor, AdapterStateCallback)}. + * + * <p>Possible values for the state to change are + * {@link #STATE_CHANGED_REASON_SESSION_STARTED}, + * {@link #STATE_CHANGED_REASON_ALL_SESSIONS_CLOSED}, + * {@link #STATE_CHANGED_REASON_SYSTEM_POLICY}, + * {@link #STATE_CHANGED_REASON_SYSTEM_BOOT}, + * {@link #STATE_CHANGED_REASON_ERROR_UNKNOWN}. + * + * @param isEnabled true when UWB adapter is enabled, false when it is disabled + * @param reason the reason for the state change + */ + void onStateChanged(boolean isEnabled, @StateChangedReason int reason); + } + + /** + * Use <code>Context.getSystemService(UwbManager.class)</code> to get an instance. + */ + private UwbManager() { + throw new UnsupportedOperationException(); + } + /** + * Register an {@link AdapterStateCallback} to listen for UWB adapter state changes + * <p>The provided callback will be invoked by the given {@link Executor}. + * + * <p>When first registering a callback, the callbacks's + * {@link AdapterStateCallback#onStateChanged(boolean, int)} is immediately invoked to indicate + * the current state of the underlying UWB adapter with the most recent + * {@link AdapterStateCallback.StateChangedReason} that caused the change. + * + * @param executor an {@link Executor} to execute given callback + * @param callback user implementation of the {@link AdapterStateCallback} + */ + public void registerAdapterStateCallback(Executor executor, AdapterStateCallback callback) { + throw new UnsupportedOperationException(); + } + + /** + * Unregister the specified {@link AdapterStateCallback} + * <p>The same {@link AdapterStateCallback} object used when calling + * {@link #registerAdapterStateCallback(Executor, AdapterStateCallback)} must be used. + * + * <p>Callbacks are automatically unregistered when application process goes away + * + * @param callback user implementation of the {@link AdapterStateCallback} + */ + public void unregisterAdapterStateCallback(AdapterStateCallback callback) { + throw new UnsupportedOperationException(); + } + + /** + * Get a {@link PersistableBundle} with the supported UWB protocols and parameters. + * <p>The {@link PersistableBundle} should be parsed using a support library + * + * <p>Android reserves the '^android.*' namespace</p> + * + * @return {@link PersistableBundle} of the device's supported UWB protocols and parameters + */ + @NonNull + public PersistableBundle getSpecificationInfo() { + throw new UnsupportedOperationException(); + } + + /** + * Check if ranging is supported, regardless of ranging method + * + * @return true if ranging is supported + */ + public boolean isRangingSupported() { + throw new UnsupportedOperationException(); + } + + @Retention(RetentionPolicy.SOURCE) + @IntDef(value = { + ANGLE_OF_ARRIVAL_SUPPORT_TYPE_NONE, + ANGLE_OF_ARRIVAL_SUPPORT_TYPE_2D, + ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_HEMISPHERICAL, + ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_SPHERICAL}) + public @interface AngleOfArrivalSupportType {} + + /** + * Indicate absence of support for angle of arrival measurement + */ + public static final int ANGLE_OF_ARRIVAL_SUPPORT_TYPE_NONE = 1; + + /** + * Indicate support for planar angle of arrival measurement, due to antenna + * limitation. Typically requires at least two antennas. + */ + public static final int ANGLE_OF_ARRIVAL_SUPPORT_TYPE_2D = 2; + + /** + * Indicate support for three dimensional angle of arrival measurement. + * Typically requires at least three antennas. However, due to antenna + * arrangement, a platform may only support hemi-spherical azimuth angles + * ranging from -pi/2 to pi/2 + */ + public static final int ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_HEMISPHERICAL = 2; + + /** + * Indicate support for three dimensional angle of arrival measurement. + * Typically requires at least three antennas. This mode supports full + * azimuth angles ranging from -pi to pi. + */ + public static final int ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_SPHERICAL = 3; + + + /** + * Gets the {@link AngleOfArrivalSupportType} supported on this platform + * <p>Possible return values are + * {@link #ANGLE_OF_ARRIVAL_SUPPORT_TYPE_NONE}, + * {@link #ANGLE_OF_ARRIVAL_SUPPORT_TYPE_2D}, + * {@link #ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_HEMISPHERICAL}, + * {@link #ANGLE_OF_ARRIVAL_SUPPORT_TYPE_3D_SPHERICAL}. + * + * @return angle of arrival type supported + */ + @AngleOfArrivalSupportType + public int getAngleOfArrivalSupport() { + throw new UnsupportedOperationException(); + } + + /** + * Get a {@link List} of supported channel numbers based on the device's current location + * <p>The returned values are ordered by the system's desired ordered of use, with the first + * entry being the most preferred. + * + * <p>Channel numbers are defined based on the IEEE 802.15.4z standard for UWB. + * + * @return {@link List} of supported channel numbers ordered by preference + */ + @NonNull + public List<Integer> getSupportedChannelNumbers() { + throw new UnsupportedOperationException(); + } + + /** + * Get a {@link List} of supported preamble code indices + * <p> Preamble code indices are defined based on the IEEE 802.15.4z standard for UWB. + * + * @return {@link List} of supported preamble code indices + */ + @NonNull + public Set<Integer> getSupportedPreambleCodeIndices() { + throw new UnsupportedOperationException(); + } + + /** + * Get the timestamp resolution for events in nanoseconds + * <p>This value defines the maximum error of all timestamps for events reported to + * {@link RangingSession.Callback}. + * + * @return the timestamp resolution in nanoseconds + */ + @SuppressLint("MethodNameUnits") + public long elapsedRealtimeResolutionNanos() { + throw new UnsupportedOperationException(); + } + + /** + * Get the number of simultaneous sessions allowed in the system + * + * @return the maximum allowed number of simultaneously open {@link RangingSession} instances. + */ + public int getMaxSimultaneousSessions() { + throw new UnsupportedOperationException(); + } + + /** + * Get the maximum number of remote devices in a {@link RangingSession} when the local device + * is the initiator. + * + * @return the maximum number of remote devices per {@link RangingSession} + */ + public int getMaxRemoteDevicesPerInitiatorSession() { + throw new UnsupportedOperationException(); + } + + /** + * Get the maximum number of remote devices in a {@link RangingSession} when the local device + * is a responder. + * + * @return the maximum number of remote devices per {@link RangingSession} + */ + public int getMaxRemoteDevicesPerResponderSession() { + throw new UnsupportedOperationException(); + } +} diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index e409071c6391..1aa5a5dd2ad7 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -9126,6 +9126,7 @@ package android.bluetooth.le { method public boolean getIncludeTxPowerLevel(); method public android.util.SparseArray<byte[]> getManufacturerSpecificData(); method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData(); + method @Nullable public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids(); method public java.util.List<android.os.ParcelUuid> getServiceUuids(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseData> CREATOR; @@ -9135,6 +9136,7 @@ package android.bluetooth.le { ctor public AdvertiseData.Builder(); method public android.bluetooth.le.AdvertiseData.Builder addManufacturerData(int, byte[]); method public android.bluetooth.le.AdvertiseData.Builder addServiceData(android.os.ParcelUuid, byte[]); + method @NonNull public android.bluetooth.le.AdvertiseData.Builder addServiceSolicitationUuid(@NonNull android.os.ParcelUuid); method public android.bluetooth.le.AdvertiseData.Builder addServiceUuid(android.os.ParcelUuid); method public android.bluetooth.le.AdvertiseData build(); method public android.bluetooth.le.AdvertiseData.Builder setIncludeDeviceName(boolean); diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 8a1baf25481b..b59f7645445d 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1126,7 +1126,6 @@ public class ConnectivityService extends IConnectivityManager.Stub // Listen to package add and removal events for all users. intentFilter = new IntentFilter(); - intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED); intentFilter.addAction(Intent.ACTION_PACKAGE_REPLACED); intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); intentFilter.addDataScheme("package"); diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 4f0c707a1dae..9d0a5c4787fd 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -3649,6 +3649,8 @@ public class PackageManagerService extends IPackageManager.Stub PackageParser.readConfigUseRoundIcon(mContext.getResources()); mServiceStartWithDelay = SystemClock.uptimeMillis() + (60 * 1000L); + + Slog.i(TAG, "Fix for b/169414761 is applied"); } /** @@ -11096,6 +11098,8 @@ public class PackageManagerService extends IPackageManager.Stub mSettings.addRenamedPackageLPw(parsedPackage.getRealPackage(), originalPkgSetting.name); mTransferredPackages.add(originalPkgSetting.name); + } else { + mSettings.removeRenamedPackageLPw(parsedPackage.getPackageName()); } } if (pkgSetting.sharedUser != null) { diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index a0feb94fd3fc..0f5d9781c612 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -476,6 +476,10 @@ public final class Settings { return mRenamedPackages.put(pkgName, origPkgName); } + void removeRenamedPackageLPw(String pkgName) { + mRenamedPackages.remove(pkgName); + } + public boolean canPropagatePermissionToInstantApp(String permName) { return mPermissions.canPropagatePermissionToInstantApp(permName); } diff --git a/services/core/java/com/android/server/wm/EnsureActivitiesVisibleHelper.java b/services/core/java/com/android/server/wm/EnsureActivitiesVisibleHelper.java index c4e03f5c65f5..aa76a07bc9c7 100644 --- a/services/core/java/com/android/server/wm/EnsureActivitiesVisibleHelper.java +++ b/services/core/java/com/android/server/wm/EnsureActivitiesVisibleHelper.java @@ -16,8 +16,6 @@ package com.android.server.wm; -import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; - import static com.android.server.wm.ActivityStack.TAG_VISIBILITY; import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_VISIBILITY; @@ -174,12 +172,7 @@ class EnsureActivitiesVisibleHelper { } final int windowingMode = mContiner.getWindowingMode(); - if (windowingMode == WINDOWING_MODE_FREEFORM) { - // The visibility of tasks and the activities they contain in freeform stack are - // determined individually unlike other stacks where the visibility or fullscreen - // status of an activity in a previous task affects other. - mBehindFullscreenActivity = !mContainerShouldBeVisible; - } else if (!mBehindFullscreenActivity && mContiner.isActivityTypeHome() + if (!mBehindFullscreenActivity && mContiner.isActivityTypeHome() && r.isRootOfTask()) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + mContiner + " stackShouldBeVisible=" + mContainerShouldBeVisible diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 0469fa56e648..a6d72450156f 100755 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -2111,7 +2111,13 @@ public final class Call { /** * Obtains a list of canned, pre-configured message responses to present to the user as - * ways of rejecting this {@code Call} using via a text message. + * ways of rejecting an incoming {@code Call} using via a text message. + * <p> + * <em>Note:</em> Since canned responses may be loaded from the file system, they are not + * guaranteed to be present when this {@link Call} is first added to the {@link InCallService} + * via {@link InCallService#onCallAdded(Call)}. The callback + * {@link Call.Callback#onCannedTextResponsesLoaded(Call, List)} will be called when/if canned + * responses for the call become available. * * @see #reject(boolean, String) * diff --git a/telecomm/java/android/telecom/CallScreeningService.java b/telecomm/java/android/telecom/CallScreeningService.java index 4d9311c282f7..49f183151e27 100644 --- a/telecomm/java/android/telecom/CallScreeningService.java +++ b/telecomm/java/android/telecom/CallScreeningService.java @@ -64,7 +64,7 @@ import com.android.internal.telecom.ICallScreeningService; * </li> * </ol> * <p> - * <h2>Becoming the {@link CallScreeningService}</h2> + * <h2>Becoming the CallScreeningService</h2> * Telecom will bind to a single app chosen by the user which implements the * {@link CallScreeningService} API when there are new incoming and outgoing calls. * <p> @@ -90,7 +90,27 @@ import com.android.internal.telecom.ICallScreeningService; * } * } * } + * } * </pre> + * + * <h2>CallScreeningService Lifecycle</h2> + * + * The framework binds to the {@link CallScreeningService} implemented by the user-chosen app + * filling the {@link android.app.role.RoleManager#ROLE_CALL_SCREENING} role when incoming calls are + * received (prior to ringing) and when outgoing calls are placed. The platform calls the + * {@link #onScreenCall(Call.Details)} method to provide your service with details about the call. + * <p> + * For incoming calls, the {@link CallScreeningService} must call + * {@link #respondToCall(Call.Details, CallResponse)} within 5 seconds of being bound to indicate to + * the platform whether the call should be blocked or not. Your app must do this even if it is + * primarily performing caller ID operations and not screening calls. It is important to perform + * screening operations in a timely matter as the user's device will not begin ringing until the + * response is received (or the timeout is hit). A {@link CallScreeningService} may choose to + * perform local database lookups to help determine if a call should be screened or not; care should + * be taken to ensure the timeout is not repeatedly hit, causing delays in the incoming call flow. + * <p> + * If your app provides a caller ID experience, it should launch an activity to show the caller ID + * information from {@link #onScreenCall(Call.Details)}. */ public abstract class CallScreeningService extends Service { /** @@ -339,7 +359,7 @@ public abstract class CallScreeningService extends Service { } /** - * Called when a new incoming or outgoing call is added which is not in the user's contact list. + * Called when a new incoming or outgoing call is added. * <p> * A {@link CallScreeningService} must indicate whether an incoming call is allowed or not by * calling @@ -347,21 +367,32 @@ public abstract class CallScreeningService extends Service { * Your app can tell if a call is an incoming call by checking to see if * {@link Call.Details#getCallDirection()} is {@link Call.Details#DIRECTION_INCOMING}. * <p> - * Note: The {@link Call.Details} instance provided to a call screening service will only have - * the following properties set. The rest of the {@link Call.Details} properties will be set to - * their default value or {@code null}. + * <em>Note:</em> A {@link CallScreeningService} must respond to a call within 5 seconds. After + * this time, the framework will unbind from the {@link CallScreeningService} and ignore its + * response. + * <p> + * <em>Note:</em> The {@link Call.Details} instance provided to a call screening service will + * only have the following properties set. The rest of the {@link Call.Details} properties will + * be set to their default value or {@code null}. * <ul> * <li>{@link Call.Details#getCallDirection()}</li> + * <li>{@link Call.Details#getCallerNumberVerificationStatus()}</li> * <li>{@link Call.Details#getConnectTimeMillis()}</li> * <li>{@link Call.Details#getCreationTimeMillis()}</li> * <li>{@link Call.Details#getHandle()}</li> - * <li>{@link Call.Details#getHandlePresentation()}</li> * </ul> * <p> * Only calls where the {@link Call.Details#getHandle() handle} {@link Uri#getScheme() scheme} * is {@link PhoneAccount#SCHEME_TEL} are passed for call * screening. Further, only calls which are not in the user's contacts are passed for - * screening. For outgoing calls, no post-dial digits are passed. + * screening, unless the {@link CallScreeningService} has been granted + * {@link Manifest.permission#READ_CONTACTS} permission by the user. For outgoing calls, no + * post-dial digits are passed. + * <p> + * Calls with a {@link Call.Details#getHandlePresentation()} of + * {@link TelecomManager#PRESENTATION_RESTRICTED}, {@link TelecomManager#PRESENTATION_UNKNOWN} + * or {@link TelecomManager#PRESENTATION_PAYPHONE} presentation are not provided to the + * {@link CallScreeningService}. * * @param callDetails Information about a new call, see {@link Call.Details}. */ @@ -376,6 +407,13 @@ public abstract class CallScreeningService extends Service { * <p> * Calls to this method are ignored unless the {@link Call.Details#getCallDirection()} is * {@link Call.Details#DIRECTION_INCOMING}. + * <p> + * For incoming calls, a {@link CallScreeningService} MUST call this method within 5 seconds of + * {@link #onScreenCall(Call.Details)} being invoked by the platform. + * <p> + * Calls which are blocked/rejected will be logged to the system call log with a call type of + * {@link android.provider.CallLog.Calls#BLOCKED_TYPE} and + * {@link android.provider.CallLog.Calls#BLOCK_REASON_CALL_SCREENING_SERVICE} block reason. * * @param callDetails The call to allow. * <p> diff --git a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl index 7bbe30a444b9..52464703c608 100644 --- a/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl +++ b/telephony/java/android/telephony/ims/aidl/IImsMmTelListener.aidl @@ -27,8 +27,11 @@ import com.android.ims.internal.IImsCallSession; * See MmTelFeature#Listener for more information. * {@hide} */ -oneway interface IImsMmTelListener { + // This interface is not considered oneway because we need to ensure that these operations are + // processed by telephony before the control flow returns to the ImsService to perform + // operations on the IImsCallSession. +interface IImsMmTelListener { void onIncomingCall(IImsCallSession c, in Bundle extras); void onRejectedCall(in ImsCallProfile callProfile, in ImsReasonInfo reason); - void onVoiceMessageCountUpdate(int count); + oneway void onVoiceMessageCountUpdate(int count); } |