diff options
42 files changed, 341 insertions, 156 deletions
diff --git a/api/test-current.txt b/api/test-current.txt index d4e04780fc05..9be252f92831 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -261,6 +261,7 @@ package android.content.pm { method public abstract java.lang.String getDefaultBrowserPackageNameAsUser(int); method public abstract int getInstallReason(java.lang.String, android.os.UserHandle); method public abstract java.util.List<android.content.pm.PackageInfo> getInstalledPackagesAsUser(int, int); + method public abstract java.util.List<android.content.pm.ApplicationInfo> getInstalledApplicationsAsUser(int, int); method public abstract java.lang.String[] getNamesForUids(int[]); method public abstract java.lang.String getPermissionControllerPackageName(); method public abstract java.lang.String getServicesSystemSharedLibraryPackageName(); diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt index 98c80ac47be7..0cb1938e6350 100644 --- a/config/hiddenapi-light-greylist.txt +++ b/config/hiddenapi-light-greylist.txt @@ -693,6 +693,7 @@ Landroid/app/INotificationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/app/INotificationManager$Stub$Proxy;->areNotificationsEnabledForPackage(Ljava/lang/String;I)Z Landroid/app/INotificationManager$Stub;-><init>()V Landroid/app/INotificationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/INotificationManager; +Landroid/app/INotificationManager$Stub;->TRANSACTION_enqueueNotificationWithTag:I Landroid/app/INotificationManager;->areNotificationsEnabledForPackage(Ljava/lang/String;I)Z Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V @@ -1222,6 +1223,7 @@ Landroid/bluetooth/IBluetooth$Stub$Proxy;->getAddress()Ljava/lang/String; Landroid/bluetooth/IBluetooth$Stub$Proxy;->getConnectionState(Landroid/bluetooth/BluetoothDevice;)I Landroid/bluetooth/IBluetooth$Stub;-><init>()V Landroid/bluetooth/IBluetooth$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetooth; +Landroid/bluetooth/IBluetooth$Stub;->TRANSACTION_enable:I Landroid/bluetooth/IBluetooth;->getAddress()Ljava/lang/String; Landroid/bluetooth/IBluetooth;->getRemoteAlias(Landroid/bluetooth/BluetoothDevice;)Ljava/lang/String; Landroid/bluetooth/IBluetooth;->isEnabled()Z @@ -1248,6 +1250,7 @@ Landroid/bluetooth/IBluetoothHeadset;->setPriority(Landroid/bluetooth/BluetoothD Landroid/bluetooth/IBluetoothHidDeviceCallback$Stub;-><init>()V Landroid/bluetooth/IBluetoothManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/bluetooth/IBluetoothManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetoothManager; +Landroid/bluetooth/IBluetoothManager$Stub;->TRANSACTION_enable:I Landroid/bluetooth/IBluetoothManager;->getBluetoothGatt()Landroid/bluetooth/IBluetoothGatt; Landroid/bluetooth/IBluetoothManager;->registerStateChangeCallback(Landroid/bluetooth/IBluetoothStateChangeCallback;)V Landroid/bluetooth/IBluetoothManager;->unregisterStateChangeCallback(Landroid/bluetooth/IBluetoothStateChangeCallback;)V @@ -1359,6 +1362,7 @@ Landroid/content/IContentProvider;->call(Ljava/lang/String;Ljava/lang/String;Lja Landroid/content/IContentProvider;->delete(Ljava/lang/String;Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I Landroid/content/IContentProvider;->descriptor:Ljava/lang/String; Landroid/content/IContentProvider;->insert(Ljava/lang/String;Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri; +Landroid/content/IContentProvider;->QUERY_TRANSACTION:I Landroid/content/IContentProvider;->update(Ljava/lang/String;Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I Landroid/content/IContentService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/IContentService$Stub;-><init>()V @@ -1466,6 +1470,7 @@ Landroid/content/pm/IPackageDeleteObserver$Stub$Proxy;-><init>(Landroid/os/IBind Landroid/content/pm/IPackageDeleteObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDeleteObserver; Landroid/content/pm/IPackageDeleteObserver2$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/pm/IPackageDeleteObserver2$Stub$Proxy;->mRemote:Landroid/os/IBinder; +Landroid/content/pm/IPackageDeleteObserver2$Stub;-><init>()V Landroid/content/pm/IPackageDeleteObserver2$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDeleteObserver2; Landroid/content/pm/IPackageDeleteObserver2;->onPackageDeleted(Ljava/lang/String;ILjava/lang/String;)V Landroid/content/pm/IPackageInstaller;->uninstall(Landroid/content/pm/VersionedPackage;Ljava/lang/String;ILandroid/content/IntentSender;I)V @@ -1495,6 +1500,7 @@ Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackagesForUid(I)[Ljava/lang Landroid/content/pm/IPackageManager$Stub$Proxy;->getSystemSharedLibraryNames()[Ljava/lang/String; Landroid/content/pm/IPackageManager$Stub;-><init>()V Landroid/content/pm/IPackageManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageManager; +Landroid/content/pm/IPackageManager$Stub;->TRANSACTION_getApplicationInfo:I Landroid/content/pm/IPackageManager;->addPermission(Landroid/content/pm/PermissionInfo;)Z Landroid/content/pm/IPackageManager;->addPermissionAsync(Landroid/content/pm/PermissionInfo;)Z Landroid/content/pm/IPackageManager;->canonicalToCurrentPackageNames([Ljava/lang/String;)[Ljava/lang/String; @@ -1979,6 +1985,7 @@ Landroid/database/CursorWindow;->sWindowToPidMap:Landroid/util/LongSparseArray; Landroid/database/CursorWrapper;->mCursor:Landroid/database/Cursor; Landroid/database/DatabaseUtils;->cursorPickFillWindowStartPosition(II)I Landroid/database/DatabaseUtils;->getTypeOfObject(Ljava/lang/Object;)I +Landroid/database/IContentObserver$Stub;-><init>()V Landroid/database/IContentObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/database/IContentObserver; Landroid/database/IContentObserver;->onChange(ZLandroid/net/Uri;I)V Landroid/database/MatrixCursor;->data:[Ljava/lang/Object; @@ -2661,6 +2668,7 @@ Landroid/location/ILocationListener;->onStatusChanged(Ljava/lang/String;ILandroi Landroid/location/ILocationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/location/ILocationManager$Stub;-><init>()V Landroid/location/ILocationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/ILocationManager; +Landroid/location/ILocationManager$Stub;->TRANSACTION_getAllProviders:I Landroid/location/ILocationManager;->getAllProviders()Ljava/util/List; Landroid/location/Location;->mElapsedRealtimeNanos:J Landroid/location/Location;->mProvider:Ljava/lang/String; @@ -3525,6 +3533,7 @@ Landroid/net/WebAddress;->setPath(Ljava/lang/String;)V Landroid/net/wifi/IWifiManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/net/wifi/IWifiManager$Stub;-><init>()V Landroid/net/wifi/IWifiManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/IWifiManager; +Landroid/net/wifi/IWifiManager$Stub;->TRANSACTION_getScanResults:I Landroid/net/wifi/IWifiManager;->getCurrentNetwork()Landroid/net/Network; Landroid/net/wifi/IWifiManager;->getWifiApConfiguration()Landroid/net/wifi/WifiConfiguration; Landroid/net/wifi/IWifiManager;->getWifiApEnabledState()I @@ -3712,6 +3721,7 @@ Landroid/nfc/cardemulation/ApduServiceInfo;->mService:Landroid/content/pm/Resolv Landroid/nfc/cardemulation/ApduServiceInfo;->mStaticAidGroups:Ljava/util/HashMap; Landroid/nfc/cardemulation/ApduServiceInfo;->requiresUnlock()Z Landroid/nfc/ErrorCodes;->isError(I)Z +Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_enable:I Landroid/nfc/INfcAdapterExtras;->authenticate(Ljava/lang/String;[B)V Landroid/nfc/INfcAdapterExtras;->close(Ljava/lang/String;Landroid/os/IBinder;)Landroid/os/Bundle; Landroid/nfc/INfcAdapterExtras;->getCardEmulationRoute(Ljava/lang/String;)I @@ -3970,6 +3980,7 @@ Landroid/os/IPowerManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/os/IPowerManager$Stub$Proxy;->isLightDeviceIdleMode()Z Landroid/os/IPowerManager$Stub;-><init>()V Landroid/os/IPowerManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IPowerManager; +Landroid/os/IPowerManager$Stub;->TRANSACTION_acquireWakeLock:I Landroid/os/IPowerManager$Stub;->TRANSACTION_goToSleep:I Landroid/os/IPowerManager;->isInteractive()Z Landroid/os/IPowerManager;->nap(J)V @@ -8188,6 +8199,7 @@ Lcom/android/internal/telephony/IPhoneStateListener;->onSignalStrengthsChanged(L Lcom/android/internal/telephony/IPhoneSubInfo$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Lcom/android/internal/telephony/IPhoneSubInfo$Stub;-><init>()V Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IPhoneSubInfo; +Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->TRANSACTION_getDeviceId:I Lcom/android/internal/telephony/IPhoneSubInfo;->getIccSerialNumber(Ljava/lang/String;)Ljava/lang/String; Lcom/android/internal/telephony/IPhoneSubInfo;->getSubscriberId(Ljava/lang/String;)Ljava/lang/String; Lcom/android/internal/telephony/ISms$Stub;-><init>()V @@ -8207,6 +8219,7 @@ Lcom/android/internal/telephony/ITelephony$Stub;->asInterface(Landroid/os/IBinde Lcom/android/internal/telephony/ITelephony$Stub;->DESCRIPTOR:Ljava/lang/String; Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_answerRingingCall:I Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_call:I +Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_dial:I Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_endCall:I Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_getDeviceId:I Lcom/android/internal/telephony/ITelephony;->answerRingingCall()V diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index d571547f350e..6fc14e768b64 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -347,6 +347,13 @@ public final class ActivityThread extends ClientTransactionHandler { final ArrayMap<ComponentName, ProviderClientRecord> mLocalProvidersByName = new ArrayMap<ComponentName, ProviderClientRecord>(); + // Mitigation for b/74523247: Used to serialize calls to AM.getContentProvider(). + // Note we never removes items from this map but that's okay because there are only so many + // users and so many authorities. + // TODO Remove it once we move CPR.wait() from AMS to the client side. + @GuardedBy("mGetProviderLocks") + final ArrayMap<ProviderKey, Object> mGetProviderLocks = new ArrayMap<>(); + final ArrayMap<Activity, ArrayList<OnActivityPausedListener>> mOnPauseListeners = new ArrayMap<Activity, ArrayList<OnActivityPausedListener>>(); @@ -5959,8 +5966,10 @@ public final class ActivityThread extends ClientTransactionHandler { // be re-entrant in the case where the provider is in the same process. ContentProviderHolder holder = null; try { - holder = ActivityManager.getService().getContentProvider( - getApplicationThread(), auth, userId, stable); + synchronized (getGetProviderLock(auth, userId)) { + holder = ActivityManager.getService().getContentProvider( + getApplicationThread(), auth, userId, stable); + } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } @@ -5976,6 +5985,18 @@ public final class ActivityThread extends ClientTransactionHandler { return holder.provider; } + private Object getGetProviderLock(String auth, int userId) { + final ProviderKey key = new ProviderKey(auth, userId); + synchronized (mGetProviderLocks) { + Object lock = mGetProviderLocks.get(key); + if (lock == null) { + lock = key; + mGetProviderLocks.put(key, lock); + } + return lock; + } + } + private final void incProviderRefLocked(ProviderRefCount prc, boolean stable) { if (stable) { prc.stableCount += 1; diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index d2338f8f13a8..07c3eef3a407 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3893,7 +3893,6 @@ public class Notification implements Parcelable * * @see Notification#FLAG_ONGOING_EVENT - * @see Service#setForeground(boolean) */ public Builder setOngoing(boolean ongoing) { setFlag(FLAG_ONGOING_EVENT, ongoing); @@ -3912,7 +3911,7 @@ public class Notification implements Parcelable * However, for {@link MediaStyle} and {@link DecoratedMediaCustomViewStyle} notifications * that have a media session attached there is no such requirement. * - * @see Builder#setColor(int) + * @see #setColor(int) * @see MediaStyle#setMediaSession(MediaSession.Token) */ public Builder setColorized(boolean colorize) { diff --git a/core/java/android/app/backup/BackupAgent.java b/core/java/android/app/backup/BackupAgent.java index d1c957b8fedc..965792271f81 100644 --- a/core/java/android/app/backup/BackupAgent.java +++ b/core/java/android/app/backup/BackupAgent.java @@ -334,7 +334,6 @@ public abstract class BackupAgent extends ContextWrapper { * @throws IOException * * @see Context#getNoBackupFilesDir() - * @see ApplicationInfo#fullBackupContent * @see #fullBackupFile(File, FullBackupDataOutput) * @see #onRestoreFile(ParcelFileDescriptor, long, File, int, long, long) */ diff --git a/core/java/android/app/slice/Slice.java b/core/java/android/app/slice/Slice.java index e54d3b64f780..d1aec048bdf1 100644 --- a/core/java/android/app/slice/Slice.java +++ b/core/java/android/app/slice/Slice.java @@ -425,7 +425,7 @@ public final class Slice implements Parcelable { /** * Add a sub-slice to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Builder addSubSlice(@NonNull Slice slice, @Nullable @SliceSubtype String subType) { Preconditions.checkNotNull(slice); @@ -437,7 +437,7 @@ public final class Slice implements Parcelable { /** * Add an action to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Slice.Builder addAction(@NonNull PendingIntent action, @NonNull Slice s, @Nullable @SliceSubtype String subType) { @@ -453,7 +453,7 @@ public final class Slice implements Parcelable { /** * Add text to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Builder addText(CharSequence text, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { @@ -464,7 +464,7 @@ public final class Slice implements Parcelable { /** * Add an image to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Builder addIcon(Icon icon, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { @@ -476,7 +476,7 @@ public final class Slice implements Parcelable { /** * Add remote input to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Slice.Builder addRemoteInput(RemoteInput remoteInput, @Nullable @SliceSubtype String subType, @@ -490,7 +490,7 @@ public final class Slice implements Parcelable { /** * Add an integer to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Builder addInt(int value, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { @@ -511,7 +511,7 @@ public final class Slice implements Parcelable { /** * Add a long to the slice being constructed * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Slice.Builder addLong(long value, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { @@ -525,7 +525,7 @@ public final class Slice implements Parcelable { * <p>Expected to be used for support library extension, should not be used for general * development * @param subType Optional template-specific type information - * @see {@link SliceItem#getSubType()} + * @see SliceItem#getSubType() */ public Slice.Builder addBundle(Bundle bundle, @Nullable @SliceSubtype String subType, @SliceHint List<String> hints) { diff --git a/core/java/android/app/slice/SliceProvider.java b/core/java/android/app/slice/SliceProvider.java index 4c22c94266d7..ca60e140ba8e 100644 --- a/core/java/android/app/slice/SliceProvider.java +++ b/core/java/android/app/slice/SliceProvider.java @@ -209,8 +209,8 @@ public abstract class SliceProvider extends ContentProvider { * * @param sliceUri Uri to bind. * @param supportedSpecs List of supported specs. - * @see {@link Slice}. - * @see {@link Slice#HINT_PARTIAL} + * @see Slice. + * @see Slice#HINT_PARTIAL */ public Slice onBindSlice(Uri sliceUri, Set<SliceSpec> supportedSpecs) { return onBindSlice(sliceUri, new ArrayList<>(supportedSpecs)); diff --git a/core/java/android/app/slice/SliceSpec.java b/core/java/android/app/slice/SliceSpec.java index 03ffe6df88ce..b3790e22eca5 100644 --- a/core/java/android/app/slice/SliceSpec.java +++ b/core/java/android/app/slice/SliceSpec.java @@ -36,7 +36,7 @@ import android.os.Parcelable; * {@link #canRender}. * * @see Slice - * @see SliceProvider#onBindSlice(Uri) + * @see SliceProvider#onBindSlice(Uri, Set) */ public final class SliceSpec implements Parcelable { diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index 32a674363535..af09f15653d1 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -766,7 +766,9 @@ public abstract class ContentResolver { * in the {@link Cursor} extras {@link Bundle}. See {@link #EXTRA_HONORED_ARGS} * for details. * - * @see #QUERY_ARG_SORT_COLUMNS, #QUERY_ARG_SORT_DIRECTION, #QUERY_ARG_SORT_COLLATION. + * @see #QUERY_ARG_SORT_COLUMNS + * @see #QUERY_ARG_SORT_DIRECTION + * @see #QUERY_ARG_SORT_COLLATION * * @param uri The URI, using the content:// scheme, for the content to * retrieve. diff --git a/core/java/android/content/QuickViewConstants.java b/core/java/android/content/QuickViewConstants.java index 132d43f2e143..ffb131c04bb9 100644 --- a/core/java/android/content/QuickViewConstants.java +++ b/core/java/android/content/QuickViewConstants.java @@ -45,8 +45,8 @@ public class QuickViewConstants { * Feature to delete an individual document. Quick viewer implementations must use * Storage Access Framework to both verify delete permission and to delete content. * - * @see DocumentsContract.Document#FLAG_SUPPORTS_DELETE - * @see DocumentsContract#deleteDocument(ContentResolver, Uri) + * @see android.provider.DocumentsContract.Document#FLAG_SUPPORTS_DELETE + * @see android.provider.DocumentsContract#deleteDocument(ContentResolver, android.net.Uri) */ public static final String FEATURE_DELETE = "android:delete"; diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 0e91a2927c79..dcf8c772fb5e 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -18,6 +18,7 @@ package android.content.pm; import android.annotation.IntDef; import android.annotation.TestApi; +import android.content.ComponentName; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Configuration.NativeConfig; @@ -400,7 +401,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { /** * Bit in {@link #flags} indicating that this activity should be run with VR mode enabled. * - * {@see android.app.Activity#setVrMode(boolean)}. + * @see android.app.Activity#setVrModeEnabled(boolean, ComponentName) */ public static final int FLAG_ENABLE_VR_MODE = 0x8000; diff --git a/core/java/android/content/pm/CrossProfileApps.java b/core/java/android/content/pm/CrossProfileApps.java index 87f4dab1115a..1c564f3708df 100644 --- a/core/java/android/content/pm/CrossProfileApps.java +++ b/core/java/android/content/pm/CrossProfileApps.java @@ -19,9 +19,7 @@ import android.annotation.NonNull; import android.content.ComponentName; import android.content.Context; import android.content.res.Resources; -import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; @@ -107,7 +105,7 @@ public class CrossProfileApps { * @return a label that calling app can show user for the semantic of launching its own * activity in the specified user profile. * - * @see #startMainActivity(ComponentName, UserHandle, Rect, Bundle) + * @see #startMainActivity(ComponentName, UserHandle) */ public @NonNull CharSequence getProfileSwitchingLabel(@NonNull UserHandle userHandle) { verifyCanAccessUser(userHandle); diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java index a50ac9b3e6dd..89517cd1d93a 100644 --- a/core/java/android/content/pm/PackageInstaller.java +++ b/core/java/android/content/pm/PackageInstaller.java @@ -1333,10 +1333,10 @@ public class PackageInstaller { * The install reason should be a pre-defined integer. The behavior is * undefined if other values are used. * - * @see PackageManager#INSTALL_REASON_UNKNOW - * @see PackageManager#INSTALL_REASON_POLICY, - * @see PackageManager#INSTALL_REASON_DEVICE_RESTORE, - * @see PackageManager#INSTALL_REASON_DEVICE_SETUP, + * @see PackageManager#INSTALL_REASON_UNKNOWN + * @see PackageManager#INSTALL_REASON_POLICY + * @see PackageManager#INSTALL_REASON_DEVICE_RESTORE + * @see PackageManager#INSTALL_REASON_DEVICE_SETUP * @see PackageManager#INSTALL_REASON_USER */ public void setInstallReason(@InstallReason int installReason) { diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 8c3f06e09ef2..8d2c511e313e 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -3798,6 +3798,7 @@ public abstract class PackageManager { * deleted with {@code DONT_DELETE_DATA} flag set). * @hide */ + @TestApi public abstract List<ApplicationInfo> getInstalledApplicationsAsUser( @ApplicationInfoFlags int flags, @UserIdInt int userId); @@ -3992,7 +3993,7 @@ public abstract class PackageManager { * <p>The sequence number starts at <code>0</code> and is * reset every boot. * @param sequenceNumber The first sequence number for which to retrieve package changes. - * @see Settings.Global#BOOT_COUNT + * @see android.provider.Settings.Global#BOOT_COUNT */ public abstract @Nullable ChangedPackages getChangedPackages( @IntRange(from=0) int sequenceNumber); diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index 35aaf78bc3c2..cbddc9167111 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -902,7 +902,6 @@ public abstract class SensorManager { * @throws NullPointerException when mem is null. * @throws UncheckedIOException if not able to create channel. * @see SensorDirectChannel#close() - * @see #configureDirectChannel(SensorDirectChannel, Sensor, int) */ public SensorDirectChannel createDirectChannel(MemoryFile mem) { return createDirectChannelImpl(mem, null); @@ -925,7 +924,6 @@ public abstract class SensorManager { * @throws NullPointerException when mem is null. * @throws UncheckedIOException if not able to create channel. * @see SensorDirectChannel#close() - * @see #configureDirectChannel(SensorDirectChannel, Sensor, int) */ public SensorDirectChannel createDirectChannel(HardwareBuffer mem) { return createDirectChannelImpl(null, mem); @@ -983,7 +981,7 @@ public abstract class SensorManager { * {@link android.hardware.SensorManager.DynamicSensorCallback * DynamicSensorCallback} * interface for receiving callbacks. - * @see #addDynamicSensorCallback(DynamicSensorCallback, Handler) + * @see #registerDynamicSensorCallback(DynamicSensorCallback, Handler) * * @throws IllegalArgumentException when callback is null. */ diff --git a/core/java/android/nfc/NdefMessage.java b/core/java/android/nfc/NdefMessage.java index 5df9272c9fea..0bb110885322 100644 --- a/core/java/android/nfc/NdefMessage.java +++ b/core/java/android/nfc/NdefMessage.java @@ -16,12 +16,12 @@ package android.nfc; -import java.nio.ByteBuffer; -import java.util.Arrays; - import android.os.Parcel; import android.os.Parcelable; +import java.nio.ByteBuffer; +import java.util.Arrays; + /** * Represents an immutable NDEF Message. @@ -187,7 +187,7 @@ public final class NdefMessage implements Parcelable { * short record (SR) format and omit the identifier field when possible. * * @return NDEF Message in binary format - * @see getByteArrayLength + * @see #getByteArrayLength() */ public byte[] toByteArray() { int length = getByteArrayLength(); diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 91888949829f..e25043d39087 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -231,8 +231,6 @@ public class Build { * increase when the hardware manufacturer provides an OTA update. * <p> * Possible values are defined in {@link Build.VERSION_CODES}. - * - * @see #FIRST_SDK_INT */ public static final int SDK_INT = SystemProperties.getInt( "ro.build.version.sdk", 0); diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java index 2d1bb2f25d88..aeced951f382 100644 --- a/core/java/android/os/storage/StorageManager.java +++ b/core/java/android/os/storage/StorageManager.java @@ -1835,7 +1835,6 @@ public class StorageManager { * @throws IOException when the storage device isn't present, or when it * doesn't support allocating space, or if the device had * trouble allocating the requested space. - * @see #getAllocatableBytes(UUID, int) * @see #isAllocationSupported(FileDescriptor) * @see Environment#isExternalStorageEmulated(File) */ diff --git a/core/java/android/preference/PreferenceManager.java b/core/java/android/preference/PreferenceManager.java index ea32dfd7f919..6095e6f8800c 100644 --- a/core/java/android/preference/PreferenceManager.java +++ b/core/java/android/preference/PreferenceManager.java @@ -531,7 +531,6 @@ public class PreferenceManager { * Returns the name used for storing default shared preferences. * * @see #getDefaultSharedPreferences(Context) - * @see Context#getSharedPreferencesPath(String) */ public static String getDefaultSharedPreferencesName(Context context) { return context.getPackageName() + "_preferences"; diff --git a/core/java/android/view/inputmethod/InputMethodSession.java b/core/java/android/view/inputmethod/InputMethodSession.java index 74fbbc7e22ad..1d82abb2803c 100644 --- a/core/java/android/view/inputmethod/InputMethodSession.java +++ b/core/java/android/view/inputmethod/InputMethodSession.java @@ -1,12 +1,12 @@ /* * Copyright (C) 2007-2008 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 @@ -24,17 +24,17 @@ import android.view.MotionEvent; /** * The InputMethodSession interface provides the per-client functionality * of {@link InputMethod} that is safe to expose to applications. - * + * * <p>Applications will not normally use this interface themselves, instead * relying on the standard interaction provided by * {@link android.widget.TextView} and {@link android.widget.EditText}. */ public interface InputMethodSession { - + public interface EventCallback { void finishedEvent(int seq, boolean handled); } - + /** * This method is called when the application would like to stop * receiving text input. @@ -44,7 +44,7 @@ public interface InputMethodSession { /** * This method is called when the selection or cursor in the current * target input field has changed. - * + * * @param oldSelStart The previous text offset of the cursor selection * start position. * @param oldSelEnd The previous text offset of the cursor selection @@ -75,48 +75,48 @@ public interface InputMethodSession { * This method is called when cursor location of the target input field * has changed within its window. This is not normally called, but will * only be reported if requested by the input method. - * + * * @param newCursor The rectangle of the cursor currently being shown in * the input field's window coordinates. */ public void updateCursor(Rect newCursor); - + /** * Called by a text editor that performs auto completion, to tell the * input method about the completions it has available. This can be used * by the input method to display them to the user to select the text to * be inserted. - * + * * @param completions Array of text completions that are available, starting with * the best. If this array is null, any existing completions will be * removed. */ public void displayCompletions(CompletionInfo[] completions); - + /** * Called by a text editor to report its new extracted text when its * contents change. This will only be called if the input method * calls {@link InputConnection#getExtractedText(ExtractedTextRequest, int) * InputConnection.getExtractedText()} with the option to report updates. - * + * * @param token The input method supplied token for identifying its request. * @param text The new extracted text. */ public void updateExtractedText(int token, ExtractedText text); - + /** * This method is called when a key is pressed. When done with the event, * the implementation must call back on <var>callback</var> with its * result. - * + * * <p> * If the input method wants to handle this event, return true, otherwise * return false and the caller (i.e. the application) will handle the event. - * + * * @param event The key event. - * + * * @return Whether the input method wants to handle this event. - * + * * @see #dispatchKeyUp * @see android.view.KeyEvent */ @@ -124,15 +124,15 @@ public interface InputMethodSession { /** * This method is called when there is a track ball event. - * + * * <p> * If the input method wants to handle this event, return true, otherwise * return false and the caller (i.e. the application) will handle the event. - * + * * @param event The motion event. - * + * * @return Whether the input method wants to handle this event. - * + * * @see android.view.MotionEvent */ public void dispatchTrackballEvent(int seq, MotionEvent event, EventCallback callback); @@ -156,14 +156,14 @@ public interface InputMethodSession { * Process a private command sent from the application to the input method. * This can be used to provide domain-specific features that are * only known between certain input methods and their clients. - * + * * @param action Name of the command to be performed. This <em>must</em> * be a scoped name, i.e. prefixed with a package name you own, so that * different developers will not create conflicting commands. * @param data Any data to include with the command. */ public void appPrivateCommand(String action, Bundle data); - + /** * Toggle the soft input window. * Applications can toggle the state of the soft input window. diff --git a/core/proto/android/service/usb.proto b/core/proto/android/service/usb.proto index c36371004c35..9f58611397f9 100644 --- a/core/proto/android/service/usb.proto +++ b/core/proto/android/service/usb.proto @@ -278,6 +278,8 @@ message UsbUserSettingsManagerProto { optional int32 user_id = 1; repeated UsbSettingsDevicePermissionProto device_permissions = 2; repeated UsbSettingsAccessoryPermissionProto accessory_permissions = 3; + repeated UsbDeviceAttachedActivities device_attached_activities = 4; + repeated UsbAccessoryAttachedActivities accessory_attached_activities = 5; } message UsbSettingsDevicePermissionProto { @@ -343,3 +345,17 @@ message UsbAccessoryFilterProto { optional string model = 2; optional string version = 3; } + +message UsbDeviceAttachedActivities { + option (android.msg_privacy).dest = DEST_AUTOMATIC; + + optional android.content.ComponentNameProto activity = 1; + repeated UsbDeviceFilterProto filters = 2; +} + +message UsbAccessoryAttachedActivities { + option (android.msg_privacy).dest = DEST_AUTOMATIC; + + optional android.content.ComponentNameProto activity = 1; + repeated UsbAccessoryFilterProto filters = 2; +} diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index eed0e463df99..483381660655 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -106,7 +106,6 @@ please see themes_device_defaults.xml. <item name="textAppearanceLargePopupMenu">@style/TextAppearance.Widget.PopupMenu.Large</item> <item name="textAppearanceSmallPopupMenu">@style/TextAppearance.Widget.PopupMenu.Small</item> - <item name="textAppearancePopupMenuHeader">@null</item> <!-- Button styles --> <item name="buttonStyle">@style/Widget.Button</item> @@ -230,7 +229,6 @@ please see themes_device_defaults.xml. <item name="panelMenuIsCompact">false</item> <item name="panelMenuListWidth">296dip</item> - <item name="panelMenuListTheme">@null</item> <!-- Scrollbar attributes --> <item name="scrollbarFadeDuration">250</item> @@ -308,8 +306,6 @@ please see themes_device_defaults.xml. <item name="quickContactBadgeStyleSmallWindowLarge">@style/Widget.QuickContactBadgeSmall.WindowLarge</item> <item name="listPopupWindowStyle">@style/Widget.ListPopupWindow</item> <item name="popupMenuStyle">@style/Widget.PopupMenu</item> - <item name="popupTheme">@null</item> - <item name="stackViewStyle">@null</item> <item name="activityChooserViewStyle">@style/Widget.ActivityChooserView</item> <item name="fragmentBreadCrumbsStyle">@style/Widget.FragmentBreadCrumbs</item> <item name="contextPopupMenuStyle">?attr/popupMenuStyle</item> diff --git a/core/res/res/values/themes_holo.xml b/core/res/res/values/themes_holo.xml index 3fe7c05c16e2..cb5b93dd7df4 100644 --- a/core/res/res/values/themes_holo.xml +++ b/core/res/res/values/themes_holo.xml @@ -112,7 +112,6 @@ please see themes_device_defaults.xml. <item name="textAppearanceLargePopupMenu">@style/TextAppearance.Holo.Widget.PopupMenu.Large</item> <item name="textAppearanceSmallPopupMenu">@style/TextAppearance.Holo.Widget.PopupMenu.Small</item> - <item name="textAppearancePopupMenuHeader">@null</item> <item name="textEditSuggestionItemLayout">@layout/text_edit_suggestion_item</item> <item name="textEditSuggestionContainerLayout">@layout/text_edit_suggestion_container</item> @@ -257,7 +256,6 @@ please see themes_device_defaults.xml. <item name="gridViewStyle">@style/Widget.Holo.GridView</item> <item name="imageButtonStyle">@style/Widget.Holo.ImageButton</item> <item name="imageWellStyle">@style/Widget.Holo.ImageWell</item> - <item name="listMenuViewStyle">@null</item> <item name="listViewStyle">@style/Widget.Holo.ListView</item> <item name="listViewWhiteStyle">@style/Widget.Holo.ListView.White</item> <item name="popupWindowStyle">@style/Widget.Holo.PopupWindow</item> @@ -298,7 +296,6 @@ please see themes_device_defaults.xml. <item name="quickContactBadgeStyleSmallWindowLarge">@style/Widget.Holo.QuickContactBadgeSmall.WindowLarge</item> <item name="listPopupWindowStyle">@style/Widget.Holo.ListPopupWindow</item> <item name="popupMenuStyle">@style/Widget.Holo.PopupMenu</item> - <item name="popupTheme">@null</item> <item name="stackViewStyle">@style/Widget.Holo.StackView</item> <item name="activityChooserViewStyle">@style/Widget.Holo.ActivityChooserView</item> <item name="fragmentBreadCrumbsStyle">@style/Widget.Holo.FragmentBreadCrumbs</item> @@ -319,11 +316,6 @@ please see themes_device_defaults.xml. <item name="editTextPreferenceStyle">@style/Preference.Holo.DialogPreference.EditTextPreference</item> <item name="ringtonePreferenceStyle">@style/Preference.Holo.RingtonePreference</item> <item name="preferenceLayoutChild">@layout/preference_child_holo</item> - <item name="preferencePanelStyle">@null</item> - <item name="preferenceHeaderPanelStyle">@null</item> - <item name="preferenceListStyle">@null</item> - <item name="preferenceFragmentListStyle">@null</item> - <item name="preferenceFragmentPaddingSide">@null</item> <item name="detailsElementBackground">@drawable/panel_bg_holo_dark</item> <!-- PreferenceFrameLayout attributes --> @@ -348,13 +340,10 @@ please see themes_device_defaults.xml. <item name="actionBarStyle">@style/Widget.Holo.ActionBar</item> <item name="actionBarSize">@dimen/action_bar_default_height</item> <item name="actionModePopupWindowStyle">@style/Widget.Holo.PopupWindow.ActionMode</item> - <item name="actionMenuTextAppearance">@null</item> - <item name="actionMenuTextColor">@null</item> <item name="actionBarWidgetTheme">@null</item> <item name="actionBarPopupTheme">?attr/popupTheme</item> <item name="actionBarTheme">@null</item> <item name="actionBarDivider">?attr/dividerVertical</item> - <item name="actionBarItemBackground">@null</item> <item name="actionModeCutDrawable">@drawable/ic_menu_cut_holo_dark</item> <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_holo_dark</item> @@ -364,8 +353,6 @@ please see themes_device_defaults.xml. <item name="actionModeFindDrawable">@drawable/ic_menu_find_holo_dark</item> <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_holo_dark</item> - <item name="toolbarStyle">@null</item> - <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Holo.ButtonBar</item> @@ -416,10 +403,6 @@ please see themes_device_defaults.xml. <item name="colorButtonNormal">@color/holo_button_normal</item> <item name="colorSwitchThumbNormal">@color/switch_thumb_material_light</item> - <!-- Tooltip popup properties --> - <item name="tooltipForegroundColor">@null</item> - <item name="tooltipBackgroundColor">@null</item> - <!-- Holo-only color attributes --> <item name="colorPressedHighlight">@color/holo_gray_light</item> <item name="colorLongPressedHighlight">@color/holo_gray_bright</item> @@ -496,7 +479,6 @@ please see themes_device_defaults.xml. <item name="textAppearanceLargePopupMenu">@style/TextAppearance.Holo.Light.Widget.PopupMenu.Large</item> <item name="textAppearanceSmallPopupMenu">@style/TextAppearance.Holo.Light.Widget.PopupMenu.Small</item> - <item name="textAppearancePopupMenuHeader">@null</item> <!-- Button styles --> <item name="buttonStyle">@style/Widget.Holo.Light.Button</item> @@ -636,7 +618,6 @@ please see themes_device_defaults.xml. <item name="gridViewStyle">@style/Widget.Holo.Light.GridView</item> <item name="imageButtonStyle">@style/Widget.Holo.Light.ImageButton</item> <item name="imageWellStyle">@style/Widget.Holo.Light.ImageWell</item> - <item name="listMenuViewStyle">@null</item> <item name="listViewStyle">@style/Widget.Holo.Light.ListView</item> <item name="listViewWhiteStyle">@style/Widget.Holo.Light.ListView.White</item> <item name="popupWindowStyle">@style/Widget.Holo.Light.PopupWindow</item> @@ -677,11 +658,9 @@ please see themes_device_defaults.xml. <item name="quickContactBadgeStyleSmallWindowLarge">@style/Widget.Holo.QuickContactBadgeSmall.WindowLarge</item> <item name="listPopupWindowStyle">@style/Widget.Holo.Light.ListPopupWindow</item> <item name="popupMenuStyle">@style/Widget.Holo.Light.PopupMenu</item> - <item name="popupTheme">@null</item> <item name="stackViewStyle">@style/Widget.Holo.StackView</item> <item name="activityChooserViewStyle">@style/Widget.Holo.Light.ActivityChooserView</item> <item name="fragmentBreadCrumbsStyle">@style/Widget.Holo.Light.FragmentBreadCrumbs</item> - <item name="contextPopupMenuStyle">@null</item> <!-- Preference styles --> <item name="preferenceScreenStyle">@style/Preference.Holo.PreferenceScreen</item> @@ -698,11 +677,6 @@ please see themes_device_defaults.xml. <item name="editTextPreferenceStyle">@style/Preference.Holo.DialogPreference.EditTextPreference</item> <item name="ringtonePreferenceStyle">@style/Preference.Holo.RingtonePreference</item> <item name="preferenceLayoutChild">@layout/preference_child_holo</item> - <item name="preferencePanelStyle">@null</item> - <item name="preferenceHeaderPanelStyle">@null</item> - <item name="preferenceListStyle">@null</item> - <item name="preferenceFragmentListStyle">@null</item> - <item name="preferenceFragmentPaddingSide">@null</item> <item name="detailsElementBackground">@drawable/panel_bg_holo_light</item> <!-- PreferenceFrameLayout attributes --> @@ -727,12 +701,9 @@ please see themes_device_defaults.xml. <item name="actionBarStyle">@style/Widget.Holo.Light.ActionBar.Solid</item> <item name="actionBarSize">@dimen/action_bar_default_height</item> <item name="actionModePopupWindowStyle">@style/Widget.Holo.Light.PopupWindow.ActionMode</item> - <item name="actionMenuTextAppearance">@null</item> - <item name="actionMenuTextColor">@null</item> <item name="actionBarWidgetTheme">@null</item> <item name="actionBarPopupTheme">?attr/popupTheme</item> <item name="actionBarTheme">@null</item> - <item name="actionBarItemBackground">@null</item> <item name="actionModeCutDrawable">@drawable/ic_menu_cut_holo_light</item> <item name="actionModeCopyDrawable">@drawable/ic_menu_copy_holo_light</item> @@ -742,8 +713,6 @@ please see themes_device_defaults.xml. <item name="actionModeFindDrawable">@drawable/ic_menu_find_holo_light</item> <item name="actionModeWebSearchDrawable">@drawable/ic_menu_search_holo_light</item> - <item name="toolbarStyle">@null</item> - <item name="dividerVertical">?attr/listDivider</item> <item name="dividerHorizontal">?attr/listDivider</item> <item name="buttonBarStyle">@style/Holo.Light.ButtonBar</item> @@ -791,10 +760,6 @@ please see themes_device_defaults.xml. <item name="colorButtonNormal">@color/holo_light_button_normal</item> <item name="colorSwitchThumbNormal">@color/switch_thumb_material_light</item> - <!-- Tooltip popup properties --> - <item name="tooltipForegroundColor">@null</item> - <item name="tooltipBackgroundColor">@null</item> - <!-- Holo-only color attributes --> <item name="colorPressedHighlight">@color/holo_gray_light</item> <item name="colorLongPressedHighlight">@color/holo_gray_bright</item> diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 0ff958fdadd5..c6f841505e03 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1229,6 +1229,7 @@ public final class Bitmap implements Parcelable { if (config == null) { throw new IllegalArgumentException("Config must not be null"); } + source.endRecording(); if (source.requiresHardwareAcceleration() && config != Config.HARDWARE) { StrictMode.noteSlowCall("GPU readback"); } diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java index 70306281514d..f2d0227645a9 100644 --- a/graphics/java/android/graphics/Picture.java +++ b/graphics/java/android/graphics/Picture.java @@ -123,6 +123,9 @@ public class Picture { * drawn to a hardware-accelerated canvas. If this returns true then this Picture can only * be drawn to another Picture or to a Canvas where canvas.isHardwareAccelerated() is true. * + * Note this value is only updated after recording has finished by a call to + * {@link #endRecording()}. Prior to that it will be the default value of false. + * * @return true if the Picture can only be drawn to a hardware-accelerated canvas, * false otherwise. */ diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java index 2cb58d043fc0..62d3dead6abe 100644 --- a/media/java/android/media/MediaCodecInfo.java +++ b/media/java/android/media/MediaCodecInfo.java @@ -412,7 +412,7 @@ public final class MediaCodecInfo { * Use this format with {@link Image}. This format corresponds to * {@link android.graphics.ImageFormat#FLEX_RGB_888}, and can represent * {@link #COLOR_Format24bitBGR888} and {@link #COLOR_Format24bitRGB888} formats. - * @see Image#getFormat. + * @see Image#getFormat() */ public static final int COLOR_FormatRGBFlexible = 0x7F36B888; @@ -425,7 +425,7 @@ public final class MediaCodecInfo { * {@link #COLOR_Format32bitBGRA8888}, {@link #COLOR_Format32bitABGR8888} and * {@link #COLOR_Format32bitARGB8888} formats. * - * @see Image#getFormat + * @see Image#getFormat() */ public static final int COLOR_FormatRGBAFlexible = 0x7F36A888; diff --git a/media/java/android/media/MediaCodecList.java b/media/java/android/media/MediaCodecList.java index 3cb4cbe99a4b..a442fe3ca312 100644 --- a/media/java/android/media/MediaCodecList.java +++ b/media/java/android/media/MediaCodecList.java @@ -201,7 +201,7 @@ final public class MediaCodecList { * <code class=prettyprint>format.setString(MediaFormat.KEY_FRAME_RATE, null)</code> * to clear any existing frame rate setting in the format. * - * @see MediaCodecList.CodecCapabilities.isFormatSupported for format keys + * @see MediaCodecInfo.CodecCapabilities#isFormatSupported(MediaFormat) for format keys * considered per android versions when evaluating suitable codecs. * * @param format A decoder media format with optional feature directives. @@ -225,7 +225,7 @@ final public class MediaCodecList { * <code class=prettyprint>format.setString(MediaFormat.KEY_FRAME_RATE, null)</code> * to clear any existing frame rate setting in the format. * - * @see MediaCodecList.CodecCapabilities.isFormatSupported for format keys + * @see MediaCodecInfo.CodecCapabilities.isFormatSupported(MediaFormat) for format keys * considered per android versions when evaluating suitable codecs. * * @param format An encoder media format with optional feature directives. diff --git a/media/java/android/media/SyncParams.java b/media/java/android/media/SyncParams.java index 9f6bfe14bd61..c56b140366cd 100644 --- a/media/java/android/media/SyncParams.java +++ b/media/java/android/media/SyncParams.java @@ -86,7 +86,7 @@ public final class SyncParams { /** * Use audio track for sync source. This requires audio data and an audio track. * - * @see AudioTrack#getTimeStamp + * @see android.media.AudioTrack#getTimeStamp(android.media.AudioTimestamp) */ public static final int SYNC_SOURCE_AUDIO = 2; diff --git a/media/java/android/media/TimedMetaData.java b/media/java/android/media/TimedMetaData.java index 0ab52d7322c2..03c877013ead 100644 --- a/media/java/android/media/TimedMetaData.java +++ b/media/java/android/media/TimedMetaData.java @@ -26,7 +26,7 @@ import android.os.Parcel; * <li> raw uninterpreted byte-array extracted directly from the container. </li> * </ul> * - * @see MediaPlayer#setOnTimedMetaDataAvailableListener(android.media.MediaPlayer.OnTimedMetaDataListener) + * @see MediaPlayer#setOnTimedMetaDataAvailableListener(android.media.MediaPlayer.OnTimedMetaDataAvailableListener) */ public final class TimedMetaData { private static final String TAG = "TimedMetaData"; diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 5c0d5dde2b4f..3b1872a9c8b3 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -499,4 +499,7 @@ <!-- On debuggable builds, alert the user if SystemUI PSS goes over this number (in kb) --> <integer name="watch_heap_limit">256000</integer> + + <!-- Allow dragging the PIP to a location to close it --> + <bool name="config_pipEnableDismissDragToEdge">true</bool> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java index 1805f96c2cf5..02345c9ffdb8 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java @@ -66,8 +66,7 @@ public class PipTouchHandler { private static final int SHOW_DISMISS_AFFORDANCE_DELAY = 225; // Allow dragging the PIP to a location to close it - private static final boolean ENABLE_DISMISS_DRAG_TO_EDGE = true; - + private final boolean mEnableDimissDragToEdge; private final Context mContext; private final IActivityManager mActivityManager; private final ViewConfiguration mViewConfig; @@ -101,7 +100,7 @@ public class PipTouchHandler { private Runnable mShowDismissAffordance = new Runnable() { @Override public void run() { - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { mDismissViewController.showDismissTarget(); } } @@ -200,6 +199,8 @@ public class PipTouchHandler { R.dimen.pip_expanded_shortest_edge_size); mImeOffset = res.getDimensionPixelSize(R.dimen.pip_ime_offset); + mEnableDimissDragToEdge = res.getBoolean(R.bool.config_pipEnableDismissDragToEdge); + // Register the listener for input consumer touch events inputConsumerController.setTouchListener(this::handleTouchEvent); inputConsumerController.setRegistrationListener(this::onRegistrationChanged); @@ -598,7 +599,7 @@ public class PipTouchHandler { mMenuController.pokeMenu(); } - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { mDismissViewController.createDismissTarget(); mHandler.postDelayed(mShowDismissAffordance, SHOW_DISMISS_AFFORDANCE_DELAY); } @@ -613,7 +614,7 @@ public class PipTouchHandler { if (touchState.startedDragging()) { mSavedSnapFraction = -1f; - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { mHandler.removeCallbacks(mShowDismissAffordance); mDismissViewController.showDismissTarget(); } @@ -629,7 +630,7 @@ public class PipTouchHandler { if (!touchState.allowDraggingOffscreen() || !ENABLE_MINIMIZE) { left = Math.max(mMovementBounds.left, Math.min(mMovementBounds.right, left)); } - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { // Allow pip to move past bottom bounds top = Math.max(mMovementBounds.top, top); } else { @@ -644,7 +645,7 @@ public class PipTouchHandler { mTmpBounds.offsetTo((int) left, (int) top); mMotionHelper.movePip(mTmpBounds); - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { updateDismissFraction(); } @@ -666,7 +667,7 @@ public class PipTouchHandler { @Override public boolean onUp(PipTouchState touchState) { - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { // Clean up the dismiss target regardless of the touch state in case the touch // enabled state changes while the user is interacting cleanUpDismissTarget(); @@ -686,7 +687,7 @@ public class PipTouchHandler { vel.y, isFling); final boolean isFlingToBot = isFling && vel.y > 0 && !isHorizontal && (mMovementWithinDismiss || isUpWithinDimiss); - if (ENABLE_DISMISS_DRAG_TO_EDGE) { + if (mEnableDimissDragToEdge) { // Check if the user dragged or flung the PiP offscreen to dismiss it if (mMotionHelper.shouldDismissPip() || isFlingToBot) { MetricsLoggerWrapper.logPictureInPictureDismissByDrag(mContext, @@ -830,7 +831,7 @@ public class PipTouchHandler { pw.println(innerPrefix + "mIsShelfShowing=" + mIsShelfShowing); pw.println(innerPrefix + "mShelfHeight=" + mShelfHeight); pw.println(innerPrefix + "mSavedSnapFraction=" + mSavedSnapFraction); - pw.println(innerPrefix + "mEnableDragToEdgeDismiss=" + ENABLE_DISMISS_DRAG_TO_EDGE); + pw.println(innerPrefix + "mEnableDragToEdgeDismiss=" + mEnableDimissDragToEdge); pw.println(innerPrefix + "mEnableMinimize=" + ENABLE_MINIMIZE); mSnapAlgorithm.dump(pw, innerPrefix); mTouchState.dump(pw, innerPrefix); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 9ba0880b3748..08a20552f993 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -463,7 +463,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn() && mCurrentInFrontAlpha != alpha) { mCurrentInFrontAlpha = alpha; - scheduleUpdate(); + updateScrims(); } mState.AOD.setAodFrontScrimAlpha(alpha); diff --git a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java index 5ed14a07cb6c..6371d777aeb7 100644 --- a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java +++ b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java @@ -185,7 +185,12 @@ public class TetherInterfaceStateMachine extends StateMachine { private boolean startIPv4() { return configureIPv4(true); } - private void stopIPv4() { configureIPv4(false); } + private void stopIPv4() { + configureIPv4(false); + // NOTE: All of configureIPv4() will be refactored out of existence + // into calls to InterfaceController, shared with startIPv4(). + mInterfaceCtrl.clearIPv4Address(); + } // TODO: Refactor this in terms of calls to InterfaceController. private boolean configureIPv4(boolean enabled) { diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index fba9a541bcac..b07dcd0635f8 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -8031,6 +8031,13 @@ public class PackageManagerService extends IPackageManager.Stub flags = updateFlagsForApplication(flags, userId, null); final boolean listUninstalled = (flags & MATCH_KNOWN_PACKAGES) != 0; + mPermissionManager.enforceCrossUserPermission( + callingUid, + userId, + false /* requireFullPermission */, + false /* checkShell */, + "get installed application info"); + // writer synchronized (mPackages) { ArrayList<ApplicationInfo> list; diff --git a/services/usb/java/com/android/server/usb/UsbProfileGroupSettingsManager.java b/services/usb/java/com/android/server/usb/UsbProfileGroupSettingsManager.java index 43f189b26dfa..7a906d0b7aaf 100644 --- a/services/usb/java/com/android/server/usb/UsbProfileGroupSettingsManager.java +++ b/services/usb/java/com/android/server/usb/UsbProfileGroupSettingsManager.java @@ -445,38 +445,80 @@ class UsbProfileGroupSettingsManager { }); } - // Checks to see if a package matches a device or accessory. - // Only one of device and accessory should be non-null. - private boolean packageMatchesLocked(ResolveInfo info, String metaDataName, - UsbDevice device, UsbAccessory accessory) { - if (isForwardMatch(info)) { - return true; - } - + /** + * Get {@link DeviceFilter} for all devices an activity should be launched for. + * + * @param pm The package manager used to get the device filter files + * @param info The {@link ResolveInfo} for the activity that can handle usb device attached + * events + * + * @return The list of {@link DeviceFilter} the activity should be called for or {@code null} if + * none + */ + @Nullable + static ArrayList<DeviceFilter> getDeviceFilters(@NonNull PackageManager pm, + @NonNull ResolveInfo info) { + ArrayList<DeviceFilter> filters = null; ActivityInfo ai = info.activityInfo; XmlResourceParser parser = null; try { - parser = ai.loadXmlMetaData(mPackageManager, metaDataName); + parser = ai.loadXmlMetaData(pm, UsbManager.ACTION_USB_DEVICE_ATTACHED); if (parser == null) { Slog.w(TAG, "no meta-data for " + info); - return false; + return null; } XmlUtils.nextElement(parser); while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { String tagName = parser.getName(); - if (device != null && "usb-device".equals(tagName)) { - DeviceFilter filter = DeviceFilter.read(parser); - if (filter.matches(device)) { - return true; + if ("usb-device".equals(tagName)) { + if (filters == null) { + filters = new ArrayList<>(1); } + filters.add(DeviceFilter.read(parser)); } - else if (accessory != null && "usb-accessory".equals(tagName)) { - AccessoryFilter filter = AccessoryFilter.read(parser); - if (filter.matches(accessory)) { - return true; + XmlUtils.nextElement(parser); + } + } catch (Exception e) { + Slog.w(TAG, "Unable to load component info " + info.toString(), e); + } finally { + if (parser != null) parser.close(); + } + return filters; + } + + /** + * Get {@link AccessoryFilter} for all accessories an activity should be launched for. + * + * @param pm The package manager used to get the accessory filter files + * @param info The {@link ResolveInfo} for the activity that can handle usb accessory attached + * events + * + * @return The list of {@link AccessoryFilter} the activity should be called for or {@code null} + * if none + */ + static @Nullable ArrayList<AccessoryFilter> getAccessoryFilters(@NonNull PackageManager pm, + @NonNull ResolveInfo info) { + ArrayList<AccessoryFilter> filters = null; + ActivityInfo ai = info.activityInfo; + + XmlResourceParser parser = null; + try { + parser = ai.loadXmlMetaData(pm, UsbManager.ACTION_USB_ACCESSORY_ATTACHED); + if (parser == null) { + Slog.w(TAG, "no meta-data for " + info); + return null; + } + + XmlUtils.nextElement(parser); + while (parser.getEventType() != XmlPullParser.END_DOCUMENT) { + String tagName = parser.getName(); + if ("usb-accessory".equals(tagName)) { + if (filters == null) { + filters = new ArrayList<>(1); } + filters.add(AccessoryFilter.read(parser)); } XmlUtils.nextElement(parser); } @@ -485,6 +527,42 @@ class UsbProfileGroupSettingsManager { } finally { if (parser != null) parser.close(); } + return filters; + } + + // Checks to see if a package matches a device or accessory. + // Only one of device and accessory should be non-null. + private boolean packageMatchesLocked(ResolveInfo info, UsbDevice device, + UsbAccessory accessory) { + if (isForwardMatch(info)) { + return true; + } + + if (device != null) { + ArrayList<DeviceFilter> deviceFilters = getDeviceFilters(mPackageManager, info); + if (deviceFilters != null) { + int numDeviceFilters = deviceFilters.size(); + for (int i = 0; i < numDeviceFilters; i++) { + if (deviceFilters.get(i).matches(device)) { + return true; + } + } + } + } + + if (accessory != null) { + ArrayList<AccessoryFilter> accessoryFilters = getAccessoryFilters(mPackageManager, + info); + if (accessoryFilters != null) { + int numAccessoryFilters = accessoryFilters.size(); + for (int i = 0; i < numAccessoryFilters; i++) { + if (accessoryFilters.get(i).matches(accessory)) { + return true; + } + } + } + } + return false; } @@ -502,8 +580,8 @@ class UsbProfileGroupSettingsManager { ArrayList<ResolveInfo> resolveInfos = new ArrayList<>(); int numProfiles = profiles.size(); for (int i = 0; i < numProfiles; i++) { - resolveInfos.addAll(mPackageManager.queryIntentActivitiesAsUser(intent, - PackageManager.GET_META_DATA, profiles.get(i).id)); + resolveInfos.addAll(mSettingsManager.getSettingsForUser(profiles.get(i).id) + .queryIntentActivities(intent)); } return resolveInfos; @@ -629,7 +707,7 @@ class UsbProfileGroupSettingsManager { int count = resolveInfos.size(); for (int i = 0; i < count; i++) { ResolveInfo resolveInfo = resolveInfos.get(i); - if (packageMatchesLocked(resolveInfo, intent.getAction(), device, null)) { + if (packageMatchesLocked(resolveInfo, device, null)) { matches.add(resolveInfo); } } @@ -644,7 +722,7 @@ class UsbProfileGroupSettingsManager { int count = resolveInfos.size(); for (int i = 0; i < count; i++) { ResolveInfo resolveInfo = resolveInfos.get(i); - if (packageMatchesLocked(resolveInfo, intent.getAction(), null, accessory)) { + if (packageMatchesLocked(resolveInfo, null, accessory)) { matches.add(resolveInfo); } } diff --git a/services/usb/java/com/android/server/usb/UsbSettingsManager.java b/services/usb/java/com/android/server/usb/UsbSettingsManager.java index caf05a3538ec..9221825b2d87 100644 --- a/services/usb/java/com/android/server/usb/UsbSettingsManager.java +++ b/services/usb/java/com/android/server/usb/UsbSettingsManager.java @@ -33,6 +33,8 @@ import android.util.SparseArray; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.dump.DualDumpOutputStream; +import java.util.List; + /** * Maintains all {@link UsbUserSettingsManager} for all users. */ @@ -140,9 +142,10 @@ class UsbSettingsManager { long token = dump.start(idName, id); synchronized (mSettingsByUser) { - int numUsers = mSettingsByUser.size(); + List<UserInfo> users = mUserManager.getUsers(); + int numUsers = users.size(); for (int i = 0; i < numUsers; i++) { - mSettingsByUser.valueAt(i).dump(dump, "user_settings", + getSettingsForUser(users.get(i).id).dump(dump, "user_settings", UsbSettingsManagerProto.USER_SETTINGS); } } diff --git a/services/usb/java/com/android/server/usb/UsbUserSettingsManager.java b/services/usb/java/com/android/server/usb/UsbUserSettingsManager.java index 840950679903..24a2d72415ed 100644 --- a/services/usb/java/com/android/server/usb/UsbUserSettingsManager.java +++ b/services/usb/java/com/android/server/usb/UsbUserSettingsManager.java @@ -16,14 +16,22 @@ package com.android.server.usb; +import static com.android.internal.util.dump.DumpUtils.writeComponentName; +import static com.android.server.usb.UsbProfileGroupSettingsManager.getAccessoryFilters; +import static com.android.server.usb.UsbProfileGroupSettingsManager.getDeviceFilters; + import android.annotation.NonNull; import android.app.PendingIntent; import android.content.ActivityNotFoundException; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; +import android.content.pm.ResolveInfo; +import android.hardware.usb.AccessoryFilter; +import android.hardware.usb.DeviceFilter; import android.hardware.usb.UsbAccessory; import android.hardware.usb.UsbConstants; import android.hardware.usb.UsbDevice; @@ -32,6 +40,8 @@ import android.hardware.usb.UsbManager; import android.os.Binder; import android.os.Process; import android.os.UserHandle; +import android.service.usb.UsbAccessoryAttachedActivities; +import android.service.usb.UsbDeviceAttachedActivities; import android.service.usb.UsbSettingsAccessoryPermissionProto; import android.service.usb.UsbSettingsDevicePermissionProto; import android.service.usb.UsbUserSettingsManagerProto; @@ -40,7 +50,9 @@ import android.util.SparseBooleanArray; import com.android.internal.util.dump.DualDumpOutputStream; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; class UsbUserSettingsManager { private static final String TAG = "UsbUserSettingsManager"; @@ -305,6 +317,18 @@ class UsbUserSettingsManager { } } + /** + * Get all activities that can handle the device/accessory attached intent. + * + * @param intent The intent to handle + * + * @return The resolve infos of the activities that can handle the intent + */ + List<ResolveInfo> queryIntentActivities(@NonNull Intent intent) { + return mPackageManager.queryIntentActivitiesAsUser(intent, PackageManager.GET_META_DATA, + mUser.getIdentifier()); + } + public void dump(@NonNull DualDumpOutputStream dump, @NonNull String idName, long id) { long token = dump.start(idName, id); @@ -341,6 +365,59 @@ class UsbUserSettingsManager { dump.end(accessoryPermissionToken); } + + List<ResolveInfo> deviceAttachedActivities = queryIntentActivities( + new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED)); + int numDeviceAttachedActivities = deviceAttachedActivities.size(); + for (int activityNum = 0; activityNum < numDeviceAttachedActivities; activityNum++) { + ResolveInfo deviceAttachedActivity = deviceAttachedActivities.get(activityNum); + + long deviceAttachedActivityToken = dump.start("device_attached_activities", + UsbUserSettingsManagerProto.DEVICE_ATTACHED_ACTIVITIES); + + writeComponentName(dump, "activity", UsbDeviceAttachedActivities.ACTIVITY, + new ComponentName(deviceAttachedActivity.activityInfo.packageName, + deviceAttachedActivity.activityInfo.name)); + + ArrayList<DeviceFilter> deviceFilters = getDeviceFilters(mPackageManager, + deviceAttachedActivity); + if (deviceFilters != null) { + int numDeviceFilters = deviceFilters.size(); + for (int filterNum = 0; filterNum < numDeviceFilters; filterNum++) { + deviceFilters.get(filterNum).dump(dump, "filters", + UsbDeviceAttachedActivities.FILTERS); + } + } + + dump.end(deviceAttachedActivityToken); + } + + List<ResolveInfo> accessoryAttachedActivities = + queryIntentActivities(new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED)); + int numAccessoryAttachedActivities = accessoryAttachedActivities.size(); + for (int activityNum = 0; activityNum < numAccessoryAttachedActivities; activityNum++) { + ResolveInfo accessoryAttachedActivity = + accessoryAttachedActivities.get(activityNum); + + long accessoryAttachedActivityToken = dump.start("accessory_attached_activities", + UsbUserSettingsManagerProto.ACCESSORY_ATTACHED_ACTIVITIES); + + writeComponentName(dump, "activity", UsbAccessoryAttachedActivities.ACTIVITY, + new ComponentName(accessoryAttachedActivity.activityInfo.packageName, + accessoryAttachedActivity.activityInfo.name)); + + ArrayList<AccessoryFilter> accessoryFilters = getAccessoryFilters(mPackageManager, + accessoryAttachedActivity); + if (accessoryFilters != null) { + int numAccessoryFilters = accessoryFilters.size(); + for (int filterNum = 0; filterNum < numAccessoryFilters; filterNum++) { + accessoryFilters.get(filterNum).dump(dump, "filters", + UsbAccessoryAttachedActivities.FILTERS); + } + } + + dump.end(accessoryAttachedActivityToken); + } } dump.end(token); diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java index e213d79e8578..2d096c0e525b 100644 --- a/telephony/java/android/provider/Telephony.java +++ b/telephony/java/android/provider/Telephony.java @@ -25,8 +25,8 @@ import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; -import android.database.Cursor; import android.database.ContentObserver; +import android.database.Cursor; import android.database.sqlite.SqliteWrapper; import android.net.Uri; import android.telephony.Rlog; @@ -40,7 +40,6 @@ import android.util.Patterns; import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.SmsApplication; - import java.util.HashSet; import java.util.Set; import java.util.regex.Matcher; @@ -3436,7 +3435,6 @@ public final class Telephony { /** * Contains carrier identification information for the current subscriptions. - * @see SubscriptionManager#getActiveSubscriptionIdList() */ public static final class CarrierId implements BaseColumns { /** diff --git a/telephony/java/android/telephony/CellSignalStrength.java b/telephony/java/android/telephony/CellSignalStrength.java index 2a3ef2197706..6090d5c7b555 100644 --- a/telephony/java/android/telephony/CellSignalStrength.java +++ b/telephony/java/android/telephony/CellSignalStrength.java @@ -49,11 +49,11 @@ public abstract class CellSignalStrength { /** * Get signal level as an int from 0..4 * <p> - * @see SIGNAL_STRENGTH_NONE_OR_UNKNOWN - * @see SIGNAL_STRENGTH_POOR - * @see SIGNAL_STRENGTH_MODERATE - * @see SIGNAL_STRENGTH_GOOD - * @see SIGNAL_STRENGTH_GREAT + * @see #SIGNAL_STRENGTH_NONE_OR_UNKNOWN + * @see #SIGNAL_STRENGTH_POOR + * @see #SIGNAL_STRENGTH_MODERATE + * @see #SIGNAL_STRENGTH_GOOD + * @see #SIGNAL_STRENGTH_GREAT */ public abstract int getLevel(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8b80cea2462a..31a81e1b0ecc 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3417,8 +3417,8 @@ public class TelephonyManager { * * @param settings The settings for the filter, or {@code null} to disable the filter. * - * @see {@link TelecomManager#getDefaultDialerPackage()} - * @see {@link CarrierConfigManager#KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY} + * @see TelecomManager#getDefaultDialerPackage() + * @see CarrierConfigManager#KEY_CARRIER_VVM_PACKAGE_NAME_STRING_ARRAY */ public void setVisualVoicemailSmsFilterSettings(VisualVoicemailSmsFilterSettings settings) { if (settings == null) { diff --git a/tests/net/java/com/android/server/connectivity/TetheringTest.java b/tests/net/java/com/android/server/connectivity/TetheringTest.java index 47e49d444612..34ecde8027c7 100644 --- a/tests/net/java/com/android/server/connectivity/TetheringTest.java +++ b/tests/net/java/com/android/server/connectivity/TetheringTest.java @@ -779,11 +779,12 @@ public class TetheringTest { sendWifiApStateChanged(WIFI_AP_STATE_ENABLED, TEST_WLAN_IFNAME, IFACE_IP_MODE_TETHERED); mLooper.dispatchAll(); - // We verify get/set called twice here: once for setup and once during + // We verify get/set called thrice here: once for setup and twice during // teardown because all events happen over the course of the single - // dispatchAll() above. + // dispatchAll() above. Note that once the TISM IPv4 address config + // code is refactored the two calls during shutdown will revert to one. verify(mNMService, times(2)).getInterfaceConfig(TEST_WLAN_IFNAME); - verify(mNMService, times(2)) + verify(mNMService, times(3)) .setInterfaceConfig(eq(TEST_WLAN_IFNAME), any(InterfaceConfiguration.class)); verify(mNMService, times(1)).tetherInterface(TEST_WLAN_IFNAME); verify(mWifiManager).updateInterfaceIpState( diff --git a/tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java b/tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java index 7c77cf59524d..19d3a2e11904 100644 --- a/tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java +++ b/tests/net/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachineTest.java @@ -173,6 +173,7 @@ public class TetherInterfaceStateMachineTest { dispatchCommand(TetherInterfaceStateMachine.CMD_TETHER_UNREQUESTED); InOrder inOrder = inOrder(mNMService, mStatsService, mTetherHelper); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); + inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( @@ -270,6 +271,7 @@ public class TetherInterfaceStateMachineTest { inOrder.verify(mNMService).stopInterfaceForwarding(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).disableNat(IFACE_NAME, UPSTREAM_IFACE); inOrder.verify(mNMService).untetherInterface(IFACE_NAME); + inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any()); inOrder.verify(mTetherHelper).updateInterfaceState( mTestedSm, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR); inOrder.verify(mTetherHelper).updateLinkProperties( |