封裝訊息
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 () 如果這是一個持久性應用程序,則傳回 |
boolean | isSystemApp () 如果這是系統應用程序,則傳回 |
boolean | isUpdatedSystemApp () 如果這是已更新的系統應用程序,則傳回 |
常數
FLAG_PERSISENTENT
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」屬性(例如在 froyo 裝置上),這將傳回null
。
退貨 | |
---|---|
String |
是持久化應用程式
public boolean isPersistentApp ()
如果這是一個持久性應用程序,則傳回true
。
退貨 | |
---|---|
boolean |
是系統應用程式
public boolean isSystemApp ()
如果這是系統應用程序,則傳回true
。
退貨 | |
---|---|
boolean |
已更新系統應用程式
public boolean isUpdatedSystemApp ()
如果這是已更新的系統應用程序,則傳回true
。
退貨 | |
---|---|
boolean |