Android content pm packagemanager namenotfoundexception

Package Manager. Name Not Found Exception Class

Definition

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

This exception is thrown when a given package, application, or component name cannot be found.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

Properties

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

(Inherited from Throwable) Class (Inherited from Throwable) Handle

The handle to the underlying Android instance.

(Inherited from Throwable) JniIdentityHashCode (Inherited from Throwable) JniPeerMembers LocalizedMessage

Creates a localized description of this throwable.

(Inherited from Throwable) Message

Returns the detail message string of this throwable.

(Inherited from Throwable) PeerReference (Inherited from Throwable) StackTrace (Inherited from Throwable) ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Appends the specified exception to the exceptions that were suppressed in order to deliver this exception.

(Inherited from Throwable) Dispose() (Inherited from Throwable) Dispose(Boolean) (Inherited from Throwable) FillInStackTrace()

Fills in the execution stack trace.

(Inherited from Throwable) GetStackTrace()

Provides programmatic access to the stack trace information printed by #printStackTrace() .

(Inherited from Throwable) GetSuppressed()

Returns an array containing all of the exceptions that were suppressed, typically by the try -with-resources statement, in order to deliver this exception.

(Inherited from Throwable) InitCause(Throwable)

Initializes the cause of this throwable to the specified value.

(Inherited from Throwable) PrintStackTrace()

Prints this throwable and its backtrace to the standard error stream.

(Inherited from Throwable) PrintStackTrace(PrintStream)

Prints this throwable and its backtrace to the standard error stream.

(Inherited from Throwable) PrintStackTrace(PrintWriter)

Prints this throwable and its backtrace to the standard error stream.

(Inherited from Throwable) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Throwable) SetStackTrace(StackTraceElement[])

Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTrace() and related methods.

(Inherited from Throwable) ToString() (Inherited from Throwable) UnregisterFromRuntime() (Inherited from Throwable)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Throwable)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Throwable)
IJavaPeerable.Finalized() (Inherited from Throwable)
IJavaPeerable.JniManagedPeerState (Inherited from Throwable)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Throwable)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Throwable)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Throwable)

Extension Methods

Performs an Android runtime-checked type conversion.

Источник

NameNotFoundException при вызове getPackageInfo на Android 11

После установки для targetSdkVersion значения 30 (Android 11) я получаю android.content.pm.PackageManager$NameNotFoundException при выполнении packageManager.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS) пакетов, о существовании которых я знаю.

Трассировка стека выглядит следующим образом:

1 ответ

Android 11 изменяет способ запроса приложений и взаимодействия с другими приложениями, установленными пользователем на устройстве. Используя новый элемент, приложения могут определять набор других приложений, к которым они могут получить доступ. Этот элемент помогает поддерживать принцип наименьших привилегий, сообщая системе, какие другие приложения сделать видимыми для вашего приложения, а также помогает магазинам приложений, таким как Google Play, оценивать конфиденциальность и безопасность, которые ваше приложение обеспечивает для пользователей.

Если ваше приложение нацелено на Android 11, вам может потребоваться добавить элемент в файл манифеста вашего приложения. В элементе вы можете указать приложения по имени пакета или подписи намерения.

Таким образом, вам нужно либо прекратить то, что вы делаете, либо запросить доступ к информации об определенных пакетах, либо — если у вас на это есть причины — использовать разрешение QUERY_ALL_PACKAGES .

Запрашивать и взаимодействовать с конкретными пакетами

Чтобы запрашивать определенные пакеты и взаимодействовать с ними, обновите AndroidManifest.xml следующим образом:

Запрашивать и взаимодействовать со всеми приложениями

Источник

Подробнее о реализации поддержки GCM на Android-клиенте

Тут уже писали об GCM. Для чего эта статья?

Верно, писали. Буквально на этой неделе на Хабре была опубликована статья GCM – новый сервис Push-уведомлений от Google (если вы еще не знакомы с Google Cloud Messaging for Android, то советую прочитать её перед прочтением этой статьи, тем более в моей статье не описываются процесс создания проекта с GCM). Не знаю использовал её автор GCM в реальном приложении или нет, а вот мне пришлось. Поэтому-то я и хочу описать кое-что, чему не нашлось места в предыдущей статье, или что не было объяснено. Добавить это все комментарием в предыдущую статью, боюсь, невыполнимая задача.

Необходимые разрешения

  • Тут всё ясно, без доступа к интернету GCM нам и не нужен
  • GCM требует доступ к Google-аккаунту
    По этому поводу в прошлой теме даже был спор, но никто из участников не решил посмотреть в исходных код. Документация этот момент умалчивает, и лишь говорит, что возможно вы захотите захватить PowerManager.WakeLock . Так вот, если вы пользуетесь стандартной библиотекой GCM, то вам придется добавлять такое разрешение.

Вкратце механизм работы такой: наше приложение подписывается на получение широковещательных запросов. При получении запроса мы устанавливаем полученному Intent’у имя класса ( setClassName() ) в имя нашего сервиса расширяющего GCMBaseIntentService , затем захватываем WakeLock с флагом PowerManager.PARTIAL_WAKE_LOCK (не даем уснуть только CPU, экран и прочее спит спокойно), запускаем Intent как сервис, по выходу из onHandleIntent сервиса освобождаем WakeLock .

Не поверили и не стали добавлять это разрешение, и в итоге получаем вот такое исключение:

Создаем свое собственное разрешение и сами его запрашиваем. Это мы делаем для того, чтобы никто кроме нас не смог получать наши сообщения.

Примечание: если вы выставили minSdkVersion в 16 или выше (Jelly Bean и последующие версии), то это разрешение вам не нужно (года через 2, надеюсь, можно будет опускать).

  • Собственно разрешение на регистрацию в GCM и получение сообщений.
  • Изменяется ли код регистрации (registationId)?

    Рассмотрим код из приложения-примера:

    Вроде бы других условий нет. Так что, не изменяется? Если перейти по этой ссылке: http://developer.android.com/intl/ru/guide/google/gcm/adv.html#reg-state, можно узнать что все-таки может измениться. Таких случая два:

    1. Обновление программы
    2. Создание резервной копии и восстановление из неё

    Для проверки на обновление программы я написал небольшой класс-помощник. Может быть кому-нибудь пригодится:

    Источник

    Package Manager Class

    Definition

    Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

    Class for retrieving various kinds of information related to the application packages that are currently installed on the device.

    Remarks

    Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

    Constructors

    A constructor used when creating managed representations of JNI objects; called by the runtime.

    Fields

    Certificate input bytes: the input bytes represent an encoded X.

    Certificate input bytes: the input bytes represent the SHA256 output of an encoded X.

    Flag parameter for #setComponentEnabledSetting(android.content.ComponentName, int, int) to indicate that you don’t want to kill the app containing the component.

    Extra field name for the ID of a package pending verification.

    Extra field name for the result of a verification, either #VERIFICATION_ALLOW , or #VERIFICATION_REJECT .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports running activities on secondary displays.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports app widgets.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s audio pipeline is low-latency, more suitable for audio applications sensitive to delays or lag in sound input or output.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes at least one form of audio output, as defined in the Android Compatibility Definition Document (CDD) FeatureAudioPro

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has professional audio level of functionality and performance.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports autofill of user credentials, addresses, credit cards, etc via integration with android.service.autofill.AutofillService autofill providers .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This is a device dedicated to showing UI on a vehicle headunit.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device can perform backup and restore operations on installed applications.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device is capable of communicating with other devices via Bluetooth.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device is capable of communicating with other devices via Bluetooth Low Energy radio.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a camera facing away from the screen.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has at least one camera pointing in some direction, or can support an external camera being connected to it.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : At least one of the cameras on the device supports the android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING capability level.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s camera supports auto-focus.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : At least one of the cameras on the device supports the android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing capability level.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : At least one of the cameras on the device supports the android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor capability level.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : At least one of the cameras on the device supports the android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW capability level.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s main front and back cameras can stream concurrently as described in android.hardware.camera2.CameraManager#getConcurrentCameraIds() .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device can support having an external camera connected to it.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s camera supports flash.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a front facing camera.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : At least one of the cameras on the device supports the android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware capability level.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports the android.R.attr#cantSaveState API.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports android.companion.CompanionDeviceManager#associate associating with devices via android.companion.CompanionDeviceManager .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The Connection Service API is enabled on the device.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device is capable of communicating with consumer IR devices.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports a system interface for the user to select and bind device control services provided by applications.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports device policy enforcement via device admins.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This is a device for IoT and may not have an UI.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This device supports ethernet.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has biometric hardware to perform face authentication.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device does not have a touch screen, but does support touch emulation for basic events.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device does not have a touch screen, but does support touch emulation for basic events that supports distinct tracking of two or more fingers.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device does not have a touch screen, but does support touch emulation for basic events that supports tracking a hand of fingers (5 or more fingers) fully independently.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has biometric hardware to detect a fingerprint.

    As a guiding principle:

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has all of the inputs necessary to be considered a compatible game controller, or includes a compatible game controller in the box.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the device implements the Android Keystore backed by an isolated execution environment.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports high fidelity sensor processing capabilities.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports a home screen that is replaceable by third party applications.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the device supports android.security.identity.IdentityCredentialStore implemented in secure hardware at the given feature version.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the device supports android.security.identity.IdentityCredentialStore implemented in secure hardware with direct access at the given feature version.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports adding new input methods implemented with the android.inputmethodservice.InputMethodService API.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has the requisite kernel support for multinetworking-capable IPsec tunnels.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has biometric hardware to perform iris authentication.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a Keystore implementation that can create application-specific attestation keys.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a Keystore implementation that can enforce limited use key in hardware with any max usage count (including count equals to 1).

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a Keystore implementation that can only enforce limited use key in hardware with max usage count equals to 1.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports leanback UI.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports only leanback UI.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports live TV and can display contents from TV inputs implemented with the android.media.tv.TvInputService API.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports live wallpapers.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports one or more methods of reporting current location.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a Global Positioning System receiver and can report precise location.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device can report location with coarse accuracy using a network-based geolocation system.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports creating secondary users and managed profiles via DevicePolicyManager .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device can record audio via a microphone.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a full implementation of the android.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device can communicate using Near-Field Communications (NFC).

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The Beam API is enabled on the device.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports host- based NFC card emulation.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports host- based NFC-F card emulation.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports eSE- based NFC card emulation.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports uicc- based NFC card emulation.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the feature version specifies a date such that the device is known to pass the OpenGLES dEQP test suite associated with that date.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports the OpenGL ES FeaturePc

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This is a device dedicated to be primarily used with keyboard, mouse or touchpad.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports picture-in-picture multi-window mode.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports printing.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s ActivityManager#isLowRamDevice() ActivityManager.isLowRamDevice() method returns true.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s ActivityManager#isLowRamDevice() ActivityManager.isLowRamDevice() method returns false.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports landscape orientation screens.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports portrait orientation screens.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a secure implementation of keyguard, meaning the device supports PIN, pattern and password as defined in Android CDD

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports secure removal of users.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device is compatible with Android’s security model.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes an accelerometer.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes an ambient temperature sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a barometer (air pressure sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a magnetometer (compass).

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a gyroscope.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a heart rate monitor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The heart rate sensor on this device is an Electrocardiogram.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a hinge angle sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a light sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a proximity sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a relative humidity sensor.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a hardware step counter.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device includes a hardware step detector.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Open Mobile API capable eSE-based secure elements.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Open Mobile API capable SD-based secure elements.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Open Mobile API capable UICC-based secure elements.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The SIP API is enabled on the device.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports SIP-based VOIP.

    Feature for #getSystemAvailableFeatures , #hasSystemFeature(String) , and #hasSystemFeature(String, int) : If this feature is supported, the device implements the Android Keystore backed by a dedicated secure processor referred to as FeatureTelephony

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a telephony radio with data communication support.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a CDMA telephony stack.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports embedded subscriptions on eUICCs.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a GSM telephony stack.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports attaching to IMS implementations using the ImsService API in telephony.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports cell-broadcast reception using the MBMS APIs.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This is a device dedicated to showing UI on a television.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s display has a touch screen.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s touch screen supports multitouch sufficient for basic two-finger gesture detection.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s touch screen is capable of tracking two or more fingers fully independently.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device’s touch screen is capable of tracking a full hand of fingers fully independently — that is, 5 or more simultaneous independent pointers.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports connecting to USB accessories.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports connecting to USB devices as the USB host.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports verified boot.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device implements headtracking suitable for a VR device.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device implements an optimized mode for virtual reality (VR) applications that handles stereoscopic rendering of notifications, and disables most monocular system UI components while a VR application has user focus.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device implements an optimized mode for virtual reality (VR) applications that handles stereoscopic rendering of notifications, disables most monocular system UI components while a VR application has user focus and meets extra CDD requirements to provide a high-quality VR experience.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the feature version specifies a date such that the device is known to pass the Vulkan dEQP test suite associated with that date.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the Vulkan implementation on this device is hardware accelerated, and the Vulkan native API will enumerate at least one VkPhysicalDevice , and the feature version will indicate what level of optional compute features that device supports beyond the Vulkan 1.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the Vulkan implementation on this device is hardware accelerated, and the Vulkan native API will enumerate at least one VkPhysicalDevice , and the feature version will indicate what level of optional hardware features limits it supports.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature(String, int) : If this feature is supported, the Vulkan implementation on this device is hardware accelerated, and the feature version will indicate the highest VkPhysicalDeviceProperties::apiVersion supported by the physical devices that support the hardware level indicated by #FEATURE_VULKAN_HARDWARE_LEVEL .

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : This is a device dedicated to showing UI on a watch.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device has a full implementation of the android.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports WiFi (802.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Wi-Fi Aware.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Wi-Fi Direct networking.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Wi-Fi Passpoint and all Passpoint related APIs in WifiManager are supported.

    Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device supports Wi-Fi RTT (IEEE 802.

    Permission whitelist flag: permissions whitelisted by the installer.

    Permission whitelist flag: permissions whitelisted by the system.

    Permission whitelist flag: permissions whitelisted by the system when upgrading from an OS version where the permission was not restricted to an OS version where the permission is restricted.

    PackageInfo flag: return all attributions declared in the package manifest

    Installation scenario indicating a bulk operation with the desired result of a fully optimized application.

    Installation scenario indicating a bulk operation that prioritizes minimal system health impact over application optimization.

    A value to indicate the lack of CUJ information, disabling all installation scenario logic.

    Installation scenario providing the fastest “install button to launch» experience possible.

    PackageInfo flag: include APEX packages that are currently installed.

    Querying flag: automatically match components based on their Direct Boot awareness and the current user state.

    Can be used as the millisecondsToDelay argument for PackageManager#extendVerificationTimeout .

    Flag parameter for #setComponentEnabledSetting(android.content.ComponentName, int, int) to indicate that the given user’s package restrictions state will be serialised to disk after the component state has been updated.

    Used as the verificationCode argument for PackageManager#verifyPendingInstall to indicate that the calling package verifier allows the installation to proceed.

    Used as the verificationCode argument for PackageManager#verifyPendingInstall to indicate the calling package verifier does not vote to allow the installation to proceed.

    Constant for specifying the highest installed package version code.

    Properties

    Gets the localized label that corresponds to the option in settings for granting background access.

    Returns the runtime class of this Object .

    (Inherited from Object) DefaultActivityIcon

    Return the generic icon for an activity that is used when no specific icon is defined.

    The handle to the underlying Android instance.

    (Inherited from Object) InstantAppCookieMaxBytes IsAutoRevokeWhitelisted

    Note: In retrospect it would have been preferred to use more inclusive terminology when naming this API.

    Returns true if the device is upgrading, such as first boot after OTA.

    Apps can query this to know if they have been suspended.

    Return whether the device has been booted into safe mode.

    Return interface that offers the ability to install, upgrade, and remove applications on the device.

    Returns a Bundle of extras that was meant to be sent to the calling app when it was suspended.

    This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

    This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

    Trust any Installer to provide checksums for the package.

    Don’t trust any Installer to provide checksums for the package.

    Methods

    Add a new dynamic permission to the system.

    Like #addPermission(PermissionInfo) but asynchronously persists the package manager state after returning from the call, allowing it to return quicker and batch a series of adds at the expense of no guarantee the added permission will be retained if the device is rebooted before it is written.

    Add a new preferred activity mapping to the system.

    Adds a whitelisted restricted permission for an app.

    Map from a packages canonical name to the current name in use on the device.

    Checks whether the calling package is allowed to request package installs through package installer.

    Check whether a particular package has been granted a particular permission.

    Like CheckSignatures(String, String), but takes UIDs of the two packages to be checked.

    Compare the signatures of two packages to determine if the same signature appears in both of them.

    Clears the instant application cookie for the calling app.

    Remove all preferred activity mappings, previously added with #addPreferredActivity , from the system whose activities are implemented in the given package name.

    Creates and returns a copy of this object.

    (Inherited from Object) CurrentToCanonicalPackageNames(String[])

    Map from the current package names in use on the device to whatever the current canonical name of that package is.

    Dispose() (Inherited from Object) Dispose(Boolean) (Inherited from Object) Equals(Object)

    Indicates whether some other object is «equal to» this one.

    (Inherited from Object) ExtendVerificationTimeout(Int32, PackageInstallVerification, Int64)

    Allows a package listening to the Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification broadcast to extend the default timeout for a response and declare what action to perform after the timeout occurs.

    Retrieve the banner associated with an activity.

    Retrieve the banner associated with an activity.

    Retrieve the icon associated with an activity.

    Retrieve the icon associated with an activity.

    Retrieve all of the information we know about a particular activity class.

    Retrieve the logo associated with an activity.

    Retrieve the logo associated with an activity.

    Retrieve all of the known permission groups in the system.

    Retrieve the banner associated with an application.

    Retrieve the banner associated with an application.

    Return the enabled setting for an application.

    Retrieve the icon associated with an application.

    Retrieve the icon associated with an application.

    Retrieve all of the information we know about a particular package/application.

    Return the label to use for this application.

    Return the label to use for this application.

    Retrieve the logo associated with an application.

    Retrieve the logo associated with an application.

    Returns the names of the packages that have been changed [eg.

    Return the enabled setting for a package component (activity, receiver, service, provider).

    Retrieve an image from a package.

    Get the platform-defined permission group of a particular permission, if the permission is a platform-defined permission.

    Returns a hash code value for the object.

    (Inherited from Object) GetInstalledApplications(PackageInfoFlags)

    Return a List of all application packages that are installed for the current user.

    Return a List of all modules that are installed.

    Return a List of all packages that are installed for the current user.

    Retrieve the package name of the application that installed a package.

    Retrieves information about how a package was installed or updated.

    Gets the instant application cookie for this app.

    Retrieve all of the information we know about a particular instrumentation class.

    Returns a «good» intent to launch a front-door activity in a package.

    Return a «good» intent to launch a front-door Leanback activity in a package, for use for example to implement an «open» button when browsing through packages.

    Gets all MIME types contained by MIME group.

    Retrieve information for a particular module.

    Retrieve the official name associated with a uid.

    Retrieve overall information about an application package defined in a package archive file

    Return an array of all of the POSIX secondary group IDs that have been assigned to the given package.

    Return an array of all of the POSIX secondary group IDs that have been assigned to the given package.

    Retrieve overall information about an application package that is installed on the system.

    Retrieve overall information about an application package that is installed on the system.

    Retrieve the names of all packages that are associated with a particular user id.

    Return a List of all installed packages that are currently holding any of the given permissions.

    Return the UID associated with the given package name.

    Retrieve all of the information we know about a particular group of permissions.

    Retrieve all of the information we know about a particular permission.

    Get the platform-defined permissions which belong to a particular permission group.

    Retrieve all preferred activities, previously added with #addPreferredActivity , that are currently registered with the system.

    Retrieve the list of all currently configured preferred packages.

    Returns the property defined in the given component declaration.

    Returns the property defined in the given component declaration.

    Retrieve all of the information we know about a particular content provider class.

    Retrieve all of the information we know about a particular receiver class.

    Retrieve the resources associated with an activity.

    Retrieve the resources for an application.

    Retrieve the resources for an application.

    Retrieve the resources for an application.

    Retrieve all of the information we know about a particular service class.

    Get a list of shared libraries on the device.

    Return whether a synthetic app details activity will be generated if the app has no enabled launcher activity.

    Get a list of features that are available on the system.

    Get a list of shared libraries that are available on the system.

    Retrieve text from a package.

    Retrieve text from a package.

    If the target user is a managed profile of the calling user or the caller is itself a managed profile, then this returns a badged copy of the given drawable allowing the user to distinguish it from the original drawable.

    If the target user is a managed profile, then this returns a badged copy of the given icon to be able to distinguish it from the original icon.

    If the target user is a managed profile of the calling user or the caller is itself a managed profile, then this returns a copy of the label with badging for accessibility services like talkback.

    If the target user is a managed profile of the calling user or the caller is itself a managed profile, then this returns a copy of the label with badging for accessibility services like talkback.

    Gets the restricted permissions that have been whitelisted and the app is allowed to have them granted in their full form.

    Retrieve an XML file from a package.

    Searches the set of signing certificates by which the package(s) for the given uid has proven to have been signed.

    Searches the set of signing certificates by which the package(s) for the given uid has proven to have been signed.

    Check whether the given feature name is one of the available features as returned by #getSystemAvailableFeatures() .

    Check whether the given feature name is one of the available features as returned by #getSystemAvailableFeatures() .

    Note: In retrospect it would have been preferred to use more inclusive terminology when naming this API.

    Gets whether this application is an instant app.

    Apps can query this to know if they have been suspended.

    Returns if the provided drawable represents the default activity icon provided by the system.

    Checks whether a particular permissions has been revoked for a package by policy.

    Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

    (Inherited from Object) Notify()

    Wakes up a single thread that is waiting on this object’s monitor.

    (Inherited from Object) NotifyAll()

    Wakes up all threads that are waiting on this object’s monitor.

    (Inherited from Object) QueryActivityProperty(String)

    Returns the property definition for all and tags.

    Returns the property definition for all tags.

    Retrieve all receivers that can handle a broadcast of the given intent.

    Retrieve content provider information.

    Retrieve information about available instrumentation code.

    Retrieve all activities that can be performed for the given intent.

    Retrieve a set of activities that should be presented to the user as similar options.

    Retrieve all providers that can match the given intent.

    Retrieve all services that can match the given intent.

    Query for all of the permissions associated with a particular group.

    Returns the property definition for all

    Returns the property definition for all tags.

    Returns the property definition for all tags.

    Removes a permission that was previously added with #addPermission(PermissionInfo) .

    Removes a whitelisted restricted permission for an app.

    Requesting the checksums for APKs within a package.

    Determine the best action to perform for a given Intent.

    Find a single content provider by its authority.

    Determine the best service to handle for a given Intent.

    Provide a hint of what the ApplicationInfo#category value should be for the given package.

    Set the enabled setting for an application This setting will override any enabled state which may have been set by the application in its manifest.

    Marks an application exempt from having its permissions be automatically revoked when the app is unused for an extended period of time.

    Set the enabled setting for a package component (activity, receiver, service, provider).

    Sets the Handle property.

    (Inherited from Object) SetInstallerPackageName(String, String)

    Change the installer associated with a given package.

    Sets MIME group’s MIME types.

    Returns a string representation of the object.

    (Inherited from Object) UnregisterFromRuntime() (Inherited from Object) UpdateInstantAppCookie(Byte[])

    Updates the instant application cookie for the calling app.

    Allows a package listening to the Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification broadcast to respond to the package manager.

    Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

    (Inherited from Object) Wait(Int64)

    Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

    (Inherited from Object) Wait(Int64, Int32)

    Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

    (Inherited from Object)

    Explicit Interface Implementations

    IJavaPeerable.Disposed() (Inherited from Object)
    IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
    IJavaPeerable.Finalized() (Inherited from Object)
    IJavaPeerable.JniManagedPeerState (Inherited from Object)
    IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
    IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
    IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

    Extension Methods

    Performs an Android runtime-checked type conversion.

    Источник

    Читайте также:  Android activity view layout
    Оцените статью