包裝信息

public class PackageInfo
extends Object

java.lang.Object
com.android.tradefed.device.PackageInfo


從設備解析的應用程序包信息的容器。

概括

常量

int FLAG_PERSISTENT

公共方法

void addPerUserAttribute (int userId, String attr, String value)
String getCodePath ()

返回包在文件系統中的位置。

String getFirstInstallTime (int userId)
String getPackageName ()

返回應用程序的包名稱。

String getVersionCode ()

返回應用程序的版本名稱。

String getVersionName ()

返回應用程序的版本名稱。

boolean isPersistentApp ()

如果這是一個持久性應用程序,則返回true

boolean isSystemApp ()

如果這是系統應用程序,則返回true

boolean isUpdatedSystemApp ()

如果這是已更新的系統應用程序,則返回true

常量

FLAG_PERSISTENT

public static final int FLAG_PERSISTENT

常量值:8 (0x00000008)

公共方法

添加每個用戶屬性

public void addPerUserAttribute (int userId, 
                String attr, 
                String value)

參數
userId int

attr String

value String

獲取代碼路徑

public String getCodePath ()

返回包在文件系統中的位置。

退貨
String

獲取首次安裝時間

public String getFirstInstallTime (int userId)

參數
userId int

退貨
String

獲取包名

public String getPackageName ()

返回應用程序的包名稱。

退貨
String

獲取版本號

public String getVersionCode ()

返回應用程序的版本名稱。注意:如果未找到“versionCode”屬性,這將返回null

退貨
String

獲取版本名稱

public String getVersionName ()

返回應用程序的版本名稱。注意:如果未找到“versionName”屬性,這將返回null ,例如在 froyo 設備上。

退貨
String

isPersistentApp

public boolean isPersistentApp ()

如果這是一個持久性應用程序,則返回true

退貨
boolean

isSystemApp

public boolean isSystemApp ()

如果這是系統應用程序,則返回true

退貨
boolean

isUpdatedSystemApp

public boolean isUpdatedSystemApp ()

如果這是已更新的系統應用程序,則返回true

退貨
boolean