public class XiaomiUpdateAgent
extends java.lang.Object
| Constructor and Description |
|---|
XiaomiUpdateAgent() |
| Modifier and Type | Method and Description |
|---|---|
static void |
arrange()
触发下载安装流程。
当setUpdateAutoPopup(true)时, 会在用户点击升级对话框的升级按钮时, 触发下载安装。
当setUpdateAutoPopup(false)时, 检查到更新后.
|
static void |
enableDebug(boolean enable)
是否开启调试
|
static AbTestIdentifier |
getAbTestIdentifier() |
static long |
getDownloadId() |
static int |
getSDKVersion()
返回当前sdk版本号
|
static void |
setAbTestIdentifer(AbTestIdentifier identifer)
设置灰度参数, 默认采用AndroidId作为灰度参数,可选择AndroidId和ImeiMd5.
|
static void |
setCheckUpdateOnlyWifi(boolean checkUpdateOnlyWifi)
设置是否仅在wifi下检查更新
|
static void |
setServer(ServerType server)
选择要使用的服务器类型,用于debug, 可选参数:ServerType.PRODUCT, ServerType.PREVIEW, ServerType.STAGING
|
static void |
setUpdateAutoPopup(boolean autoPopup) |
static void |
setUpdateListener(XiaomiUpdateListener updateListener)
设置检查更新结果回调函数.
|
static void |
setUpdateMethod(Constants.UpdateMethod method)
set priority updateMethod , con`t ensure use mi market to update apps
|
static void |
setUseImeiMd5AsIdentifier(boolean value)
Deprecated.
|
static void |
setUseInternationalHost(boolean useInternational)
设置是否使用海外地区apk.
|
static void |
update(android.content.Context context,
boolean useSandbox)
触发检查更新
|
static boolean |
useImeiMd5AsIdentifier() |
public static void enableDebug(boolean enable)
enable - public static void update(android.content.Context context,
boolean useSandbox)
context - 会以WeakRerference的形式存在, 若检查更新结果返回时, context已销毁,
此次检查更新被忽略useSandbox - 是否使用沙盒测试public static void setUseInternationalHost(boolean useInternational)
useInternational - public static void setServer(ServerType server)
server - public static void arrange()
public static void setUpdateAutoPopup(boolean autoPopup)
autoPopup - 设置有可更新包时, 是否自动弹出升级对话框, 默认为truepublic static void setCheckUpdateOnlyWifi(boolean checkUpdateOnlyWifi)
checkUpdateOnlyWifi - public static void setUpdateListener(XiaomiUpdateListener updateListener)
updateListener - public static int getSDKVersion()
public static void setUpdateMethod(Constants.UpdateMethod method)
method - public static long getDownloadId()
@Deprecated public static void setUseImeiMd5AsIdentifier(boolean value)
value - public static void setAbTestIdentifer(AbTestIdentifier identifer)
identifer - public static AbTestIdentifier getAbTestIdentifier()
public static boolean useImeiMd5AsIdentifier()