PackageInfo
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_PERSISTENT
public static final int FLAG_PERSISTENT
常數值: 8 (0x00000008)
公用方法
addPerUserAttribute
public void addPerUserAttribute (int userId, String attr, String value)
參數 | |
---|---|
userId |
int |
attr |
String |
value |
String |
getCodePath
public String getCodePath ()
傳回套件在檔案系統中的所在位置。
傳回 | |
---|---|
String |
getFirstInstallTime
public String getFirstInstallTime (int userId)
參數 | |
---|---|
userId |
int |
傳回 | |
---|---|
String |
getPackageName
public String getPackageName ()
傳回應用程式的套件名稱。
傳回 | |
---|---|
String |
getVersionCode
public String getVersionCode ()
傳回應用程式的版本名稱。注意:如果找不到「versionCode」屬性,系統會傳回 null
傳回 | |
---|---|
String |
getVersionName
public String getVersionName ()
傳回應用程式的版本名稱。注意:如果找不到「versionName」屬性 (例如在 Froyo 裝置上),這個方法會傳回 null
。
傳回 | |
---|---|
String |
isPersistentApp
public boolean isPersistentApp ()
如果是持續性應用程式,則傳回 true
。
傳回 | |
---|---|
boolean |
isSystemApp
public boolean isSystemApp ()
如果是系統應用程式,就會傳回 true
。
傳回 | |
---|---|
boolean |
isUpdatedSystemApp
public boolean isUpdatedSystemApp ()
如果這是已更新的系統應用程式,則傳回 true
。
傳回 | |
---|---|
boolean |