summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-04-24 15:15:48 -0700
committerRoman Birg <roman@cyngn.com>2015-04-27 13:30:08 -0700
commit3c37b0b69c0d7e0d95814019bbe48f46e204d34e (patch)
treeb347a7eb7f7b5cd27963fd71c2d8b7e18e2efefa
parent2a98e6f6f6811a478a4e60dd770f1993db4213cb (diff)
downloadpackages_apps_SetupWizard-3c37b0b69c0d7e0d95814019bbe48f46e204d34e.zip
packages_apps_SetupWizard-3c37b0b69c0d7e0d95814019bbe48f46e204d34e.tar.gz
packages_apps_SetupWizard-3c37b0b69c0d7e0d95814019bbe48f46e204d34e.tar.bz2
SetupWizard: update stats permission and package
Change-Id: I3ef19b616422ca5cc0896840753192b1c1712525 Signed-off-by: Roman Birg <roman@cyngn.com>
-rw-r--r--src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java4
-rw-r--r--src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java b/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
index ba73076..ea881f9 100644
--- a/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
+++ b/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
@@ -28,8 +28,8 @@ public class SetupStats {
private static final String TAG = SetupStats.class.getSimpleName();
- private static final String ANALYTIC_INTENT = "com.cyngn.cmstats.action.SEND_ANALYTIC_EVENT";
- private static final String ANALYTIC_PERMISSION = "com.cyngn.cmstats.RECEIVE_ANALYTICS";
+ private static final String ANALYTIC_INTENT = "com.cyngn.stats.action.SEND_ANALYTIC_EVENT";
+ private static final String ANALYTIC_PERMISSION = "com.cyngn.stats.SEND_ANALYTICS";
public static final String TRACKING_ID = "tracking_id";
diff --git a/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java b/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
index 8271e68..b8c58c1 100644
--- a/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
+++ b/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
@@ -18,12 +18,13 @@
package com.cyanogenmod.setupwizard.cmstats;
import android.content.Context;
+import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.provider.Settings;
public class StatsUtils {
- private static final String STATS_PACKAGE = "com.cyngn.cmstats";
+ private static final String STATS_PACKAGE = "com.cyngn.stats";
public static boolean isStatsCollectionEnabled(Context context) {
return Settings.Secure.getInt(context.getContentResolver(),
@@ -33,7 +34,8 @@ public class StatsUtils {
public static boolean isStatsPackageInstalled(Context context) {
try {
PackageInfo pi = context.getPackageManager().getPackageInfo(STATS_PACKAGE, 0);
- return pi.applicationInfo.enabled;
+ return pi.applicationInfo.enabled
+ && ((pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
} catch (PackageManager.NameNotFoundException e) {
return false;
}