MockPackageManager 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
This class is obsoleted in this android platform
模拟 android.content.pm.PackageManager 类。
[Android.Runtime.Register("android/test/mock/MockPackageManager", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public class MockPackageManager : Android.Content.PM.PackageManager
[<Android.Runtime.Register("android/test/mock/MockPackageManager", DoNotGenerateAcw=true)>]
[<System.Obsolete("This class is obsoleted in this android platform")>]
type MockPackageManager = class
inherit PackageManager
- 继承
- 特性
注解
模拟 android.content.pm.PackageManager 类。 所有方法都是非功能性和引发 java.lang.UnsupportedOperationException方法。 重写它以提供所需的操作。
此成员已弃用。 使用 Mockito 等模拟框架。 应使用 Android 测试支持库编写新测试。
Java文档android.test.mock.MockPackageManager。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
构造函数
| 名称 | 说明 |
|---|---|
| MockPackageManager() |
已过时.
初始化新的模拟包管理器。 |
| MockPackageManager(IntPtr, JniHandleOwnership) |
已过时.
创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。 |
字段
| 名称 | 说明 |
|---|---|
| CertInputRawX509 |
已过时.
证书输入字节:输入字节表示编码的 X.509 证书,可以使用 生成 |
| CertInputSha256 |
已过时.
证书输入字节:输入字节表示编码的 X.509 证书的 SHA256 输出。 (继承自 PackageManager) |
| DeleteArchive |
已过时.
用于 |
| DontKillApp |
已过时.
用于指示你不想终止包含组件的应用的标志参数 |
| ExtraVerificationId |
已过时.
等待验证的包 ID 的额外字段名称。 (继承自 PackageManager) |
| ExtraVerificationResult |
已过时.
验证结果的额外字段名称, |
| FeatureActivitiesOnSecondaryDisplays |
已过时.
|
| FeatureAppWidgets |
已过时.
|
| FeatureAudioLowLatency |
已过时.
|
| FeatureAudioOutput |
已过时.
功能和:设备至少包括一种形式的音频输出,如 Android 兼容性定义文档(CDD) |
| FeatureAudioPro |
已过时.
|
| FeatureAudioSpatialHeadtrackingLowLatency |
已过时.
功能, |
| FeatureAutofill |
已过时.
|
| FeatureAutomotive |
已过时.
|
| FeatureBackup |
已过时.
|
| FeatureBluetooth |
已过时.
|
| FeatureBluetoothLe |
已过时.
|
| FeatureBluetoothLeChannelSounding |
已过时.
|
| FeatureCamera |
已过时.
功能: |
| FeatureCameraAny |
已过时.
|
| FeatureCameraAr |
已过时.
|
| FeatureCameraAutofocus |
已过时.
|
| FeatureCameraCapabilityManualPostProcessing |
已过时.
|
| FeatureCameraCapabilityManualSensor |
已过时.
|
| FeatureCameraCapabilityRaw |
已过时.
|
| FeatureCameraConcurrent |
已过时.
|
| FeatureCameraExternal |
已过时.
|
| FeatureCameraFlash |
已过时.
|
| FeatureCameraFront |
已过时.
|
| FeatureCameraLevelFull |
已过时.
|
| FeatureCantSaveState |
已过时.
|
| FeatureCompanionDeviceSetup |
已过时.
|
| FeatureConnectionService |
已过时.
|
| FeatureConsumerIr |
已过时.
|
| FeatureControls |
已过时.
|
| FeatureCredentials |
已过时.
|
| FeatureDeviceAdmin |
已过时.
|
| FeatureDeviceIdAttestation |
已过时.
|
| FeatureDeviceLock |
已过时.
|
| FeatureEmbedded |
已过时.
|
| FeatureEthernet |
已过时.
|
| FeatureExpandedPictureInPicture |
已过时.
|
| FeatureFace |
已过时.
|
| FeatureFaketouch |
已过时.
|
| FeatureFaketouchMultitouchDistinct |
已过时.
|
| FeatureFaketouchMultitouchJazzhand |
已过时.
|
| FeatureFingerprint |
已过时.
|
| FeatureFreeformWindowManagement |
已过时.
|
| FeatureGamepad |
已过时.
|
| FeatureHardwareKeystore |
已过时.
|
| FeatureHifiSensors |
已过时.
|
| FeatureHomeScreen |
已过时.
|
| FeatureIdentityCredentialHardware |
已过时.
|
| FeatureIdentityCredentialHardwareDirectAccess |
已过时.
|
| FeatureInputMethods |
已过时.
|
| FeatureIpsecTunnelMigration |
已过时.
|
| FeatureIpsecTunnels |
已过时.
|
| FeatureIris |
已过时.
|
| FeatureKeystoreAppAttestKey |
已过时.
|
| FeatureKeystoreLimitedUseKey |
已过时.
|
| FeatureKeystoreSingleUseKey |
已过时.
|
| FeatureLeanback |
已过时.
|
| FeatureLeanbackOnly |
已过时.
|
| FeatureLiveTv |
已过时.
|
| FeatureLiveWallpaper |
已过时.
|
| FeatureLocation |
已过时.
|
| FeatureLocationGps |
已过时.
|
| FeatureLocationNetwork |
已过时.
|
| FeatureManagedUsers |
已过时.
|
| FeatureMicrophone |
已过时.
|
| FeatureMidi |
已过时.
|
| FeatureNeuralProcessingUnit |
已过时.
|
| FeatureNfc |
已过时.
|
| FeatureNfcBeam |
已过时.
功能: |
| FeatureNfcHostCardEmulation |
已过时.
|
| FeatureNfcHostCardEmulationNfcf |
已过时.
|
| FeatureNfcOffHostCardEmulationEse |
已过时.
|
| FeatureNfcOffHostCardEmulationUicc |
已过时.
|
| FeatureOpenglesDeqpLevel |
已过时.
|
| FeatureOpenglesExtensionPack |
已过时.
|
| FeaturePc |
已过时.
|
| FeaturePictureInPicture |
已过时.
|
| FeaturePrinting |
已过时.
|
| FeatureRamLow |
已过时.
|
| FeatureRamNormal |
已过时.
|
| FeatureScreenLandscape |
已过时.
|
| FeatureScreenPortrait |
已过时.
|
| FeatureSecureLockScreen |
已过时.
|
| FeatureSecurelyRemovesUsers |
已过时.
|
| FeatureSecurityModelCompatible |
已过时.
|
| FeatureSensorAccelerometer |
已过时.
|
| FeatureSensorAccelerometerLimitedAxes |
已过时.
|
| FeatureSensorAccelerometerLimitedAxesUncalibrated |
已过时.
|
| FeatureSensorAmbientTemperature |
已过时.
|
| FeatureSensorBarometer |
已过时.
|
| FeatureSensorCompass |
已过时.
|
| FeatureSensorDynamicHeadTracker |
已过时.
|
| FeatureSensorGyroscope |
已过时.
|
| FeatureSensorGyroscopeLimitedAxes |
已过时.
|
| FeatureSensorGyroscopeLimitedAxesUncalibrated |
已过时.
|
| FeatureSensorHeading |
已过时.
|
| FeatureSensorHeartRate |
已过时.
|
| FeatureSensorHeartRateEcg |
已过时.
|
| FeatureSensorHingeAngle |
已过时.
|
| FeatureSensorLight |
已过时.
|
| FeatureSensorProximity |
已过时.
|
| FeatureSensorRelativeHumidity |
已过时.
|
| FeatureSensorStepCounter |
已过时.
|
| FeatureSensorStepDetector |
已过时.
|
| FeatureSeOmapiEse |
已过时.
|
| FeatureSeOmapiSd |
已过时.
|
| FeatureSeOmapiUicc |
已过时.
|
| FeatureSip |
已过时.
功能: |
| FeatureSipVoip |
已过时.
|
| FeatureStrongboxKeystore |
已过时.
|
| FeatureTelecom |
已过时.
|
| FeatureTelephony |
已过时.
|
| FeatureTelephonyCalling |
已过时.
|
| FeatureTelephonyCdma |
已过时.
|
| FeatureTelephonyData |
已过时.
|
| FeatureTelephonyEuicc |
已过时.
|
| FeatureTelephonyEuiccMep |
已过时.
|
| FeatureTelephonyGsm |
已过时.
|
| FeatureTelephonyIms |
已过时.
|
| FeatureTelephonyMbms |
已过时.
|
| FeatureTelephonyMessaging |
已过时.
|
| FeatureTelephonyRadioAccess |
已过时.
|
| FeatureTelephonySubscription |
已过时.
|
| FeatureTelevision |
已过时.
|
| FeatureThreadNetwork |
已过时.
功能和:设备能够通过 |
| FeatureTouchscreen |
已过时.
|
| FeatureTouchscreenMultitouch |
已过时.
|
| FeatureTouchscreenMultitouchDistinct |
已过时.
|
| FeatureTouchscreenMultitouchJazzhand |
已过时.
|
| FeatureUsbAccessory |
已过时.
|
| FeatureUsbHost |
已过时.
|
| FeatureUwb |
已过时.
|
| FeatureVerifiedBoot |
已过时.
|
| FeatureVrHeadtracking |
已过时.
|
| FeatureVrMode |
已过时.
|
| FeatureVrModeHighPerformance |
已过时.
|
| FeatureVulkanDeqpLevel |
已过时.
|
| FeatureVulkanHardwareCompute |
已过时.
|
| FeatureVulkanHardwareLevel |
已过时.
|
| FeatureVulkanHardwareVersion |
已过时.
|
| FeatureWalletLocationBasedSuggestions |
已过时.
|
| FeatureWatch |
已过时.
功能: |
| FeatureWebview |
已过时.
|
| FeatureWifi |
已过时.
|
| FeatureWifiAware |
已过时.
|
| FeatureWifiDirect |
已过时.
|
| FeatureWifiPasspoint |
已过时.
|
| FeatureWifiRtt |
已过时.
|
| FeatureWindowMagnification |
已过时.
|
| FlagPermissionWhitelistInstaller |
已过时.
权限允许列表标志:安装程序加入允许列表的权限。 (继承自 PackageManager) |
| FlagPermissionWhitelistSystem |
已过时.
权限允许列表标志:系统允许列表的权限。 (继承自 PackageManager) |
| FlagPermissionWhitelistUpgrade |
已过时.
权限允许列表标志:从权限不受限制的操作系统版本升级时,系统将权限加入允许列表的权限。 (继承自 PackageManager) |
| GetAppLockInfo |
已过时.
|
| GetAttributions |
已过时.
此成员已弃用。 (继承自 PackageManager) |
| GetAttributionsLong |
已过时.
|
| InstallScenarioBulk |
已过时.
安装方案指示具有完全优化应用程序所需结果的批量操作。 (继承自 PackageManager) |
| InstallScenarioBulkSecondary |
已过时.
安装方案指示批量操作,该操作优先于应用程序优化对系统运行状况的影响最小。 (继承自 PackageManager) |
| InstallScenarioDefault |
已过时.
一个值,指示缺少 CUJ 信息,禁用所有安装方案逻辑。 (继承自 PackageManager) |
| InstallScenarioFast |
已过时.
安装方案尽可能提供最快的“安装按钮启动”体验。 (继承自 PackageManager) |
| MatchApex |
已过时.
|
| MatchArchivedPackages |
已过时.
标记参数,以检索有关存档包的一些信息。 (继承自 PackageManager) |
| MatchDirectBootAuto |
已过时.
查询标志:根据组件的直接启动感知和当前用户状态自动匹配组件。 (继承自 PackageManager) |
| MaximumVerificationTimeout |
已过时.
可用作 |
| PropertyCompatOverrideLandscapeToPortrait |
已过时.
应用的应用程序级别 |
| PropertyMediaCapabilities |
已过时.
<
>指定包含应用程序的媒体功能 XML 文件的 XML 资源 ID 的应用程序级别
(继承自 PackageManager)
|
| PropertyNativeServiceFunctionName |
已过时.
本机服务的服务级别 |
| PropertyNativeServiceLibraryName |
已过时.
用于指定要加载到承载服务的进程的库名称的本机服务的服务级别 |
| PropertySelfCertifiedNetworkCapabilities |
已过时.
<指定 XML 资源 ID 的应用程序> 级别 |
| PropertySpecialUseFgsSubtype |
已过时.
<如果服务是具有类型 |
| PropertyUseRestrictedBackupMode |
已过时.
<应用程序> 级别 |
| Synchronous |
已过时.
用于指示给定用户的包限制状态在组件状态更新后将序列化为磁盘的标志参数 |
| VerificationAllow |
已过时.
|
| VerificationReject |
已过时.
|
| VersionCodeHighest |
已过时.
用于指定安装的最高包版本代码的常量。 (继承自 PackageManager) |
属性
| 名称 | 说明 |
|---|---|
| BackgroundPermissionOptionLabel |
已过时.
获取用于授予后台访问权限作为字符串的文本标签。 (继承自 PackageManager) |
| BackgroundPermissionOptionLabelFormatted |
已过时.
获取与设置中用于授予后台访问权限的选项对应的本地化标签。 (继承自 PackageManager) |
| Class |
已过时.
返回此 |
| DefaultActivityIcon |
已过时.
返回未定义特定图标时使用的活动的泛型图标。 |
| Handle |
已过时.
基础 Android 实例的句柄。 (继承自 Object) |
| InstantAppCookieMaxBytes |
已过时.
引发而不是 UnsupportedOperationException 提供即时应用程序 Cookie 大小限制。 重写此属性以用于测试。 |
| IsAutoRevokeWhitelisted |
已过时.
<strong Note: </strong>>In retrospect it to preferred to use more inclusive terminology when naming this API. (继承自 PackageManager) |
| IsDeviceUpgrading |
已过时.
如果设备正在升级,例如在 OTA 后首次启动,则返回 true。 (继承自 PackageManager) |
| IsInstantApp |
已过时.
引发而不是 UnsupportedOperationException 提供即时应用程序状态。 重写此属性以用于测试。 |
| IsPackageSuspended |
已过时.
应用可以查询这一点,以了解它们是否已暂停。 (继承自 PackageManager) |
| IsSafeMode |
已过时.
返回设备是否已启动到安全模式。 |
| JniIdentityHashCode |
已过时.
获取为此对等方存储的Java标识哈希代码。 (继承自 Object) |
| JniManagedPeerState |
已过时.
获取运行时上次分配的状态标志。 (继承自 JavaObject) |
| JniPeerMembers |
已过时.
获取用于访问此Java绑定成员的 JNI 元数据。 |
| PackageInstaller |
已过时.
{ } |
| PeerReference |
已过时.
获取此Java对等方的 JNI 对象引用。 (继承自 Object) |
| SuspendedPackageAppExtras |
已过时.
返回一个 |
| ThresholdClass |
已过时.
此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。 |
| ThresholdType |
已过时.
此 API 支持 Mono for Android 基础结构,不打算直接从代码使用。 |
方法
显式接口实现
| 名称 | 说明 |
|---|---|
| IJavaPeerable.Disposed() |
已过时.
将此对等方标记为已释放,并将 |
| IJavaPeerable.Finalized() |
已过时.
将此对等方标记为已释放,并将 |
| IJavaPeerable.JniObjectReferenceControlBlock |
已过时.
获取此对等方使用的本机控制块指针。 (继承自 JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
已过时.
存储运行时提供的标识哈希代码。 (继承自 JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
已过时.
替换存储的托管对等状态标志。 (继承自 JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
已过时.
更新对等引用,并在引用无效时释放已释放的对等方控制块。 (继承自 JavaObject) |
扩展方法
| 名称 | 说明 |
|---|---|
| GetJniTypeName(IJavaPeerable) |
已过时.
获取实例 |
| JavaAs<TResult>(IJavaPeerable) |
已过时.
尝试强制 |
| JavaCast<TResult>(IJavaObject) |
已过时.
执行 Android 运行时检查的类型转换。 |
| JavaCast<TResult>(IJavaObject) |
已过时.
重复使用兼容的托管对等,或获取请求类型的包装器。 |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
已过时.
尝试强制 |