summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2015-07-10 17:20:45 -0400
committerJulia Reynolds <juliacr@google.com>2015-07-13 10:38:38 -0400
commit2b5cc1da682ffe011f71b26f27eacdba68e1f8bb (patch)
tree4caf50a6affa6178ef45b58195695ead89205cc8 /src
parent57b5d43f4839c62225cf616296f464b0739e66ba (diff)
downloadandroid_packages_apps_PackageInstaller-2b5cc1da682ffe011f71b26f27eacdba68e1f8bb.tar.gz
android_packages_apps_PackageInstaller-2b5cc1da682ffe011f71b26f27eacdba68e1f8bb.tar.bz2
android_packages_apps_PackageInstaller-2b5cc1da682ffe011f71b26f27eacdba68e1f8bb.zip
Remove personal/device group & skip perm screen for M+ apps.
Bug: 22229417 Change-Id: I30d7e7a2e7abf4dcf70adb055d3252ee4941cd42
Diffstat (limited to 'src')
-rw-r--r--src/com/android/packageinstaller/PackageInstallerActivity.java93
1 files changed, 47 insertions, 46 deletions
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java
index 9153d71a..e9b50315 100644
--- a/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -36,6 +36,7 @@ import android.content.pm.PackageUserState;
import android.content.pm.ResolveInfo;
import android.content.pm.VerificationParams;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.UserManager;
@@ -132,8 +133,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
int msg = 0;
if (mPkgInfo != null) {
AppSecurityPermissions perms = new AppSecurityPermissions(this, mPkgInfo);
- final int NP = perms.getPermissionCount(AppSecurityPermissions.WHICH_PERSONAL);
- final int ND = perms.getPermissionCount(AppSecurityPermissions.WHICH_DEVICE);
+ final int N = perms.getPermissionCount(AppSecurityPermissions.WHICH_ALL);
if (mAppInfo != null) {
msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
? R.string.install_confirm_question_update_system
@@ -160,7 +160,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
findViewById(R.id.tabscontainer).setVisibility(View.GONE);
findViewById(R.id.divider).setVisibility(View.VISIBLE);
}
- if (NP > 0 || ND > 0) {
+ if (N > 0) {
permVisible = true;
LayoutInflater inflater = (LayoutInflater)getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
@@ -168,18 +168,8 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
if (mScrollView == null) {
mScrollView = (CaffeinatedScrollView)root.findViewById(R.id.scrollview);
}
- if (NP > 0) {
- ((ViewGroup)root.findViewById(R.id.privacylist)).addView(
- perms.getPermissionsView(AppSecurityPermissions.WHICH_PERSONAL));
- } else {
- root.findViewById(R.id.privacylist).setVisibility(View.GONE);
- }
- if (ND > 0) {
- ((ViewGroup)root.findViewById(R.id.devicelist)).addView(
- perms.getPermissionsView(AppSecurityPermissions.WHICH_DEVICE));
- } else {
- root.findViewById(R.id.devicelist).setVisibility(View.GONE);
- }
+ ((ViewGroup)root.findViewById(R.id.permission_list)).addView(
+ perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL));
adapter.addTab(tabHost.newTabSpec(TAB_ID_ALL).setIndicator(
getText(R.string.allPerms)), root);
}
@@ -402,6 +392,12 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
}
private void initiateInstall() {
+ if (mPkgInfo.applicationInfo
+ .targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1) {
+ startInstall();
+ return;
+ }
+
String pkgName = mPkgInfo.packageName;
// Check if there is already a package on the device with this name
// but it has been renamed to something else.
@@ -665,39 +661,10 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
// story ends; assume success.
mInstallFlowAnalytics.setFlowFinishedWithPackageManagerResult(
PackageManager.INSTALL_SUCCEEDED);
+ finish();
} else {
- // Start subactivity to actually install the application
- Intent newIntent = new Intent();
- newIntent.putExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO,
- mPkgInfo.applicationInfo);
- newIntent.setData(mPackageURI);
- newIntent.setClass(this, InstallAppProgress.class);
- newIntent.putExtra(InstallAppProgress.EXTRA_MANIFEST_DIGEST, mPkgDigest);
- newIntent.putExtra(
- InstallAppProgress.EXTRA_INSTALL_FLOW_ANALYTICS, mInstallFlowAnalytics);
- String installerPackageName = getIntent().getStringExtra(
- Intent.EXTRA_INSTALLER_PACKAGE_NAME);
- if (mOriginatingURI != null) {
- newIntent.putExtra(Intent.EXTRA_ORIGINATING_URI, mOriginatingURI);
- }
- if (mReferrerURI != null) {
- newIntent.putExtra(Intent.EXTRA_REFERRER, mReferrerURI);
- }
- if (mOriginatingUid != VerificationParams.NO_UID) {
- newIntent.putExtra(Intent.EXTRA_ORIGINATING_UID, mOriginatingUid);
- }
- if (installerPackageName != null) {
- newIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME,
- installerPackageName);
- }
- if (getIntent().getBooleanExtra(Intent.EXTRA_RETURN_RESULT, false)) {
- newIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
- newIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
- }
- if(localLOGV) Log.i(TAG, "downloaded app uri="+mPackageURI);
- startActivity(newIntent);
+ startInstall();
}
- finish();
} else {
mScrollView.pageScroll(View.FOCUS_DOWN);
}
@@ -712,4 +679,38 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen
finish();
}
}
+
+ private void startInstall() {
+ // Start subactivity to actually install the application
+ Intent newIntent = new Intent();
+ newIntent.putExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO,
+ mPkgInfo.applicationInfo);
+ newIntent.setData(mPackageURI);
+ newIntent.setClass(this, InstallAppProgress.class);
+ newIntent.putExtra(InstallAppProgress.EXTRA_MANIFEST_DIGEST, mPkgDigest);
+ newIntent.putExtra(
+ InstallAppProgress.EXTRA_INSTALL_FLOW_ANALYTICS, mInstallFlowAnalytics);
+ String installerPackageName = getIntent().getStringExtra(
+ Intent.EXTRA_INSTALLER_PACKAGE_NAME);
+ if (mOriginatingURI != null) {
+ newIntent.putExtra(Intent.EXTRA_ORIGINATING_URI, mOriginatingURI);
+ }
+ if (mReferrerURI != null) {
+ newIntent.putExtra(Intent.EXTRA_REFERRER, mReferrerURI);
+ }
+ if (mOriginatingUid != VerificationParams.NO_UID) {
+ newIntent.putExtra(Intent.EXTRA_ORIGINATING_UID, mOriginatingUid);
+ }
+ if (installerPackageName != null) {
+ newIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME,
+ installerPackageName);
+ }
+ if (getIntent().getBooleanExtra(Intent.EXTRA_RETURN_RESULT, false)) {
+ newIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
+ newIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
+ }
+ if(localLOGV) Log.i(TAG, "downloaded app uri="+mPackageURI);
+ startActivity(newIntent);
+ finish();
+ }
}