From 7b30bc34492a0c53b02cec2fee7d0993da407fc4 Mon Sep 17 00:00:00 2001 From: Alex Klyubin Date: Wed, 4 Sep 2013 11:20:31 -0700 Subject: Record analytics about package install attempts to Event Log. The purpose of this change is to provide analytics about the various stages of the install flow. Recorded information does not contain user-, device-, or package/app-identifying information. Examples of recorded information are: * duration of the flow (start to finish) * duration of the flow until the moment the user clicks Install * whether the attempt is an update or a new install. * whether app verification is enabled. * whether Unknown Sources is enabled. * whether the attempt was blocked by Unknown Sources. * whether permissions were displayed. * error code (if any) returned by PackageManager when installing the package. Bug: 10605940 Change-Id: I9bc009223a365a558cdf02bd91cf4315b82564c2 --- src/com/android/packageinstaller/InstallAppProgress.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/android/packageinstaller/InstallAppProgress.java') diff --git a/src/com/android/packageinstaller/InstallAppProgress.java b/src/com/android/packageinstaller/InstallAppProgress.java index 71c792ee..f5282cfd 100755 --- a/src/com/android/packageinstaller/InstallAppProgress.java +++ b/src/com/android/packageinstaller/InstallAppProgress.java @@ -57,8 +57,11 @@ public class InstallAppProgress extends Activity implements View.OnClickListener private boolean localLOGV = false; static final String EXTRA_MANIFEST_DIGEST = "com.android.packageinstaller.extras.manifest_digest"; + static final String EXTRA_INSTALL_FLOW_ANALYTICS = + "com.android.packageinstaller.extras.install_flow_analytics"; private ApplicationInfo mAppInfo; private Uri mPackageURI; + private InstallFlowAnalytics mInstallFlowAnalytics; private ProgressBar mProgressBar; private View mOkPanel; private TextView mStatusTextView; @@ -74,6 +77,7 @@ public class InstallAppProgress extends Activity implements View.OnClickListener public void handleMessage(Message msg) { switch (msg.what) { case INSTALL_COMPLETE: + mInstallFlowAnalytics.setFlowFinishedWithPackageManagerResult(msg.arg1); if (getIntent().getBooleanExtra(Intent.EXTRA_RETURN_RESULT, false)) { Intent result = new Intent(); result.putExtra(Intent.EXTRA_INSTALL_RESULT, msg.arg1); @@ -163,10 +167,13 @@ public class InstallAppProgress extends Activity implements View.OnClickListener super.onCreate(icicle); Intent intent = getIntent(); mAppInfo = intent.getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO); + mInstallFlowAnalytics = intent.getParcelableExtra(EXTRA_INSTALL_FLOW_ANALYTICS); mPackageURI = intent.getData(); final String scheme = mPackageURI.getScheme(); if (scheme != null && !"file".equals(scheme) && !"package".equals(scheme)) { + mInstallFlowAnalytics.setFlowFinished( + InstallFlowAnalytics.RESULT_FAILED_UNSUPPORTED_SCHEME); throw new IllegalArgumentException("unexpected scheme " + scheme); } -- cgit v1.2.3