当前位置: 首页>>代码示例>>Java>>正文


Java InstallConfirmActivity类代码示例

本文整理汇总了Java中org.fdroid.fdroid.privileged.views.InstallConfirmActivity的典型用法代码示例。如果您正苦于以下问题:Java InstallConfirmActivity类的具体用法?Java InstallConfirmActivity怎么用?Java InstallConfirmActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InstallConfirmActivity类属于org.fdroid.fdroid.privileged.views包,在下文中一共展示了InstallConfirmActivity类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPermissionScreen

import org.fdroid.fdroid.privileged.views.InstallConfirmActivity; //导入依赖的package包/类
/**
 * Returns permission screen for given apk.
 *
 * @return Intent with Activity to show required permissions.
 * Returns null if Installer handles that on itself, e.g., with DefaultInstaller,
 * or if no new permissions have been introduced during an update
 */
public Intent getPermissionScreen() {
    if (!isUnattended()) {
        return null;
    }

    int count = newPermissionCount();
    if (count == 0) {
        // no permission screen needed!
        return null;
    }
    Uri uri = ApkProvider.getApkFromAnyRepoUri(apk);
    Intent intent = new Intent(context, InstallConfirmActivity.class);
    intent.setData(uri);

    return intent;
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:24,代码来源:Installer.java

示例2: installPackageInternal

import org.fdroid.fdroid.privileged.views.InstallConfirmActivity; //导入依赖的package包/类
@Override
protected void installPackageInternal(File apkFile) throws InstallFailedException {
    Uri packageUri = Uri.fromFile(apkFile);
    int count = newPermissionCount(packageUri);
    if (count < 0) {
        mCallback.onError(InstallerCallback.OPERATION_INSTALL,
                InstallerCallback.ERROR_CODE_CANNOT_PARSE);
        return;
    }
    if (count > 0) {
        Intent intent = new Intent(mContext, InstallConfirmActivity.class);
        intent.setData(packageUri);
        mActivity.startActivityForResult(intent, REQUEST_CONFIRM_PERMS);
    } else {
        try {
            doInstallPackageInternal(packageUri);
        } catch (InstallFailedException e) {
            mCallback.onError(InstallerCallback.OPERATION_INSTALL,
                    InstallerCallback.ERROR_CODE_OTHER);
        }
    }
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:23,代码来源:PrivilegedInstaller.java

示例3: handleOnActivityResult

import org.fdroid.fdroid.privileged.views.InstallConfirmActivity; //导入依赖的package包/类
@Override
public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case REQUEST_CONFIRM_PERMS:
            if (resultCode == Activity.RESULT_OK) {
                final Uri packageUri = data.getData();
                try {
                    doInstallPackageInternal(packageUri);
                } catch (InstallFailedException e) {
                    mCallback.onError(InstallerCallback.OPERATION_INSTALL,
                            InstallerCallback.ERROR_CODE_OTHER);
                }
            } else if (resultCode == InstallConfirmActivity.RESULT_CANNOT_PARSE) {
                mCallback.onError(InstallerCallback.OPERATION_INSTALL,
                        InstallerCallback.ERROR_CODE_CANNOT_PARSE);
            } else { // Activity.RESULT_CANCELED
                mCallback.onError(InstallerCallback.OPERATION_INSTALL,
                        InstallerCallback.ERROR_CODE_CANCELED);
            }
            return true;
        default:
            return false;
    }
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:25,代码来源:PrivilegedInstaller.java


注:本文中的org.fdroid.fdroid.privileged.views.InstallConfirmActivity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。