包装信息
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)
公共方法
添加每个用户属性
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 |