droid_wrap::android::os

Struct Build_VERSION

Source
pub struct Build_VERSION { /* private fields */ }
Expand description

各种版本字符串。

Implementations§

Source§

impl Build_VERSION

Source

pub const INCREMENTAL: fn() -> String = {<{closure@src/android/os.rs:625:38: 625:40} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

底层源代码控制用来表示此构建的内部值。例如,perforce 变更列表编号或 git 哈希。

Source

pub const RELEASE: fn() -> String = {<{closure@src/android/os.rs:631:34: 631:36} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

用户可见版本字符串。 例如,“ 1.0”或“ 3.4B5”或“香蕉”。 此字段是一个不透明的字符串。不要假设其值具有任何特定结构,也不要假设不同版本的 RELEASE 值可以以某种方式排序。

Source

pub const RELEASE_OR_CODENAME: fn() -> String = {<{closure@src/android/os.rs:635:9: 635:11} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

版本字符串。如果不是最终发布版本,则可能是 RELEASE 或 CODENAME。

Source

pub const RELEASE_OR_PREVIEW_DISPLAY: fn() -> String = {<{closure@src/android/os.rs:639:9: 639:11} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

我们向用户展示的版本字符串;如果不是最终发布版本,则可能是 RELEASE 或描述性字符串。

Source

pub const BASE_OS: fn() -> String = {<{closure@src/android/os.rs:642:34: 642:36} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

产品所基于的基本操作系统构建。

Source

pub const SECURITY_PATCH: fn() -> String = {<{closure@src/android/os.rs:647:41: 647:43} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

用户可见的安全补丁级别。此值表示设备最近应用安全补丁的日期。

Source

pub const SDK: fn() -> String = {<{closure@src/android/os.rs:656:30: 656:32} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

👎Deprecated: 使用 SDK_INT 可轻松将其作为整数获取。

框架的原始字符串表示形式中用户可见的 SDK 版本;请改用 SDK_INT。

Source

pub const SDK_INT: fn() -> i32 = {<{closure@src/android/os.rs:660:9: 660:11} as std::ops::FnOnce<()>>::call_once as fn() -> i32}

此硬件设备上当前运行的软件的 SDK 版本。设备启动时此值不会改变,但硬件制造商提供 OTA 更新时此值可能会增加。可能的值在 Build.VERSION_CODES 中定义。

Source

pub const DEVICE_INITIAL_SDK_INT: fn() -> i32 = {<{closure@src/android/os.rs:664:9: 664:11} as std::ops::FnOnce<()>>::call_once as fn() -> i32}

此硬件设备上最初搭载的软件的 SDK 版本。该版本在设备生命周期内永远不会改变,即使 SDK_INT 因 OTA 更新而增加也是如此。可能的值在 Build.VERSION_CODES 中定义。

Source

pub const PREVIEW_SDK_INT: fn() -> i32 = {<{closure@src/android/os.rs:672:9: 672:11} as std::ops::FnOnce<()>>::call_once as fn() -> i32}

预发布 SDK 的开发者预览修订版本。在生产平台版本/设备上,此值始终为 0。 当此值非零时,自上次正式发布 SDK_INT API 级别以来添加的任何新 API 都只能保证在该特定预览修订版本中存在。例如,API Activity.fooBar() 可能存在于预览修订版本 1 中,但在预览修订版本 2 中被重命名或完全移除,这可能会导致尝试调用它的应用在运行时崩溃。 针对预览 API 的实验性应用在使用任何预发布平台 API 之前,应检查此值是否与它们所针对的预览 SDK 修订版本相等 (==)。如果应用检测到的预览 SDK 修订版本不是它们所期望的特定修订版本,则应回退到仅使用之前发布的 API 级别的 API,以避免不必要的运行时异常。

Source

pub const PREVIEW_SDK_FINGERPRINT: fn() -> String = {<{closure@src/android/os.rs:679:50: 679:52} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

给定预发布 SDK 的 SDK 指纹。此值在生产平台版本/设备上始终为“ ”。 当该值不是’’时。 此属性旨在供安装程序用于更细粒度地定位软件包。针对预览 API 的应用程序不应使用此字段,而应使用 或使用反射或其他运行时检查来检测 API 的存在或防止意外的运行时行为。

Source

pub const CODENAME: fn() -> String = {<{closure@src/android/os.rs:687:35: 687:37} as std::ops::FnOnce<()>>::call_once as fn() -> std::string::String}

当前开发代号,如果这是发布版本,则为字符串“REL”。

Source

pub const KNOWN_CODENAMES: fn() -> HashSet<String> = {<{closure@src/android/os.rs:694:59: 694:61} as std::ops::FnOnce<()>>::call_once as fn() -> std::collections::HashSet<std::string::String>}

VERSION_CODES 中存在的所有已知代号。 这也包括开发代号,即如果 CODENAME 不是“REL”,那么该集合中就存在该值。 如果此集合中不存在特定字符串,则它不是代号,或者是未来版本的代号。例如,在 Android R 开发期间,“Tiramisu”并不是一个已知的代号。

Source

pub const MIN_SUPPORTED_TARGET_SDK_INT: fn() -> i32 = {<{closure@src/android/os.rs:702:9: 702:11} as std::ops::FnOnce<()>>::call_once as fn() -> i32}

应用目标 SDK 当前支持的最低值。以较低值为目标的应用可能无法在运行此 SDK 版本的设备上运行。其可能的值在 Build.VERSION_CODES 中定义。

Methods from Deref<Target = GlobalRef>§

Source

pub fn as_obj(&self) -> &JObject<'static>

Get the object from the global ref

This borrows the ref and prevents it from being dropped as long as the JObject sticks around.

Methods from Deref<Target = JObject<'static>>§

Source

pub fn as_raw(&self) -> *mut _jobject

Returns the raw JNI pointer.

Trait Implementations§

Source§

impl Debug for Build_VERSION

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Build_VERSION

Source§

type Target = GlobalRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<&GlobalRef> for Build_VERSION

Source§

fn from(obj: &GlobalRef) -> Self

Converts to this type from the input type.
Source§

impl Into<GlobalRef> for &Build_VERSION

Source§

fn into(self) -> GlobalRef

Converts this type into the (usually inferred) input type.
Source§

impl JObjNew for Build_VERSION

Source§

type Fields = ()

字段类型
Source§

fn _new(this: &GlobalRef, fields: Self::Fields) -> Self

从java对象创建本地对象。 this java对象引用。
Source§

fn null() -> Self
where Self: Sized, Self::Fields: Default,

创建空对象。
Source§

impl JObjRef for Build_VERSION

Source§

fn java_ref(&self) -> GlobalRef

获取java对象引用。
Source§

impl JType for Build_VERSION

Source§

const CLASS: &'static str = "android/os/Build$VERSION"

java类的名称。
Source§

const OBJECT_SIG: &'static str = "Landroid/os/Build$VERSION;"

对象的签名描述。
Source§

type Error = Error

错误类型。
Source§

const DIM: u8 = 0u8

数组维度,0表示不是数组
Source§

impl PartialEq for Build_VERSION

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToString for Build_VERSION

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.