diff options
103 files changed, 1242 insertions, 781 deletions
diff --git a/api/current.txt b/api/current.txt index 4ec226506f79..f7ec2fb59de5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -42408,9 +42408,11 @@ package android.telephony { method public deprecated int getMnc(); method public java.lang.String getMncString(); method public java.lang.String getNumber(); + method public int getParentSubId(); method public int getSimSlotIndex(); method public int getSubscriptionId(); method public boolean isEmbedded(); + method public boolean isOpportunistic(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.telephony.SubscriptionInfo> CREATOR; } @@ -42435,6 +42437,7 @@ package android.telephony { method public void setSubscriptionOverrideCongested(int, boolean, long); method public void setSubscriptionOverrideUnmetered(int, boolean, long); method public void setSubscriptionPlans(int, java.util.List<android.telephony.SubscriptionPlan>); + method public void switchToSubscription(int, android.app.PendingIntent); field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_MANAGE_SUBSCRIPTION_PLANS = "android.telephony.action.MANAGE_SUBSCRIPTION_PLANS"; diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt index f88a039e6b57..c8c542096a43 100644 --- a/config/hiddenapi-light-greylist.txt +++ b/config/hiddenapi-light-greylist.txt @@ -291,114 +291,8 @@ Landroid/bluetooth/IBluetoothManager;->unregisterStateChangeCallback(Landroid/bl Landroid/bluetooth/IBluetoothManagerCallback$Stub;-><init>()V Landroid/bluetooth/IBluetoothPbap$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetoothPbap; Landroid/bluetooth/IBluetoothStateChangeCallback$Stub;-><init>()V -Landroid/content/AsyncTaskLoader;->mExecutor:Ljava/util/concurrent/Executor; -Landroid/content/AsyncTaskLoader;->waitForLoader()V -Landroid/content/BroadcastReceiver$PendingResult;-><init>(ILjava/lang/String;Landroid/os/Bundle;IZZLandroid/os/IBinder;II)V -Landroid/content/BroadcastReceiver$PendingResult;->mAbortBroadcast:Z -Landroid/content/BroadcastReceiver$PendingResult;->mFinished:Z -Landroid/content/BroadcastReceiver$PendingResult;->mFlags:I -Landroid/content/BroadcastReceiver$PendingResult;->mInitialStickyHint:Z -Landroid/content/BroadcastReceiver$PendingResult;->mOrderedHint:Z -Landroid/content/BroadcastReceiver$PendingResult;->mResultCode:I -Landroid/content/BroadcastReceiver$PendingResult;->mResultData:Ljava/lang/String; -Landroid/content/BroadcastReceiver$PendingResult;->mResultExtras:Landroid/os/Bundle; -Landroid/content/BroadcastReceiver$PendingResult;->mSendingUser:I -Landroid/content/BroadcastReceiver$PendingResult;->mToken:Landroid/os/IBinder; -Landroid/content/BroadcastReceiver$PendingResult;->mType:I -Landroid/content/BroadcastReceiver;->getPendingResult()Landroid/content/BroadcastReceiver$PendingResult; -Landroid/content/BroadcastReceiver;->mPendingResult:Landroid/content/BroadcastReceiver$PendingResult; -Landroid/content/BroadcastReceiver;->setPendingResult(Landroid/content/BroadcastReceiver$PendingResult;)V -Landroid/content/ClipboardManager;-><init>(Landroid/content/Context;Landroid/os/Handler;)V -Landroid/content/ClipboardManager;->reportPrimaryClipChanged()V -Landroid/content/ClipData$Item;->mUri:Landroid/net/Uri; -Landroid/content/ClipData;->getIcon()Landroid/graphics/Bitmap; -Landroid/content/ComponentName;->appendShortString(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)V -Landroid/content/ComponentName;->printShortString(Ljava/io/PrintWriter;Ljava/lang/String;Ljava/lang/String;)V -Landroid/content/ContentProvider;->coerceToLocalContentProvider(Landroid/content/IContentProvider;)Landroid/content/ContentProvider; -Landroid/content/ContentProvider;->mAuthorities:[Ljava/lang/String; -Landroid/content/ContentProvider;->mAuthority:Ljava/lang/String; -Landroid/content/ContentProvider;->maybeAddUserId(Landroid/net/Uri;I)Landroid/net/Uri; -Landroid/content/ContentProvider;->mContext:Landroid/content/Context; -Landroid/content/ContentProvider;->mPathPermissions:[Landroid/content/pm/PathPermission; -Landroid/content/ContentProvider;->mReadPermission:Ljava/lang/String; -Landroid/content/ContentProvider;->mWritePermission:Ljava/lang/String; -Landroid/content/ContentProvider;->setAppOps(II)V -Landroid/content/ContentProviderClient;->mContentProvider:Landroid/content/IContentProvider; -Landroid/content/ContentProviderClient;->mPackageName:Ljava/lang/String; -Landroid/content/ContentProviderNative;->asInterface(Landroid/os/IBinder;)Landroid/content/IContentProvider; -Landroid/content/ContentProviderOperation;->getType()I -Landroid/content/ContentProviderOperation;->mSelection:Ljava/lang/String; -Landroid/content/ContentProviderOperation;->mType:I -Landroid/content/ContentProviderOperation;->mUri:Landroid/net/Uri; -Landroid/content/ContentProviderOperation;->TYPE_DELETE:I -Landroid/content/ContentProviderOperation;->TYPE_INSERT:I -Landroid/content/ContentProviderOperation;->TYPE_UPDATE:I -Landroid/content/ContentResolver$OpenResourceIdResult;->id:I -Landroid/content/ContentResolver$OpenResourceIdResult;->r:Landroid/content/res/Resources; -Landroid/content/ContentResolver;->acquireExistingProvider(Landroid/content/Context;Ljava/lang/String;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireExistingProvider(Landroid/net/Uri;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireProvider(Landroid/content/Context;Ljava/lang/String;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireProvider(Landroid/net/Uri;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireProvider(Ljava/lang/String;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireUnstableProvider(Landroid/content/Context;Ljava/lang/String;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->acquireUnstableProvider(Ljava/lang/String;)Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->getContentService()Landroid/content/IContentService; -Landroid/content/ContentResolver;->getPackageName()Ljava/lang/String; -Landroid/content/ContentResolver;->getResourceId(Landroid/net/Uri;)Landroid/content/ContentResolver$OpenResourceIdResult; -Landroid/content/ContentResolver;->getSyncStatus(Landroid/accounts/Account;Ljava/lang/String;)Landroid/content/SyncStatusInfo; -Landroid/content/ContentResolver;->getSyncStatusAsUser(Landroid/accounts/Account;Ljava/lang/String;I)Landroid/content/SyncStatusInfo; -Landroid/content/ContentResolver;->mContext:Landroid/content/Context; -Landroid/content/ContentResolver;->mPackageName:Ljava/lang/String; -Landroid/content/ContentResolver;->releaseProvider(Landroid/content/IContentProvider;)Z -Landroid/content/ContentResolver;->releaseUnstableProvider(Landroid/content/IContentProvider;)Z -Landroid/content/ContentResolver;->sContentService:Landroid/content/IContentService; -Landroid/content/ContentResolver;->SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS:I -Landroid/content/ContentResolver;->SYNC_OBSERVER_TYPE_STATUS:I -Landroid/content/ContentResolver;->takePersistableUriPermission(Ljava/lang/String;Landroid/net/Uri;I)V -Landroid/content/ContentResolver;->unstableProviderDied(Landroid/content/IContentProvider;)V -Landroid/content/ContentValues;-><init>(Ljava/util/HashMap;)V -Landroid/content/ContentValues;->mValues:Ljava/util/HashMap; -Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z -Landroid/content/Context;->canStartActivityForResult()Z -Landroid/content/Context;->checkPermission(Ljava/lang/String;IILandroid/os/IBinder;)I -Landroid/content/Context;->COUNTRY_DETECTOR:Ljava/lang/String; -Landroid/content/Context;->createApplicationContext(Landroid/content/pm/ApplicationInfo;I)Landroid/content/Context; -Landroid/content/Context;->ETHERNET_SERVICE:Ljava/lang/String; -Landroid/content/Context;->getBasePackageName()Ljava/lang/String; -Landroid/content/Context;->getDisplay()Landroid/view/Display; -Landroid/content/Context;->getSharedPrefsFile(Ljava/lang/String;)Ljava/io/File; -Landroid/content/Context;->getThemeResId()I -Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;Ljava/lang/String;I)V -Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;Ljava/lang/String;I)V -Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;ILandroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V -Landroid/content/Context;->sendOrderedBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;Ljava/lang/String;ILandroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V -Landroid/content/Context;->sendOrderedBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;Ljava/lang/String;ILandroid/os/Bundle;Landroid/content/BroadcastReceiver;Landroid/os/Handler;ILjava/lang/String;Landroid/os/Bundle;)V -Landroid/content/Context;->startActivityAsUser(Landroid/content/Intent;Landroid/os/Bundle;Landroid/os/UserHandle;)V -Landroid/content/Context;->startActivityForResult(Ljava/lang/String;Landroid/content/Intent;ILandroid/os/Bundle;)V -Landroid/content/Context;->STATUS_BAR_SERVICE:Ljava/lang/String; -Landroid/content/ContextWrapper;->createApplicationContext(Landroid/content/pm/ApplicationInfo;I)Landroid/content/Context; -Landroid/content/ContextWrapper;->getBasePackageName()Ljava/lang/String; -Landroid/content/ContextWrapper;->getDisplay()Landroid/view/Display; -Landroid/content/ContextWrapper;->getOpPackageName()Ljava/lang/String; -Landroid/content/ContextWrapper;->mBase:Landroid/content/Context; -Landroid/content/ContextWrapper;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent; -Landroid/content/ContextWrapper;->startActivityAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V -Landroid/content/ContextWrapper;->startForegroundServiceAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)Landroid/content/ComponentName; -Landroid/content/ContextWrapper;->startServiceAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)Landroid/content/ComponentName; -Landroid/content/CursorEntityIterator;-><init>(Landroid/database/Cursor;)V -Landroid/content/CursorLoader;->mCancellationSignal:Landroid/os/CancellationSignal; -Landroid/content/CursorLoader;->mObserver:Landroid/content/Loader$ForceLoadContentObserver; -Landroid/content/Entity;->mSubValues:Ljava/util/ArrayList; -Landroid/content/Entity;->mValues:Landroid/content/ContentValues; Landroid/content/IClipboard$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/IClipboard$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IClipboard; -Landroid/content/IContentProvider;->bulkInsert(Ljava/lang/String;Landroid/net/Uri;[Landroid/content/ContentValues;)I -Landroid/content/IContentProvider;->call(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/os/Bundle;)Landroid/os/Bundle; -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 Landroid/content/IContentService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IContentService; @@ -415,29 +309,6 @@ Landroid/content/IIntentReceiver$Stub;->asInterface(Landroid/os/IBinder;)Landroi Landroid/content/IIntentReceiver;->performReceive(Landroid/content/Intent;ILjava/lang/String;Landroid/os/Bundle;ZZI)V Landroid/content/IIntentSender$Stub;-><init>()V Landroid/content/IIntentSender$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IIntentSender; -Landroid/content/Intent;->ACTION_ALARM_CHANGED:Ljava/lang/String; -Landroid/content/Intent;->ACTION_USER_SWITCHED:Ljava/lang/String; -Landroid/content/Intent;->FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT:I -Landroid/content/Intent;->getExtra(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; -Landroid/content/Intent;->isExcludingStopped()Z -Landroid/content/Intent;->mExtras:Landroid/os/Bundle; -Landroid/content/Intent;->parseCommandArgs(Landroid/os/ShellCommand;Landroid/content/Intent$CommandOptionHandler;)Landroid/content/Intent; -Landroid/content/Intent;->prepareToLeaveProcess(Landroid/content/Context;)V -Landroid/content/Intent;->printIntentArgsHelp(Ljava/io/PrintWriter;Ljava/lang/String;)V -Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/IBinder;)Landroid/content/Intent; -Landroid/content/Intent;->setAllowFds(Z)V -Landroid/content/Intent;->toInsecureString()Ljava/lang/String; -Landroid/content/IntentFilter;->hasDataAuthority(Landroid/content/IntentFilter$AuthorityEntry;)Z -Landroid/content/IntentFilter;->hasDataPath(Landroid/os/PatternMatcher;)Z -Landroid/content/IntentFilter;->hasDataSchemeSpecificPart(Landroid/os/PatternMatcher;)Z -Landroid/content/IntentFilter;->hasExactDataType(Ljava/lang/String;)Z -Landroid/content/IntentFilter;->isVerified()Z -Landroid/content/IntentFilter;->mActions:Ljava/util/ArrayList; -Landroid/content/IntentFilter;->mOrder:I -Landroid/content/IntentFilter;->setAutoVerify(Z)V -Landroid/content/IntentSender;-><init>(Landroid/content/IIntentSender;)V -Landroid/content/IntentSender;->getTarget()Landroid/content/IIntentSender; -Landroid/content/IntentSender;->mTarget:Landroid/content/IIntentSender; Landroid/content/IOnPrimaryClipChangedListener$Stub;-><init>()V Landroid/content/IOnPrimaryClipChangedListener$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IOnPrimaryClipChangedListener; Landroid/content/IRestrictionsManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IRestrictionsManager; @@ -463,40 +334,6 @@ Landroid/content/ISyncStatusObserver;->onStatusChanged(I)V Landroid/content/om/IOverlayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/om/IOverlayManager; Landroid/content/om/IOverlayManager;->getAllOverlays(I)Ljava/util/Map; Landroid/content/om/IOverlayManager;->getOverlayInfo(Ljava/lang/String;I)Landroid/content/om/OverlayInfo; -Landroid/content/om/OverlayInfo;->isEnabled()Z -Landroid/content/om/OverlayInfo;->packageName:Ljava/lang/String; -Landroid/content/om/OverlayInfo;->state:I -Landroid/content/om/OverlayInfo;->targetPackageName:Ljava/lang/String; -Landroid/content/pm/ActivityInfo;->activityInfoConfigJavaToNative(I)I -Landroid/content/pm/ActivityInfo;->FLAG_ALLOW_EMBEDDED:I -Landroid/content/pm/ActivityInfo;->FLAG_SHOW_FOR_ALL_USERS:I -Landroid/content/pm/ActivityInfo;->isResizeableMode(I)Z -Landroid/content/pm/ActivityInfo;->resizeMode:I -Landroid/content/pm/ActivityInfo;->supportsPictureInPicture()Z -Landroid/content/pm/ApplicationInfo$DisplayNameComparator;->mPM:Landroid/content/pm/PackageManager; -Landroid/content/pm/ApplicationInfo$DisplayNameComparator;->sCollator:Ljava/text/Collator; -Landroid/content/pm/ApplicationInfo;->disableCompatibilityMode()V -Landroid/content/pm/ApplicationInfo;->enabledSetting:I -Landroid/content/pm/ApplicationInfo;->fullBackupContent:I -Landroid/content/pm/ApplicationInfo;->getBaseResourcePath()Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->getCodePath()Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->hasRtlSupport()Z -Landroid/content/pm/ApplicationInfo;->installLocation:I -Landroid/content/pm/ApplicationInfo;->isForwardLocked()Z -Landroid/content/pm/ApplicationInfo;->isPackageUnavailable(Landroid/content/pm/PackageManager;)Z -Landroid/content/pm/ApplicationInfo;->nativeLibraryRootDir:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->primaryCpuAbi:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->privateFlags:I -Landroid/content/pm/ApplicationInfo;->PRIVATE_FLAG_PRIVILEGED:I -Landroid/content/pm/ApplicationInfo;->resourceDirs:[Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->scanPublicSourceDir:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->scanSourceDir:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->secondaryCpuAbi:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->secondaryNativeLibraryDir:Ljava/lang/String; -Landroid/content/pm/ApplicationInfo;->versionCode:I -Landroid/content/pm/BaseParceledListSlice;->getList()Ljava/util/List; -Landroid/content/pm/BaseParceledListSlice;->writeParcelableCreator(Ljava/lang/Object;Landroid/os/Parcel;)V -Landroid/content/pm/ComponentInfo;->getComponentName()Landroid/content/ComponentName; Landroid/content/pm/IPackageDataObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/pm/IPackageDataObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder; Landroid/content/pm/IPackageDataObserver$Stub$Proxy;->onRemoveCompleted(Ljava/lang/String;Z)V @@ -610,422 +447,9 @@ Landroid/content/pm/IPackageStatsObserver$Stub;->DESCRIPTOR:Ljava/lang/String; Landroid/content/pm/IPackageStatsObserver$Stub;->TRANSACTION_onGetStatsCompleted:I Landroid/content/pm/IShortcutService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Landroid/content/pm/IShortcutService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IShortcutService; -Landroid/content/pm/LauncherActivityInfo;->mActivityInfo:Landroid/content/pm/ActivityInfo; -Landroid/content/pm/LauncherApps;->mPm:Landroid/content/pm/PackageManager; -Landroid/content/pm/LauncherApps;->mService:Landroid/content/pm/ILauncherApps; -Landroid/content/pm/LauncherApps;->startShortcut(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Rect;Landroid/os/Bundle;I)V -Landroid/content/pm/PackageInfo;-><init>(Landroid/os/Parcel;)V -Landroid/content/pm/PackageInfo;->coreApp:Z -Landroid/content/pm/PackageInfo;->INSTALL_LOCATION_UNSPECIFIED:I -Landroid/content/pm/PackageInfo;->overlayTarget:Ljava/lang/String; -Landroid/content/pm/PackageInfoLite;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/content/pm/PackageInstaller$Session;->addProgress(F)V -Landroid/content/pm/PackageInstaller$SessionInfo;-><init>()V -Landroid/content/pm/PackageInstaller$SessionInfo;->active:Z -Landroid/content/pm/PackageInstaller$SessionInfo;->appIcon:Landroid/graphics/Bitmap; -Landroid/content/pm/PackageInstaller$SessionInfo;->appLabel:Ljava/lang/CharSequence; -Landroid/content/pm/PackageInstaller$SessionInfo;->appPackageName:Ljava/lang/String; -Landroid/content/pm/PackageInstaller$SessionInfo;->installerPackageName:Ljava/lang/String; -Landroid/content/pm/PackageInstaller$SessionInfo;->mode:I -Landroid/content/pm/PackageInstaller$SessionInfo;->progress:F -Landroid/content/pm/PackageInstaller$SessionInfo;->resolvedBaseCodePath:Ljava/lang/String; -Landroid/content/pm/PackageInstaller$SessionInfo;->sealed:Z -Landroid/content/pm/PackageInstaller$SessionInfo;->sessionId:I -Landroid/content/pm/PackageInstaller$SessionInfo;->sizeBytes:J -Landroid/content/pm/PackageInstaller$SessionParams;->appIcon:Landroid/graphics/Bitmap; -Landroid/content/pm/PackageInstaller$SessionParams;->appLabel:Ljava/lang/String; -Landroid/content/pm/PackageInstaller$SessionParams;->appPackageName:Ljava/lang/String; -Landroid/content/pm/PackageInstaller$SessionParams;->installFlags:I -Landroid/content/pm/PackageInstaller$SessionParams;->mode:I -Landroid/content/pm/PackageInstaller$SessionParams;->originatingUid:I -Landroid/content/pm/PackageInstaller$SessionParams;->sizeBytes:J -Landroid/content/pm/PackageItemInfo;->setForceSafeLabels(Z)V -Landroid/content/pm/PackageManager;->addCrossProfileIntentFilter(Landroid/content/IntentFilter;III)V -Landroid/content/pm/PackageManager;->addPreferredActivityAsUser(Landroid/content/IntentFilter;I[Landroid/content/ComponentName;Landroid/content/ComponentName;I)V -Landroid/content/pm/PackageManager;->buildRequestPermissionsIntent([Ljava/lang/String;)Landroid/content/Intent; -Landroid/content/pm/PackageManager;->clearApplicationUserData(Ljava/lang/String;Landroid/content/pm/IPackageDataObserver;)V -Landroid/content/pm/PackageManager;->clearCrossProfileIntentFilters(I)V -Landroid/content/pm/PackageManager;->deleteApplicationCacheFiles(Ljava/lang/String;Landroid/content/pm/IPackageDataObserver;)V -Landroid/content/pm/PackageManager;->deleteApplicationCacheFilesAsUser(Ljava/lang/String;ILandroid/content/pm/IPackageDataObserver;)V -Landroid/content/pm/PackageManager;->deletePackage(Ljava/lang/String;Landroid/content/pm/IPackageDeleteObserver;I)V -Landroid/content/pm/PackageManager;->deletePackageAsUser(Ljava/lang/String;Landroid/content/pm/IPackageDeleteObserver;II)V -Landroid/content/pm/PackageManager;->deleteStatusToString(I)Ljava/lang/String; -Landroid/content/pm/PackageManager;->flushPackageRestrictionsAsUser(I)V -Landroid/content/pm/PackageManager;->freeStorage(JLandroid/content/IntentSender;)V -Landroid/content/pm/PackageManager;->freeStorage(Ljava/lang/String;JLandroid/content/IntentSender;)V -Landroid/content/pm/PackageManager;->freeStorageAndNotify(JLandroid/content/pm/IPackageDataObserver;)V -Landroid/content/pm/PackageManager;->freeStorageAndNotify(Ljava/lang/String;JLandroid/content/pm/IPackageDataObserver;)V -Landroid/content/pm/PackageManager;->getApplicationHiddenSettingAsUser(Ljava/lang/String;Landroid/os/UserHandle;)Z -Landroid/content/pm/PackageManager;->getApplicationInfoAsUser(Ljava/lang/String;II)Landroid/content/pm/ApplicationInfo; -Landroid/content/pm/PackageManager;->getHomeActivities(Ljava/util/List;)Landroid/content/ComponentName; -Landroid/content/pm/PackageManager;->getKeySetByAlias(Ljava/lang/String;Ljava/lang/String;)Landroid/content/pm/KeySet; -Landroid/content/pm/PackageManager;->getMoveStatus(I)I -Landroid/content/pm/PackageManager;->getPackageCandidateVolumes(Landroid/content/pm/ApplicationInfo;)Ljava/util/List; -Landroid/content/pm/PackageManager;->getPackageCurrentVolume(Landroid/content/pm/ApplicationInfo;)Landroid/os/storage/VolumeInfo; -Landroid/content/pm/PackageManager;->getPackageInfoAsUser(Ljava/lang/String;II)Landroid/content/pm/PackageInfo; -Landroid/content/pm/PackageManager;->getPackageSizeInfo(Ljava/lang/String;Landroid/content/pm/IPackageStatsObserver;)V -Landroid/content/pm/PackageManager;->getPackageSizeInfoAsUser(Ljava/lang/String;ILandroid/content/pm/IPackageStatsObserver;)V -Landroid/content/pm/PackageManager;->getPackageUidAsUser(Ljava/lang/String;I)I -Landroid/content/pm/PackageManager;->getPackageUidAsUser(Ljava/lang/String;II)I -Landroid/content/pm/PackageManager;->getResourcesForApplicationAsUser(Ljava/lang/String;I)Landroid/content/res/Resources; -Landroid/content/pm/PackageManager;->getSigningKeySet(Ljava/lang/String;)Landroid/content/pm/KeySet; -Landroid/content/pm/PackageManager;->getUidForSharedUser(Ljava/lang/String;)I -Landroid/content/pm/PackageManager;->getUserBadgeForDensity(Landroid/os/UserHandle;I)Landroid/graphics/drawable/Drawable; -Landroid/content/pm/PackageManager;->getUserBadgeForDensityNoBackground(Landroid/os/UserHandle;I)Landroid/graphics/drawable/Drawable; -Landroid/content/pm/PackageManager;->installExistingPackageAsUser(Ljava/lang/String;I)I -Landroid/content/pm/PackageManager;->installStatusToString(I)Ljava/lang/String; -Landroid/content/pm/PackageManager;->installStatusToString(ILjava/lang/String;)Ljava/lang/String; -Landroid/content/pm/PackageManager;->INSTALL_REPLACE_EXISTING:I -Landroid/content/pm/PackageManager;->isPackageAvailable(Ljava/lang/String;)Z -Landroid/content/pm/PackageManager;->isPackageSuspendedForUser(Ljava/lang/String;I)Z -Landroid/content/pm/PackageManager;->isSignedBy(Ljava/lang/String;Landroid/content/pm/KeySet;)Z -Landroid/content/pm/PackageManager;->isSignedByExactly(Ljava/lang/String;Landroid/content/pm/KeySet;)Z -Landroid/content/pm/PackageManager;->isUpgrade()Z -Landroid/content/pm/PackageManager;->loadItemIcon(Landroid/content/pm/PackageItemInfo;Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable; -Landroid/content/pm/PackageManager;->loadUnbadgedItemIcon(Landroid/content/pm/PackageItemInfo;Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable; -Landroid/content/pm/PackageManager;->movePackage(Ljava/lang/String;Landroid/os/storage/VolumeInfo;)I -Landroid/content/pm/PackageManager;->MOVE_EXTERNAL_MEDIA:I -Landroid/content/pm/PackageManager;->MOVE_INTERNAL:I -Landroid/content/pm/PackageManager;->NO_NATIVE_LIBRARIES:I -Landroid/content/pm/PackageManager;->queryBroadcastReceivers(Landroid/content/Intent;II)Ljava/util/List; -Landroid/content/pm/PackageManager;->queryBroadcastReceiversAsUser(Landroid/content/Intent;II)Ljava/util/List; -Landroid/content/pm/PackageManager;->queryIntentActivitiesAsUser(Landroid/content/Intent;II)Ljava/util/List; -Landroid/content/pm/PackageManager;->queryIntentContentProvidersAsUser(Landroid/content/Intent;II)Ljava/util/List; -Landroid/content/pm/PackageManager;->queryIntentServicesAsUser(Landroid/content/Intent;II)Ljava/util/List; -Landroid/content/pm/PackageManager;->registerMoveCallback(Landroid/content/pm/PackageManager$MoveCallback;Landroid/os/Handler;)V -Landroid/content/pm/PackageManager;->replacePreferredActivity(Landroid/content/IntentFilter;I[Landroid/content/ComponentName;Landroid/content/ComponentName;)V -Landroid/content/pm/PackageManager;->replacePreferredActivityAsUser(Landroid/content/IntentFilter;I[Landroid/content/ComponentName;Landroid/content/ComponentName;I)V -Landroid/content/pm/PackageManager;->resolveActivityAsUser(Landroid/content/Intent;II)Landroid/content/pm/ResolveInfo; -Landroid/content/pm/PackageManager;->resolveContentProviderAsUser(Ljava/lang/String;II)Landroid/content/pm/ProviderInfo; -Landroid/content/pm/PackageManager;->setApplicationHiddenSettingAsUser(Ljava/lang/String;ZLandroid/os/UserHandle;)Z -Landroid/content/pm/PackageManager;->shouldShowRequestPermissionRationale(Ljava/lang/String;)Z -Landroid/content/pm/PackageManager;->unregisterMoveCallback(Landroid/content/pm/PackageManager$MoveCallback;)V -Landroid/content/pm/PackageParser$Activity;->info:Landroid/content/pm/ActivityInfo; -Landroid/content/pm/PackageParser$ActivityIntentInfo;->activity:Landroid/content/pm/PackageParser$Activity; -Landroid/content/pm/PackageParser$Component;->className:Ljava/lang/String; -Landroid/content/pm/PackageParser$Component;->getComponentName()Landroid/content/ComponentName; -Landroid/content/pm/PackageParser$Component;->intents:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Component;->metaData:Landroid/os/Bundle; -Landroid/content/pm/PackageParser$Component;->owner:Landroid/content/pm/PackageParser$Package; -Landroid/content/pm/PackageParser$Instrumentation;->info:Landroid/content/pm/InstrumentationInfo; -Landroid/content/pm/PackageParser$IntentInfo;-><init>()V -Landroid/content/pm/PackageParser$IntentInfo;->banner:I -Landroid/content/pm/PackageParser$IntentInfo;->hasDefault:Z -Landroid/content/pm/PackageParser$IntentInfo;->icon:I -Landroid/content/pm/PackageParser$IntentInfo;->labelRes:I -Landroid/content/pm/PackageParser$IntentInfo;->logo:I -Landroid/content/pm/PackageParser$IntentInfo;->nonLocalizedLabel:Ljava/lang/CharSequence; -Landroid/content/pm/PackageParser$NewPermissionInfo;->name:Ljava/lang/String; -Landroid/content/pm/PackageParser$NewPermissionInfo;->sdkVersion:I -Landroid/content/pm/PackageParser$Package;-><init>(Ljava/lang/String;)V -Landroid/content/pm/PackageParser$Package;->activities:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo; -Landroid/content/pm/PackageParser$Package;->configPreferences:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->installLocation:I -Landroid/content/pm/PackageParser$Package;->instrumentation:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->mAppMetaData:Landroid/os/Bundle; -Landroid/content/pm/PackageParser$Package;->mExtras:Ljava/lang/Object; -Landroid/content/pm/PackageParser$Package;->mKeySetMapping:Landroid/util/ArrayMap; -Landroid/content/pm/PackageParser$Package;->mPreferredOrder:I -Landroid/content/pm/PackageParser$Package;->mSharedUserId:Ljava/lang/String; -Landroid/content/pm/PackageParser$Package;->mSharedUserLabel:I -Landroid/content/pm/PackageParser$Package;->mSigningDetails:Landroid/content/pm/PackageParser$SigningDetails; -Landroid/content/pm/PackageParser$Package;->mUpgradeKeySets:Landroid/util/ArraySet; -Landroid/content/pm/PackageParser$Package;->mVersionCode:I -Landroid/content/pm/PackageParser$Package;->mVersionName:Ljava/lang/String; -Landroid/content/pm/PackageParser$Package;->packageName:Ljava/lang/String; -Landroid/content/pm/PackageParser$Package;->permissionGroups:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->permissions:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->protectedBroadcasts:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->providers:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->receivers:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->reqFeatures:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->requestedPermissions:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->services:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->setPackageName(Ljava/lang/String;)V -Landroid/content/pm/PackageParser$Package;->usesLibraries:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$Package;->usesLibraryFiles:[Ljava/lang/String; -Landroid/content/pm/PackageParser$Package;->usesOptionalLibraries:Ljava/util/ArrayList; -Landroid/content/pm/PackageParser$PackageLite;->installLocation:I -Landroid/content/pm/PackageParser$PackageLite;->packageName:Ljava/lang/String; -Landroid/content/pm/PackageParser$Permission;-><init>(Landroid/content/pm/PackageParser$Package;Landroid/content/pm/PermissionInfo;)V -Landroid/content/pm/PackageParser$Permission;->group:Landroid/content/pm/PackageParser$PermissionGroup; -Landroid/content/pm/PackageParser$Permission;->info:Landroid/content/pm/PermissionInfo; -Landroid/content/pm/PackageParser$Permission;->tree:Z -Landroid/content/pm/PackageParser$PermissionGroup;->info:Landroid/content/pm/PermissionGroupInfo; -Landroid/content/pm/PackageParser$Provider;-><init>(Landroid/content/pm/PackageParser$Provider;)V -Landroid/content/pm/PackageParser$Provider;->info:Landroid/content/pm/ProviderInfo; -Landroid/content/pm/PackageParser$Provider;->syncable:Z -Landroid/content/pm/PackageParser$ProviderIntentInfo;->provider:Landroid/content/pm/PackageParser$Provider; -Landroid/content/pm/PackageParser$Service;->info:Landroid/content/pm/ServiceInfo; -Landroid/content/pm/PackageParser$ServiceIntentInfo;->service:Landroid/content/pm/PackageParser$Service; -Landroid/content/pm/PackageParser$SigningDetails$Builder;-><init>()V -Landroid/content/pm/PackageParser$SigningDetails$Builder;->build()Landroid/content/pm/PackageParser$SigningDetails; -Landroid/content/pm/PackageParser$SigningDetails$Builder;->setPastSigningCertificates([Landroid/content/pm/Signature;)Landroid/content/pm/PackageParser$SigningDetails$Builder; -Landroid/content/pm/PackageParser$SigningDetails$Builder;->setPastSigningCertificatesFlags([I)Landroid/content/pm/PackageParser$SigningDetails$Builder; -Landroid/content/pm/PackageParser$SigningDetails$Builder;->setSignatures([Landroid/content/pm/Signature;)Landroid/content/pm/PackageParser$SigningDetails$Builder; -Landroid/content/pm/PackageParser$SigningDetails$Builder;->setSignatureSchemeVersion(I)Landroid/content/pm/PackageParser$SigningDetails$Builder; -Landroid/content/pm/PackageParser$SigningDetails;->signatures:[Landroid/content/pm/Signature; -Landroid/content/pm/PackageParser;-><init>()V -Landroid/content/pm/PackageParser;->collectCertificates(Landroid/content/pm/PackageParser$Package;Ljava/io/File;Z)V -Landroid/content/pm/PackageParser;->collectCertificates(Landroid/content/pm/PackageParser$Package;Z)V -Landroid/content/pm/PackageParser;->generateActivityInfo(Landroid/content/pm/PackageParser$Activity;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ActivityInfo; -Landroid/content/pm/PackageParser;->generateApplicationInfo(Landroid/content/pm/PackageParser$Package;ILandroid/content/pm/PackageUserState;)Landroid/content/pm/ApplicationInfo; -Landroid/content/pm/PackageParser;->generateApplicationInfo(Landroid/content/pm/PackageParser$Package;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ApplicationInfo; -Landroid/content/pm/PackageParser;->generateInstrumentationInfo(Landroid/content/pm/PackageParser$Instrumentation;I)Landroid/content/pm/InstrumentationInfo; -Landroid/content/pm/PackageParser;->generatePackageInfo(Landroid/content/pm/PackageParser$Package;[IIJJLjava/util/Set;Landroid/content/pm/PackageUserState;)Landroid/content/pm/PackageInfo; -Landroid/content/pm/PackageParser;->generatePackageInfo(Landroid/content/pm/PackageParser$Package;[IIJJLjava/util/Set;Landroid/content/pm/PackageUserState;I)Landroid/content/pm/PackageInfo; -Landroid/content/pm/PackageParser;->generatePermissionGroupInfo(Landroid/content/pm/PackageParser$PermissionGroup;I)Landroid/content/pm/PermissionGroupInfo; -Landroid/content/pm/PackageParser;->generatePermissionInfo(Landroid/content/pm/PackageParser$Permission;I)Landroid/content/pm/PermissionInfo; -Landroid/content/pm/PackageParser;->generateProviderInfo(Landroid/content/pm/PackageParser$Provider;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ProviderInfo; -Landroid/content/pm/PackageParser;->generateServiceInfo(Landroid/content/pm/PackageParser$Service;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ServiceInfo; -Landroid/content/pm/PackageParser;->mCallback:Landroid/content/pm/PackageParser$Callback; -Landroid/content/pm/PackageParser;->NEW_PERMISSIONS:[Landroid/content/pm/PackageParser$NewPermissionInfo; -Landroid/content/pm/PackageParser;->parseBaseApk(Ljava/lang/String;Landroid/content/res/Resources;Landroid/content/res/XmlResourceParser;I[Ljava/lang/String;)Landroid/content/pm/PackageParser$Package; -Landroid/content/pm/PackageParser;->parseBaseApplication(Landroid/content/pm/PackageParser$Package;Landroid/content/res/Resources;Landroid/content/res/XmlResourceParser;I[Ljava/lang/String;)Z -Landroid/content/pm/PackageParser;->parseMonolithicPackage(Ljava/io/File;I)Landroid/content/pm/PackageParser$Package; -Landroid/content/pm/PackageParser;->parsePackage(Ljava/io/File;I)Landroid/content/pm/PackageParser$Package; -Landroid/content/pm/PackageParser;->parsePackage(Ljava/io/File;IZ)Landroid/content/pm/PackageParser$Package; -Landroid/content/pm/PackageParser;->parsePackageLite(Ljava/io/File;I)Landroid/content/pm/PackageParser$PackageLite; -Landroid/content/pm/PackageParser;->setCompatibilityModeEnabled(Z)V -Landroid/content/pm/PackageParser;->setSeparateProcesses([Ljava/lang/String;)V -Landroid/content/pm/PackageStats;->userHandle:I -Landroid/content/pm/PackageUserState;-><init>()V -Landroid/content/pm/ParceledListSlice;-><init>(Ljava/util/List;)V -Landroid/content/pm/ParceledListSlice;->CREATOR:Landroid/os/Parcelable$ClassLoaderCreator; -Landroid/content/pm/ParceledListSlice;->writeParcelableCreator(Landroid/os/Parcelable;Landroid/os/Parcel;)V -Landroid/content/pm/PermissionInfo;->protectionToString(I)Ljava/lang/String; -Landroid/content/pm/RegisteredServicesCache$ServiceInfo;->componentName:Landroid/content/ComponentName; -Landroid/content/pm/RegisteredServicesCache$ServiceInfo;->type:Ljava/lang/Object; -Landroid/content/pm/RegisteredServicesCache$ServiceInfo;->uid:I -Landroid/content/pm/RegisteredServicesCache;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/content/pm/XmlSerializerAndParser;)V -Landroid/content/pm/ResolveInfo;->getComponentInfo()Landroid/content/pm/ComponentInfo; -Landroid/content/pm/ResolveInfo;->handleAllWebDataURI:Z -Landroid/content/pm/ResolveInfo;->system:Z -Landroid/content/pm/ResolveInfo;->targetUserId:I -Landroid/content/pm/ShortcutInfo;->getIcon()Landroid/graphics/drawable/Icon; -Landroid/content/pm/ShortcutManager;->mService:Landroid/content/pm/IShortcutService; -Landroid/content/pm/Signature;->getPublicKey()Ljava/security/PublicKey; -Landroid/content/pm/UserInfo;-><init>(ILjava/lang/String;I)V -Landroid/content/pm/UserInfo;-><init>(ILjava/lang/String;Ljava/lang/String;I)V -Landroid/content/pm/UserInfo;->creationTime:J -Landroid/content/pm/UserInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/content/pm/UserInfo;->flags:I -Landroid/content/pm/UserInfo;->FLAG_PRIMARY:I -Landroid/content/pm/UserInfo;->getUserHandle()Landroid/os/UserHandle; -Landroid/content/pm/UserInfo;->guestToRemove:Z -Landroid/content/pm/UserInfo;->iconPath:Ljava/lang/String; -Landroid/content/pm/UserInfo;->id:I -Landroid/content/pm/UserInfo;->isAdmin()Z -Landroid/content/pm/UserInfo;->isEnabled()Z -Landroid/content/pm/UserInfo;->isGuest()Z -Landroid/content/pm/UserInfo;->isManagedProfile()Z -Landroid/content/pm/UserInfo;->isPrimary()Z -Landroid/content/pm/UserInfo;->isRestricted()Z -Landroid/content/pm/UserInfo;->lastLoggedInTime:J -Landroid/content/pm/UserInfo;->name:Ljava/lang/String; -Landroid/content/pm/UserInfo;->partial:Z -Landroid/content/pm/UserInfo;->profileGroupId:I -Landroid/content/pm/UserInfo;->serialNumber:I -Landroid/content/pm/VerifierInfo;-><init>(Ljava/lang/String;Ljava/security/PublicKey;)V -Landroid/content/pm/XmlSerializerAndParser;->createFromXml(Lorg/xmlpull/v1/XmlPullParser;)Ljava/lang/Object; -Landroid/content/pm/XmlSerializerAndParser;->writeAsXml(Ljava/lang/Object;Lorg/xmlpull/v1/XmlSerializer;)V -Landroid/content/res/AssetFileDescriptor;->mFd:Landroid/os/ParcelFileDescriptor; -Landroid/content/res/AssetFileDescriptor;->mLength:J -Landroid/content/res/AssetFileDescriptor;->mStartOffset:J -Landroid/content/res/AssetManager$AssetInputStream;->getAssetInt()I -Landroid/content/res/AssetManager$AssetInputStream;->getNativeAsset()J -Landroid/content/res/AssetManager;-><init>()V -Landroid/content/res/AssetManager;->addAssetPath(Ljava/lang/String;)I -Landroid/content/res/AssetManager;->addAssetPathAsSharedLibrary(Ljava/lang/String;)I -Landroid/content/res/AssetManager;->addOverlayPath(Ljava/lang/String;)I -Landroid/content/res/AssetManager;->applyStyle(JIILandroid/content/res/XmlBlock$Parser;[IJJ)V -Landroid/content/res/AssetManager;->createTheme()J -Landroid/content/res/AssetManager;->getAssignedPackageIdentifiers()Landroid/util/SparseArray; -Landroid/content/res/AssetManager;->getGlobalAssetCount()I -Landroid/content/res/AssetManager;->getGlobalAssetManagerCount()I -Landroid/content/res/AssetManager;->getResourceBagText(II)Ljava/lang/CharSequence; -Landroid/content/res/AssetManager;->getResourceEntryName(I)Ljava/lang/String; -Landroid/content/res/AssetManager;->getResourceIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I -Landroid/content/res/AssetManager;->getResourceName(I)Ljava/lang/String; -Landroid/content/res/AssetManager;->getResourcePackageName(I)Ljava/lang/String; -Landroid/content/res/AssetManager;->getResourceText(I)Ljava/lang/CharSequence; -Landroid/content/res/AssetManager;->getResourceTypeName(I)Ljava/lang/String; -Landroid/content/res/AssetManager;->getResourceValue(IILandroid/util/TypedValue;Z)Z -Landroid/content/res/AssetManager;->getSystem()Landroid/content/res/AssetManager; -Landroid/content/res/AssetManager;->isUpToDate()Z -Landroid/content/res/AssetManager;->mObject:J -Landroid/content/res/AssetManager;->openNonAsset(ILjava/lang/String;)Ljava/io/InputStream; -Landroid/content/res/AssetManager;->openNonAsset(ILjava/lang/String;I)Ljava/io/InputStream; -Landroid/content/res/AssetManager;->openNonAsset(Ljava/lang/String;)Ljava/io/InputStream; -Landroid/content/res/AssetManager;->openNonAsset(Ljava/lang/String;I)Ljava/io/InputStream; -Landroid/content/res/AssetManager;->resolveAttrs(JII[I[I[I[I)Z -Landroid/content/res/AssetManager;->retrieveAttributes(Landroid/content/res/XmlBlock$Parser;[I[I[I)Z -Landroid/content/res/AssetManager;->setConfiguration(IILjava/lang/String;IIIIIIIIIIIIIII)V -Landroid/content/res/AssetManager;->sSystem:Landroid/content/res/AssetManager; -Landroid/content/res/ColorStateList$ColorStateListFactory;-><init>(Landroid/content/res/ColorStateList;)V -Landroid/content/res/ColorStateList;-><init>()V -Landroid/content/res/ColorStateList;->canApplyTheme()Z -Landroid/content/res/ColorStateList;->getColors()[I -Landroid/content/res/ColorStateList;->getStates()[[I -Landroid/content/res/ColorStateList;->mColors:[I -Landroid/content/res/ColorStateList;->mDefaultColor:I -Landroid/content/res/ColorStateList;->mFactory:Landroid/content/res/ColorStateList$ColorStateListFactory; -Landroid/content/res/ColorStateList;->mStateSpecs:[[I -Landroid/content/res/ColorStateList;->obtainForTheme(Landroid/content/res/Resources$Theme;)Landroid/content/res/ColorStateList; -Landroid/content/res/ColorStateList;->onColorsChanged()V -Landroid/content/res/CompatibilityInfo$Translator;->applicationInvertedScale:F -Landroid/content/res/CompatibilityInfo$Translator;->applicationScale:F -Landroid/content/res/CompatibilityInfo$Translator;->getTranslatedContentInsets(Landroid/graphics/Rect;)Landroid/graphics/Rect; -Landroid/content/res/CompatibilityInfo$Translator;->translateCanvas(Landroid/graphics/Canvas;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateEventInScreenToAppWindow(Landroid/view/MotionEvent;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateRectInAppWindowToScreen(Landroid/graphics/Rect;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateRectInScreenToAppWindow(Landroid/graphics/Rect;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateRectInScreenToAppWinFrame(Landroid/graphics/Rect;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateRegionInWindowToScreen(Landroid/graphics/Region;)V -Landroid/content/res/CompatibilityInfo$Translator;->translateWindowLayout(Landroid/view/WindowManager$LayoutParams;)V -Landroid/content/res/CompatibilityInfo;-><init>()V -Landroid/content/res/CompatibilityInfo;-><init>(Landroid/content/pm/ApplicationInfo;IIZ)V -Landroid/content/res/CompatibilityInfo;->applicationScale:F -Landroid/content/res/CompatibilityInfo;->computeCompatibleScaling(Landroid/util/DisplayMetrics;Landroid/util/DisplayMetrics;)F -Landroid/content/res/CompatibilityInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/content/res/CompatibilityInfo;->DEFAULT_COMPATIBILITY_INFO:Landroid/content/res/CompatibilityInfo; -Landroid/content/res/CompatibilityInfo;->getTranslator()Landroid/content/res/CompatibilityInfo$Translator; -Landroid/content/res/CompatibilityInfo;->isScalingRequired()Z -Landroid/content/res/CompatibilityInfo;->supportsScreen()Z -Landroid/content/res/Configuration;->generateDelta(Landroid/content/res/Configuration;Landroid/content/res/Configuration;)Landroid/content/res/Configuration; -Landroid/content/res/Configuration;->makeDefault()V -Landroid/content/res/Configuration;->resourceQualifierString(Landroid/content/res/Configuration;)Ljava/lang/String; -Landroid/content/res/Configuration;->seq:I -Landroid/content/res/Configuration;->userSetLocale:Z Landroid/content/res/ConfigurationBoundResourceCache;-><init>()V Landroid/content/res/DrawableCache;-><init>()V -Landroid/content/res/DrawableCache;->getInstance(JLandroid/content/res/Resources;Landroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; -Landroid/content/res/ObbInfo;->salt:[B -Landroid/content/res/Resources$Theme;->mThemeImpl:Landroid/content/res/ResourcesImpl$ThemeImpl; -Landroid/content/res/Resources$Theme;->resolveAttributes([I[I)Landroid/content/res/TypedArray; -Landroid/content/res/Resources;-><init>()V -Landroid/content/res/Resources;-><init>(Ljava/lang/ClassLoader;)V -Landroid/content/res/Resources;->getCompatibilityInfo()Landroid/content/res/CompatibilityInfo; -Landroid/content/res/Resources;->getDisplayAdjustments()Landroid/view/DisplayAdjustments; -Landroid/content/res/Resources;->getDrawableInflater()Landroid/graphics/drawable/DrawableInflater; -Landroid/content/res/Resources;->getFloat(I)F -Landroid/content/res/Resources;->getImpl()Landroid/content/res/ResourcesImpl; -Landroid/content/res/Resources;->getPreloadedDrawables()Landroid/util/LongSparseArray; -Landroid/content/res/Resources;->loadDrawable(Landroid/util/TypedValue;IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; -Landroid/content/res/Resources;->loadXmlResourceParser(ILjava/lang/String;)Landroid/content/res/XmlResourceParser; -Landroid/content/res/Resources;->loadXmlResourceParser(Ljava/lang/String;IILjava/lang/String;)Landroid/content/res/XmlResourceParser; -Landroid/content/res/Resources;->mClassLoader:Ljava/lang/ClassLoader; -Landroid/content/res/Resources;->mDrawableInflater:Landroid/graphics/drawable/DrawableInflater; -Landroid/content/res/Resources;->mResourcesImpl:Landroid/content/res/ResourcesImpl; -Landroid/content/res/Resources;->mSystem:Landroid/content/res/Resources; -Landroid/content/res/Resources;->mTmpValue:Landroid/util/TypedValue; -Landroid/content/res/Resources;->mTypedArrayPool:Landroid/util/Pools$SynchronizedPool; -Landroid/content/res/Resources;->selectDefaultTheme(II)I -Landroid/content/res/Resources;->setCompatibilityInfo(Landroid/content/res/CompatibilityInfo;)V -Landroid/content/res/Resources;->setImpl(Landroid/content/res/ResourcesImpl;)V -Landroid/content/res/Resources;->updateSystemConfiguration(Landroid/content/res/Configuration;Landroid/util/DisplayMetrics;Landroid/content/res/CompatibilityInfo;)V -Landroid/content/res/ResourcesImpl;-><init>(Landroid/content/res/AssetManager;Landroid/util/DisplayMetrics;Landroid/content/res/Configuration;Landroid/view/DisplayAdjustments;)V -Landroid/content/res/ResourcesImpl;->getAssets()Landroid/content/res/AssetManager; -Landroid/content/res/ResourcesImpl;->getDisplayMetrics()Landroid/util/DisplayMetrics; -Landroid/content/res/ResourcesImpl;->getValue(ILandroid/util/TypedValue;Z)V -Landroid/content/res/ResourcesImpl;->mAccessLock:Ljava/lang/Object; -Landroid/content/res/ResourcesImpl;->mAnimatorCache:Landroid/content/res/ConfigurationBoundResourceCache; -Landroid/content/res/ResourcesImpl;->mAssets:Landroid/content/res/AssetManager; -Landroid/content/res/ResourcesImpl;->mColorDrawableCache:Landroid/content/res/DrawableCache; -Landroid/content/res/ResourcesImpl;->mConfiguration:Landroid/content/res/Configuration; -Landroid/content/res/ResourcesImpl;->mDrawableCache:Landroid/content/res/DrawableCache; -Landroid/content/res/ResourcesImpl;->mPreloading:Z -Landroid/content/res/ResourcesImpl;->mStateListAnimatorCache:Landroid/content/res/ConfigurationBoundResourceCache; -Landroid/content/res/ResourcesImpl;->sPreloadedColorDrawables:Landroid/util/LongSparseArray; -Landroid/content/res/ResourcesImpl;->sPreloadedComplexColors:Landroid/util/LongSparseArray; -Landroid/content/res/ResourcesImpl;->sPreloadedDrawables:[Landroid/util/LongSparseArray; -Landroid/content/res/ResourcesImpl;->TRACE_FOR_MISS_PRELOAD:Z -Landroid/content/res/ResourcesImpl;->TRACE_FOR_PRELOAD:Z -Landroid/content/res/ResourcesKey;-><init>(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;ILandroid/content/res/Configuration;Landroid/content/res/CompatibilityInfo;)V -Landroid/content/res/ResourcesKey;->mResDir:Ljava/lang/String; -Landroid/content/res/ResourcesKey;->mSplitResDirs:[Ljava/lang/String; -Landroid/content/res/StringBlock;-><init>(JZ)V -Landroid/content/res/StringBlock;->get(I)Ljava/lang/CharSequence; -Landroid/content/res/ThemedResourceCache;->mThemedEntries:Landroid/util/ArrayMap; -Landroid/content/res/ThemedResourceCache;->onConfigurationChange(I)V -Landroid/content/res/TypedArray;->extractThemeAttrs()[I -Landroid/content/res/TypedArray;->extractThemeAttrs([I)[I -Landroid/content/res/TypedArray;->getNonConfigurationString(II)Ljava/lang/String; -Landroid/content/res/TypedArray;->getValueAt(ILandroid/util/TypedValue;)Z -Landroid/content/res/TypedArray;->mAssets:Landroid/content/res/AssetManager; -Landroid/content/res/TypedArray;->mData:[I -Landroid/content/res/TypedArray;->mIndices:[I -Landroid/content/res/TypedArray;->mLength:I -Landroid/content/res/TypedArray;->mMetrics:Landroid/util/DisplayMetrics; -Landroid/content/res/TypedArray;->mRecycled:Z -Landroid/content/res/TypedArray;->mResources:Landroid/content/res/Resources; -Landroid/content/res/TypedArray;->mTheme:Landroid/content/res/Resources$Theme; -Landroid/content/res/TypedArray;->mValue:Landroid/util/TypedValue; -Landroid/content/res/TypedArray;->mXml:Landroid/content/res/XmlBlock$Parser; -Landroid/content/res/XmlBlock$Parser;->mBlock:Landroid/content/res/XmlBlock; -Landroid/content/res/XmlBlock$Parser;->mParseState:J -Landroid/content/res/XmlBlock;-><init>([B)V -Landroid/content/res/XmlBlock;->newParser()Landroid/content/res/XmlResourceParser; -Landroid/content/RestrictionsManager;->mService:Landroid/content/IRestrictionsManager; -Landroid/content/SearchRecentSuggestionsProvider;->mSuggestionProjection:[Ljava/lang/String; -Landroid/content/SyncAdaptersCache;-><init>(Landroid/content/Context;)V -Landroid/content/SyncAdapterType;-><init>(Ljava/lang/String;Ljava/lang/String;)V -Landroid/content/SyncAdapterType;->allowParallelSyncs:Z -Landroid/content/SyncAdapterType;->isAlwaysSyncable:Z -Landroid/content/SyncAdapterType;->settingsActivity:Ljava/lang/String; -Landroid/content/SyncAdapterType;->supportsUploading:Z -Landroid/content/SyncAdapterType;->userVisible:Z -Landroid/content/SyncContext;-><init>(Landroid/content/ISyncContext;)V -Landroid/content/SyncContext;->setStatusText(Ljava/lang/String;)V -Landroid/content/SyncInfo;-><init>(ILandroid/accounts/Account;Ljava/lang/String;J)V -Landroid/content/SyncInfo;-><init>(Landroid/os/Parcel;)V -Landroid/content/SyncInfo;->authorityId:I -Landroid/content/SyncInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/content/SyncRequest;->mAccountToSync:Landroid/accounts/Account; -Landroid/content/SyncRequest;->mAuthority:Ljava/lang/String; -Landroid/content/SyncRequest;->mExtras:Landroid/os/Bundle; -Landroid/content/SyncRequest;->mIsPeriodic:Z -Landroid/content/SyncRequest;->mSyncRunTimeSecs:J -Landroid/content/SyncStatusInfo;-><init>(I)V -Landroid/content/SyncStatusInfo;-><init>(Landroid/os/Parcel;)V -Landroid/content/SyncStatusInfo;->authorityId:I -Landroid/content/SyncStatusInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/content/SyncStatusInfo;->ensurePeriodicSyncTimeSize(I)V -Landroid/content/SyncStatusInfo;->getLastFailureMesgAsInt(I)I -Landroid/content/SyncStatusInfo;->getPeriodicSyncTime(I)J -Landroid/content/SyncStatusInfo;->initialFailureTime:J -Landroid/content/SyncStatusInfo;->initialize:Z -Landroid/content/SyncStatusInfo;->lastFailureMesg:Ljava/lang/String; -Landroid/content/SyncStatusInfo;->lastFailureSource:I -Landroid/content/SyncStatusInfo;->lastFailureTime:J -Landroid/content/SyncStatusInfo;->lastSuccessSource:I -Landroid/content/SyncStatusInfo;->lastSuccessTime:J -Landroid/content/SyncStatusInfo;->pending:Z -Landroid/content/SyncStatusInfo;->periodicSyncTimes:Ljava/util/ArrayList; -Landroid/content/SyncStatusInfo;->removePeriodicSyncTime(I)V -Landroid/content/SyncStatusInfo;->setPeriodicSyncTime(IJ)V Landroid/content/UndoManager;-><init>()V -Landroid/content/UndoManager;->addOperation(Landroid/content/UndoOperation;I)V -Landroid/content/UndoManager;->beginUpdate(Ljava/lang/CharSequence;)V -Landroid/content/UndoManager;->commitState(Landroid/content/UndoOwner;)I -Landroid/content/UndoManager;->countRedos([Landroid/content/UndoOwner;)I -Landroid/content/UndoManager;->countUndos([Landroid/content/UndoOwner;)I -Landroid/content/UndoManager;->endUpdate()V -Landroid/content/UndoManager;->forgetRedos([Landroid/content/UndoOwner;I)I -Landroid/content/UndoManager;->forgetUndos([Landroid/content/UndoOwner;I)I -Landroid/content/UndoManager;->getLastOperation(Ljava/lang/Class;Landroid/content/UndoOwner;I)Landroid/content/UndoOperation; -Landroid/content/UndoManager;->getOwner(Ljava/lang/String;Ljava/lang/Object;)Landroid/content/UndoOwner; -Landroid/content/UndoManager;->isInUndo()Z -Landroid/content/UndoManager;->redo([Landroid/content/UndoOwner;I)I -Landroid/content/UndoManager;->restoreInstanceState(Landroid/os/Parcel;Ljava/lang/ClassLoader;)V -Landroid/content/UndoManager;->saveInstanceState(Landroid/os/Parcel;)V -Landroid/content/UndoManager;->setUndoLabel(Ljava/lang/CharSequence;)V -Landroid/content/UndoManager;->undo([Landroid/content/UndoOwner;I)I -Landroid/content/UndoOperation;-><init>(Landroid/content/UndoOwner;)V -Landroid/content/UndoOperation;-><init>(Landroid/os/Parcel;Ljava/lang/ClassLoader;)V -Landroid/content/UriMatcher;->mChildren:Ljava/util/ArrayList; -Landroid/content/UriMatcher;->mText:Ljava/lang/String; 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 @@ -6237,15 +5661,6 @@ Llibcore/io/Memory;->pokeLong(JJZ)V Llibcore/io/Streams;->copy(Ljava/io/InputStream;Ljava/io/OutputStream;)I Llibcore/util/BasicLruCache;->map:Ljava/util/LinkedHashMap; Llibcore/util/ZoneInfo;->mTransitions:[J -Lorg/apache/http/conn/ssl/AbstractVerifier;->BAD_COUNTRY_2LDS:[Ljava/lang/String; -Lorg/apache/http/conn/ssl/SSLSocketFactory;-><init>()V -Lorg/apache/http/conn/ssl/SSLSocketFactory;-><init>(Ljavax/net/ssl/SSLSocketFactory;)V -Lorg/apache/http/conn/ssl/SSLSocketFactory;->createKeyManagers(Ljava/security/KeyStore;Ljava/lang/String;)[Ljavax/net/ssl/KeyManager; -Lorg/apache/http/conn/ssl/SSLSocketFactory;->createTrustManagers(Ljava/security/KeyStore;)[Ljavax/net/ssl/TrustManager; -Lorg/apache/http/conn/ssl/SSLSocketFactory;->hostnameVerifier:Lorg/apache/http/conn/ssl/X509HostnameVerifier; -Lorg/apache/http/conn/ssl/SSLSocketFactory;->nameResolver:Lorg/apache/http/conn/scheme/HostNameResolver; -Lorg/apache/http/conn/ssl/SSLSocketFactory;->socketfactory:Ljavax/net/ssl/SSLSocketFactory; -Lorg/apache/http/conn/ssl/SSLSocketFactory;->sslcontext:Ljavax/net/ssl/SSLContext; Lorg/ccil/cowan/tagsoup/AttributesImpl;->data:[Ljava/lang/String; Lorg/ccil/cowan/tagsoup/AttributesImpl;->length:I Lorg/ccil/cowan/tagsoup/ElementType;->theAtts:Lorg/ccil/cowan/tagsoup/AttributesImpl; diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt index 6d50eb67e75e..42aacbca6e74 100644 --- a/config/hiddenapi-vendor-list.txt +++ b/config/hiddenapi-vendor-list.txt @@ -25,20 +25,6 @@ Landroid/companion/ICompanionDeviceDiscoveryService$Stub;-><init>()V Landroid/companion/ICompanionDeviceDiscoveryServiceCallback;->onDeviceSelected(Ljava/lang/String;ILjava/lang/String;)V Landroid/companion/ICompanionDeviceDiscoveryServiceCallback;->onDeviceSelectionCancel()V Landroid/companion/IFindDeviceCallback;->onSuccess(Landroid/app/PendingIntent;)V -Landroid/content/ContentProvider;-><init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;[Landroid/content/pm/PathPermission;)V -Landroid/content/ContentProvider;->attachInfoForTesting(Landroid/content/Context;Landroid/content/pm/ProviderInfo;)V -Landroid/content/ContentProvider;->getIContentProvider()Landroid/content/IContentProvider; -Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V -Landroid/content/ContentValues;->getStringArrayList(Ljava/lang/String;)Ljava/util/ArrayList; -Landroid/content/ContentValues;->putStringArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V -Landroid/content/Context;->getOpPackageName()Ljava/lang/String; -Landroid/content/Context;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent; -Landroid/content/Context;->startActivityAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V -Landroid/content/Context;->startServiceAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)Landroid/content/ComponentName; -Landroid/content/ContextWrapper;->getThemeResId()I -Landroid/content/Intent;->getExtra(Ljava/lang/String;)Ljava/lang/Object; -Landroid/content/Intent;->getIBinderExtra(Ljava/lang/String;)Landroid/os/IBinder; -Landroid/content/Intent;->resolveSystemService(Landroid/content/pm/PackageManager;I)Landroid/content/ComponentName; Landroid/content/pm/IPackageDataObserver$Stub;-><init>()V Landroid/content/pm/IPackageDeleteObserver$Stub;-><init>()V Landroid/content/pm/IPackageDeleteObserver;->packageDeleted(Ljava/lang/String;I)V diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java index c44e35687909..bb7d5e49ccfb 100644 --- a/core/java/android/content/AsyncTaskLoader.java +++ b/core/java/android/content/AsyncTaskLoader.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.AsyncTask; import android.os.Handler; import android.os.OperationCanceledException; @@ -128,6 +129,7 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> { } } + @UnsupportedAppUsage private final Executor mExecutor; volatile LoadTask mTask; @@ -354,6 +356,7 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> { * * @hide */ + @UnsupportedAppUsage public void waitForLoader() { LoadTask task = mTask; if (task != null) { diff --git a/core/java/android/content/BroadcastReceiver.java b/core/java/android/content/BroadcastReceiver.java index 58a9183d1b09..b55fe7618b94 100644 --- a/core/java/android/content/BroadcastReceiver.java +++ b/core/java/android/content/BroadcastReceiver.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.ActivityThread; import android.app.IActivityManager; @@ -43,6 +44,7 @@ import android.util.Slog; * */ public abstract class BroadcastReceiver { + @UnsupportedAppUsage private PendingResult mPendingResult; private boolean mDebugUnregister; @@ -69,20 +71,32 @@ public abstract class BroadcastReceiver { /** @hide */ public static final int TYPE_UNREGISTERED = 2; + @UnsupportedAppUsage final int mType; + @UnsupportedAppUsage final boolean mOrderedHint; + @UnsupportedAppUsage final boolean mInitialStickyHint; + @UnsupportedAppUsage final IBinder mToken; + @UnsupportedAppUsage final int mSendingUser; + @UnsupportedAppUsage final int mFlags; + @UnsupportedAppUsage int mResultCode; + @UnsupportedAppUsage String mResultData; + @UnsupportedAppUsage Bundle mResultExtras; + @UnsupportedAppUsage boolean mAbortBroadcast; + @UnsupportedAppUsage boolean mFinished; /** @hide */ + @UnsupportedAppUsage public PendingResult(int resultCode, String resultData, Bundle resultExtras, int type, boolean ordered, boolean sticky, IBinder token, int userId, int flags) { mResultCode = resultCode; @@ -595,6 +609,7 @@ public abstract class BroadcastReceiver { /** * For internal use to set the result data that is active. @hide */ + @UnsupportedAppUsage public final void setPendingResult(PendingResult result) { mPendingResult = result; } @@ -602,6 +617,7 @@ public abstract class BroadcastReceiver { /** * For internal use to set the result data that is active. @hide */ + @UnsupportedAppUsage public final PendingResult getPendingResult() { return mPendingResult; } diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java index 94e1e2dff235..2b7ea66d2054 100644 --- a/core/java/android/content/ClipData.java +++ b/core/java/android/content/ClipData.java @@ -21,6 +21,7 @@ import static android.content.ContentResolver.SCHEME_ANDROID_RESOURCE; import static android.content.ContentResolver.SCHEME_CONTENT; import static android.content.ContentResolver.SCHEME_FILE; +import android.annotation.UnsupportedAppUsage; import android.content.res.AssetFileDescriptor; import android.graphics.Bitmap; import android.net.Uri; @@ -197,6 +198,7 @@ public class ClipData implements Parcelable { final CharSequence mText; final String mHtmlText; final Intent mIntent; + @UnsupportedAppUsage Uri mUri; /** @hide */ @@ -912,6 +914,7 @@ public class ClipData implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public Bitmap getIcon() { return mIcon; } diff --git a/core/java/android/content/ClipboardManager.java b/core/java/android/content/ClipboardManager.java index 73b6eb27bed3..3b6c8c148dcb 100644 --- a/core/java/android/content/ClipboardManager.java +++ b/core/java/android/content/ClipboardManager.java @@ -19,6 +19,7 @@ package android.content; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemService; +import android.annotation.UnsupportedAppUsage; import android.os.Handler; import android.os.RemoteException; import android.os.ServiceManager; @@ -82,6 +83,7 @@ public class ClipboardManager extends android.text.ClipboardManager { } /** {@hide} */ + @UnsupportedAppUsage public ClipboardManager(Context context, Handler handler) throws ServiceNotFoundException { mContext = context; mHandler = handler; @@ -221,6 +223,7 @@ public class ClipboardManager extends android.text.ClipboardManager { } } + @UnsupportedAppUsage void reportPrimaryClipChanged() { Object[] listeners; diff --git a/core/java/android/content/ComponentName.java b/core/java/android/content/ComponentName.java index fc5853353ce6..54e6342747db 100644 --- a/core/java/android/content/ComponentName.java +++ b/core/java/android/content/ComponentName.java @@ -18,6 +18,7 @@ package android.content; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -229,12 +230,14 @@ public final class ComponentName implements Parcelable, Cloneable, Comparable<Co } /** @hide */ + @UnsupportedAppUsage public static void appendShortString(StringBuilder sb, String packageName, String className) { sb.append(packageName).append('/'); appendShortClassName(sb, packageName, className); } /** @hide */ + @UnsupportedAppUsage public static void printShortString(PrintWriter pw, String packageName, String className) { pw.print(packageName); pw.print('/'); diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java index cdeaea3ebcae..7c7e93a4610c 100644 --- a/core/java/android/content/ContentProvider.java +++ b/core/java/android/content/ContentProvider.java @@ -24,6 +24,7 @@ import static android.content.pm.PackageManager.PERMISSION_GRANTED; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.app.AppOpsManager; import android.content.pm.PathPermission; import android.content.pm.ProviderInfo; @@ -105,15 +106,21 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * MockContentProvider. */ + @UnsupportedAppUsage private Context mContext = null; private int mMyUid; // Since most Providers have only one authority, we keep both a String and a String[] to improve // performance. + @UnsupportedAppUsage private String mAuthority; + @UnsupportedAppUsage private String[] mAuthorities; + @UnsupportedAppUsage private String mReadPermission; + @UnsupportedAppUsage private String mWritePermission; + @UnsupportedAppUsage private PathPermission[] mPathPermissions; private boolean mExported; private boolean mNoPerms; @@ -154,6 +161,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * in the test, which is available via {@link #getPathPermissions()}. * @hide */ + @UnsupportedAppUsage public ContentProvider( Context context, String readPermission, @@ -178,6 +186,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * ContentProvider instance. Otherwise returns {@code null}. * @hide */ + @UnsupportedAppUsage public static ContentProvider coerceToLocalContentProvider( IContentProvider abstractInterface) { if (abstractInterface instanceof Transport) { @@ -849,6 +858,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { } /** @hide */ + @UnsupportedAppUsage public final void setAppOps(int readOp, int writeOp) { if (!mNoPerms) { mTransport.mReadOp = readOp; @@ -1868,6 +1878,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * @return the Binder object for this provider * @hide */ + @UnsupportedAppUsage public IContentProvider getIContentProvider() { return mTransport; } @@ -1877,6 +1888,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { * when directly instantiating the provider for testing. * @hide */ + @UnsupportedAppUsage public void attachInfoForTesting(Context context, ProviderInfo info) { attachInfo(context, info, true); } @@ -2096,6 +2108,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 { } /** @hide */ + @UnsupportedAppUsage public static Uri maybeAddUserId(Uri uri, int userId) { if (uri == null) return null; if (userId != UserHandle.USER_CURRENT diff --git a/core/java/android/content/ContentProviderClient.java b/core/java/android/content/ContentProviderClient.java index 2d490a03bd76..74f7958387ea 100644 --- a/core/java/android/content/ContentProviderClient.java +++ b/core/java/android/content/ContentProviderClient.java @@ -18,6 +18,7 @@ package android.content; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.res.AssetFileDescriptor; import android.database.CrossProcessCursorWrapper; import android.database.Cursor; @@ -68,7 +69,9 @@ public class ContentProviderClient implements AutoCloseable { private static Handler sAnrHandler; private final ContentResolver mContentResolver; + @UnsupportedAppUsage private final IContentProvider mContentProvider; + @UnsupportedAppUsage private final String mPackageName; private final boolean mStable; diff --git a/core/java/android/content/ContentProviderNative.java b/core/java/android/content/ContentProviderNative.java index d428a3a857b7..6bede131c817 100644 --- a/core/java/android/content/ContentProviderNative.java +++ b/core/java/android/content/ContentProviderNative.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.res.AssetFileDescriptor; import android.database.BulkCursorDescriptor; import android.database.BulkCursorToCursorAdaptor; @@ -50,6 +51,7 @@ abstract public class ContentProviderNative extends Binder implements IContentPr * Cast a Binder object into a content resolver interface, generating * a proxy if needed. */ + @UnsupportedAppUsage static public IContentProvider asInterface(IBinder obj) { if (obj == null) { diff --git a/core/java/android/content/ContentProviderOperation.java b/core/java/android/content/ContentProviderOperation.java index 8f3a31746266..e3d9b1931faa 100644 --- a/core/java/android/content/ContentProviderOperation.java +++ b/core/java/android/content/ContentProviderOperation.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.content.ContentProvider; import android.database.Cursor; import android.net.Uri; @@ -35,16 +36,22 @@ import java.util.Map; */ public class ContentProviderOperation implements Parcelable { /** @hide exposed for unit tests */ + @UnsupportedAppUsage public final static int TYPE_INSERT = 1; /** @hide exposed for unit tests */ + @UnsupportedAppUsage public final static int TYPE_UPDATE = 2; /** @hide exposed for unit tests */ + @UnsupportedAppUsage public final static int TYPE_DELETE = 3; /** @hide exposed for unit tests */ public final static int TYPE_ASSERT = 4; + @UnsupportedAppUsage private final int mType; + @UnsupportedAppUsage private final Uri mUri; + @UnsupportedAppUsage private final String mSelection; private final String[] mSelectionArgs; private final ContentValues mValues; @@ -218,6 +225,7 @@ public class ContentProviderOperation implements Parcelable { } /** @hide exposed for unit tests */ + @UnsupportedAppUsage public int getType() { return mType; } diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index 32a674363535..b138b9d62ea2 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityThread; @@ -429,6 +430,7 @@ public abstract class ContentResolver { public static final String ANY_CURSOR_ITEM_TYPE = "vnd.android.cursor.item/*"; /** @hide */ + @UnsupportedAppUsage public static final int SYNC_ERROR_SYNC_ALREADY_IN_PROGRESS = 1; /** @hide */ public static final int SYNC_ERROR_AUTHENTICATION = 2; @@ -485,6 +487,7 @@ public abstract class ContentResolver { public static final int SYNC_OBSERVER_TYPE_PENDING = 1<<1; public static final int SYNC_OBSERVER_TYPE_ACTIVE = 1<<2; /** @hide */ + @UnsupportedAppUsage public static final int SYNC_OBSERVER_TYPE_STATUS = 1<<3; /** @hide */ public static final int SYNC_OBSERVER_TYPE_ALL = 0x7fffffff; @@ -567,6 +570,7 @@ public abstract class ContentResolver { } /** @hide */ + @UnsupportedAppUsage protected abstract IContentProvider acquireProvider(Context c, String name); /** @@ -576,17 +580,22 @@ public abstract class ContentResolver { * * @hide */ + @UnsupportedAppUsage protected IContentProvider acquireExistingProvider(Context c, String name) { return acquireProvider(c, name); } /** @hide */ + @UnsupportedAppUsage public abstract boolean releaseProvider(IContentProvider icp); /** @hide */ + @UnsupportedAppUsage protected abstract IContentProvider acquireUnstableProvider(Context c, String name); /** @hide */ + @UnsupportedAppUsage public abstract boolean releaseUnstableProvider(IContentProvider icp); /** @hide */ + @UnsupportedAppUsage public abstract void unstableProviderDied(IContentProvider icp); /** @hide */ @@ -1518,7 +1527,9 @@ public abstract class ContentResolver { * @hide */ public class OpenResourceIdResult { + @UnsupportedAppUsage public Resources r; + @UnsupportedAppUsage public int id; } @@ -1527,6 +1538,7 @@ public abstract class ContentResolver { * * @hide */ + @UnsupportedAppUsage public OpenResourceIdResult getResourceId(Uri uri) throws FileNotFoundException { String authority = uri.getAuthority(); Resources r; @@ -1772,6 +1784,7 @@ public abstract class ContentResolver { * @return The ContentProvider for the given URI, or null if no content provider is found. * @hide */ + @UnsupportedAppUsage public final IContentProvider acquireProvider(Uri uri) { if (!SCHEME_CONTENT.equals(uri.getScheme())) { return null; @@ -1791,6 +1804,7 @@ public abstract class ContentResolver { * @return The ContentProvider for the given URI, or null if no content provider is found. * @hide */ + @UnsupportedAppUsage public final IContentProvider acquireExistingProvider(Uri uri) { if (!SCHEME_CONTENT.equals(uri.getScheme())) { return null; @@ -1805,6 +1819,7 @@ public abstract class ContentResolver { /** * @hide */ + @UnsupportedAppUsage public final IContentProvider acquireProvider(String name) { if (name == null) { return null; @@ -1833,6 +1848,7 @@ public abstract class ContentResolver { /** * @hide */ + @UnsupportedAppUsage public final IContentProvider acquireUnstableProvider(String name) { if (name == null) { return null; @@ -1966,6 +1982,7 @@ public abstract class ContentResolver { } /** @hide - designated user version */ + @UnsupportedAppUsage public final void registerContentObserver(Uri uri, boolean notifyForDescendents, ContentObserver observer, @UserIdInt int userHandle) { try { @@ -2145,6 +2162,7 @@ public abstract class ContentResolver { /** * @hide */ + @UnsupportedAppUsage public void takePersistableUriPermission(@NonNull String toPackage, @NonNull Uri uri, @Intent.AccessUriMode int modeFlags) { Preconditions.checkNotNull(toPackage, "toPackage"); @@ -2779,6 +2797,7 @@ public abstract class ContentResolver { * @return the SyncStatusInfo for the authority, or null if none exists * @hide */ + @UnsupportedAppUsage public static SyncStatusInfo getSyncStatus(Account account, String authority) { try { return getContentService().getSyncStatus(account, authority, null); @@ -2791,6 +2810,7 @@ public abstract class ContentResolver { * @see #getSyncStatus(Account, String) * @hide */ + @UnsupportedAppUsage public static SyncStatusInfo getSyncStatusAsUser(Account account, String authority, @UserIdInt int userId) { try { @@ -3033,6 +3053,7 @@ public abstract class ContentResolver { public static final String CONTENT_SERVICE_NAME = "content"; /** @hide */ + @UnsupportedAppUsage public static IContentService getContentService() { if (sContentService != null) { return sContentService; @@ -3043,13 +3064,17 @@ public abstract class ContentResolver { } /** @hide */ + @UnsupportedAppUsage public String getPackageName() { return mPackageName; } + @UnsupportedAppUsage private static volatile IContentService sContentService; + @UnsupportedAppUsage private final Context mContext; + @UnsupportedAppUsage final String mPackageName; final int mTargetSdkVersion; diff --git a/core/java/android/content/ContentValues.java b/core/java/android/content/ContentValues.java index 6f9379890a3a..54857bb55f2e 100644 --- a/core/java/android/content/ContentValues.java +++ b/core/java/android/content/ContentValues.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; @@ -33,6 +34,7 @@ public final class ContentValues implements Parcelable { public static final String TAG = "ContentValues"; /** Holds the actual values */ + @UnsupportedAppUsage private HashMap<String, Object> mValues; /** @@ -69,6 +71,7 @@ public final class ContentValues implements Parcelable { * @param values the values to start with * {@hide} */ + @UnsupportedAppUsage private ContentValues(HashMap<String, Object> values) { mValues = values; } @@ -502,6 +505,7 @@ public final class ContentValues implements Parcelable { * {@hide} */ @Deprecated + @UnsupportedAppUsage public void putStringArrayList(String key, ArrayList<String> value) { mValues.put(key, value); } @@ -512,6 +516,7 @@ public final class ContentValues implements Parcelable { */ @SuppressWarnings("unchecked") @Deprecated + @UnsupportedAppUsage public ArrayList<String> getStringArrayList(String key) { return (ArrayList<String>) mValues.get(key); } diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 97d520717c70..9ff275ff6491 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -31,6 +31,7 @@ import android.annotation.StyleRes; import android.annotation.StyleableRes; import android.annotation.SystemApi; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.IApplicationThread; @@ -654,6 +655,7 @@ public abstract class Context { /** @hide Needed for some internal implementation... not public because * you can't assume this actually means anything. */ + @UnsupportedAppUsage public int getThemeResId() { return 0; } @@ -722,6 +724,7 @@ public abstract class Context { public abstract String getPackageName(); /** @hide Return the name of the base context this context is derived from. */ + @UnsupportedAppUsage public abstract String getBasePackageName(); /** @hide Return the package name that should be used for app ops calls from @@ -729,6 +732,7 @@ public abstract class Context { * cases where system components are loaded into other app processes, in which * case this will be the name of the primary package in that process (so that app * ops uid verification will work with the name). */ + @UnsupportedAppUsage public abstract String getOpPackageName(); /** Return the full application info for this context's package. */ @@ -763,6 +767,7 @@ public abstract class Context { * @deprecated use {@link #getSharedPreferencesPath(String)} */ @Deprecated + @UnsupportedAppUsage public File getSharedPrefsFile(String name) { return getSharedPreferencesPath(name); } @@ -1696,6 +1701,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) + @UnsupportedAppUsage public void startActivityAsUser(@RequiresPermission Intent intent, UserHandle user) { throw new RuntimeException("Not implemented. Must override in a subclass."); } @@ -1742,6 +1748,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) + @UnsupportedAppUsage public void startActivityAsUser(@RequiresPermission Intent intent, @Nullable Bundle options, UserHandle userId) { throw new RuntimeException("Not implemented. Must override in a subclass."); @@ -1760,6 +1767,7 @@ public abstract class Context { * for building it manually. * @hide */ + @UnsupportedAppUsage public void startActivityForResult( @NonNull String who, Intent intent, int requestCode, @Nullable Bundle options) { throw new RuntimeException("This method is only implemented for Activity-based Contexts. " @@ -1771,6 +1779,7 @@ public abstract class Context { * {@link #startActivityForResult(String, Intent, int, Bundle)}. * @hide */ + @UnsupportedAppUsage public boolean canStartActivityForResult() { return false; } @@ -2038,6 +2047,7 @@ public abstract class Context { * of an associated app op as per {@link android.app.AppOpsManager}. * @hide */ + @UnsupportedAppUsage public abstract void sendBroadcast(Intent intent, String receiverPermission, int appOp); @@ -2164,6 +2174,7 @@ public abstract class Context { * of an associated app op as per {@link android.app.AppOpsManager}. * @hide */ + @UnsupportedAppUsage public abstract void sendOrderedBroadcast(Intent intent, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, @@ -2239,6 +2250,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent, UserHandle user, @Nullable String receiverPermission, int appOp); @@ -2284,6 +2296,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public abstract void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, @Nullable String receiverPermission, int appOp, BroadcastReceiver resultReceiver, @Nullable Handler scheduler, int initialCode, @Nullable String initialData, @@ -2296,6 +2309,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public abstract void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, @Nullable String receiverPermission, int appOp, @Nullable Bundle options, BroadcastReceiver resultReceiver, @Nullable Handler scheduler, int initialCode, @@ -2688,6 +2702,7 @@ public abstract class Context { */ @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) + @UnsupportedAppUsage public abstract Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user, IntentFilter filter, @Nullable String broadcastPermission, @Nullable Handler scheduler); @@ -2835,6 +2850,7 @@ public abstract class Context { */ @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public abstract ComponentName startServiceAsUser(Intent service, UserHandle user); /** @@ -2922,6 +2938,7 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int flags, Handler handler, UserHandle user) { throw new RuntimeException("Not implemented. Must override in a subclass."); @@ -3393,6 +3410,7 @@ public abstract class Context { * * @hide */ + @UnsupportedAppUsage public static final String COUNTRY_DETECTOR = "country_detector"; /** @@ -3462,6 +3480,7 @@ public abstract class Context { * @see android.app.StatusBarManager * @hide */ + @UnsupportedAppUsage public static final String STATUS_BAR_SERVICE = "statusbar"; /** @@ -3608,6 +3627,7 @@ public abstract class Context { * * @hide */ + @UnsupportedAppUsage public static final String ETHERNET_SERVICE = "ethernet"; /** @@ -4251,6 +4271,7 @@ public abstract class Context { /** @hide */ @PackageManager.PermissionResult + @UnsupportedAppUsage public abstract int checkPermission(@NonNull String permission, int pid, int uid, IBinder callerToken); @@ -4743,6 +4764,7 @@ public abstract class Context { * * @hide */ + @UnsupportedAppUsage public abstract Context createApplicationContext(ApplicationInfo application, @CreatePackageOptions int flags) throws PackageManager.NameNotFoundException; @@ -4888,6 +4910,7 @@ public abstract class Context { /** * @hide */ + @UnsupportedAppUsage public abstract Display getDisplay(); /** diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java index bae99b85d6b8..adc2ebaf30fa 100644 --- a/core/java/android/content/ContextWrapper.java +++ b/core/java/android/content/ContextWrapper.java @@ -18,6 +18,7 @@ package android.content; import android.annotation.SystemApi; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.app.IApplicationThread; import android.app.IServiceConnection; import android.content.pm.ApplicationInfo; @@ -54,6 +55,7 @@ import java.util.concurrent.Executor; * the original Context. */ public class ContextWrapper extends Context { + @UnsupportedAppUsage Context mBase; public ContextWrapper(Context base) { @@ -123,6 +125,7 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public int getThemeResId() { return mBase.getThemeResId(); } @@ -144,12 +147,14 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public String getBasePackageName() { return mBase.getBasePackageName(); } /** @hide */ @Override + @UnsupportedAppUsage public String getOpPackageName() { return mBase.getOpPackageName(); } @@ -381,6 +386,7 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public void startActivityAsUser(Intent intent, UserHandle user) { mBase.startActivityAsUser(intent, user); } @@ -647,6 +653,7 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public Intent registerReceiverAsUser( BroadcastReceiver receiver, UserHandle user, IntentFilter filter, String broadcastPermission, Handler scheduler) { @@ -676,12 +683,14 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public ComponentName startServiceAsUser(Intent service, UserHandle user) { return mBase.startServiceAsUser(service, user); } /** @hide */ @Override + @UnsupportedAppUsage public ComponentName startForegroundServiceAsUser(Intent service, UserHandle user) { return mBase.startForegroundServiceAsUser(service, user); } @@ -861,6 +870,7 @@ public class ContextWrapper extends Context { /** @hide */ @Override + @UnsupportedAppUsage public Context createApplicationContext(ApplicationInfo application, int flags) throws PackageManager.NameNotFoundException { return mBase.createApplicationContext(application, flags); @@ -904,6 +914,7 @@ public class ContextWrapper extends Context { * @hide */ @Override + @UnsupportedAppUsage public Display getDisplay() { return mBase.getDisplay(); } diff --git a/core/java/android/content/CursorEntityIterator.java b/core/java/android/content/CursorEntityIterator.java index 18437e5f92a1..2c630d29621b 100644 --- a/core/java/android/content/CursorEntityIterator.java +++ b/core/java/android/content/CursorEntityIterator.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.database.Cursor; import android.os.RemoteException; @@ -33,6 +34,7 @@ public abstract class CursorEntityIterator implements EntityIterator { * first Entity, if there are any. * @param cursor the cursor that contains the rows that make up the entities */ + @UnsupportedAppUsage public CursorEntityIterator(Cursor cursor) { mIsClosed = false; mCursor = cursor; diff --git a/core/java/android/content/CursorLoader.java b/core/java/android/content/CursorLoader.java index 5a08636c8fff..4e46d5716c7b 100644 --- a/core/java/android/content/CursorLoader.java +++ b/core/java/android/content/CursorLoader.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.database.Cursor; import android.net.Uri; import android.os.CancellationSignal; @@ -44,6 +45,7 @@ import java.util.Arrays; */ @Deprecated public class CursorLoader extends AsyncTaskLoader<Cursor> { + @UnsupportedAppUsage final ForceLoadContentObserver mObserver; Uri mUri; @@ -53,6 +55,7 @@ public class CursorLoader extends AsyncTaskLoader<Cursor> { String mSortOrder; Cursor mCursor; + @UnsupportedAppUsage CancellationSignal mCancellationSignal; /* Runs on a worker thread */ diff --git a/core/java/android/content/Entity.java b/core/java/android/content/Entity.java index 607cb3f4d841..b9473e04c63c 100644 --- a/core/java/android/content/Entity.java +++ b/core/java/android/content/Entity.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.net.Uri; import java.util.ArrayList; @@ -28,7 +29,9 @@ import java.util.ArrayList; * corresponds to that RawContact. The uri refers to the Data table uri for each row. */ public final class Entity { + @UnsupportedAppUsage final private ContentValues mValues; + @UnsupportedAppUsage final private ArrayList<NamedContentValues> mSubValues; public Entity(ContentValues values) { diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java index 66087fb99cdf..d814e676886e 100644 --- a/core/java/android/content/IContentProvider.java +++ b/core/java/android/content/IContentProvider.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.res.AssetFileDescriptor; import android.database.Cursor; import android.net.Uri; @@ -39,12 +40,16 @@ public interface IContentProvider extends IInterface { @Nullable Bundle queryArgs, @Nullable ICancellationSignal cancellationSignal) throws RemoteException; public String getType(Uri url) throws RemoteException; + @UnsupportedAppUsage public Uri insert(String callingPkg, Uri url, ContentValues initialValues) throws RemoteException; + @UnsupportedAppUsage public int bulkInsert(String callingPkg, Uri url, ContentValues[] initialValues) throws RemoteException; + @UnsupportedAppUsage public int delete(String callingPkg, Uri url, String selection, String[] selectionArgs) throws RemoteException; + @UnsupportedAppUsage public int update(String callingPkg, Uri url, ContentValues values, String selection, String[] selectionArgs) throws RemoteException; public ParcelFileDescriptor openFile( @@ -57,6 +62,7 @@ public interface IContentProvider extends IInterface { public ContentProviderResult[] applyBatch(String callingPkg, ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException; + @UnsupportedAppUsage public Bundle call( String callingPkg, String method, @Nullable String arg, @Nullable Bundle extras) throws RemoteException; @@ -74,8 +80,10 @@ public interface IContentProvider extends IInterface { Bundle opts, ICancellationSignal signal) throws RemoteException, FileNotFoundException; /* IPC constants */ + @UnsupportedAppUsage static final String descriptor = "android.content.IContentProvider"; + @UnsupportedAppUsage static final int QUERY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; static final int GET_TYPE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 1; static final int INSERT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 2; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 3dfabdd74a86..0fc55b4a7f09 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -26,6 +26,7 @@ import android.annotation.Nullable; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.ComponentInfo; @@ -2027,6 +2028,7 @@ public class Intent implements Parcelable, Cloneable { * @hide */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @UnsupportedAppUsage public static final String ACTION_ALARM_CHANGED = "android.intent.action.ALARM_CHANGED"; /** @@ -3254,6 +3256,7 @@ public class Intent implements Parcelable, Cloneable { * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast. * @hide */ + @UnsupportedAppUsage public static final String ACTION_USER_SWITCHED = "android.intent.action.USER_SWITCHED"; @@ -5772,6 +5775,7 @@ public class Intent implements Parcelable, Cloneable { * * @hide */ + @UnsupportedAppUsage public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 0x04000000; /** * Set when this broadcast is for a boot upgrade, a special mode that @@ -5938,6 +5942,7 @@ public class Intent implements Parcelable, Cloneable { private ComponentName mComponent; private int mFlags; private ArraySet<String> mCategories; + @UnsupportedAppUsage private Bundle mExtras; private Rect mSourceBounds; private Intent mSelector; @@ -6605,6 +6610,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ + @UnsupportedAppUsage public static Intent parseCommandArgs(ShellCommand cmd, CommandOptionHandler optionHandler) throws URISyntaxException { Intent intent = new Intent(); @@ -6989,6 +6995,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ + @UnsupportedAppUsage public static void printIntentArgsHelp(PrintWriter pw, String prefix) { final String[] lines = new String[] { "<INTENT> specifications include these flags and arguments:", @@ -7266,6 +7273,7 @@ public class Intent implements Parcelable, Cloneable { } /** {@hide} */ + @UnsupportedAppUsage public void setAllowFds(boolean allowFds) { if (mExtras != null) { mExtras.setAllowFds(allowFds); @@ -7291,6 +7299,7 @@ public class Intent implements Parcelable, Cloneable { * @hide */ @Deprecated + @UnsupportedAppUsage public Object getExtra(String name) { return getExtra(name, null); } @@ -7729,6 +7738,7 @@ public class Intent implements Parcelable, Cloneable { * @hide */ @Deprecated + @UnsupportedAppUsage public IBinder getIBinderExtra(String name) { return mExtras == null ? null : mExtras.getIBinder(name); } @@ -7749,6 +7759,7 @@ public class Intent implements Parcelable, Cloneable { * @hide */ @Deprecated + @UnsupportedAppUsage public Object getExtra(String name, Object defaultValue) { Object result = defaultValue; if (mExtras != null) { @@ -7821,6 +7832,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ + @UnsupportedAppUsage public boolean isExcludingStopped() { return (mFlags&(FLAG_EXCLUDE_STOPPED_PACKAGES|FLAG_INCLUDE_STOPPED_PACKAGES)) == FLAG_EXCLUDE_STOPPED_PACKAGES; @@ -7970,6 +7982,7 @@ public class Intent implements Parcelable, Cloneable { * there are no matches. * @hide */ + @UnsupportedAppUsage public @Nullable ComponentName resolveSystemService(@NonNull PackageManager pm, @PackageManager.ComponentInfoFlags int flags) { if (mComponent != null) { @@ -8979,6 +8992,7 @@ public class Intent implements Parcelable, Cloneable { * @hide */ @Deprecated + @UnsupportedAppUsage public @NonNull Intent putExtra(String name, IBinder value) { if (mExtras == null) { mExtras = new Bundle(); @@ -9546,6 +9560,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ + @UnsupportedAppUsage public String toInsecureString() { StringBuilder b = new StringBuilder(128); @@ -10195,6 +10210,7 @@ public class Intent implements Parcelable, Cloneable { * * @hide */ + @UnsupportedAppUsage public void prepareToLeaveProcess(Context context) { final boolean leavingPackage = (mComponent == null) || !Objects.equals(mComponent.getPackageName(), context.getPackageName()); diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java index cec3badd2e6c..212e13262433 100644 --- a/core/java/android/content/IntentFilter.java +++ b/core/java/android/content/IntentFilter.java @@ -18,6 +18,7 @@ package android.content; import android.annotation.IntDef; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; @@ -271,7 +272,9 @@ public class IntentFilter implements Parcelable { public static final String SCHEME_HTTPS = "https"; private int mPriority; + @UnsupportedAppUsage private int mOrder; + @UnsupportedAppUsage private final ArrayList<String> mActions; private ArrayList<String> mCategories = null; private ArrayList<String> mDataSchemes = null; @@ -536,6 +539,7 @@ public class IntentFilter implements Parcelable { * * @hide */ + @UnsupportedAppUsage public final void setAutoVerify(boolean autoVerify) { mVerifyState &= ~STATE_VERIFY_AUTO; if (autoVerify) mVerifyState |= STATE_VERIFY_AUTO; @@ -651,6 +655,7 @@ public class IntentFilter implements Parcelable { * * @hide */ + @UnsupportedAppUsage public final boolean isVerified() { if ((mVerifyState & STATE_NEED_VERIFY_CHECKED) == STATE_NEED_VERIFY_CHECKED) { return ((mVerifyState & STATE_NEED_VERIFY) == STATE_NEED_VERIFY); @@ -806,6 +811,7 @@ public class IntentFilter implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public final boolean hasExactDataType(String type) { return mDataTypes != null && mDataTypes.contains(type); } @@ -1071,6 +1077,7 @@ public class IntentFilter implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public final boolean hasDataSchemeSpecificPart(PatternMatcher ssp) { if (mDataSchemeSpecificParts == null) { return false; @@ -1154,6 +1161,7 @@ public class IntentFilter implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public final boolean hasDataAuthority(AuthorityEntry auth) { if (mDataAuthorities == null) { return false; @@ -1250,6 +1258,7 @@ public class IntentFilter implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public final boolean hasDataPath(PatternMatcher path) { if (mDataPaths == null) { return false; diff --git a/core/java/android/content/IntentSender.java b/core/java/android/content/IntentSender.java index ff127df6ec9b..bfd1a43d36be 100644 --- a/core/java/android/content/IntentSender.java +++ b/core/java/android/content/IntentSender.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.os.Bundle; import android.os.RemoteException; @@ -55,6 +56,7 @@ import android.util.AndroidException; * {@link android.app.PendingIntent#getIntentSender() PendingIntent.getIntentSender()}. */ public class IntentSender implements Parcelable { + @UnsupportedAppUsage private final IIntentSender mTarget; IBinder mWhitelistToken; @@ -356,6 +358,7 @@ public class IntentSender implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public IIntentSender getTarget() { return mTarget; } @@ -366,6 +369,7 @@ public class IntentSender implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public IntentSender(IIntentSender target) { mTarget = target; } diff --git a/core/java/android/content/RestrictionsManager.java b/core/java/android/content/RestrictionsManager.java index b463ec6277e7..33395ec37d9d 100644 --- a/core/java/android/content/RestrictionsManager.java +++ b/core/java/android/content/RestrictionsManager.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.SystemService; +import android.annotation.UnsupportedAppUsage; import android.app.Activity; import android.app.admin.DevicePolicyManager; import android.content.pm.ApplicationInfo; @@ -402,6 +403,7 @@ public class RestrictionsManager { private static final String TAG_RESTRICTION = "restriction"; private final Context mContext; + @UnsupportedAppUsage private final IRestrictionsManager mService; /** diff --git a/core/java/android/content/SearchRecentSuggestionsProvider.java b/core/java/android/content/SearchRecentSuggestionsProvider.java index d6f7d97367a7..8ee7b9e403b4 100644 --- a/core/java/android/content/SearchRecentSuggestionsProvider.java +++ b/core/java/android/content/SearchRecentSuggestionsProvider.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.app.SearchManager; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -115,6 +116,7 @@ public class SearchRecentSuggestionsProvider extends ContentProvider { private UriMatcher mUriMatcher; private String mSuggestSuggestionClause; + @UnsupportedAppUsage private String[] mSuggestionProjection; /** diff --git a/core/java/android/content/SyncAdapterType.java b/core/java/android/content/SyncAdapterType.java index 6ef7fd214069..ff77676505a7 100644 --- a/core/java/android/content/SyncAdapterType.java +++ b/core/java/android/content/SyncAdapterType.java @@ -17,6 +17,7 @@ package android.content; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.text.TextUtils; import android.os.Parcelable; import android.os.Parcel; @@ -29,10 +30,15 @@ public class SyncAdapterType implements Parcelable { public final String authority; public final String accountType; public final boolean isKey; + @UnsupportedAppUsage private final boolean userVisible; + @UnsupportedAppUsage private final boolean supportsUploading; + @UnsupportedAppUsage private final boolean isAlwaysSyncable; + @UnsupportedAppUsage private final boolean allowParallelSyncs; + @UnsupportedAppUsage private final String settingsActivity; private final String packageName; @@ -79,6 +85,7 @@ public class SyncAdapterType implements Parcelable { this.packageName = packageName; } + @UnsupportedAppUsage private SyncAdapterType(String authority, String accountType) { if (TextUtils.isEmpty(authority)) { throw new IllegalArgumentException("the authority must not be empty: " + authority); diff --git a/core/java/android/content/SyncAdaptersCache.java b/core/java/android/content/SyncAdaptersCache.java index ccd799407308..d4e52175f9b5 100644 --- a/core/java/android/content/SyncAdaptersCache.java +++ b/core/java/android/content/SyncAdaptersCache.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; @@ -51,6 +52,7 @@ public class SyncAdaptersCache extends RegisteredServicesCache<SyncAdapterType> private SparseArray<ArrayMap<String,String[]>> mAuthorityToSyncAdapters = new SparseArray<>(); + @UnsupportedAppUsage public SyncAdaptersCache(Context context) { super(context, SERVICE_INTERFACE, SERVICE_META_DATA, ATTRIBUTES_NAME, sSerializer); } diff --git a/core/java/android/content/SyncContext.java b/core/java/android/content/SyncContext.java index cc914c0c4c44..50d1dc96fc0a 100644 --- a/core/java/android/content/SyncContext.java +++ b/core/java/android/content/SyncContext.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.RemoteException; import android.os.SystemClock; import android.os.IBinder; @@ -29,6 +30,7 @@ public class SyncContext { /** * @hide */ + @UnsupportedAppUsage public SyncContext(ISyncContext syncContextInterface) { mSyncContext = syncContextInterface; mLastHeartbeatSendTime = 0; @@ -42,6 +44,7 @@ public class SyncContext { * * @hide */ + @UnsupportedAppUsage public void setStatusText(String message) { updateHeartbeat(); } diff --git a/core/java/android/content/SyncInfo.java b/core/java/android/content/SyncInfo.java index ab3c30bb2d2a..7ebf922aead0 100644 --- a/core/java/android/content/SyncInfo.java +++ b/core/java/android/content/SyncInfo.java @@ -17,6 +17,7 @@ package android.content; import android.accounts.Account; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -32,6 +33,7 @@ public class SyncInfo implements Parcelable { private static final Account REDACTED_ACCOUNT = new Account("*****", "*****"); /** @hide */ + @UnsupportedAppUsage public final int authorityId; /** @@ -63,6 +65,7 @@ public class SyncInfo implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public SyncInfo(int authorityId, Account account, String authority, long startTime) { this.authorityId = authorityId; this.account = account; @@ -92,6 +95,7 @@ public class SyncInfo implements Parcelable { } /** @hide */ + @UnsupportedAppUsage SyncInfo(Parcel parcel) { authorityId = parcel.readInt(); account = parcel.readParcelable(Account.class.getClassLoader()); @@ -100,6 +104,7 @@ public class SyncInfo implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public static final Creator<SyncInfo> CREATOR = new Creator<SyncInfo>() { public SyncInfo createFromParcel(Parcel in) { return new SyncInfo(in); diff --git a/core/java/android/content/SyncRequest.java b/core/java/android/content/SyncRequest.java index 74d2f114aae5..fd12d7acc8d7 100644 --- a/core/java/android/content/SyncRequest.java +++ b/core/java/android/content/SyncRequest.java @@ -17,6 +17,7 @@ package android.content; import android.accounts.Account; +import android.annotation.UnsupportedAppUsage; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; @@ -29,10 +30,13 @@ import android.os.Parcelable; public class SyncRequest implements Parcelable { private static final String TAG = "SyncRequest"; /** Account to pass to the sync adapter. Can be null. */ + @UnsupportedAppUsage private final Account mAccountToSync; /** Authority string that corresponds to a ContentProvider. */ + @UnsupportedAppUsage private final String mAuthority; /** Bundle containing user info as well as sync settings. */ + @UnsupportedAppUsage private final Bundle mExtras; /** Don't allow this sync request on metered networks. */ private final boolean mDisallowMetered; @@ -44,8 +48,10 @@ public class SyncRequest implements Parcelable { /** * Specifies a point in the future at which the sync must have been scheduled to run. */ + @UnsupportedAppUsage private final long mSyncRunTimeSecs; /** Periodic versus one-off. */ + @UnsupportedAppUsage private final boolean mIsPeriodic; /** Service versus provider. */ private final boolean mIsAuthority; diff --git a/core/java/android/content/SyncStatusInfo.java b/core/java/android/content/SyncStatusInfo.java index 2d521e9e4e60..a9065caec13d 100644 --- a/core/java/android/content/SyncStatusInfo.java +++ b/core/java/android/content/SyncStatusInfo.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; @@ -37,6 +38,7 @@ public class SyncStatusInfo implements Parcelable { */ private static final int SOURCE_COUNT = 6; + @UnsupportedAppUsage public final int authorityId; /** @@ -117,13 +119,21 @@ public class SyncStatusInfo implements Parcelable { public final Stats todayStats = new Stats(); public final Stats yesterdayStats = new Stats(); + @UnsupportedAppUsage public long lastSuccessTime; + @UnsupportedAppUsage public int lastSuccessSource; + @UnsupportedAppUsage public long lastFailureTime; + @UnsupportedAppUsage public int lastFailureSource; + @UnsupportedAppUsage public String lastFailureMesg; + @UnsupportedAppUsage public long initialFailureTime; + @UnsupportedAppUsage public boolean pending; + @UnsupportedAppUsage public boolean initialize; public final long[] perSourceLastSuccessTimes = new long[SOURCE_COUNT]; @@ -131,15 +141,18 @@ public class SyncStatusInfo implements Parcelable { // Warning: It is up to the external caller to ensure there are // no race conditions when accessing this list + @UnsupportedAppUsage private ArrayList<Long> periodicSyncTimes; private final ArrayList<Long> mLastEventTimes = new ArrayList<>(); private final ArrayList<String> mLastEvents = new ArrayList<>(); + @UnsupportedAppUsage public SyncStatusInfo(int authorityId) { this.authorityId = authorityId; } + @UnsupportedAppUsage public int getLastFailureMesgAsInt(int def) { final int i = ContentResolver.syncErrorStringToInt(lastFailureMesg); if (i > 0) { @@ -205,6 +218,7 @@ public class SyncStatusInfo implements Parcelable { parcel.writeLongArray(perSourceLastFailureTimes); } + @UnsupportedAppUsage public SyncStatusInfo(Parcel parcel) { int version = parcel.readInt(); if (version != VERSION && version != 1) { @@ -309,6 +323,7 @@ public class SyncStatusInfo implements Parcelable { System.arraycopy(from, 0, to, 0, to.length); } + @UnsupportedAppUsage public void setPeriodicSyncTime(int index, long when) { // The list is initialized lazily when scheduling occurs so we need to make sure // we initialize elements < index to zero (zero is ignore for scheduling purposes) @@ -316,6 +331,7 @@ public class SyncStatusInfo implements Parcelable { periodicSyncTimes.set(index, when); } + @UnsupportedAppUsage public long getPeriodicSyncTime(int index) { if (periodicSyncTimes != null && index < periodicSyncTimes.size()) { return periodicSyncTimes.get(index); @@ -324,6 +340,7 @@ public class SyncStatusInfo implements Parcelable { } } + @UnsupportedAppUsage public void removePeriodicSyncTime(int index) { if (periodicSyncTimes != null && index < periodicSyncTimes.size()) { periodicSyncTimes.remove(index); @@ -383,6 +400,7 @@ public class SyncStatusInfo implements Parcelable { } } + @UnsupportedAppUsage public static final Creator<SyncStatusInfo> CREATOR = new Creator<SyncStatusInfo>() { public SyncStatusInfo createFromParcel(Parcel in) { return new SyncStatusInfo(in); @@ -393,6 +411,7 @@ public class SyncStatusInfo implements Parcelable { } }; + @UnsupportedAppUsage private void ensurePeriodicSyncTimeSize(int index) { if (periodicSyncTimes == null) { periodicSyncTimes = new ArrayList<Long>(0); diff --git a/core/java/android/content/UndoManager.java b/core/java/android/content/UndoManager.java index fb21641e40b6..f6a0d771bf4c 100644 --- a/core/java/android/content/UndoManager.java +++ b/core/java/android/content/UndoManager.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.os.ParcelableParcel; @@ -86,6 +87,7 @@ public class UndoManager { */ public static final int MERGE_MODE_ANY = 2; + @UnsupportedAppUsage public UndoOwner getOwner(String tag, Object data) { if (tag == null) { throw new NullPointerException("tag can't be null"); @@ -122,6 +124,7 @@ public class UndoManager { * Flatten the current undo state into a Parcel object, which can later be restored * with {@link #restoreInstanceState(android.os.Parcel, java.lang.ClassLoader)}. */ + @UnsupportedAppUsage public void saveInstanceState(Parcel p) { if (mUpdateCount > 0) { throw new IllegalStateException("Can't save state while updating"); @@ -170,6 +173,7 @@ public class UndoManager { * associated with each {@link UndoOwner}, which requires separate calls to * {@link #getOwner(String, Object)} to re-associate the owner with its data. */ + @UnsupportedAppUsage public void restoreInstanceState(Parcel p, ClassLoader loader) { if (mUpdateCount > 0) { throw new IllegalStateException("Can't save state while updating"); @@ -230,6 +234,7 @@ public class UndoManager { * @param count Number of undo states to pop. * @return Returns the number of undo states that were actually popped. */ + @UnsupportedAppUsage public int undo(UndoOwner[] owners, int count) { if (mWorking != null) { throw new IllegalStateException("Can't be called during an update"); @@ -267,6 +272,7 @@ public class UndoManager { * @param count Number of undo states to pop. * @return Returns the number of undo states that were actually redone. */ + @UnsupportedAppUsage public int redo(UndoOwner[] owners, int count) { if (mWorking != null) { throw new IllegalStateException("Can't be called during an update"); @@ -295,10 +301,12 @@ public class UndoManager { * useful for editors to know whether they should be generating new undo state * when they see edit operations happening. */ + @UnsupportedAppUsage public boolean isInUndo() { return mInUndo; } + @UnsupportedAppUsage public int forgetUndos(UndoOwner[] owners, int count) { if (count < 0) { count = mUndos.size(); @@ -320,6 +328,7 @@ public class UndoManager { return removed; } + @UnsupportedAppUsage public int forgetRedos(UndoOwner[] owners, int count) { if (count < 0) { count = mRedos.size(); @@ -346,6 +355,7 @@ public class UndoManager { * @param owners If non-null, only those states containing an operation with one of * the owners supplied here will be counted. */ + @UnsupportedAppUsage public int countUndos(UndoOwner[] owners) { if (owners == null) { return mUndos.size(); @@ -365,6 +375,7 @@ public class UndoManager { * @param owners If non-null, only those states containing an operation with one of * the owners supplied here will be counted. */ + @UnsupportedAppUsage public int countRedos(UndoOwner[] owners) { if (owners == null) { return mRedos.size(); @@ -404,6 +415,7 @@ public class UndoManager { * they are all matched by a later call to {@link #endUpdate}. * @param label Optional user-visible label for this new undo state. */ + @UnsupportedAppUsage public void beginUpdate(CharSequence label) { if (mInUndo) { throw new IllegalStateException("Can't being update while performing undo/redo"); @@ -436,6 +448,7 @@ public class UndoManager { * Forcibly set a new for the new undo state being built within a {@link #beginUpdate}. * Any existing label will be replaced with this one. */ + @UnsupportedAppUsage public void setUndoLabel(CharSequence label) { if (mWorking == null) { throw new IllegalStateException("Must be called during an update"); @@ -510,6 +523,7 @@ public class UndoManager { * @param mergeMode May be either {@link #MERGE_MODE_NONE}, {@link #MERGE_MODE_UNIQUE}, * or {@link #MERGE_MODE_ANY}. */ + @UnsupportedAppUsage public <T extends UndoOperation> T getLastOperation(Class<T> clazz, UndoOwner owner, int mergeMode) { if (mWorking == null) { @@ -539,6 +553,7 @@ public class UndoManager { * @param mergeMode May be either {@link #MERGE_MODE_NONE}, {@link #MERGE_MODE_UNIQUE}, * or {@link #MERGE_MODE_ANY}. */ + @UnsupportedAppUsage public void addOperation(UndoOperation<?> op, int mergeMode) { if (mWorking == null) { throw new IllegalStateException("Must be called during an update"); @@ -565,6 +580,7 @@ public class UndoManager { * Finish the creation of an undo state, matching a previous call to * {@link #beginUpdate}. */ + @UnsupportedAppUsage public void endUpdate() { if (mWorking == null) { throw new IllegalStateException("Must be called during an update"); @@ -613,6 +629,7 @@ public class UndoManager { * @return Returns an integer identifier for the committed undo state, which * can later be used to try to uncommit the state to perform further edits on it. */ + @UnsupportedAppUsage public int commitState(UndoOwner owner) { if (mWorking != null && mWorking.hasData()) { if (owner == null || mWorking.hasOperation(owner)) { diff --git a/core/java/android/content/UndoOperation.java b/core/java/android/content/UndoOperation.java index 1ff32d4a8013..a425486e5739 100644 --- a/core/java/android/content/UndoOperation.java +++ b/core/java/android/content/UndoOperation.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -34,6 +35,7 @@ public abstract class UndoOperation<DATA> implements Parcelable { * @param owner Who owns the data being modified by this undo state; must be * returned by {@link UndoManager#getOwner(String, Object) UndoManager.getOwner}. */ + @UnsupportedAppUsage public UndoOperation(UndoOwner owner) { mOwner = owner; } @@ -41,6 +43,7 @@ public abstract class UndoOperation<DATA> implements Parcelable { /** * Construct from a Parcel. */ + @UnsupportedAppUsage protected UndoOperation(Parcel src, ClassLoader loader) { } diff --git a/core/java/android/content/UriMatcher.java b/core/java/android/content/UriMatcher.java index 444edd0deac2..d17bc4826ed4 100644 --- a/core/java/android/content/UriMatcher.java +++ b/core/java/android/content/UriMatcher.java @@ -16,6 +16,7 @@ package android.content; +import android.annotation.UnsupportedAppUsage; import android.net.Uri; import java.util.ArrayList; @@ -274,6 +275,8 @@ public class UriMatcher private int mCode; private int mWhich; + @UnsupportedAppUsage private String mText; + @UnsupportedAppUsage private ArrayList<UriMatcher> mChildren; } diff --git a/core/java/android/content/om/OverlayInfo.java b/core/java/android/content/om/OverlayInfo.java index edacbb0bb2b4..07b23d1decc0 100644 --- a/core/java/android/content/om/OverlayInfo.java +++ b/core/java/android/content/om/OverlayInfo.java @@ -18,6 +18,7 @@ package android.content.om; import android.annotation.IntDef; import android.annotation.NonNull; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -107,11 +108,13 @@ public final class OverlayInfo implements Parcelable { /** * Package name of the overlay package */ + @UnsupportedAppUsage public final String packageName; /** * Package name of the target package */ + @UnsupportedAppUsage public final String targetPackageName; /** @@ -127,6 +130,7 @@ public final class OverlayInfo implements Parcelable { /** * The state of this OverlayInfo as defined by the STATE_* constants in this class. */ + @UnsupportedAppUsage public final @State int state; /** @@ -251,6 +255,7 @@ public final class OverlayInfo implements Parcelable { * * @return true if the overlay is enabled, else false. */ + @UnsupportedAppUsage public boolean isEnabled() { switch (state) { case STATE_ENABLED: diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 0e91a2927c79..0c9325fe1fb5 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.annotation.UnsupportedAppUsage; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Configuration.NativeConfig; @@ -221,6 +222,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * See {@link android.R.attr#resizeableActivity}. * @hide */ + @UnsupportedAppUsage public int resizeMode = RESIZE_MODE_RESIZEABLE; /** @@ -354,6 +356,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * {@link android.R.attr#showForAllUsers} attribute. * @hide */ + @UnsupportedAppUsage public static final int FLAG_SHOW_FOR_ALL_USERS = 0x0400; /** * Bit in {@link #flags} corresponding to an immersive activity @@ -475,6 +478,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * this activity is launched into such a container a SecurityException will be * thrown. Set from the {@link android.R.attr#allowEmbedded} attribute. */ + @UnsupportedAppUsage public static final int FLAG_ALLOW_EMBEDDED = 0x80000000; /** @@ -815,6 +819,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public static @NativeConfig int activityInfoConfigJavaToNative(@Config int input) { int output = 0; for (int i = 0; i < CONFIG_NATIVE_BITS.length; i++) { @@ -1046,11 +1051,13 @@ public class ActivityInfo extends ComponentInfo implements Parcelable { * Returns true if the activity supports picture-in-picture. * @hide */ + @UnsupportedAppUsage public boolean supportsPictureInPicture() { return (flags & FLAG_SUPPORTS_PICTURE_IN_PICTURE) != 0; } /** @hide */ + @UnsupportedAppUsage public static boolean isResizeableMode(int mode) { return mode == RESIZE_MODE_RESIZEABLE || mode == RESIZE_MODE_FORCE_RESIZEABLE diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index d65e051b70b4..d2611563d0aa 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -22,6 +22,7 @@ import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; @@ -127,6 +128,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public int fullBackupContent = 0; /** @@ -477,6 +479,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ + @UnsupportedAppUsage public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3; /** @@ -649,6 +652,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants. * @hide */ + @UnsupportedAppUsage public @ApplicationInfoPrivateFlags int privateFlags; /** @@ -702,8 +706,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public UUID storageUuid; /** {@hide} */ + @UnsupportedAppUsage public String scanSourceDir; /** {@hide} */ + @UnsupportedAppUsage public String scanPublicSourceDir; /** @@ -769,6 +775,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ + @UnsupportedAppUsage public String[] resourceDirs; /** @@ -845,6 +852,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public String secondaryNativeLibraryDir; /** @@ -856,6 +864,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public String nativeLibraryRootDir; /** @@ -875,6 +884,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ + @UnsupportedAppUsage public String primaryCpuAbi; /** @@ -884,6 +894,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ + @UnsupportedAppUsage public String secondaryCpuAbi; /** @@ -923,6 +934,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * @hide */ @Deprecated + @UnsupportedAppUsage public int versionCode; /** @@ -958,12 +970,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * For convenient access to the current enabled setting of this app. * @hide */ + @UnsupportedAppUsage public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; /** * For convenient access to package's install location. * @hide */ + @UnsupportedAppUsage public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; /** @@ -1369,6 +1383,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * @return true if "supportsRtl" has been set to true in the AndroidManifest * @hide */ + @UnsupportedAppUsage public boolean hasRtlSupport() { return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL; } @@ -1397,7 +1412,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return sCollator.compare(sa.toString(), sb.toString()); } + @UnsupportedAppUsage private final Collator sCollator = Collator.getInstance(); + @UnsupportedAppUsage private PackageManager mPM; } @@ -1633,6 +1650,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public void disableCompatibilityMode() { flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | @@ -1757,6 +1775,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { return pm.getDefaultActivityIcon(); } + @UnsupportedAppUsage private boolean isPackageUnavailable(PackageManager pm) { try { return pm.getPackageInfo(packageName, 0) == null; @@ -1792,6 +1811,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public boolean isForwardLocked() { return (privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0; } @@ -1892,10 +1912,14 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { /** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; } /** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; } - /** {@hide} */ public String getCodePath() { return scanSourceDir; } + /** {@hide} */ + @UnsupportedAppUsage + public String getCodePath() { return scanSourceDir; } /** {@hide} */ public String getBaseCodePath() { return sourceDir; } /** {@hide} */ public String[] getSplitCodePaths() { return splitSourceDirs; } /** {@hide} */ public String getResourcePath() { return scanPublicSourceDir; } - /** {@hide} */ public String getBaseResourcePath() { return publicSourceDir; } + /** {@hide} */ + @UnsupportedAppUsage + public String getBaseResourcePath() { return publicSourceDir; } /** {@hide} */ public String[] getSplitResourcePaths() { return splitPublicSourceDirs; } } diff --git a/core/java/android/content/pm/BaseParceledListSlice.java b/core/java/android/content/pm/BaseParceledListSlice.java index 5877a09b7759..a3e5d6d43588 100644 --- a/core/java/android/content/pm/BaseParceledListSlice.java +++ b/core/java/android/content/pm/BaseParceledListSlice.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Binder; import android.os.IBinder; import android.os.Parcel; @@ -132,6 +133,7 @@ abstract class BaseParceledListSlice<T> implements Parcelable { } } + @UnsupportedAppUsage public List<T> getList() { return mList; } @@ -205,6 +207,7 @@ abstract class BaseParceledListSlice<T> implements Parcelable { protected abstract void writeElement(T parcelable, Parcel reply, int callFlags); + @UnsupportedAppUsage protected abstract void writeParcelableCreator(T parcelable, Parcel dest); protected abstract Parcelable.Creator<?> readParcelableCreator(Parcel from, ClassLoader loader); diff --git a/core/java/android/content/pm/ComponentInfo.java b/core/java/android/content/pm/ComponentInfo.java index 0269b6c3e5e1..29612c25d0cd 100644 --- a/core/java/android/content/pm/ComponentInfo.java +++ b/core/java/android/content/pm/ComponentInfo.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.graphics.drawable.Drawable; import android.os.Parcel; @@ -162,6 +163,7 @@ public class ComponentInfo extends PackageItemInfo { } /** {@hide} */ + @UnsupportedAppUsage public ComponentName getComponentName() { return new ComponentName(packageName, name); } diff --git a/core/java/android/content/pm/LauncherActivityInfo.java b/core/java/android/content/pm/LauncherActivityInfo.java index e9c958857d5c..1451431b7852 100644 --- a/core/java/android/content/pm/LauncherActivityInfo.java +++ b/core/java/android/content/pm/LauncherActivityInfo.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; @@ -35,6 +36,7 @@ public class LauncherActivityInfo { private final PackageManager mPm; + @UnsupportedAppUsage private ActivityInfo mActivityInfo; private ComponentName mComponentName; private UserHandle mUser; diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index fa423e29406a..46877ca9fe5c 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -23,6 +23,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemService; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; @@ -135,7 +136,9 @@ public class LauncherApps { "android.content.pm.extra.PIN_ITEM_REQUEST"; private final Context mContext; + @UnsupportedAppUsage private final ILauncherApps mService; + @UnsupportedAppUsage private final PackageManager mPm; private final UserManager mUserManager; @@ -1055,6 +1058,7 @@ public class LauncherApps { shortcut.getUserId()); } + @UnsupportedAppUsage private void startShortcut(@NonNull String packageName, @NonNull String shortcutId, @Nullable Rect sourceBounds, @Nullable Bundle startActivityOptions, int userId) { diff --git a/core/java/android/content/pm/PackageInfo.java b/core/java/android/content/pm/PackageInfo.java index 5d8122f65c71..d9d177760243 100644 --- a/core/java/android/content/pm/PackageInfo.java +++ b/core/java/android/content/pm/PackageInfo.java @@ -17,6 +17,7 @@ package android.content.pm; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -297,6 +298,7 @@ public class PackageInfo implements Parcelable { * the {@link android.R.attr#installLocation} attribute. * @hide */ + @UnsupportedAppUsage public static final int INSTALL_LOCATION_UNSPECIFIED = -1; /** @@ -329,6 +331,7 @@ public class PackageInfo implements Parcelable { public boolean isStub; /** @hide */ + @UnsupportedAppUsage public boolean coreApp; /** @hide */ @@ -346,6 +349,7 @@ public class PackageInfo implements Parcelable { * Package name of target package, or null. * @hide */ + @UnsupportedAppUsage public String overlayTarget; /** @@ -483,6 +487,7 @@ public class PackageInfo implements Parcelable { } }; + @UnsupportedAppUsage private PackageInfo(Parcel source) { packageName = source.readString(); splitNames = source.createStringArray(); diff --git a/core/java/android/content/pm/PackageInfoLite.java b/core/java/android/content/pm/PackageInfoLite.java index bbf020d76c92..e0e67b9321aa 100644 --- a/core/java/android/content/pm/PackageInfoLite.java +++ b/core/java/android/content/pm/PackageInfoLite.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -115,6 +116,7 @@ public class PackageInfoLite implements Parcelable { } } + @UnsupportedAppUsage public static final Parcelable.Creator<PackageInfoLite> CREATOR = new Parcelable.Creator<PackageInfoLite>() { public PackageInfoLite createFromParcel(Parcel source) { diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java index 25af1a76700f..b3a18292ab76 100644 --- a/core/java/android/content/pm/PackageInstaller.java +++ b/core/java/android/content/pm/PackageInstaller.java @@ -23,6 +23,7 @@ import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.AppGlobals; import android.content.Intent; @@ -788,6 +789,7 @@ public class PackageInstaller { } /** {@hide} */ + @UnsupportedAppUsage public void addProgress(float progress) { try { mSession.addClientProgress(progress); @@ -1090,26 +1092,33 @@ public class PackageInstaller { public static final int UID_UNKNOWN = -1; /** {@hide} */ + @UnsupportedAppUsage public int mode = MODE_INVALID; /** {@hide} */ + @UnsupportedAppUsage public int installFlags; /** {@hide} */ public int installLocation = PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY; /** {@hide} */ public @InstallReason int installReason = PackageManager.INSTALL_REASON_UNKNOWN; /** {@hide} */ + @UnsupportedAppUsage public long sizeBytes = -1; /** {@hide} */ + @UnsupportedAppUsage public String appPackageName; /** {@hide} */ + @UnsupportedAppUsage public Bitmap appIcon; /** {@hide} */ + @UnsupportedAppUsage public String appLabel; /** {@hide} */ public long appIconLastModified = -1; /** {@hide} */ public Uri originatingUri; /** {@hide} */ + @UnsupportedAppUsage public int originatingUid = UID_UNKNOWN; /** {@hide} */ public Uri referrerUri; @@ -1420,29 +1429,40 @@ public class PackageInstaller { public static class SessionInfo implements Parcelable { /** {@hide} */ + @UnsupportedAppUsage public int sessionId; /** {@hide} */ + @UnsupportedAppUsage public String installerPackageName; /** {@hide} */ + @UnsupportedAppUsage public String resolvedBaseCodePath; /** {@hide} */ + @UnsupportedAppUsage public float progress; /** {@hide} */ + @UnsupportedAppUsage public boolean sealed; /** {@hide} */ + @UnsupportedAppUsage public boolean active; /** {@hide} */ + @UnsupportedAppUsage public int mode; /** {@hide} */ public @InstallReason int installReason; /** {@hide} */ + @UnsupportedAppUsage public long sizeBytes; /** {@hide} */ + @UnsupportedAppUsage public String appPackageName; /** {@hide} */ + @UnsupportedAppUsage public Bitmap appIcon; /** {@hide} */ + @UnsupportedAppUsage public CharSequence appLabel; /** {@hide} */ @@ -1459,6 +1479,7 @@ public class PackageInstaller { public int installFlags; /** {@hide} */ + @UnsupportedAppUsage public SessionInfo() { } diff --git a/core/java/android/content/pm/PackageItemInfo.java b/core/java/android/content/pm/PackageItemInfo.java index 52e28a4b4b9b..79c426791a50 100644 --- a/core/java/android/content/pm/PackageItemInfo.java +++ b/core/java/android/content/pm/PackageItemInfo.java @@ -22,6 +22,7 @@ import android.annotation.FloatRange; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -98,6 +99,7 @@ public class PackageItemInfo { private static volatile boolean sForceSafeLabels = false; /** {@hide} */ + @UnsupportedAppUsage public static void setForceSafeLabels(boolean forceSafeLabels) { sForceSafeLabels = forceSafeLabels; } diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 7253e7758008..5cbd18538fd1 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -29,6 +29,7 @@ import android.annotation.SdkConstant.SdkConstantType; import android.annotation.StringRes; import android.annotation.SystemApi; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.annotation.UserIdInt; import android.annotation.XmlRes; import android.app.ActivityManager; @@ -707,6 +708,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public static final int INSTALL_REPLACE_EXISTING = 0x00000002; /** @@ -1300,6 +1302,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public static final int NO_NATIVE_LIBRARIES = -114; /** {@hide} */ @@ -1524,6 +1527,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public static final int MOVE_INTERNAL = 0x00000001; /** @@ -1532,6 +1536,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; /** {@hide} */ @@ -3063,6 +3068,7 @@ public abstract class PackageManager { * @hide */ @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) + @UnsupportedAppUsage public abstract PackageInfo getPackageInfoAsUser(String packageName, @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; @@ -3192,6 +3198,7 @@ public abstract class PackageManager { * found on the system. * @hide */ + @UnsupportedAppUsage public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) throws NameNotFoundException; @@ -3209,6 +3216,7 @@ public abstract class PackageManager { * found on the system. * @hide */ + @UnsupportedAppUsage public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; @@ -3296,6 +3304,7 @@ public abstract class PackageManager { @ApplicationInfoFlags int flags) throws NameNotFoundException; /** {@hide} */ + @UnsupportedAppUsage public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; @@ -3636,6 +3645,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public abstract boolean shouldShowRequestPermissionRationale(String permission); /** @@ -3647,6 +3657,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { if (ArrayUtils.isEmpty(permissions)) { throw new IllegalArgumentException("permission cannot be null or empty"); @@ -3747,6 +3758,7 @@ public abstract class PackageManager { * found on the system. * @hide */ + @UnsupportedAppUsage public abstract int getUidForSharedUser(String sharedUserName) throws NameNotFoundException; @@ -4074,6 +4086,7 @@ public abstract class PackageManager { * containing something else, such as the activity resolver. * @hide */ + @UnsupportedAppUsage public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); @@ -4112,6 +4125,7 @@ public abstract class PackageManager { * empty list is returned. * @hide */ + @UnsupportedAppUsage public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); @@ -4177,12 +4191,14 @@ public abstract class PackageManager { /** * @hide */ + @UnsupportedAppUsage public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); /** {@hide} */ @Deprecated + @UnsupportedAppUsage public List<ResolveInfo> queryBroadcastReceivers(Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId) { final String msg = "Shame on you for calling the hidden API " @@ -4240,6 +4256,7 @@ public abstract class PackageManager { * empty list or null is returned. * @hide */ + @UnsupportedAppUsage public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); @@ -4255,6 +4272,7 @@ public abstract class PackageManager { * no matching services, an empty list or null is returned. * @hide */ + @UnsupportedAppUsage public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); @@ -4292,6 +4310,7 @@ public abstract class PackageManager { * provider. If a provider was not found, returns null. * @hide */ + @UnsupportedAppUsage public abstract ProviderInfo resolveContentProviderAsUser(String name, @ComponentInfoFlags int flags, @UserIdInt int userId); @@ -4653,6 +4672,7 @@ public abstract class PackageManager { * @return the drawable or null if no drawable is required. * @hide */ + @UnsupportedAppUsage public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); /** @@ -4669,6 +4689,7 @@ public abstract class PackageManager { * @return the drawable or null if no drawable is required. * @hide */ + @UnsupportedAppUsage public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); /** @@ -4782,6 +4803,7 @@ public abstract class PackageManager { throws NameNotFoundException; /** @hide */ + @UnsupportedAppUsage public abstract Resources getResourcesForApplicationAsUser(String appPackageName, @UserIdInt int userId) throws NameNotFoundException; @@ -4844,6 +4866,7 @@ public abstract class PackageManager { @RequiresPermission(anyOf = { Manifest.permission.INSTALL_PACKAGES, Manifest.permission.INTERACT_ACROSS_USERS_FULL}) + @UnsupportedAppUsage public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) throws NameNotFoundException; @@ -5076,6 +5099,7 @@ public abstract class PackageManager { * @hide */ @RequiresPermission(Manifest.permission.DELETE_PACKAGES) + @UnsupportedAppUsage public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, @DeleteFlags int flags); @@ -5097,6 +5121,7 @@ public abstract class PackageManager { @RequiresPermission(anyOf = { Manifest.permission.DELETE_PACKAGES, Manifest.permission.INTERACT_ACROSS_USERS_FULL}) + @UnsupportedAppUsage public abstract void deletePackageAsUser(@NonNull String packageName, IPackageDeleteObserver observer, @DeleteFlags int flags, @UserIdInt int userId); @@ -5123,6 +5148,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public abstract void clearApplicationUserData(String packageName, IPackageDataObserver observer); /** @@ -5141,6 +5167,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public abstract void deleteApplicationCacheFiles(String packageName, IPackageDataObserver observer); @@ -5162,6 +5189,7 @@ public abstract class PackageManager { * callback is desired. * @hide */ + @UnsupportedAppUsage public abstract void deleteApplicationCacheFilesAsUser(String packageName, int userId, IPackageDataObserver observer); @@ -5187,11 +5215,13 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { freeStorageAndNotify(null, freeStorageSize, observer); } /** {@hide} */ + @UnsupportedAppUsage public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, IPackageDataObserver observer); @@ -5218,11 +5248,13 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public void freeStorage(long freeStorageSize, IntentSender pi) { freeStorage(null, freeStorageSize, pi); } /** {@hide} */ + @UnsupportedAppUsage public abstract void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi); /** @@ -5245,6 +5277,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, IPackageStatsObserver observer); @@ -5256,6 +5289,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { getPackageSizeInfoAsUser(packageName, getUserId(), observer); } @@ -5316,6 +5350,7 @@ public abstract class PackageManager { to. * @hide */ + @UnsupportedAppUsage public void addPreferredActivityAsUser(IntentFilter filter, int match, ComponentName[] set, ComponentName activity, @UserIdInt int userId) { throw new RuntimeException("Not implemented. Must override in a subclass."); @@ -5343,6 +5378,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public abstract void replacePreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity); @@ -5350,6 +5386,7 @@ public abstract class PackageManager { * @hide */ @Deprecated + @UnsupportedAppUsage public void replacePreferredActivityAsUser(IntentFilter filter, int match, ComponentName[] set, ComponentName activity, @UserIdInt int userId) { throw new RuntimeException("Not implemented. Must override in a subclass."); @@ -5391,6 +5428,7 @@ public abstract class PackageManager { * default, if any. * @hide */ + @UnsupportedAppUsage public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); /** @@ -5453,6 +5491,7 @@ public abstract class PackageManager { * @param userId Ther userId of the user whose restrictions are to be flushed. * @hide */ + @UnsupportedAppUsage public abstract void flushPackageRestrictionsAsUser(int userId); /** @@ -5462,6 +5501,7 @@ public abstract class PackageManager { * or by installing it, such as with {@link #installExistingPackage(String)} * @hide */ + @UnsupportedAppUsage public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, UserHandle userHandle); @@ -5470,6 +5510,7 @@ public abstract class PackageManager { * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) * @hide */ + @UnsupportedAppUsage public abstract boolean getApplicationHiddenSettingAsUser(String packageName, UserHandle userHandle); @@ -5508,11 +5549,13 @@ public abstract class PackageManager { * application's AndroidManifest.xml. * @hide */ + @UnsupportedAppUsage public abstract KeySet getKeySetByAlias(String packageName, String alias); /** Return the signing {@link KeySet} for this application. * @hide */ + @UnsupportedAppUsage public abstract KeySet getSigningKeySet(String packageName); /** @@ -5522,6 +5565,7 @@ public abstract class PackageManager { * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. * @hide */ + @UnsupportedAppUsage public abstract boolean isSignedBy(String packageName, KeySet ks); /** @@ -5530,6 +5574,7 @@ public abstract class PackageManager { * {@link #isSignedBy(String packageName, KeySet ks)}. * @hide */ + @UnsupportedAppUsage public abstract boolean isSignedByExactly(String packageName, KeySet ks); /** @@ -5592,6 +5637,7 @@ public abstract class PackageManager { * @throws IllegalArgumentException if the package was not found. * @hide */ + @UnsupportedAppUsage public abstract boolean isPackageSuspendedForUser(String packageName, int userId); /** @@ -5683,18 +5729,24 @@ public abstract class PackageManager { } /** {@hide} */ + @UnsupportedAppUsage public abstract int getMoveStatus(int moveId); /** {@hide} */ + @UnsupportedAppUsage public abstract void registerMoveCallback(MoveCallback callback, Handler handler); /** {@hide} */ + @UnsupportedAppUsage public abstract void unregisterMoveCallback(MoveCallback callback); /** {@hide} */ + @UnsupportedAppUsage public abstract int movePackage(String packageName, VolumeInfo vol); /** {@hide} */ + @UnsupportedAppUsage public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); /** {@hide} */ + @UnsupportedAppUsage public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); /** {@hide} */ @@ -5718,6 +5770,7 @@ public abstract class PackageManager { * * @hide */ + @UnsupportedAppUsage public abstract boolean isUpgrade(); /** @@ -5739,6 +5792,7 @@ public abstract class PackageManager { * {@link #ONLY_IF_NO_MATCH_FOUND}. * @hide */ + @UnsupportedAppUsage public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId, int flags); @@ -5749,22 +5803,27 @@ public abstract class PackageManager { * @param sourceUserId The source user id. * @hide */ + @UnsupportedAppUsage public abstract void clearCrossProfileIntentFilters(int sourceUserId); /** * @hide */ + @UnsupportedAppUsage public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); /** * @hide */ + @UnsupportedAppUsage public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); /** {@hide} */ + @UnsupportedAppUsage public abstract boolean isPackageAvailable(String packageName); /** {@hide} */ + @UnsupportedAppUsage public static String installStatusToString(int status, String msg) { final String str = installStatusToString(status); if (msg != null) { @@ -5775,6 +5834,7 @@ public abstract class PackageManager { } /** {@hide} */ + @UnsupportedAppUsage public static String installStatusToString(int status) { switch (status) { case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; @@ -5885,6 +5945,7 @@ public abstract class PackageManager { } /** {@hide} */ + @UnsupportedAppUsage public static String deleteStatusToString(int status) { switch (status) { case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 3f8a390c215e..89a72c96ec64 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -45,6 +45,7 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Intent; @@ -243,7 +244,9 @@ public class PackageParser { /** @hide */ public static class NewPermissionInfo { + @UnsupportedAppUsage public final String name; + @UnsupportedAppUsage public final int sdkVersion; public final int fileVersion; @@ -276,6 +279,7 @@ public class PackageParser { * granted during a platform update. * @hide */ + @UnsupportedAppUsage public static final PackageParser.NewPermissionInfo NEW_PERMISSIONS[] = new PackageParser.NewPermissionInfo[] { new PackageParser.NewPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, @@ -315,6 +319,7 @@ public class PackageParser { private String[] mSeparateProcesses; private boolean mOnlyCoreApps; private DisplayMetrics mMetrics; + @UnsupportedAppUsage private Callback mCallback; private File mCacheDir; @@ -382,9 +387,11 @@ public class PackageParser { * Lightweight parsed details about a single package. */ public static class PackageLite { + @UnsupportedAppUsage public final String packageName; public final int versionCode; public final int versionCodeMajor; + @UnsupportedAppUsage public final int installLocation; public final VerifierInfo[] verifiers; @@ -540,11 +547,13 @@ public class PackageParser { private static final String TAG = "PackageParser"; + @UnsupportedAppUsage public PackageParser() { mMetrics = new DisplayMetrics(); mMetrics.setToDefaults(); } + @UnsupportedAppUsage public void setSeparateProcesses(String[] procs) { mSeparateProcesses = procs; } @@ -624,6 +633,7 @@ public class PackageParser { * @param p the parsed package. * @param flags indicating which optional information is included. */ + @UnsupportedAppUsage public static PackageInfo generatePackageInfo(PackageParser.Package p, int gids[], int flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, PackageUserState state) { @@ -650,6 +660,7 @@ public class PackageParser { return checkUseInstalledOrHidden(0, state, null); } + @UnsupportedAppUsage public static PackageInfo generatePackageInfo(PackageParser.Package p, int gids[], int flags, long firstInstallTime, long lastUpdateTime, Set<String> grantedPermissions, PackageUserState state, int userId) { @@ -876,6 +887,7 @@ public class PackageParser { * * @see PackageParser#parsePackage(File, int) */ + @UnsupportedAppUsage public static PackageLite parsePackageLite(File packageFile, int flags) throws PackageParserException { if (packageFile.isDirectory()) { @@ -1000,6 +1012,7 @@ public class PackageParser { * * @see #parsePackageLite(File, int) */ + @UnsupportedAppUsage public Package parsePackage(File packageFile, int flags, boolean useCaches) throws PackageParserException { Package parsed = useCaches ? getCachedResult(packageFile, flags) : null; @@ -1030,6 +1043,7 @@ public class PackageParser { /** * Equivalent to {@link #parsePackage(File, int, boolean)} with {@code useCaches == false}. */ + @UnsupportedAppUsage public Package parsePackage(File packageFile, int flags) throws PackageParserException { return parsePackage(packageFile, flags, false /* useCaches */); } @@ -1277,6 +1291,7 @@ public class PackageParser { * be marked private. */ @Deprecated + @UnsupportedAppUsage public Package parseMonolithicPackage(File apkFile, int flags) throws PackageParserException { final PackageLite lite = parseMonolithicPackageLite(apkFile, flags); if (mOnlyCoreApps) { @@ -1473,6 +1488,7 @@ public class PackageParser { * populating {@link Package#mSigningDetails}. Also asserts that all APK * contents are signed correctly and consistently. */ + @UnsupportedAppUsage public static void collectCertificates(Package pkg, boolean skipVerify) throws PackageParserException { collectCertificatesInternal(pkg, skipVerify); @@ -1501,6 +1517,7 @@ public class PackageParser { } } + @UnsupportedAppUsage private static void collectCertificates(Package pkg, File apkFile, boolean skipVerify) throws PackageParserException { final String apkPath = apkFile.getAbsolutePath(); @@ -1870,6 +1887,7 @@ public class PackageParser { * @throws XmlPullParserException * @throws IOException */ + @UnsupportedAppUsage private Package parseBaseApk(String apkPath, Resources res, XmlResourceParser parser, int flags, String[] outError) throws XmlPullParserException, IOException { final String splitName; @@ -3308,6 +3326,7 @@ public class PackageParser { * When adding new features, carefully consider if they should also be * supported by split APKs. */ + @UnsupportedAppUsage private boolean parseBaseApplication(Package owner, Resources res, XmlResourceParser parser, int flags, String[] outError) throws XmlPullParserException, IOException { @@ -5665,6 +5684,7 @@ public class PackageParser { } @Nullable + @UnsupportedAppUsage public final Signature[] signatures; @SignatureSchemeVersion public final int signatureSchemeVersion; @@ -6130,28 +6150,33 @@ public class PackageParser { private Signature[] mPastSigningCertificates; private int[] mPastSigningCertificatesFlags; + @UnsupportedAppUsage public Builder() { } /** get signing certificates used to sign the current APK */ + @UnsupportedAppUsage public Builder setSignatures(Signature[] signatures) { mSignatures = signatures; return this; } /** set the signature scheme version used to sign the APK */ + @UnsupportedAppUsage public Builder setSignatureSchemeVersion(int signatureSchemeVersion) { mSignatureSchemeVersion = signatureSchemeVersion; return this; } /** set the signing certificates by which the APK proved it can be authenticated */ + @UnsupportedAppUsage public Builder setPastSigningCertificates(Signature[] pastSigningCertificates) { mPastSigningCertificates = pastSigningCertificates; return this; } /** set the flags for the {@code pastSigningCertificates} */ + @UnsupportedAppUsage public Builder setPastSigningCertificatesFlags(int[] pastSigningCertificatesFlags) { mPastSigningCertificatesFlags = pastSigningCertificatesFlags; return this; @@ -6180,6 +6205,7 @@ public class PackageParser { } } /** build a {@code SigningDetails} object */ + @UnsupportedAppUsage public SigningDetails build() throws CertificateException { checkInvariants(); @@ -6195,6 +6221,7 @@ public class PackageParser { */ public final static class Package implements Parcelable { + @UnsupportedAppUsage public String packageName; // The package name declared in the manifest as the package can be @@ -6238,18 +6265,28 @@ public class PackageParser { public boolean baseHardwareAccelerated; // For now we only support one application per package. + @UnsupportedAppUsage public ApplicationInfo applicationInfo = new ApplicationInfo(); + @UnsupportedAppUsage public final ArrayList<Permission> permissions = new ArrayList<Permission>(0); + @UnsupportedAppUsage public final ArrayList<PermissionGroup> permissionGroups = new ArrayList<PermissionGroup>(0); + @UnsupportedAppUsage public final ArrayList<Activity> activities = new ArrayList<Activity>(0); + @UnsupportedAppUsage public final ArrayList<Activity> receivers = new ArrayList<Activity>(0); + @UnsupportedAppUsage public final ArrayList<Provider> providers = new ArrayList<Provider>(0); + @UnsupportedAppUsage public final ArrayList<Service> services = new ArrayList<Service>(0); + @UnsupportedAppUsage public final ArrayList<Instrumentation> instrumentation = new ArrayList<Instrumentation>(0); + @UnsupportedAppUsage public final ArrayList<String> requestedPermissions = new ArrayList<String>(); + @UnsupportedAppUsage public ArrayList<String> protectedBroadcasts; public Package parentPackage; @@ -6258,11 +6295,14 @@ public class PackageParser { public String staticSharedLibName = null; public long staticSharedLibVersion = 0; public ArrayList<String> libraryNames = null; + @UnsupportedAppUsage public ArrayList<String> usesLibraries = null; public ArrayList<String> usesStaticLibraries = null; public long[] usesStaticLibrariesVersions = null; public String[][] usesStaticLibrariesCertDigests = null; + @UnsupportedAppUsage public ArrayList<String> usesOptionalLibraries = null; + @UnsupportedAppUsage public String[] usesLibraryFiles = null; public ArrayList<ActivityIntentInfo> preferredActivityFilters = null; @@ -6272,9 +6312,11 @@ public class PackageParser { public ArrayList<String> mAdoptPermissions = null; // We store the application meta-data independently to avoid multiple unwanted references + @UnsupportedAppUsage public Bundle mAppMetaData = null; // The version code declared for this package. + @UnsupportedAppUsage public int mVersionCode; // The major version code declared for this package. @@ -6286,19 +6328,24 @@ public class PackageParser { } // The version name declared for this package. + @UnsupportedAppUsage public String mVersionName; // The shared user id that this package wants to use. + @UnsupportedAppUsage public String mSharedUserId; // The shared user label that this package wants to use. + @UnsupportedAppUsage public int mSharedUserLabel; // Signatures that were read from the package. + @UnsupportedAppUsage @NonNull public SigningDetails mSigningDetails = SigningDetails.UNKNOWN; // For use by package manager service for quick lookup of // preferred up order. + @UnsupportedAppUsage public int mPreferredOrder = 0; // For use by package manager to keep track of when a package was last used. @@ -6312,17 +6359,21 @@ public class PackageParser { // public boolean mSetStopped = false; // Additional data supplied by callers. + @UnsupportedAppUsage public Object mExtras; // Applications hardware preferences + @UnsupportedAppUsage public ArrayList<ConfigurationInfo> configPreferences = null; // Applications requested features + @UnsupportedAppUsage public ArrayList<FeatureInfo> reqFeatures = null; // Applications requested feature groups public ArrayList<FeatureGroupInfo> featureGroups = null; + @UnsupportedAppUsage public int installLocation; public boolean coreApp; @@ -6347,7 +6398,9 @@ public class PackageParser { /** * Data used to feed the KeySetManagerService */ + @UnsupportedAppUsage public ArraySet<String> mUpgradeKeySets; + @UnsupportedAppUsage public ArrayMap<String, ArraySet<PublicKey>> mKeySetMapping; /** @@ -6373,6 +6426,7 @@ public class PackageParser { /** Whether or not the package is a stub and must be replaced by the full version. */ public boolean isStub; + @UnsupportedAppUsage public Package(String packageName) { this.packageName = packageName; this.manifestPackageName = packageName; @@ -6570,6 +6624,7 @@ public class PackageParser { return paths; } + @UnsupportedAppUsage public void setPackageName(String newName) { packageName = newName; applicationInfo.packageName = newName; @@ -7058,10 +7113,14 @@ public class PackageParser { } public static abstract class Component<II extends IntentInfo> { + @UnsupportedAppUsage public final ArrayList<II> intents; + @UnsupportedAppUsage public final String className; + @UnsupportedAppUsage public Bundle metaData; + @UnsupportedAppUsage public Package owner; /** The order of this component in relation to its peers */ public int order; @@ -7124,6 +7183,7 @@ public class PackageParser { componentShortName = clone.componentShortName; } + @UnsupportedAppUsage public ComponentName getComponentName() { if (componentName != null) { return componentName; @@ -7227,8 +7287,11 @@ public class PackageParser { } public final static class Permission extends Component<IntentInfo> implements Parcelable { + @UnsupportedAppUsage public final PermissionInfo info; + @UnsupportedAppUsage public boolean tree; + @UnsupportedAppUsage public PermissionGroup group; public Permission(Package _owner) { @@ -7236,6 +7299,7 @@ public class PackageParser { info = new PermissionInfo(); } + @UnsupportedAppUsage public Permission(Package _owner, PermissionInfo _info) { super(_owner); info = _info; @@ -7294,6 +7358,7 @@ public class PackageParser { } public final static class PermissionGroup extends Component<IntentInfo> implements Parcelable { + @UnsupportedAppUsage public final PermissionGroupInfo info; public PermissionGroup(Package _owner) { @@ -7384,6 +7449,7 @@ public class PackageParser { return false; } + @UnsupportedAppUsage public static ApplicationInfo generateApplicationInfo(Package p, int flags, PackageUserState state) { return generateApplicationInfo(p, flags, state, UserHandle.getCallingUserId()); @@ -7439,6 +7505,7 @@ public class PackageParser { ai.resourceDirs = state.overlayPaths; } + @UnsupportedAppUsage public static ApplicationInfo generateApplicationInfo(Package p, int flags, PackageUserState state, int userId) { if (p == null) return null; @@ -7496,6 +7563,7 @@ public class PackageParser { return ai; } + @UnsupportedAppUsage public static final PermissionInfo generatePermissionInfo( Permission p, int flags) { if (p == null) return null; @@ -7507,6 +7575,7 @@ public class PackageParser { return pi; } + @UnsupportedAppUsage public static final PermissionGroupInfo generatePermissionGroupInfo( PermissionGroup pg, int flags) { if (pg == null) return null; @@ -7519,6 +7588,7 @@ public class PackageParser { } public final static class Activity extends Component<ActivityIntentInfo> implements Parcelable { + @UnsupportedAppUsage public final ActivityInfo info; private boolean mHasMaxAspectRatio; @@ -7602,6 +7672,7 @@ public class PackageParser { }; } + @UnsupportedAppUsage public static final ActivityInfo generateActivityInfo(Activity a, int flags, PackageUserState state, int userId) { if (a == null) return null; @@ -7633,6 +7704,7 @@ public class PackageParser { } public final static class Service extends Component<ServiceIntentInfo> implements Parcelable { + @UnsupportedAppUsage public final ServiceInfo info; public Service(final ParseComponentArgs args, final ServiceInfo _info) { @@ -7692,6 +7764,7 @@ public class PackageParser { }; } + @UnsupportedAppUsage public static final ServiceInfo generateServiceInfo(Service s, int flags, PackageUserState state, int userId) { if (s == null) return null; @@ -7710,7 +7783,9 @@ public class PackageParser { } public final static class Provider extends Component<ProviderIntentInfo> implements Parcelable { + @UnsupportedAppUsage public final ProviderInfo info; + @UnsupportedAppUsage public boolean syncable; public Provider(final ParseComponentArgs args, final ProviderInfo _info) { @@ -7720,6 +7795,7 @@ public class PackageParser { syncable = false; } + @UnsupportedAppUsage public Provider(Provider existingProvider) { super(existingProvider); this.info = existingProvider.info; @@ -7786,6 +7862,7 @@ public class PackageParser { }; } + @UnsupportedAppUsage public static final ProviderInfo generateProviderInfo(Provider p, int flags, PackageUserState state, int userId) { if (p == null) return null; @@ -7810,6 +7887,7 @@ public class PackageParser { public final static class Instrumentation extends Component<IntentInfo> implements Parcelable { + @UnsupportedAppUsage public final InstrumentationInfo info; public Instrumentation(final ParsePackageItemArgs args, final InstrumentationInfo _info) { @@ -7867,6 +7945,7 @@ public class PackageParser { }; } + @UnsupportedAppUsage public static final InstrumentationInfo generateInstrumentationInfo( Instrumentation i, int flags) { if (i == null) return null; @@ -7879,14 +7958,21 @@ public class PackageParser { } public static abstract class IntentInfo extends IntentFilter { + @UnsupportedAppUsage public boolean hasDefault; + @UnsupportedAppUsage public int labelRes; + @UnsupportedAppUsage public CharSequence nonLocalizedLabel; + @UnsupportedAppUsage public int icon; + @UnsupportedAppUsage public int logo; + @UnsupportedAppUsage public int banner; public int preferred; + @UnsupportedAppUsage protected IntentInfo() { } @@ -7915,6 +8001,7 @@ public class PackageParser { } public final static class ActivityIntentInfo extends IntentInfo { + @UnsupportedAppUsage public Activity activity; public ActivityIntentInfo(Activity _activity) { @@ -7937,6 +8024,7 @@ public class PackageParser { } public final static class ServiceIntentInfo extends IntentInfo { + @UnsupportedAppUsage public Service service; public ServiceIntentInfo(Service _service) { @@ -7959,6 +8047,7 @@ public class PackageParser { } public static final class ProviderIntentInfo extends IntentInfo { + @UnsupportedAppUsage public Provider provider; public ProviderIntentInfo(Provider provider) { @@ -7983,6 +8072,7 @@ public class PackageParser { /** * @hide */ + @UnsupportedAppUsage public static void setCompatibilityModeEnabled(boolean compatibilityModeEnabled) { sCompatibilityModeEnabled = compatibilityModeEnabled; } diff --git a/core/java/android/content/pm/PackageStats.java b/core/java/android/content/pm/PackageStats.java index 27b3506f49a7..f70ec390e90e 100644 --- a/core/java/android/content/pm/PackageStats.java +++ b/core/java/android/content/pm/PackageStats.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.app.usage.StorageStatsManager; import android.os.Parcel; import android.os.Parcelable; @@ -37,6 +38,7 @@ public class PackageStats implements Parcelable { public String packageName; /** @hide */ + @UnsupportedAppUsage public int userHandle; /** Size of the code (e.g., APK) */ diff --git a/core/java/android/content/pm/PackageUserState.java b/core/java/android/content/pm/PackageUserState.java index f471a1d9b36c..3d0d787d47c4 100644 --- a/core/java/android/content/pm/PackageUserState.java +++ b/core/java/android/content/pm/PackageUserState.java @@ -27,6 +27,7 @@ import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS; import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS; import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY; +import android.annotation.UnsupportedAppUsage; import android.os.BaseBundle; import android.os.PersistableBundle; import android.util.ArraySet; @@ -66,6 +67,7 @@ public class PackageUserState { public String[] overlayPaths; + @UnsupportedAppUsage public PackageUserState() { installed = true; hidden = false; diff --git a/core/java/android/content/pm/ParceledListSlice.java b/core/java/android/content/pm/ParceledListSlice.java index d12e8846aabb..2eef16584c9d 100644 --- a/core/java/android/content/pm/ParceledListSlice.java +++ b/core/java/android/content/pm/ParceledListSlice.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -31,6 +32,7 @@ import java.util.List; * @hide */ public class ParceledListSlice<T extends Parcelable> extends BaseParceledListSlice<T> { + @UnsupportedAppUsage public ParceledListSlice(List<T> list) { super(list); } @@ -59,6 +61,7 @@ public class ParceledListSlice<T extends Parcelable> extends BaseParceledListSli } @Override + @UnsupportedAppUsage protected void writeParcelableCreator(T parcelable, Parcel dest) { dest.writeParcelableCreator((Parcelable) parcelable); } @@ -69,6 +72,7 @@ public class ParceledListSlice<T extends Parcelable> extends BaseParceledListSli } @SuppressWarnings("unchecked") + @UnsupportedAppUsage public static final Parcelable.ClassLoaderCreator<ParceledListSlice> CREATOR = new Parcelable.ClassLoaderCreator<ParceledListSlice>() { public ParceledListSlice createFromParcel(Parcel in) { diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 938409af90e9..f1ce6b1b360f 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -19,6 +19,7 @@ package android.content.pm; import android.annotation.IntDef; import android.annotation.SystemApi; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -307,6 +308,7 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public static String protectionToString(int level) { String protLevel = "????"; switch (level & PROTECTION_MASK_BASE) { diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java index 020e8c22b128..a8c3b889421b 100644 --- a/core/java/android/content/pm/RegisteredServicesCache.java +++ b/core/java/android/content/pm/RegisteredServicesCache.java @@ -17,6 +17,7 @@ package android.content.pm; import android.Manifest; +import android.annotation.UnsupportedAppUsage; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; @@ -145,6 +146,7 @@ public abstract class RegisteredServicesCache<V> { private RegisteredServicesCacheListener<V> mListener; private Handler mHandler; + @UnsupportedAppUsage public RegisteredServicesCache(Context context, String interfaceName, String metaDataName, String attributeName, XmlSerializerAndParser<V> serializerAndParser) { mContext = context; @@ -299,9 +301,12 @@ public abstract class RegisteredServicesCache<V> { * to bind to the service. */ public static class ServiceInfo<V> { + @UnsupportedAppUsage public final V type; public final ComponentInfo componentInfo; + @UnsupportedAppUsage public final ComponentName componentName; + @UnsupportedAppUsage public final int uid; /** @hide */ diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java index fc2eba282352..701c5dbc8398 100644 --- a/core/java/android/content/pm/ResolveInfo.java +++ b/core/java/android/content/pm/ResolveInfo.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.IntentFilter; import android.graphics.drawable.Drawable; @@ -149,6 +150,7 @@ public class ResolveInfo implements Parcelable { * If not equal to UserHandle.USER_CURRENT, then the intent will be forwarded to this user. * @hide */ + @UnsupportedAppUsage public int targetUserId; /** @@ -169,14 +171,17 @@ public class ResolveInfo implements Parcelable { /** * @hide Target comes from system process? */ + @UnsupportedAppUsage public boolean system; /** * @hide Does the associated IntentFilter comes from a Browser ? */ + @UnsupportedAppUsage public boolean handleAllWebDataURI; /** {@hide} */ + @UnsupportedAppUsage public ComponentInfo getComponentInfo() { if (activityInfo != null) return activityInfo; if (serviceInfo != null) return serviceInfo; diff --git a/core/java/android/content/pm/ShortcutInfo.java b/core/java/android/content/pm/ShortcutInfo.java index ea476b0abf33..546c21331dbd 100644 --- a/core/java/android/content/pm/ShortcutInfo.java +++ b/core/java/android/content/pm/ShortcutInfo.java @@ -19,6 +19,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.annotation.UserIdInt; import android.app.TaskStackBuilder; import android.content.ComponentName; @@ -1242,6 +1243,7 @@ public final class ShortcutInfo implements Parcelable { * @hide */ @Nullable + @UnsupportedAppUsage public Icon getIcon() { return mIcon; } diff --git a/core/java/android/content/pm/ShortcutManager.java b/core/java/android/content/pm/ShortcutManager.java index 25e0ccd8d551..925fa4a7c567 100644 --- a/core/java/android/content/pm/ShortcutManager.java +++ b/core/java/android/content/pm/ShortcutManager.java @@ -19,6 +19,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemService; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.annotation.UserIdInt; import android.app.Activity; import android.app.usage.UsageStatsManager; @@ -288,6 +289,7 @@ public class ShortcutManager { private static final String TAG = "ShortcutManager"; private final Context mContext; + @UnsupportedAppUsage private final IShortcutService mService; /** diff --git a/core/java/android/content/pm/Signature.java b/core/java/android/content/pm/Signature.java index a2a14eddd59f..e58ca609f1a8 100644 --- a/core/java/android/content/pm/Signature.java +++ b/core/java/android/content/pm/Signature.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -170,6 +171,7 @@ public class Signature implements Parcelable { * certificate; shouldn't happen. * @hide */ + @UnsupportedAppUsage public PublicKey getPublicKey() throws CertificateException { final CertificateFactory certFactory = CertificateFactory.getInstance("X.509"); final ByteArrayInputStream bais = new ByteArrayInputStream(mSignature); diff --git a/core/java/android/content/pm/UserInfo.java b/core/java/android/content/pm/UserInfo.java index f34b590e693c..b75ed35c36aa 100644 --- a/core/java/android/content/pm/UserInfo.java +++ b/core/java/android/content/pm/UserInfo.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.os.SystemProperties; @@ -41,6 +42,7 @@ public class UserInfo implements Parcelable { * Primary user. Only one user can have this flag set. It identifies the first human user * on a device. */ + @UnsupportedAppUsage public static final int FLAG_PRIMARY = 0x00000001; /** @@ -94,12 +96,19 @@ public class UserInfo implements Parcelable { public static final int NO_PROFILE_GROUP_ID = UserHandle.USER_NULL; + @UnsupportedAppUsage public int id; + @UnsupportedAppUsage public int serialNumber; + @UnsupportedAppUsage public String name; + @UnsupportedAppUsage public String iconPath; + @UnsupportedAppUsage public int flags; + @UnsupportedAppUsage public long creationTime; + @UnsupportedAppUsage public long lastLoggedInTime; public String lastLoggedInFingerprint; /** @@ -107,19 +116,24 @@ public class UserInfo implements Parcelable { * If this user is a child user, it would be its parent user id. * Otherwise, it would be {@link #NO_PROFILE_GROUP_ID}. */ + @UnsupportedAppUsage public int profileGroupId; public int restrictedProfileParentId; /** Which profile badge color/label to use. */ public int profileBadge; /** User is only partially created. */ + @UnsupportedAppUsage public boolean partial; + @UnsupportedAppUsage public boolean guestToRemove; + @UnsupportedAppUsage public UserInfo(int id, String name, int flags) { this(id, name, null, flags); } + @UnsupportedAppUsage public UserInfo(int id, String name, String iconPath, int flags) { this.id = id; this.name = name; @@ -129,26 +143,32 @@ public class UserInfo implements Parcelable { this.restrictedProfileParentId = NO_PROFILE_GROUP_ID; } + @UnsupportedAppUsage public boolean isPrimary() { return (flags & FLAG_PRIMARY) == FLAG_PRIMARY; } + @UnsupportedAppUsage public boolean isAdmin() { return (flags & FLAG_ADMIN) == FLAG_ADMIN; } + @UnsupportedAppUsage public boolean isGuest() { return (flags & FLAG_GUEST) == FLAG_GUEST; } + @UnsupportedAppUsage public boolean isRestricted() { return (flags & FLAG_RESTRICTED) == FLAG_RESTRICTED; } + @UnsupportedAppUsage public boolean isManagedProfile() { return (flags & FLAG_MANAGED_PROFILE) == FLAG_MANAGED_PROFILE; } + @UnsupportedAppUsage public boolean isEnabled() { return (flags & FLAG_DISABLED) != FLAG_DISABLED; } @@ -238,6 +258,7 @@ public class UserInfo implements Parcelable { profileBadge = orig.profileBadge; } + @UnsupportedAppUsage public UserHandle getUserHandle() { return new UserHandle(id); } @@ -267,6 +288,7 @@ public class UserInfo implements Parcelable { dest.writeInt(profileBadge); } + @UnsupportedAppUsage public static final Parcelable.Creator<UserInfo> CREATOR = new Parcelable.Creator<UserInfo>() { public UserInfo createFromParcel(Parcel source) { diff --git a/core/java/android/content/pm/VerifierInfo.java b/core/java/android/content/pm/VerifierInfo.java index 0a2b2832d319..b4e72e6659d0 100644 --- a/core/java/android/content/pm/VerifierInfo.java +++ b/core/java/android/content/pm/VerifierInfo.java @@ -16,6 +16,7 @@ package android.content.pm; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -43,6 +44,7 @@ public class VerifierInfo implements Parcelable { * not be {@code null} or empty. * @throws IllegalArgumentException if either argument is null or empty. */ + @UnsupportedAppUsage public VerifierInfo(String packageName, PublicKey publicKey) { if (packageName == null || packageName.length() == 0) { throw new IllegalArgumentException("packageName must not be null or empty"); diff --git a/core/java/android/content/pm/XmlSerializerAndParser.java b/core/java/android/content/pm/XmlSerializerAndParser.java index 20cb61c2ff2d..6d24800edb07 100644 --- a/core/java/android/content/pm/XmlSerializerAndParser.java +++ b/core/java/android/content/pm/XmlSerializerAndParser.java @@ -20,10 +20,13 @@ import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; +import android.annotation.UnsupportedAppUsage; import java.io.IOException; /** @hide */ public interface XmlSerializerAndParser<T> { + @UnsupportedAppUsage void writeAsXml(T item, XmlSerializer out) throws IOException; + @UnsupportedAppUsage T createFromXml(XmlPullParser parser) throws IOException, XmlPullParserException; } diff --git a/core/java/android/content/res/AssetFileDescriptor.java b/core/java/android/content/res/AssetFileDescriptor.java index be4103622b11..b6cbf08e5e78 100644 --- a/core/java/android/content/res/AssetFileDescriptor.java +++ b/core/java/android/content/res/AssetFileDescriptor.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.os.Bundle; import android.os.Parcel; import android.os.ParcelFileDescriptor; @@ -40,8 +41,11 @@ public class AssetFileDescriptor implements Parcelable, Closeable { */ public static final long UNKNOWN_LENGTH = -1; + @UnsupportedAppUsage private final ParcelFileDescriptor mFd; + @UnsupportedAppUsage private final long mStartOffset; + @UnsupportedAppUsage private final long mLength; private final Bundle mExtras; diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java index 289534273d13..17039272646f 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -23,6 +23,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringRes; import android.annotation.StyleRes; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo; import android.content.res.Configuration.NativeConfig; import android.os.ParcelFileDescriptor; @@ -65,6 +66,7 @@ public final class AssetManager implements AutoCloseable { private static final ApkAssets[] sEmptyApkAssets = new ApkAssets[0]; // Not private for LayoutLib's BridgeAssetManager. + @UnsupportedAppUsage @GuardedBy("sSync") static AssetManager sSystem = null; @GuardedBy("sSync") private static ApkAssets[] sSystemApkAssets = new ApkAssets[0]; @@ -95,6 +97,7 @@ public final class AssetManager implements AutoCloseable { @GuardedBy("this") private final long[] mOffsets = new long[2]; // Pointer to native implementation, stuffed inside a long. + @UnsupportedAppUsage @GuardedBy("this") private long mObject; // The loaded asset paths. @@ -152,6 +155,7 @@ public final class AssetManager implements AutoCloseable { * use by applications. * @hide */ + @UnsupportedAppUsage public AssetManager() { final ApkAssets[] assets; synchronized (sSync) { @@ -249,6 +253,7 @@ public final class AssetManager implements AutoCloseable { * system assets (no application assets). * @hide */ + @UnsupportedAppUsage public static AssetManager getSystem() { synchronized (sSync) { createSystemAssetsInZygoteLocked(); @@ -362,6 +367,7 @@ public final class AssetManager implements AutoCloseable { * @hide */ @Deprecated + @UnsupportedAppUsage public int addAssetPath(String path) { return addAssetPathInternal(path, false /*overlay*/, false /*appAsLib*/); } @@ -371,6 +377,7 @@ public final class AssetManager implements AutoCloseable { * @hide */ @Deprecated + @UnsupportedAppUsage public int addAssetPathAsSharedLibrary(String path) { return addAssetPathInternal(path, false /*overlay*/, true /*appAsLib*/); } @@ -380,6 +387,7 @@ public final class AssetManager implements AutoCloseable { * @hide */ @Deprecated + @UnsupportedAppUsage public int addOverlayPath(String path) { return addAssetPathInternal(path, true /*overlay*/, false /*appAsLib*/); } @@ -457,6 +465,7 @@ public final class AssetManager implements AutoCloseable { * @return {@code true} if the data was loaded into {@code outValue}, * {@code false} otherwise */ + @UnsupportedAppUsage boolean getResourceValue(@AnyRes int resId, int densityDpi, @NonNull TypedValue outValue, boolean resolveRefs) { Preconditions.checkNotNull(outValue, "outValue"); @@ -486,6 +495,7 @@ public final class AssetManager implements AutoCloseable { * @param resId the resource identifier to load * @return the string value, or {@code null} */ + @UnsupportedAppUsage @Nullable CharSequence getResourceText(@StringRes int resId) { synchronized (this) { final TypedValue outValue = mValue; @@ -504,6 +514,7 @@ public final class AssetManager implements AutoCloseable { * @param bagEntryId the index into the bag to load * @return the string value, or {@code null} */ + @UnsupportedAppUsage @Nullable CharSequence getResourceBagText(@StringRes int resId, int bagEntryId) { synchronized (this) { ensureValidLocked(); @@ -665,6 +676,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage @Nullable String getResourceName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); @@ -672,6 +684,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage @Nullable String getResourcePackageName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); @@ -679,6 +692,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage @Nullable String getResourceTypeName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); @@ -686,6 +700,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage @Nullable String getResourceEntryName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); @@ -693,6 +708,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage @AnyRes int getResourceIdentifier(@NonNull String name, @Nullable String defType, @Nullable String defPackage) { synchronized (this) { @@ -804,6 +820,7 @@ public final class AssetManager implements AutoCloseable { * @see #open(String) * @hide */ + @UnsupportedAppUsage public @NonNull InputStream openNonAsset(@NonNull String fileName) throws IOException { return openNonAsset(0, fileName, ACCESS_STREAMING); } @@ -824,6 +841,7 @@ public final class AssetManager implements AutoCloseable { * @see #open(String, int) * @hide */ + @UnsupportedAppUsage public @NonNull InputStream openNonAsset(@NonNull String fileName, int accessMode) throws IOException { return openNonAsset(0, fileName, accessMode); @@ -836,6 +854,7 @@ public final class AssetManager implements AutoCloseable { * @param fileName Name of the asset to retrieve. * @hide */ + @UnsupportedAppUsage public @NonNull InputStream openNonAsset(int cookie, @NonNull String fileName) throws IOException { return openNonAsset(cookie, fileName, ACCESS_STREAMING); @@ -849,6 +868,7 @@ public final class AssetManager implements AutoCloseable { * @param accessMode Desired access mode for retrieving the data. * @hide */ + @UnsupportedAppUsage public @NonNull InputStream openNonAsset(int cookie, @NonNull String fileName, int accessMode) throws IOException { Preconditions.checkNotNull(fileName, "fileName"); @@ -970,6 +990,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage void applyStyle(long themePtr, @AttrRes int defStyleAttr, @StyleRes int defStyleRes, @Nullable XmlBlock.Parser parser, @NonNull int[] inAttrs, long outValuesAddress, long outIndicesAddress) { @@ -984,6 +1005,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage boolean resolveAttrs(long themePtr, @AttrRes int defStyleAttr, @StyleRes int defStyleRes, @Nullable int[] inValues, @NonNull int[] inAttrs, @NonNull int[] outValues, @NonNull int[] outIndices) { @@ -999,6 +1021,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage boolean retrieveAttributes(@NonNull XmlBlock.Parser parser, @NonNull int[] inAttrs, @NonNull int[] outValues, @NonNull int[] outIndices) { Preconditions.checkNotNull(parser, "parser"); @@ -1014,6 +1037,7 @@ public final class AssetManager implements AutoCloseable { } } + @UnsupportedAppUsage long createTheme() { synchronized (this) { ensureValidLocked(); @@ -1066,6 +1090,7 @@ public final class AssetManager implements AutoCloseable { /** * @hide */ + @UnsupportedAppUsage public final int getAssetInt() { throw new UnsupportedOperationException(); } @@ -1073,6 +1098,7 @@ public final class AssetManager implements AutoCloseable { /** * @hide */ + @UnsupportedAppUsage public final long getNativeAsset() { return mAssetNativePtr; } @@ -1169,6 +1195,7 @@ public final class AssetManager implements AutoCloseable { * instantiate a new AssetManager class to see the new data. * @hide */ + @UnsupportedAppUsage public boolean isUpToDate() { for (ApkAssets apkAssets : getApkAssets()) { if (!apkAssets.isUpToDate()) { @@ -1228,6 +1255,7 @@ public final class AssetManager implements AutoCloseable { * applications. * @hide */ + @UnsupportedAppUsage public void setConfiguration(int mcc, int mnc, @Nullable String locale, int orientation, int touchscreen, int density, int keyboard, int keyboardHidden, int navigation, int screenWidth, int screenHeight, int smallestScreenWidthDp, int screenWidthDp, @@ -1244,6 +1272,7 @@ public final class AssetManager implements AutoCloseable { /** * @hide */ + @UnsupportedAppUsage public SparseArray<String> getAssignedPackageIdentifiers() { synchronized (this) { ensureValidLocked(); @@ -1367,6 +1396,7 @@ public final class AssetManager implements AutoCloseable { /** * @hide */ + @UnsupportedAppUsage public static native int getGlobalAssetCount(); /** @@ -1377,5 +1407,6 @@ public final class AssetManager implements AutoCloseable { /** * @hide */ + @UnsupportedAppUsage public static native int getGlobalAssetManagerCount(); } diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java index faf238164a09..16b9726a4b15 100644 --- a/core/java/android/content/res/ColorStateList.java +++ b/core/java/android/content/res/ColorStateList.java @@ -30,6 +30,7 @@ import com.android.internal.util.GrowingArrayUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; +import android.annotation.UnsupportedAppUsage; import android.util.AttributeSet; import android.util.Log; import android.util.MathUtils; @@ -132,16 +133,21 @@ public class ColorStateList extends ComplexColor implements Parcelable { private static final SparseArray<WeakReference<ColorStateList>> sCache = new SparseArray<>(); /** Lazily-created factory for this color state list. */ + @UnsupportedAppUsage private ColorStateListFactory mFactory; private int[][] mThemeAttrs; private @Config int mChangingConfigurations; + @UnsupportedAppUsage private int[][] mStateSpecs; + @UnsupportedAppUsage private int[] mColors; + @UnsupportedAppUsage private int mDefaultColor; private boolean mIsOpaque; + @UnsupportedAppUsage private ColorStateList() { // Not publicly instantiable. } @@ -394,6 +400,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { * @hide only for resource preloading */ @Override + @UnsupportedAppUsage public boolean canApplyTheme() { return mThemeAttrs != null; } @@ -474,6 +481,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { * @hide only for resource preloading */ @Override + @UnsupportedAppUsage public ColorStateList obtainForTheme(Theme t) { if (t == null || !canApplyTheme()) { return this; @@ -579,6 +587,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { * @return the states in this {@link ColorStateList} * @hide */ + @UnsupportedAppUsage public int[][] getStates() { return mStateSpecs; } @@ -590,6 +599,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { * @return the colors in this {@link ColorStateList} * @hide */ + @UnsupportedAppUsage public int[] getColors() { return mColors; } @@ -634,6 +644,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { /** * Updates the default color and opacity. */ + @UnsupportedAppUsage private void onColorsChanged() { int defaultColor = DEFAULT_COLOR; boolean isOpaque = true; @@ -677,6 +688,7 @@ public class ColorStateList extends ComplexColor implements Parcelable { private static class ColorStateListFactory extends ConstantState<ComplexColor> { private final ColorStateList mSrc; + @UnsupportedAppUsage public ColorStateListFactory(ColorStateList src) { mSrc = src; } diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java index 781e23533870..1ca7b132fdab 100644 --- a/core/java/android/content/res/CompatibilityInfo.java +++ b/core/java/android/content/res/CompatibilityInfo.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ApplicationInfo; import android.graphics.Canvas; import android.graphics.PointF; @@ -38,6 +39,7 @@ import android.view.WindowManager.LayoutParams; */ public class CompatibilityInfo implements Parcelable { /** default compatibility info object for compatible applications */ + @UnsupportedAppUsage public static final CompatibilityInfo DEFAULT_COMPATIBILITY_INFO = new CompatibilityInfo() { }; @@ -92,6 +94,7 @@ public class CompatibilityInfo implements Parcelable { /** * Application's scale. */ + @UnsupportedAppUsage public final float applicationScale; /** @@ -99,6 +102,7 @@ public class CompatibilityInfo implements Parcelable { */ public final float applicationInvertedScale; + @UnsupportedAppUsage public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, int sw, boolean forceCompat) { int compatFlags = 0; @@ -259,6 +263,7 @@ public class CompatibilityInfo implements Parcelable { applicationInvertedScale = invertedScale; } + @UnsupportedAppUsage private CompatibilityInfo() { this(NEVER_NEEDS_COMPAT, DisplayMetrics.DENSITY_DEVICE, 1.0f, @@ -268,10 +273,12 @@ public class CompatibilityInfo implements Parcelable { /** * @return true if the scaling is required */ + @UnsupportedAppUsage public boolean isScalingRequired() { return (mCompatibilityFlags&SCALING_REQUIRED) != 0; } + @UnsupportedAppUsage public boolean supportsScreen() { return (mCompatibilityFlags&NEEDS_SCREEN_COMPAT) == 0; } @@ -292,6 +299,7 @@ public class CompatibilityInfo implements Parcelable { * Returns the translator which translates the coordinates in compatibility mode. * @param params the window's parameter */ + @UnsupportedAppUsage public Translator getTranslator() { return isScalingRequired() ? new Translator() : null; } @@ -301,7 +309,9 @@ public class CompatibilityInfo implements Parcelable { * @hide */ public class Translator { + @UnsupportedAppUsage final public float applicationScale; + @UnsupportedAppUsage final public float applicationInvertedScale; private Rect mContentInsetsBuffer = null; @@ -321,6 +331,7 @@ public class CompatibilityInfo implements Parcelable { /** * Translate the screen rect to the application frame. */ + @UnsupportedAppUsage public void translateRectInScreenToAppWinFrame(Rect rect) { rect.scale(applicationInvertedScale); } @@ -328,6 +339,7 @@ public class CompatibilityInfo implements Parcelable { /** * Translate the region in window to screen. */ + @UnsupportedAppUsage public void translateRegionInWindowToScreen(Region transparentRegion) { transparentRegion.scale(applicationScale); } @@ -335,6 +347,7 @@ public class CompatibilityInfo implements Parcelable { /** * Apply translation to the canvas that is necessary to draw the content. */ + @UnsupportedAppUsage public void translateCanvas(Canvas canvas) { if (applicationScale == 1.5f) { /* When we scale for compatibility, we can put our stretched @@ -361,6 +374,7 @@ public class CompatibilityInfo implements Parcelable { /** * Translate the motion event captured on screen to the application's window. */ + @UnsupportedAppUsage public void translateEventInScreenToAppWindow(MotionEvent event) { event.scale(applicationInvertedScale); } @@ -369,6 +383,7 @@ public class CompatibilityInfo implements Parcelable { * Translate the window's layout parameter, from application's view to * Screen's view. */ + @UnsupportedAppUsage public void translateWindowLayout(WindowManager.LayoutParams params) { params.scale(applicationScale); } @@ -376,6 +391,7 @@ public class CompatibilityInfo implements Parcelable { /** * Translate a Rect in application's window to screen. */ + @UnsupportedAppUsage public void translateRectInAppWindowToScreen(Rect rect) { rect.scale(applicationScale); } @@ -383,6 +399,7 @@ public class CompatibilityInfo implements Parcelable { /** * Translate a Rect in screen coordinates into the app window's coordinates. */ + @UnsupportedAppUsage public void translateRectInScreenToAppWindow(Rect rect) { rect.scale(applicationInvertedScale); } @@ -410,6 +427,7 @@ public class CompatibilityInfo implements Parcelable { * Translate the content insets in application window to Screen. This uses * the internal buffer for content insets to avoid extra object allocation. */ + @UnsupportedAppUsage public Rect getTranslatedContentInsets(Rect contentInsets) { if (mContentInsetsBuffer == null) mContentInsetsBuffer = new Rect(); mContentInsetsBuffer.set(contentInsets); @@ -488,6 +506,7 @@ public class CompatibilityInfo implements Parcelable { * @param outDm If non-null the width and height will be set to their scaled values. * @return Returns the scaling factor for the window. */ + @UnsupportedAppUsage public static float computeCompatibleScaling(DisplayMetrics dm, DisplayMetrics outDm) { final int width = dm.noncompatWidthPixels; final int height = dm.noncompatHeightPixels; @@ -593,6 +612,7 @@ public class CompatibilityInfo implements Parcelable { dest.writeFloat(applicationInvertedScale); } + @UnsupportedAppUsage public static final Parcelable.Creator<CompatibilityInfo> CREATOR = new Parcelable.Creator<CompatibilityInfo>() { @Override diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 193e56ef404d..f7aea978f5d1 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -44,6 +44,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; +import android.annotation.UnsupportedAppUsage; import android.app.WindowConfiguration; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo.Config; @@ -127,6 +128,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration * questionable whether this is the right way to expose the functionality. * @hide */ + @UnsupportedAppUsage public boolean userSetLocale; @@ -793,6 +795,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration /** * @hide Internal book-keeping. */ + @UnsupportedAppUsage public int seq; /** @hide */ @@ -1207,6 +1210,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration } /** {@hide} */ + @UnsupportedAppUsage @Deprecated public void makeDefault() { setToDefaults(); } @@ -1978,6 +1982,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration * * @hide */ + @UnsupportedAppUsage public static String resourceQualifierString(Configuration config) { return resourceQualifierString(config, null); } @@ -2264,6 +2269,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration * This is fine for device configurations as no member is ever undefined. * {@hide} */ + @UnsupportedAppUsage public static Configuration generateDelta(Configuration base, Configuration change) { final Configuration delta = new Configuration(); if (base.fontScale != change.fontScale) { diff --git a/core/java/android/content/res/ConfigurationBoundResourceCache.java b/core/java/android/content/res/ConfigurationBoundResourceCache.java index 70290c4b0595..3af395a4fc19 100644 --- a/core/java/android/content/res/ConfigurationBoundResourceCache.java +++ b/core/java/android/content/res/ConfigurationBoundResourceCache.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo.Config; /** diff --git a/core/java/android/content/res/DrawableCache.java b/core/java/android/content/res/DrawableCache.java index 7b27fac2a44d..d4f0ca5f8ebf 100644 --- a/core/java/android/content/res/DrawableCache.java +++ b/core/java/android/content/res/DrawableCache.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.graphics.drawable.Drawable; /** @@ -31,6 +32,7 @@ class DrawableCache extends ThemedResourceCache<Drawable.ConstantState> { * @return a new instance of the resource, or {@code null} if not in * the cache */ + @UnsupportedAppUsage public Drawable getInstance(long key, Resources resources, Resources.Theme theme) { final Drawable.ConstantState entry = get(key, theme); if (entry != null) { diff --git a/core/java/android/content/res/ObbInfo.java b/core/java/android/content/res/ObbInfo.java index b653f9ff8c24..452fdce6f031 100644 --- a/core/java/android/content/res/ObbInfo.java +++ b/core/java/android/content/res/ObbInfo.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -53,6 +54,7 @@ public class ObbInfo implements Parcelable { * * @hide */ + @UnsupportedAppUsage public byte[] salt; // Only allow things in this package to instantiate. diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 7adea6a880be..94418aed3fe0 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -39,6 +39,7 @@ import android.annotation.RawRes; import android.annotation.StringRes; import android.annotation.StyleRes; import android.annotation.StyleableRes; +import android.annotation.UnsupportedAppUsage; import android.annotation.XmlRes; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo.Config; @@ -102,22 +103,28 @@ public class Resources { private static final Object sSync = new Object(); // Used by BridgeResources in layoutlib + @UnsupportedAppUsage static Resources mSystem = null; + @UnsupportedAppUsage private ResourcesImpl mResourcesImpl; // Pool of TypedArrays targeted to this Resources object. + @UnsupportedAppUsage final SynchronizedPool<TypedArray> mTypedArrayPool = new SynchronizedPool<>(5); /** Used to inflate drawable objects from XML. */ + @UnsupportedAppUsage private DrawableInflater mDrawableInflater; /** Lock object used to protect access to {@link #mTmpValue}. */ private final Object mTmpValueLock = new Object(); /** Single-item pool used to minimize TypedValue allocations. */ + @UnsupportedAppUsage private TypedValue mTmpValue = new TypedValue(); + @UnsupportedAppUsage final ClassLoader mClassLoader; /** @@ -149,6 +156,7 @@ public class Resources { * @return A theme resource identifier * @hide */ + @UnsupportedAppUsage public static int selectDefaultTheme(int curTheme, int targetSdkVersion) { return selectSystemTheme(curTheme, targetSdkVersion, com.android.internal.R.style.Theme, @@ -236,6 +244,7 @@ public class Resources { * class loader * @hide */ + @UnsupportedAppUsage public Resources(@Nullable ClassLoader classLoader) { mClassLoader = classLoader == null ? ClassLoader.getSystemClassLoader() : classLoader; } @@ -243,6 +252,7 @@ public class Resources { /** * Only for creating the System resources. */ + @UnsupportedAppUsage private Resources() { this(null); @@ -261,6 +271,7 @@ public class Resources { * and updates all Theme references to new implementations as well. * @hide */ + @UnsupportedAppUsage public void setImpl(ResourcesImpl impl) { if (impl == mResourcesImpl) { return; @@ -284,6 +295,7 @@ public class Resources { /** * @hide */ + @UnsupportedAppUsage public ResourcesImpl getImpl() { return mResourcesImpl; } @@ -299,6 +311,7 @@ public class Resources { * @return the inflater used to create drawable objects * @hide Pending API finalization. */ + @UnsupportedAppUsage public final DrawableInflater getDrawableInflater() { if (mDrawableInflater == null) { mDrawableInflater = new DrawableInflater(this, mClassLoader); @@ -892,6 +905,7 @@ public class Resources { } @NonNull + @UnsupportedAppUsage Drawable loadDrawable(@NonNull TypedValue value, int id, int density, @Nullable Theme theme) throws NotFoundException { return mResourcesImpl.loadDrawable(this, value, id, density, theme); @@ -1116,6 +1130,7 @@ public class Resources { * not exist or is not a floating-point value. * @hide Pending API council approval. */ + @UnsupportedAppUsage public float getFloat(int id) { final TypedValue value = obtainTempTypedValue(); try { @@ -1390,6 +1405,7 @@ public class Resources { * retrieve XML attributes with style and theme information applied. */ public final class Theme { + @UnsupportedAppUsage private ResourcesImpl.ThemeImpl mThemeImpl; private Theme() { @@ -1553,6 +1569,7 @@ public class Resources { * @hide */ @NonNull + @UnsupportedAppUsage public TypedArray resolveAttributes(@NonNull int[] values, @NonNull int[] attrs) { return mThemeImpl.resolveAttributes(this, values, attrs); } @@ -1842,6 +1859,7 @@ public class Resources { * * @hide */ + @UnsupportedAppUsage public static void updateSystemConfiguration(Configuration config, DisplayMetrics metrics, CompatibilityInfo compat) { if (mSystem != null) { @@ -1862,6 +1880,7 @@ public class Resources { } /** @hide */ + @UnsupportedAppUsage public DisplayAdjustments getDisplayAdjustments() { return mResourcesImpl.getDisplayAdjustments(); } @@ -1888,6 +1907,7 @@ public class Resources { * @return compatibility info. * @hide */ + @UnsupportedAppUsage public CompatibilityInfo getCompatibilityInfo() { return mResourcesImpl.getCompatibilityInfo(); } @@ -1897,6 +1917,7 @@ public class Resources { * @hide */ @VisibleForTesting + @UnsupportedAppUsage public void setCompatibilityInfo(CompatibilityInfo ci) { if (ci != null) { mResourcesImpl.updateConfiguration(null, null, ci); @@ -2134,6 +2155,7 @@ public class Resources { /** * @hide */ + @UnsupportedAppUsage public LongSparseArray<ConstantState> getPreloadedDrawables() { return mResourcesImpl.getPreloadedDrawables(); } @@ -2147,6 +2169,7 @@ public class Resources { * @throws NotFoundException if the file could not be loaded */ @NonNull + @UnsupportedAppUsage XmlResourceParser loadXmlResourceParser(@AnyRes int id, @NonNull String type) throws NotFoundException { final TypedValue value = obtainTempTypedValue(); @@ -2175,6 +2198,7 @@ public class Resources { * @throws NotFoundException if the file could not be loaded */ @NonNull + @UnsupportedAppUsage XmlResourceParser loadXmlResourceParser(String file, int id, int assetCookie, String type) throws NotFoundException { return mResourcesImpl.loadXmlResourceParser(file, id, assetCookie, type); diff --git a/core/java/android/content/res/ResourcesImpl.java b/core/java/android/content/res/ResourcesImpl.java index 8c980677fdd0..19e399a50724 100644 --- a/core/java/android/content/res/ResourcesImpl.java +++ b/core/java/android/content/res/ResourcesImpl.java @@ -25,6 +25,7 @@ import android.annotation.PluralsRes; import android.annotation.RawRes; import android.annotation.StyleRes; import android.annotation.StyleableRes; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo.Config; import android.content.res.AssetManager.AssetInputStream; @@ -79,7 +80,9 @@ public class ResourcesImpl { static final String TAG_PRELOAD = TAG + ".preload"; + @UnsupportedAppUsage private static final boolean TRACE_FOR_PRELOAD = false; // Do we still need it? + @UnsupportedAppUsage private static final boolean TRACE_FOR_MISS_PRELOAD = false; // Do we still need it? public static final boolean TRACE_FOR_DETAILED_PRELOAD = @@ -96,28 +99,37 @@ public class ResourcesImpl { private static final Object sSync = new Object(); private static boolean sPreloaded; + @UnsupportedAppUsage private boolean mPreloading; // Information about preloaded resources. Note that they are not // protected by a lock, because while preloading in zygote we are all // single-threaded, and after that these are immutable. + @UnsupportedAppUsage private static final LongSparseArray<Drawable.ConstantState>[] sPreloadedDrawables; + @UnsupportedAppUsage private static final LongSparseArray<Drawable.ConstantState> sPreloadedColorDrawables = new LongSparseArray<>(); + @UnsupportedAppUsage private static final LongSparseArray<android.content.res.ConstantState<ComplexColor>> sPreloadedComplexColors = new LongSparseArray<>(); /** Lock object used to protect access to caches and configuration. */ + @UnsupportedAppUsage private final Object mAccessLock = new Object(); // These are protected by mAccessLock. private final Configuration mTmpConfig = new Configuration(); + @UnsupportedAppUsage private final DrawableCache mDrawableCache = new DrawableCache(); + @UnsupportedAppUsage private final DrawableCache mColorDrawableCache = new DrawableCache(); private final ConfigurationBoundResourceCache<ComplexColor> mComplexColorCache = new ConfigurationBoundResourceCache<>(); + @UnsupportedAppUsage private final ConfigurationBoundResourceCache<Animator> mAnimatorCache = new ConfigurationBoundResourceCache<>(); + @UnsupportedAppUsage private final ConfigurationBoundResourceCache<StateListAnimator> mStateListAnimatorCache = new ConfigurationBoundResourceCache<>(); @@ -138,12 +150,14 @@ public class ResourcesImpl { private final XmlBlock[] mCachedXmlBlocks = new XmlBlock[XML_BLOCK_CACHE_SIZE]; + @UnsupportedAppUsage final AssetManager mAssets; private final DisplayMetrics mMetrics = new DisplayMetrics(); private final DisplayAdjustments mDisplayAdjustments; private PluralRules mPluralRule; + @UnsupportedAppUsage private final Configuration mConfiguration = new Configuration(); static { @@ -163,6 +177,7 @@ public class ResourcesImpl { * @param displayAdjustments this resource's Display override and compatibility info. * Must not be null. */ + @UnsupportedAppUsage public ResourcesImpl(@NonNull AssetManager assets, @Nullable DisplayMetrics metrics, @Nullable Configuration config, @NonNull DisplayAdjustments displayAdjustments) { mAssets = assets; @@ -176,10 +191,12 @@ public class ResourcesImpl { return mDisplayAdjustments; } + @UnsupportedAppUsage public AssetManager getAssets() { return mAssets; } + @UnsupportedAppUsage DisplayMetrics getDisplayMetrics() { if (DEBUG_CONFIG) Slog.v(TAG, "Returning DisplayMetrics: " + mMetrics.widthPixels + "x" + mMetrics.heightPixels + " " + mMetrics.density); @@ -207,6 +224,7 @@ public class ResourcesImpl { } } + @UnsupportedAppUsage void getValue(@AnyRes int id, TypedValue outValue, boolean resolveRefs) throws NotFoundException { boolean found = mAssets.getResourceValue(id, 0, outValue, resolveRefs); diff --git a/core/java/android/content/res/ResourcesKey.java b/core/java/android/content/res/ResourcesKey.java index b03ed1eee768..1db2dd85fb37 100644 --- a/core/java/android/content/res/ResourcesKey.java +++ b/core/java/android/content/res/ResourcesKey.java @@ -18,6 +18,7 @@ package android.content.res; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.text.TextUtils; import java.util.Arrays; @@ -26,9 +27,11 @@ import java.util.Objects; /** @hide */ public final class ResourcesKey { @Nullable + @UnsupportedAppUsage public final String mResDir; @Nullable + @UnsupportedAppUsage public final String[] mSplitResDirs; @Nullable @@ -47,6 +50,7 @@ public final class ResourcesKey { private final int mHash; + @UnsupportedAppUsage public ResourcesKey(@Nullable String resDir, @Nullable String[] splitResDirs, @Nullable String[] overlayDirs, diff --git a/core/java/android/content/res/StringBlock.java b/core/java/android/content/res/StringBlock.java index 5cfc41f2eae6..b5ec0f9f3712 100644 --- a/core/java/android/content/res/StringBlock.java +++ b/core/java/android/content/res/StringBlock.java @@ -16,6 +16,7 @@ package android.content.res; +import android.annotation.UnsupportedAppUsage; import android.graphics.Color; import android.text.*; import android.text.style.*; @@ -59,6 +60,7 @@ final class StringBlock { + ": " + nativeGetSize(mNative)); } + @UnsupportedAppUsage public CharSequence get(int idx) { synchronized (this) { if (mStrings != null) { @@ -478,6 +480,7 @@ final class StringBlock { * are doing! The given native object must exist for the entire lifetime * of this newly creating StringBlock. */ + @UnsupportedAppUsage StringBlock(long obj, boolean useSparse) { mNative = obj; mUseSparse = useSparse; diff --git a/core/java/android/content/res/ThemedResourceCache.java b/core/java/android/content/res/ThemedResourceCache.java index f1b1e74a697e..06cafdb2bb91 100644 --- a/core/java/android/content/res/ThemedResourceCache.java +++ b/core/java/android/content/res/ThemedResourceCache.java @@ -18,6 +18,7 @@ package android.content.res; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo.Config; import android.content.res.Resources.Theme; import android.content.res.Resources.ThemeKey; @@ -32,6 +33,7 @@ import java.lang.ref.WeakReference; * @param <T> type of data to cache */ abstract class ThemedResourceCache<T> { + @UnsupportedAppUsage private ArrayMap<ThemeKey, LongSparseArray<WeakReference<T>>> mThemedEntries; private LongSparseArray<WeakReference<T>> mUnthemedEntries; private LongSparseArray<WeakReference<T>> mNullThemedEntries; @@ -116,6 +118,7 @@ abstract class ThemedResourceCache<T> { * * @param configChanges a bitmask of configuration changes */ + @UnsupportedAppUsage public void onConfigurationChange(@Config int configChanges) { prune(configChanges); } diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java index cbb3c6df0558..30d2d5f73206 100644 --- a/core/java/android/content/res/TypedArray.java +++ b/core/java/android/content/res/TypedArray.java @@ -20,6 +20,7 @@ import android.annotation.AnyRes; import android.annotation.ColorInt; import android.annotation.Nullable; import android.annotation.StyleableRes; +import android.annotation.UnsupportedAppUsage; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo.Config; import android.graphics.Typeface; @@ -70,19 +71,29 @@ public class TypedArray { static final int STYLE_CHANGING_CONFIGURATIONS = 4; static final int STYLE_DENSITY = 5; + @UnsupportedAppUsage private final Resources mResources; + @UnsupportedAppUsage private DisplayMetrics mMetrics; + @UnsupportedAppUsage private AssetManager mAssets; + @UnsupportedAppUsage private boolean mRecycled; + @UnsupportedAppUsage /*package*/ XmlBlock.Parser mXml; + @UnsupportedAppUsage /*package*/ Resources.Theme mTheme; + @UnsupportedAppUsage /*package*/ int[] mData; /*package*/ long mDataAddress; + @UnsupportedAppUsage /*package*/ int[] mIndices; /*package*/ long mIndicesAddress; + @UnsupportedAppUsage /*package*/ int mLength; + @UnsupportedAppUsage /*package*/ TypedValue mValue = new TypedValue(); private void resize(int len) { @@ -276,6 +287,7 @@ public class TypedArray { * @throws RuntimeException if the TypedArray has already been recycled. * @hide */ + @UnsupportedAppUsage public String getNonConfigurationString(@StyleableRes int index, @Config int allowedChangingConfigs) { if (mRecycled) { @@ -1165,6 +1177,7 @@ public class TypedArray { * @hide */ @Nullable + @UnsupportedAppUsage public int[] extractThemeAttrs() { return extractThemeAttrs(null); } @@ -1173,6 +1186,7 @@ public class TypedArray { * @hide */ @Nullable + @UnsupportedAppUsage public int[] extractThemeAttrs(@Nullable int[] scrap) { if (mRecycled) { throw new RuntimeException("Cannot make calls to a recycled instance!"); @@ -1244,6 +1258,7 @@ public class TypedArray { return changingConfig; } + @UnsupportedAppUsage private boolean getValueAt(int index, TypedValue outValue) { final int[] data = mData; final int type = data[index + STYLE_TYPE]; diff --git a/core/java/android/content/res/XmlBlock.java b/core/java/android/content/res/XmlBlock.java index d4ccffb83ca5..4e1159a9bce9 100644 --- a/core/java/android/content/res/XmlBlock.java +++ b/core/java/android/content/res/XmlBlock.java @@ -17,6 +17,7 @@ package android.content.res; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.util.TypedValue; import com.android.internal.util.XmlUtils; @@ -37,6 +38,7 @@ import java.io.Reader; final class XmlBlock implements AutoCloseable { private static final boolean DEBUG=false; + @UnsupportedAppUsage public XmlBlock(byte[] data) { mAssets = null; mNative = nativeCreate(data, 0, data.length); @@ -69,6 +71,7 @@ final class XmlBlock implements AutoCloseable { } } + @UnsupportedAppUsage public XmlResourceParser newParser() { synchronized (this) { if (mNative != 0) { @@ -462,7 +465,9 @@ final class XmlBlock implements AutoCloseable { return mStrings.get(id); } + @UnsupportedAppUsage /*package*/ long mParseState; + @UnsupportedAppUsage private final XmlBlock mBlock; private boolean mStarted = false; private boolean mDecNextDepth = false; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 0affe58666c7..88d09af6e511 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -11329,6 +11329,14 @@ public final class Settings { public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; /** + * Enable faster emergency phone call feature. + * The value is a boolean (1 or 0). + * @hide + */ + public static final String FASTER_EMERGENCY_PHONE_CALL_ENABLED = + "faster_emergency_phone_call_enabled"; + + /** * See RIL_PreferredNetworkType in ril.h * @hide */ diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index bbdf15c871bb..d1de498d71ed 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -1247,7 +1247,10 @@ public class RelativeLayout extends ViewGroup { private int[] mRules = new int[VERB_COUNT]; private int[] mInitialRules = new int[VERB_COUNT]; - private int mLeft, mTop, mRight, mBottom; + private int mLeft; + private int mTop; + private int mRight; + private int mBottom; /** * Whether this view had any relative rules modified following the most diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index a57d154532eb..a8d9ab403cd0 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -420,7 +420,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private Editable.Factory mEditableFactory = Editable.Factory.getInstance(); private Spannable.Factory mSpannableFactory = Spannable.Factory.getInstance(); - private float mShadowRadius, mShadowDx, mShadowDy; + private float mShadowRadius; + private float mShadowDx; + private float mShadowDy; private int mShadowColor; private boolean mPreDrawRegistered; @@ -716,8 +718,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private Scroller mScroller; private TextPaint mTempTextPaint; - private BoringLayout.Metrics mBoring, mHintBoring; - private BoringLayout mSavedLayout, mSavedHintLayout; + private BoringLayout.Metrics mBoring; + private BoringLayout.Metrics mHintBoring; + private BoringLayout mSavedLayout; + private BoringLayout mSavedHintLayout; private TextDirectionHeuristic mTextDir; diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java index d74a60e483e5..8c8cbd6ce393 100644 --- a/core/java/android/widget/Toast.java +++ b/core/java/android/widget/Toast.java @@ -354,7 +354,8 @@ public class Toast { final Handler mHandler; int mGravity; - int mX, mY; + int mX; + int mY; float mHorizontalMargin; float mVerticalMargin; diff --git a/core/java/org/apache/http/conn/ssl/AbstractVerifier.java b/core/java/org/apache/http/conn/ssl/AbstractVerifier.java index b9349b39ba94..36d6e22ca847 100644 --- a/core/java/org/apache/http/conn/ssl/AbstractVerifier.java +++ b/core/java/org/apache/http/conn/ssl/AbstractVerifier.java @@ -46,6 +46,7 @@ import java.util.Locale; import java.util.logging.Logger; import java.util.logging.Level; +import android.annotation.UnsupportedAppUsage; import javax.net.ssl.SSLException; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; @@ -76,6 +77,7 @@ public abstract class AbstractVerifier implements X509HostnameVerifier { * Looks like we're the only implementation guarding against this. * Firefox, Curl, Sun Java 1.4, 5, 6 don't bother with this check. */ + @UnsupportedAppUsage private final static String[] BAD_COUNTRY_2LDS = { "ac", "co", "com", "ed", "edu", "go", "gouv", "gov", "info", "lg", "ne", "net", "or", "org" }; diff --git a/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java b/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java index 250932be0f36..65be161bc0f6 100644 --- a/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java +++ b/core/java/org/apache/http/conn/ssl/SSLSocketFactory.java @@ -36,6 +36,7 @@ import org.apache.http.conn.scheme.LayeredSocketFactory; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; +import android.annotation.UnsupportedAppUsage; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; @@ -174,9 +175,13 @@ public class SSLSocketFactory implements LayeredSocketFactory { return NoPreloadHolder.DEFAULT_FACTORY; } + @UnsupportedAppUsage private final SSLContext sslcontext; + @UnsupportedAppUsage private final javax.net.ssl.SSLSocketFactory socketfactory; + @UnsupportedAppUsage private final HostNameResolver nameResolver; + @UnsupportedAppUsage private X509HostnameVerifier hostnameVerifier = BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; public SSLSocketFactory( @@ -233,6 +238,7 @@ public class SSLSocketFactory implements LayeredSocketFactory { * * @hide */ + @UnsupportedAppUsage public SSLSocketFactory(javax.net.ssl.SSLSocketFactory socketfactory) { super(); this.sslcontext = null; @@ -245,6 +251,7 @@ public class SSLSocketFactory implements LayeredSocketFactory { * This constructor is used exclusively to instantiate the factory for * {@link #getSocketFactory getSocketFactory}. */ + @UnsupportedAppUsage private SSLSocketFactory() { super(); this.sslcontext = null; @@ -252,6 +259,7 @@ public class SSLSocketFactory implements LayeredSocketFactory { this.nameResolver = null; } + @UnsupportedAppUsage private static KeyManager[] createKeyManagers(final KeyStore keystore, final String password) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { if (keystore == null) { @@ -263,6 +271,7 @@ public class SSLSocketFactory implements LayeredSocketFactory { return kmfactory.getKeyManagers(); } + @UnsupportedAppUsage private static TrustManager[] createTrustManagers(final KeyStore keystore) throws KeyStoreException, NoSuchAlgorithmException { if (keystore == null) { diff --git a/core/res/res/drawable/emergency_icon.xml b/core/res/res/drawable/emergency_icon.xml index b2ffa2b4481c..c142be356a2b 100644 --- a/core/res/res/drawable/emergency_icon.xml +++ b/core/res/res/drawable/emergency_icon.xml @@ -18,7 +18,7 @@ Copyright (C) 2014 The Android Open Source Project android:height="24.0dp" android:viewportWidth="24.0" android:viewportHeight="24.0" - android:tint="?attr/colorControlNormal"> + android:tint="?attr/colorError"> <path android:fillColor="#FF000000" android:pathData="M6.8,17.3C5.3,15.9 4.5,14.0 4.5,12.0c0.0,-2.0 0.8,-3.8 2.1,-5.2l1.4,1.4c-1.0,1.0 -1.6,2.4 -1.6,3.8c0.0,1.5 0.6,2.9 1.6,3.9L6.8,17.3z"/> diff --git a/core/res/res/drawable/ic_faster_emergency.xml b/core/res/res/drawable/ic_faster_emergency.xml new file mode 100644 index 000000000000..680dfce5d632 --- /dev/null +++ b/core/res/res/drawable/ic_faster_emergency.xml @@ -0,0 +1,31 @@ +<!-- +Copyright (C) 2018 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24.0dp" + android:height="24.0dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?attr/colorError"> + <path + android:fillColor="#FF000000" + android:pathData="M19,3H5C3.9,3,3.01,3.9,3.01,5L3,19c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M19,19L5,19V5h14V19z" /> + <path + android:fillColor="#FF000000" + android:pathData="M 10.5 17 L 13.5 17 L 13.5 13.5 L 17 13.5 L 17 10.5 L 13.5 10.5 L 13.5 7 L 10.5 7 L 10.5 10.5 L 7 10.5 L 7 13.5 L 10.5 13.5 Z" /> + <path + android:pathData="M0,0h24v24H0V0z" /> + +</vector> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 8be4aa9608cb..ca204ecda027 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2580,6 +2580,7 @@ "silent" = silent mode "users" = list of users "restart" = restart device + "emergency" = Launch emergency dialer "lockdown" = Lock down device until the user authenticates "logout" = Logout the current user --> @@ -2590,6 +2591,7 @@ <item>logout</item> <item>bugreport</item> <item>screenshot</item> + <item>emergency</item> </string-array> <!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 2305e317ebc7..f2539e78d971 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2976,7 +2976,7 @@ <!-- Global actions icons --> <java-symbol type="drawable" name="ic_restart" /> <java-symbol type="drawable" name="ic_screenshot" /> - + <java-symbol type="drawable" name="ic_faster_emergency" /> <java-symbol type="drawable" name="emergency_icon" /> <java-symbol type="array" name="config_convert_to_emergency_number_map" /> diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java index dea32358824b..815294c0c98d 100644 --- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java +++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java @@ -238,6 +238,7 @@ public class SettingsBackupTest { Settings.Global.EUICC_SUPPORTED_COUNTRIES, Settings.Global.EUICC_FACTORY_RESET_TIMEOUT_MILLIS, Settings.Global.FANCY_IME_ANIMATIONS, + Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, Settings.Global.FORCE_ALLOW_ON_EXTERNAL, Settings.Global.FORCED_APP_STANDBY_ENABLED, Settings.Global.FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED, diff --git a/media/java/android/media/EncoderCapabilities.java b/media/java/android/media/EncoderCapabilities.java index 332e3604bd3e..59c9b82b879c 100644 --- a/media/java/android/media/EncoderCapabilities.java +++ b/media/java/android/media/EncoderCapabilities.java @@ -42,11 +42,15 @@ public class EncoderCapabilities */ static public class VideoEncoderCap { // These are not modifiable externally, thus are public accessible - public final int mCodec; // @see android.media.MediaRecorder.VideoEncoder - public final int mMinBitRate, mMaxBitRate; // min and max bit rate (bps) - public final int mMinFrameRate, mMaxFrameRate; // min and max frame rate (fps) - public final int mMinFrameWidth, mMaxFrameWidth; // min and max frame width (pixel) - public final int mMinFrameHeight, mMaxFrameHeight; // minn and max frame height (pixel) + public final int mCodec; // @see android.media.MediaRecorder.VideoEncoder + public final int mMinBitRate; // min bit rate (bps) + public final int mMaxBitRate; // max bit rate (bps) + public final int mMinFrameRate; // min frame rate (fps) + public final int mMaxFrameRate; // max frame rate (fps) + public final int mMinFrameWidth; // min frame width (pixel) + public final int mMaxFrameWidth; // max frame width (pixel) + public final int mMinFrameHeight; // min frame height (pixel) + public final int mMaxFrameHeight; // max frame height (pixel) // Private constructor called by JNI private VideoEncoderCap(int codec, diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java index 24037a6ba5b4..65535b58fae7 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java @@ -133,20 +133,6 @@ public class A2dpProfile implements LocalBluetoothProfile { public boolean connect(BluetoothDevice device) { if (mService == null) return false; - int max_connected_devices = mLocalAdapter.getMaxConnectedAudioDevices(); - if (max_connected_devices == 1) { - // Original behavior: disconnect currently connected device - List<BluetoothDevice> sinks = getConnectedDevices(); - if (sinks != null) { - for (BluetoothDevice sink : sinks) { - if (sink.equals(device)) { - Log.w(TAG, "Connecting to device " + device + " : disconnect skipped"); - continue; - } - mService.disconnect(sink); - } - } - } return mService.connect(device); } diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java index 38c8a883d89c..cbeeed8ea538 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothAdapter.java @@ -246,10 +246,6 @@ public class LocalBluetoothAdapter { return mAdapter.getRemoteDevice(address); } - public int getMaxConnectedAudioDevices() { - return mAdapter.getMaxConnectedAudioDevices(); - } - public List<Integer> getSupportedProfiles() { return mAdapter.getSupportedProfiles(); } diff --git a/packages/SystemUI/res/layout/global_actions_wrapped.xml b/packages/SystemUI/res/layout/global_actions_wrapped.xml index b715def73294..7f4e0d21078f 100644 --- a/packages/SystemUI/res/layout/global_actions_wrapped.xml +++ b/packages/SystemUI/res/layout/global_actions_wrapped.xml @@ -3,7 +3,9 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_gravity="top|right" android:layout_marginBottom="0dp" + android:orientation="vertical" android:paddingTop="@dimen/global_actions_top_padding" android:clipToPadding="false" android:theme="@style/qs_theme" @@ -17,7 +19,19 @@ android:layout_gravity="top|right" android:gravity="center" android:orientation="vertical" - android:padding="12dp" - android:translationZ="9dp" /> + android:padding="@dimen/global_actions_padding" + android:translationZ="@dimen/global_actions_translate" /> + + <!-- For separated button--> + <FrameLayout + android:id="@+id/separated_button" + android:layout_width="@dimen/global_actions_panel_width" + android:layout_height="wrap_content" + android:layout_gravity="top|right" + android:layout_marginTop="6dp" + android:gravity="center" + android:orientation="vertical" + android:padding="@dimen/global_actions_padding" + android:translationZ="@dimen/global_actions_translate" /> </com.android.systemui.HardwareUiLayout> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index f00957a14e09..2701e27e97ca 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -922,6 +922,10 @@ <dimen name="global_actions_top_padding">120dp</dimen> + <dimen name="global_actions_padding">12dp</dimen> + + <dimen name="global_actions_translate">9dp</dimen> + <!-- the maximum offset in either direction that elements are moved horizontally to prevent burn-in on AOD --> <dimen name="burn_in_prevention_offset_x">8dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/HardwareUiLayout.java b/packages/SystemUI/src/com/android/systemui/HardwareUiLayout.java index 98dc3219acc6..198a4e6cedb8 100644 --- a/packages/SystemUI/src/com/android/systemui/HardwareUiLayout.java +++ b/packages/SystemUI/src/com/android/systemui/HardwareUiLayout.java @@ -27,32 +27,33 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewOutlineProvider; import android.view.ViewTreeObserver; -import android.widget.FrameLayout; import android.widget.LinearLayout; + import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; import com.android.systemui.util.leak.RotationUtils; -import java.util.ArrayList; - import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_NONE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; -public class HardwareUiLayout extends FrameLayout implements Tunable { +public class HardwareUiLayout extends LinearLayout implements Tunable { private static final String EDGE_BLEED = "sysui_hwui_edge_bleed"; private static final String ROUNDED_DIVIDER = "sysui_hwui_rounded_divider"; private final int[] mTmp2 = new int[2]; - private View mChild; + private View mList; + private View mSeparatedView; private int mOldHeight; private boolean mAnimating; private AnimatorSet mAnimation; private View mDivision; private boolean mHasOutsideTouch; - private HardwareBgDrawable mBackground; + private HardwareBgDrawable mListBackground; + private HardwareBgDrawable mSeparatedViewBackground; private Animator mAnimator; private boolean mCollapse; + private boolean mHasSeparatedButton; private int mEndPoint; private boolean mEdgeBleed; private boolean mRoundedDivider; @@ -91,16 +92,19 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { mRoundedDivider = Settings.Secure.getInt(getContext().getContentResolver(), ROUNDED_DIVIDER, 0) != 0; updateEdgeMargin(mEdgeBleed ? 0 : getEdgePadding()); - mBackground = new HardwareBgDrawable(mRoundedDivider, !mEdgeBleed, getContext()); - if (mChild != null) { - mChild.setBackground(mBackground); + mListBackground = new HardwareBgDrawable(mRoundedDivider, !mEdgeBleed, getContext()); + mSeparatedViewBackground = new HardwareBgDrawable(mRoundedDivider, !mEdgeBleed, + getContext()); + if (mList != null) { + mList.setBackground(mListBackground); + mSeparatedView.setBackground(mSeparatedViewBackground); requestLayout(); } } private void updateEdgeMargin(int edge) { - if (mChild != null) { - MarginLayoutParams params = (MarginLayoutParams) mChild.getLayoutParams(); + if (mList != null) { + MarginLayoutParams params = (MarginLayoutParams) mList.getLayoutParams(); if (mRotation == ROTATION_LANDSCAPE) { params.topMargin = edge; } else if (mRotation == ROTATION_SEASCAPE) { @@ -108,7 +112,19 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { } else { params.rightMargin = edge; } - mChild.setLayoutParams(params); + mList.setLayoutParams(params); + } + + if (mSeparatedView != null) { + MarginLayoutParams params = (MarginLayoutParams) mSeparatedView.getLayoutParams(); + if (mRotation == ROTATION_LANDSCAPE) { + params.topMargin = edge; + } else if (mRotation == ROTATION_SEASCAPE) { + params.bottomMargin = edge; + } else { + params.rightMargin = edge; + } + mSeparatedView.setLayoutParams(params); } } @@ -119,13 +135,15 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); - if (mChild == null) { + if (mList == null) { if (getChildCount() != 0) { - mChild = getChildAt(0); - mChild.setBackground(mBackground); + mList = getChildAt(0); + mList.setBackground(mListBackground); + mSeparatedView = getChildAt(1); + mSeparatedView.setBackground(mSeparatedViewBackground); updateEdgeMargin(mEdgeBleed ? 0 : getEdgePadding()); - mOldHeight = mChild.getMeasuredHeight(); - mChild.addOnLayoutChangeListener( + mOldHeight = mList.getMeasuredHeight(); + mList.addOnLayoutChangeListener( (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updatePosition()); updateRotation(); @@ -133,7 +151,7 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { return; } } - int newHeight = mChild.getMeasuredHeight(); + int newHeight = mList.getMeasuredHeight(); if (newHeight != mOldHeight) { animateChild(mOldHeight, newHeight); } @@ -170,37 +188,60 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { } else { rotateLeft(); } + if (mHasSeparatedButton) { + if (from == ROTATION_SEASCAPE || to == ROTATION_SEASCAPE) { + // Separated view has top margin, so seascape separated view need special rotation, + // not a full left or right rotation. + swapLeftAndTop(mSeparatedView); + } else if (from == ROTATION_LANDSCAPE) { + rotateRight(mSeparatedView); + } else { + rotateLeft(mSeparatedView); + } + } if (to != ROTATION_NONE) { - if (mChild instanceof LinearLayout) { + if (mList instanceof LinearLayout) { mRotatedBackground = true; - mBackground.setRotatedBackground(true); - LinearLayout linearLayout = (LinearLayout) mChild; + mListBackground.setRotatedBackground(true); + mSeparatedViewBackground.setRotatedBackground(true); + LinearLayout linearLayout = (LinearLayout) mList; if (mSwapOrientation) { linearLayout.setOrientation(LinearLayout.HORIZONTAL); + setOrientation(LinearLayout.HORIZONTAL); } - swapDimens(this.mChild); + swapDimens(mList); + swapDimens(mSeparatedView); } } else { - if (mChild instanceof LinearLayout) { + if (mList instanceof LinearLayout) { mRotatedBackground = false; - mBackground.setRotatedBackground(false); - LinearLayout linearLayout = (LinearLayout) mChild; + mListBackground.setRotatedBackground(false); + mSeparatedViewBackground.setRotatedBackground(false); + LinearLayout linearLayout = (LinearLayout) mList; if (mSwapOrientation) { linearLayout.setOrientation(LinearLayout.VERTICAL); + setOrientation(LinearLayout.VERTICAL); } - swapDimens(mChild); + swapDimens(mList); + swapDimens(mSeparatedView); } } } private void rotateRight() { rotateRight(this); - rotateRight(mChild); + rotateRight(mList); swapDimens(this); - LayoutParams p = (LayoutParams) mChild.getLayoutParams(); + LayoutParams p = (LayoutParams) mList.getLayoutParams(); p.gravity = rotateGravityRight(p.gravity); - mChild.setLayoutParams(p); + mList.setLayoutParams(p); + + LayoutParams separatedViewLayoutParams = (LayoutParams) mSeparatedView.getLayoutParams(); + separatedViewLayoutParams.gravity = rotateGravityRight(separatedViewLayoutParams.gravity); + mSeparatedView.setLayoutParams(separatedViewLayoutParams); + + setGravity(p.gravity); } private void swapDimens(View v) { @@ -247,12 +288,18 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { private void rotateLeft() { rotateLeft(this); - rotateLeft(mChild); + rotateLeft(mList); swapDimens(this); - LayoutParams p = (LayoutParams) mChild.getLayoutParams(); + LayoutParams p = (LayoutParams) mList.getLayoutParams(); p.gravity = rotateGravityLeft(p.gravity); - mChild.setLayoutParams(p); + mList.setLayoutParams(p); + + LayoutParams separatedViewLayoutParams = (LayoutParams) mSeparatedView.getLayoutParams(); + separatedViewLayoutParams.gravity = rotateGravityLeft(separatedViewLayoutParams.gravity); + mSeparatedView.setLayoutParams(separatedViewLayoutParams); + + setGravity(p.gravity); } private int rotateGravityLeft(int gravity) { @@ -310,6 +357,15 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { v.setLayoutParams(params); } + private void swapLeftAndTop(View v) { + v.setPadding(v.getPaddingTop(), v.getPaddingLeft(), v.getPaddingBottom(), + v.getPaddingRight()); + MarginLayoutParams params = (MarginLayoutParams) v.getLayoutParams(); + params.setMargins(params.topMargin, params.leftMargin, params.bottomMargin, + params.rightMargin); + v.setLayoutParams(params); + } + @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); @@ -329,14 +385,14 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { mAnimating = false; } }); - int fromTop = mChild.getTop(); - int fromBottom = mChild.getBottom(); + int fromTop = mList.getTop(); + int fromBottom = mList.getBottom(); int toTop = fromTop - ((newHeight - oldHeight) / 2); int toBottom = fromBottom + ((newHeight - oldHeight) / 2); - ObjectAnimator top = ObjectAnimator.ofInt(mChild, "top", fromTop, toTop); - top.addUpdateListener(animation -> mBackground.invalidateSelf()); + ObjectAnimator top = ObjectAnimator.ofInt(mList, "top", fromTop, toTop); + top.addUpdateListener(animation -> mListBackground.invalidateSelf()); mAnimation.playTogether(top, - ObjectAnimator.ofInt(mChild, "bottom", fromBottom, toBottom)); + ObjectAnimator.ofInt(mList, "bottom", fromBottom, toBottom)); } public void setDivisionView(View v) { @@ -350,26 +406,30 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { } private void updatePosition() { - if (mChild == null) return; + if (mList == null) return; + // If got separated button, setRotatedBackground to false, + // all items won't get white background. + mListBackground.setRotatedBackground(mHasSeparatedButton); + mSeparatedViewBackground.setRotatedBackground(mHasSeparatedButton); if (mDivision != null && mDivision.getVisibility() == VISIBLE) { int index = mRotatedBackground ? 0 : 1; mDivision.getLocationOnScreen(mTmp2); float trans = mRotatedBackground ? mDivision.getTranslationX() : mDivision.getTranslationY(); int viewTop = (int) (mTmp2[index] + trans); - mChild.getLocationOnScreen(mTmp2); + mList.getLocationOnScreen(mTmp2); viewTop -= mTmp2[index]; setCutPoint(viewTop); } else { - setCutPoint(mChild.getMeasuredHeight()); + setCutPoint(mList.getMeasuredHeight()); } } private void setCutPoint(int point) { - int curPoint = mBackground.getCutPoint(); + int curPoint = mListBackground.getCutPoint(); if (curPoint == point) return; if (getAlpha() == 0 || curPoint == 0) { - mBackground.setCutPoint(point); + mListBackground.setCutPoint(point); return; } if (mAnimator != null) { @@ -379,7 +439,7 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { mAnimator.cancel(); } mEndPoint = point; - mAnimator = ObjectAnimator.ofInt(mBackground, "cutPoint", curPoint, point); + mAnimator = ObjectAnimator.ofInt(mListBackground, "cutPoint", curPoint, point); if (mCollapse) { mAnimator.setStartDelay(300); mCollapse = false; @@ -404,6 +464,10 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { mCollapse = true; } + public void setHasSeparatedButton(boolean hasSeparatedButton) { + mHasSeparatedButton = hasSeparatedButton; + } + public static HardwareUiLayout get(View v) { if (v instanceof HardwareUiLayout) return (HardwareUiLayout) v; if (v.getParent() instanceof View) { @@ -413,14 +477,14 @@ public class HardwareUiLayout extends FrameLayout implements Tunable { } private final ViewTreeObserver.OnComputeInternalInsetsListener mInsetsListener = inoutInfo -> { - if (mHasOutsideTouch || (mChild == null)) { + if (mHasOutsideTouch || (mList == null)) { inoutInfo.setTouchableInsets( ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME); return; } inoutInfo.setTouchableInsets( ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT); - inoutInfo.contentInsets.set(mChild.getLeft(), mChild.getTop(), - 0, getBottom() - mChild.getBottom()); + inoutInfo.contentInsets.set(mList.getLeft(), mList.getTop(), + 0, getBottom() - mList.getBottom()); }; } diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index d232108ded40..8320d32b7978 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -28,12 +28,10 @@ import android.app.WallpaperManager; import android.app.admin.DevicePolicyManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; -import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; -import android.content.ServiceConnection; import android.content.pm.UserInfo; import android.database.ContentObserver; import android.graphics.Point; @@ -42,9 +40,7 @@ import android.media.AudioManager; import android.net.ConnectivityManager; import android.os.Build; import android.os.Handler; -import android.os.IBinder; import android.os.Message; -import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; @@ -68,9 +64,9 @@ import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.view.accessibility.AccessibilityEvent; -import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.BaseAdapter; +import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; @@ -127,6 +123,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private static final String GLOBAL_ACTION_KEY_ASSIST = "assist"; private static final String GLOBAL_ACTION_KEY_RESTART = "restart"; private static final String GLOBAL_ACTION_KEY_LOGOUT = "logout"; + private static final String GLOBAL_ACTION_KEY_EMERGENCY = "emergency"; private static final String GLOBAL_ACTION_KEY_SCREENSHOT = "screenshot"; private final Context mContext; @@ -153,6 +150,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean mHasVibrator; private boolean mHasLogoutButton; private boolean mHasLockdownButton; + private boolean mSeparatedEmergencyButtonEnabled; private final boolean mShowSilentToggle; private final EmergencyAffordanceManager mEmergencyAffordanceManager; private final ScreenshotHelper mScreenshotHelper; @@ -319,6 +317,8 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, ArraySet<String> addedKeys = new ArraySet<String>(); mHasLogoutButton = false; mHasLockdownButton = false; + mSeparatedEmergencyButtonEnabled = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0; for (int i = 0; i < defaultActions.length; i++) { String actionKey = defaultActions[i]; if (addedKeys.contains(actionKey)) { @@ -365,6 +365,11 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, mItems.add(new LogoutAction()); mHasLogoutButton = true; } + } else if (GLOBAL_ACTION_KEY_EMERGENCY.equals(actionKey)) { + if (mSeparatedEmergencyButtonEnabled + && !mEmergencyAffordanceManager.needsEmergencyAffordance()) { + mItems.add(new EmergencyDialerAction()); + } } else { Log.e(TAG, "Invalid global action key " + actionKey); } @@ -386,7 +391,8 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, } return false; }; - ActionsDialog dialog = new ActionsDialog(mContext, this, mAdapter, onItemLongClickListener); + ActionsDialog dialog = new ActionsDialog(mContext, this, mAdapter, onItemLongClickListener, + mSeparatedEmergencyButtonEnabled); dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. dialog.setKeyguardShowing(mKeyguardShowing); @@ -441,6 +447,33 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } + private class EmergencyDialerAction extends SinglePressAction { + private static final String ACTION_EMERGENCY_DIALER_DIAL = + "com.android.phone.EmergencyDialer.DIAL"; + + private EmergencyDialerAction() { + super(R.drawable.ic_faster_emergency, + R.string.global_action_emergency); + } + + @Override + public void onPress() { + Intent intent = new Intent(ACTION_EMERGENCY_DIALER_DIAL); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + mContext.startActivityAsUser(intent, UserHandle.CURRENT); + } + + @Override + public boolean showDuringKeyguard() { + return true; + } + + @Override + public boolean showBeforeProvisioning() { + return true; + } + } + private final class RestartAction extends SinglePressAction implements LongPressAction { private RestartAction() { super(R.drawable.ic_restart, R.string.global_action_restart); @@ -626,6 +659,12 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, } private Action getEmergencyAction() { + Drawable emergencyIcon = mContext.getDrawable(R.drawable.emergency_icon); + if(!mSeparatedEmergencyButtonEnabled) { + // use un-colored legacy treatment + emergencyIcon.setTintList(null); + } + return new SinglePressAction(R.drawable.emergency_icon, R.string.global_action_emergency) { @Override @@ -1354,15 +1393,17 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final Context mContext; private final MyAdapter mAdapter; private final LinearLayout mListView; + private final FrameLayout mSeparatedView; private final HardwareUiLayout mHardwareLayout; private final OnClickListener mClickListener; private final OnItemLongClickListener mLongClickListener; private final GradientDrawable mGradientDrawable; private final ColorExtractor mColorExtractor; private boolean mKeyguardShowing; + private boolean mShouldDisplaySeparatedButton; public ActionsDialog(Context context, OnClickListener clickListener, MyAdapter adapter, - OnItemLongClickListener longClickListener) { + OnItemLongClickListener longClickListener, boolean shouldDisplaySeparatedButton) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); mContext = context; mAdapter = adapter; @@ -1370,6 +1411,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, mLongClickListener = longClickListener; mGradientDrawable = new GradientDrawable(mContext); mColorExtractor = Dependency.get(SysuiColorExtractor.class); + mShouldDisplaySeparatedButton = shouldDisplaySeparatedButton; // Window initialization Window window = getWindow(); @@ -1393,8 +1435,13 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, setContentView(com.android.systemui.R.layout.global_actions_wrapped); mListView = findViewById(android.R.id.list); + mSeparatedView = findViewById(com.android.systemui.R.id.separated_button); + if (!mShouldDisplaySeparatedButton) { + mSeparatedView.setVisibility(View.GONE); + } mHardwareLayout = HardwareUiLayout.get(mListView); mHardwareLayout.setOutsideTouchListener(view -> dismiss()); + mHardwareLayout.setHasSeparatedButton(mShouldDisplaySeparatedButton); setTitle(R.string.global_actions); mListView.setAccessibilityDelegate(new View.AccessibilityDelegate() { @Override @@ -1409,13 +1456,16 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private void updateList() { mListView.removeAllViews(); + mSeparatedView.removeAllViews(); for (int i = 0; i < mAdapter.getCount(); i++) { - View v = mAdapter.getView(i, null, mListView); + ViewGroup parentView = mShouldDisplaySeparatedButton && i == mAdapter.getCount() - 1 + ? mSeparatedView : mListView; + View v = mAdapter.getView(i, null, parentView); final int pos = i; v.setOnClickListener(view -> mClickListener.onClick(this, pos)); v.setOnLongClickListener(view -> mLongClickListener.onItemLongClick(null, v, pos, 0)); - mListView.addView(v); + parentView.addView(v); } } diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 607db4efb63e..ad9fa40e0ab8 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -1588,10 +1588,10 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { // Wakeup apps for the (SUBSCRIPTION_)PHONE_STATE broadcast. intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); + // Create a version of the intent with the number always populated. Intent intentWithPhoneNumber = new Intent(intent); - if (!TextUtils.isEmpty(incomingNumber)) { - intentWithPhoneNumber.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, incomingNumber); - } + intentWithPhoneNumber.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, incomingNumber); + // Send broadcast twice, once for apps that have PRIVILEGED permission and once for those // that have the runtime one mContext.sendBroadcastAsUser(intentWithPhoneNumber, UserHandle.ALL, diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java index aba75ddb4555..60e9eaab5721 100644 --- a/services/core/java/com/android/server/net/NetworkStatsService.java +++ b/services/core/java/com/android/server/net/NetworkStatsService.java @@ -324,6 +324,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { wakeLock, getDefaultClock(), TelephonyManager.getDefault(), new DefaultNetworkStatsSettings(context), new NetworkStatsObservers(), getDefaultSystemDir(), getDefaultBaseDir()); + service.registerLocalService(); HandlerThread handlerThread = new HandlerThread(TAG); Handler.Callback callback = new HandlerCallback(service); @@ -333,6 +334,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub { return service; } + // This must not be called outside of tests, even within the same package, as this constructor + // does not register the local service. Use the create() helper above. @VisibleForTesting NetworkStatsService(Context context, INetworkManagementService networkManager, AlarmManager alarmManager, PowerManager.WakeLock wakeLock, Clock clock, @@ -349,7 +352,9 @@ public class NetworkStatsService extends INetworkStatsService.Stub { mSystemDir = checkNotNull(systemDir, "missing systemDir"); mBaseDir = checkNotNull(baseDir, "missing baseDir"); mUseBpfTrafficStats = new File("/sys/fs/bpf/traffic_uid_stats_map").exists(); + } + private void registerLocalService() { LocalServices.addService(NetworkStatsManagerInternal.class, new NetworkStatsManagerInternalImpl()); } diff --git a/services/tests/servicestests/AndroidManifest.xml b/services/tests/servicestests/AndroidManifest.xml index a8efe819e518..d46b99170ded 100644 --- a/services/tests/servicestests/AndroidManifest.xml +++ b/services/tests/servicestests/AndroidManifest.xml @@ -65,6 +65,7 @@ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.SUSPEND_APPS"/> <uses-permission android:name="android.permission.CONTROL_KEYGUARD"/> + <uses-permission android:name="android.permission.MANAGE_BIND_INSTANT_SERVICE"/> <!-- Uses API introduced in O (26) --> <uses-sdk android:minSdkVersion="1" diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java index 149ef156a9fa..f2057c5e6971 100644 --- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java @@ -48,6 +48,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; +import android.content.pm.PackageManagerInternal; import android.content.pm.ResolveInfo; import android.content.pm.Signature; import android.content.pm.UserInfo; @@ -114,6 +115,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { @Mock private IAccountManagerResponse mMockAccountManagerResponse; @Mock private IBinder mMockBinder; @Mock private INotificationManager mMockNotificationManager; + @Mock private PackageManagerInternal mMockPackageManagerInternal; @Captor private ArgumentCaptor<Intent> mIntentCaptor; @Captor private ArgumentCaptor<Bundle> mBundleCaptor; @@ -158,6 +160,9 @@ public class AccountManagerServiceTest extends AndroidTestCase { when(mMockContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn( mMockDevicePolicyManager); when(mMockAccountManagerResponse.asBinder()).thenReturn(mMockBinder); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(true); + LocalServices.addService(PackageManagerInternal.class, mMockPackageManagerInternal); Context realTestContext = getContext(); MyMockContext mockContext = new MyMockContext(realTestContext, mMockContext); @@ -177,6 +182,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { cdl.countDown(); }); cdl.await(1, TimeUnit.SECONDS); + LocalServices.removeServiceForTest(PackageManagerInternal.class); super.tearDown(); } @@ -610,6 +616,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -626,7 +634,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { waitForLatch(latch); verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -792,6 +800,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -808,7 +818,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { waitForLatch(latch); verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -1092,6 +1102,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -1106,7 +1118,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { waitForLatch(latch); verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -1352,6 +1364,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { unlockSystemUser(); when(mMockPackageManager.checkSignatures(anyInt(), anyInt())) .thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); try { mAms.removeAccountAsUser( mMockAccountManagerResponse, // response @@ -1688,6 +1702,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -1701,7 +1717,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { waitForLatch(latch); verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -1959,6 +1975,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -1974,7 +1992,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { waitForLatch(latch); verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -2097,6 +2115,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -2110,7 +2130,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -2230,6 +2250,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); when(mMockPackageManager.checkSignatures( anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); @@ -2245,7 +2267,7 @@ public class AccountManagerServiceTest extends AndroidTestCase { verify(mMockAccountManagerResponse, never()).onResult(any(Bundle.class)); verify(mMockAccountManagerResponse).onError( - eq(AccountManager.ERROR_CODE_REMOTE_EXCEPTION), anyString()); + eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), anyString()); } @SmallTest @@ -2332,6 +2354,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { unlockSystemUser(); when(mMockPackageManager.checkSignatures(anyInt(), anyInt())) .thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); try { mAms.editProperties( mMockAccountManagerResponse, // response @@ -2621,6 +2645,8 @@ public class AccountManagerServiceTest extends AndroidTestCase { PackageManager.PERMISSION_DENIED); when(mMockPackageManager.checkSignatures(anyInt(), anyInt())) .thenReturn(PackageManager.SIGNATURE_NO_MATCH); + when(mMockPackageManagerInternal.hasSignatureCapability(anyInt(), anyInt(), anyInt())) + .thenReturn(false); final CountDownLatch latch = new CountDownLatch(1); Response response = new Response(latch, mMockAccountManagerResponse); diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java index 5d0c23f81737..ce9b552e418a 100644 --- a/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java +++ b/services/tests/servicestests/src/com/android/server/accounts/AccountsDbTest.java @@ -22,6 +22,7 @@ import android.content.Context; import android.database.Cursor; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; +import android.os.Build; import android.test.suitebuilder.annotation.SmallTest; import android.util.Pair; @@ -85,6 +86,12 @@ public class AccountsDbTest { @Test public void testCeNotAvailableInitially() { + // If the CE database is not attached to the DE database then any calls that modify the CE + // database will result in a Log.wtf call that will crash this process on eng builds. To + // allow the test to run through to completion skip this test on eng builds. + if (Build.IS_ENG) { + return; + } Account account = new Account("name", "example.com"); long id = mAccountsDb.insertCeAccount(account, ""); assertEquals("Insert into CE should fail until CE database is attached", -1, id); diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index 667ad91086b2..2bc43d410174 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -135,12 +135,35 @@ public class SubscriptionInfo implements Parcelable { private String mCardId; /** + * Whether the subscription is opportunistic. + */ + private boolean mIsOpportunistic; + + /** + * SubId of the parent subscription, if there is one. + */ + private int mParentSubId; + + /** * @hide */ public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, @Nullable UiccAccessRule[] accessRules, String cardId) { + this(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, + roaming, icon, mcc, mnc, countryIso, isEmbedded, accessRules, cardId, + false, SubscriptionManager.INVALID_SUBSCRIPTION_ID); + } + + /** + * @hide + */ + public SubscriptionInfo(int id, String iccId, int simSlotIndex, CharSequence displayName, + CharSequence carrierName, int nameSource, int iconTint, String number, int roaming, + Bitmap icon, String mcc, String mnc, String countryIso, boolean isEmbedded, + @Nullable UiccAccessRule[] accessRules, String cardId, boolean isOpportunistic, + int parentSubId) { this.mId = id; this.mIccId = iccId; this.mSimSlotIndex = simSlotIndex; @@ -157,6 +180,8 @@ public class SubscriptionInfo implements Parcelable { this.mIsEmbedded = isEmbedded; this.mAccessRules = accessRules; this.mCardId = cardId; + this.mIsOpportunistic = isOpportunistic; + this.mParentSubId = parentSubId; } /** @@ -347,6 +372,29 @@ public class SubscriptionInfo implements Parcelable { } /** + * An opportunistic subscription connects to a network that is + * limited in functionality and / or coverage. + * + * @return whether subscription is opportunistic. + */ + public boolean isOpportunistic() { + return mIsOpportunistic; + } + + /** + * Used in scenarios where a child subscription is bundled with a primary parent subscription. + * The child subscription will typically be opportunistic (see {@link #isOpportunistic()}) + * and will be used to provide data services where available, with the parent being the primary + * fallback subscription. + * + * @return subId of parent subscription if it’s bundled with a primary subscription. + * If there isn't one, {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} + */ + public int getParentSubId() { + return mParentSubId; + } + + /** * Checks whether the app with the given context is authorized to manage this subscription * according to its metadata. Only supported for embedded subscriptions (if {@link #isEmbedded} * returns true). @@ -438,10 +486,12 @@ public class SubscriptionInfo implements Parcelable { boolean isEmbedded = source.readBoolean(); UiccAccessRule[] accessRules = source.createTypedArray(UiccAccessRule.CREATOR); String cardId = source.readString(); + boolean isOpportunistic = source.readBoolean(); + int parentSubId = source.readInt(); return new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, - isEmbedded, accessRules, cardId); + isEmbedded, accessRules, cardId, isOpportunistic, parentSubId); } @Override @@ -468,6 +518,8 @@ public class SubscriptionInfo implements Parcelable { dest.writeBoolean(mIsEmbedded); dest.writeTypedArray(mAccessRules, flags); dest.writeString(mCardId); + dest.writeBoolean(mIsOpportunistic); + dest.writeInt(mParentSubId); } @Override @@ -500,6 +552,7 @@ public class SubscriptionInfo implements Parcelable { + " dataRoaming=" + mDataRoaming + " iconBitmap=" + mIconBitmap + " mcc " + mMcc + " mnc " + mMnc + " isEmbedded " + mIsEmbedded + " accessRules " + Arrays.toString(mAccessRules) - + " cardId=" + cardIdToPrint + "}"; + + " cardId=" + cardIdToPrint + " isOpportunistic " + mIsOpportunistic + + " parentSubId=" + mParentSubId + "}"; } } diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 17e7c49f6289..151b936604fd 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -29,6 +29,7 @@ import android.annotation.SuppressAutoDoc; import android.annotation.SystemApi; import android.annotation.SystemService; import android.app.BroadcastOptions; +import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; @@ -43,6 +44,7 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; +import android.telephony.euicc.EuiccManager; import android.util.DisplayMetrics; import com.android.internal.telephony.IOnSubscriptionsChangedListener; @@ -301,7 +303,7 @@ public class SubscriptionManager { * <P>Type: TEXT (String)</P> * @hide */ - public static final String CARD_ID = "card_id"; + public static final String CARD_ID = "card_id"; /** * TelephonyProvider column name for the encoded {@link UiccAccessRule}s from @@ -433,6 +435,24 @@ public class SubscriptionManager { public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; /** + * TelephonyProvider column name for whether a subscription is opportunistic, that is, + * whether the network it connects to is limited in functionality or coverage. + * For example, CBRS. + * IS_EMBEDDED should always be true. + * <p>Type: INTEGER (int), 1 for opportunistic or 0 for non-opportunistic. + * @hide + */ + public static final String IS_OPPORTUNISTIC = "is_opportunistic"; + + /** + * TelephonyProvider column name for subId of parent subscription of an opportunistic + * subscription. + * if the parent sub id is valid, then is_opportunistic should always to true. + * @hide + */ + public static final String PARENT_SUB_ID = "parent_sub_id"; + + /** * Broadcast Action: The user has changed one of the default subs related to * data, phone calls, or sms</p> * @@ -1051,24 +1071,9 @@ public class SubscriptionManager { */ public int setIconTint(int tint, int subId) { if (VDBG) logd("[setIconTint]+ tint:" + tint + " subId:" + subId); - if (!isValidSubscriptionId(subId)) { - logd("[setIconTint]- fail"); - return -1; - } - - int result = 0; - - try { - ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); - if (iSub != null) { - result = iSub.setIconTint(tint, subId); - } - } catch (RemoteException ex) { - // ignore it - } - - return result; - + return setSubscriptionPropertyHelper(subId, "setIconTint", + (iSub)-> iSub.setIconTint(tint, subId) + ); } /** @@ -1096,24 +1101,9 @@ public class SubscriptionManager { logd("[setDisplayName]+ displayName:" + displayName + " subId:" + subId + " nameSource:" + nameSource); } - if (!isValidSubscriptionId(subId)) { - logd("[setDisplayName]- fail"); - return -1; - } - - int result = 0; - - try { - ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); - if (iSub != null) { - result = iSub.setDisplayNameUsingSrc(displayName, subId, nameSource); - } - } catch (RemoteException ex) { - // ignore it - } - - return result; - + return setSubscriptionPropertyHelper(subId, "setDisplayName", + (iSub)-> iSub.setDisplayNameUsingSrc(displayName, subId, nameSource) + ); } /** @@ -1124,24 +1114,13 @@ public class SubscriptionManager { * @hide */ public int setDisplayNumber(String number, int subId) { - if (number == null || !isValidSubscriptionId(subId)) { + if (number == null) { logd("[setDisplayNumber]- fail"); return -1; } - - int result = 0; - - try { - ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); - if (iSub != null) { - result = iSub.setDisplayNumber(number, subId); - } - } catch (RemoteException ex) { - // ignore it - } - - return result; - + return setSubscriptionPropertyHelper(subId, "setDisplayNumber", + (iSub)-> iSub.setDisplayNumber(number, subId) + ); } /** @@ -1153,23 +1132,9 @@ public class SubscriptionManager { */ public int setDataRoaming(int roaming, int subId) { if (VDBG) logd("[setDataRoaming]+ roaming:" + roaming + " subId:" + subId); - if (roaming < 0 || !isValidSubscriptionId(subId)) { - logd("[setDataRoaming]- fail"); - return -1; - } - - int result = 0; - - try { - ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); - if (iSub != null) { - result = iSub.setDataRoaming(roaming, subId); - } - } catch (RemoteException ex) { - // ignore it - } - - return result; + return setSubscriptionPropertyHelper(subId, "setDataRoaming", + (iSub)->iSub.setDataRoaming(roaming, subId) + ); } /** @@ -1994,4 +1959,114 @@ public class SubscriptionManager { } return false; } + + /** + * Set preferred default data. + * Set on which slot default data will be on. + * + * @param slotId which slot is preferred to for cellular data. + * @hide + * + */ + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public void setPreferredData(int slotId) { + if (VDBG) logd("[setPreferredData]+ slotId:" + slotId); + setSubscriptionPropertyHelper(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, + "setPreferredData", (iSub)-> iSub.setPreferredData(slotId)); + } + + /** + * Get User downloaded Profiles. + * + * Provide all available user downloaded profile on the phone. + * @param slotId on which phone the switch will operate on + */ + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId) { + String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; + List<SubscriptionInfo> subInfoList = null; + + try { + ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); + if (iSub != null) { + subInfoList = iSub.getOpportunisticSubscriptions(slotId, pkgForDebug); + } + } catch (RemoteException ex) { + // ignore it + } + + if (subInfoList == null) { + subInfoList = new ArrayList<>(); + } + + return subInfoList; + } + + /** + * Switch to a certain subscription + * + * @param subId sub id + * @param callbackIntent pending intent that will be sent after operation is done. + */ + @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) + public void switchToSubscription(int subId, PendingIntent callbackIntent) { + EuiccManager euiccManager = new EuiccManager(mContext); + euiccManager.switchToSubscription(subId, callbackIntent); + } + + /** + * Set opportunistic by simInfo index + * + * @param opportunistic whether it’s opportunistic subscription. + * @param subId the unique SubscriptionInfo index in database + * @return the number of records updated + * @hide + */ + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public int setOpportunistic(boolean opportunistic, int subId) { + if (VDBG) logd("[setOpportunistic]+ opportunistic:" + opportunistic + " subId:" + subId); + return setSubscriptionPropertyHelper(subId, "setOpportunistic", + (iSub)-> iSub.setOpportunistic(opportunistic, subId)); + } + + /** + * Set parent subId by simInfo index + * + * @param parentSubId subId of its parent subscription. + * @param subId the unique SubscriptionInfo index in database + * @return the number of records updated + * @hide + * + */ + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public int setParentSubId(int parentSubId, int subId) { + if (VDBG) logd("[setParentSubId]+ parentSubId:" + parentSubId + " subId:" + subId); + return setSubscriptionPropertyHelper(subId, "parentSubId", + (iSub)-> iSub.setParentSubId(parentSubId, subId)); + } + + private interface CallISubMethodHelper { + int callMethod(ISub iSub) throws RemoteException; + } + + private int setSubscriptionPropertyHelper(int subId, String methodName, + CallISubMethodHelper helper) { + if (!isValidSubscriptionId(subId)) { + logd("[" + methodName + "]" + "- fail"); + return -1; + } + + int result = 0; + + try { + ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); + if (iSub != null) { + result = helper.callMethod(iSub); + } + } catch (RemoteException ex) { + // ignore it + } + + return result; + } } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index eda6192978a6..59f3f1ab78e0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -335,11 +335,18 @@ public class TelephonyManager { * <p> * The {@link #EXTRA_STATE} extra indicates the new call state. * If a receiving app has {@link android.Manifest.permission#READ_CALL_LOG} permission, a second - * extra {@link #EXTRA_INCOMING_NUMBER} provides the phone number for incoming and outoing calls - * as a String. Note: If the receiving app has + * extra {@link #EXTRA_INCOMING_NUMBER} provides the phone number for incoming and outgoing + * calls as a String. + * <p> + * If the receiving app has * {@link android.Manifest.permission#READ_CALL_LOG} and * {@link android.Manifest.permission#READ_PHONE_STATE} permission, it will receive the - * broadcast twice; one with the phone number and another without it. + * broadcast twice; one with the {@link #EXTRA_INCOMING_NUMBER} populated with the phone number, + * and another with it blank. Due to the nature of broadcasts, you cannot assume the order + * in which these broadcasts will arrive, however you are guaranteed to receive two in this + * case. Apps which are interested in the {@link #EXTRA_INCOMING_NUMBER} can ignore the + * broadcasts where {@link #EXTRA_INCOMING_NUMBER} is not present in the extras (e.g. where + * {@link Intent#hasExtra(String)} returns {@code false}). * <p class="note"> * This was a {@link android.content.Context#sendStickyBroadcast sticky} * broadcast in version 1.0, but it is no longer sticky. @@ -488,10 +495,19 @@ public class TelephonyManager { public static final String EXTRA_STATE_OFFHOOK = PhoneConstants.State.OFFHOOK.toString(); /** - * The lookup key used with the {@link #ACTION_PHONE_STATE_CHANGED} broadcast - * for a String containing the incoming phone number. - * Only valid when the new call state is RINGING. - * + * Extra key used with the {@link #ACTION_PHONE_STATE_CHANGED} broadcast + * for a String containing the incoming or outgoing phone number. + * <p> + * This extra is only populated for receivers of the {@link #ACTION_PHONE_STATE_CHANGED} + * broadcast which have been granted the {@link android.Manifest.permission#READ_CALL_LOG} and + * {@link android.Manifest.permission#READ_PHONE_STATE} permissions. + * <p> + * For incoming calls, the phone number is only guaranteed to be populated when the + * {@link #EXTRA_STATE} changes from {@link #EXTRA_STATE_IDLE} to {@link #EXTRA_STATE_RINGING}. + * If the incoming caller is from an unknown number, the extra will be populated with an empty + * string. + * For outgoing calls, the phone number is only guaranteed to be populated when the + * {@link #EXTRA_STATE} changes from {@link #EXTRA_STATE_IDLE} to {@link #EXTRA_STATE_OFFHOOK}. * <p class="note"> * Retrieve with * {@link android.content.Intent#getStringExtra(String)}. diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 5e015e069f4a..6521f0b41cb2 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -156,6 +156,42 @@ interface ISub { */ int setDataRoaming(int roaming, int subId); + /** + * Switch to a certain subscription + * + * @param opportunistic whether it’s opportunistic subscription. + * @param subId the unique SubscriptionInfo index in database + * @return the number of records updated + */ + int setOpportunistic(boolean opportunistic, int subId); + + /** + * Set parent subId by simInfo index + * + * @param parentSubId: subId of its parent subscription. + * @param subId the unique SubscriptionInfo index in database + * @return the number of records updated + */ + int setParentSubId(int parentSubId, int subId); + + /** + * Set preferred default data. + * Set on which slot default data will be on. + * + * @param slotId which slot is preferred to for cellular data. + * @hide + * + */ + int setPreferredData(int slotId); + + /** + * Get User downloaded Profiles. + * + * Provide all available user downloaded profile on the phone. + * @param slotId on which phone the switch will operate on + */ + List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId, String callingPackage); + int getSlotIndex(int subId); int[] getSubId(int slotIndex); @@ -186,7 +222,7 @@ interface ISub { int[] getActiveSubIdList(); - void setSubscriptionProperty(int subId, String propKey, String propValue); + int setSubscriptionProperty(int subId, String propKey, String propValue); String getSubscriptionProperty(int subId, String propKey, String callingPackage); diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index 51369d06bf46..5ecb43ebf112 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -15,7 +15,6 @@ */ package com.android.internal.telephony; -import android.content.Intent; import android.content.Intent; import android.telephony.SubscriptionManager; diff --git a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java index 280e4c234e03..f89f303a1345 100644 --- a/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java +++ b/tests/net/java/com/android/server/net/NetworkStatsServiceTest.java @@ -227,9 +227,6 @@ public class NetworkStatsServiceTest { @After public void tearDown() throws Exception { - // Registered by NetworkStatsService's constructor. - LocalServices.removeServiceForTest(NetworkStatsManagerInternal.class); - IoUtils.deleteContents(mStatsDir); mServiceContext = null; |