From b42573d0e6870b026110ece22f13dc15452d507c Mon Sep 17 00:00:00 2001 From: Rajat Dewan Date: Tue, 29 Apr 2014 20:32:37 -0700 Subject: [PATCH] Adding code to invoke feedback for the device. Please also see http://ag/457938 Change-Id: I842e7211b339ece7066523c503db6e7b0eb12f40 --- res/values/strings.xml | 6 ++ res/xml/device_info_settings.xml | 5 ++ .../android/settings/DeviceInfoSettings.java | 63 ++++++++++++++++++- 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 1eae3aec5c4..0c738935f08 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5206,4 +5206,10 @@ %s next day + + + Send feedback about this device + + + diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml index 07abe41a6ac..0261b67e934 100644 --- a/res/xml/device_info_settings.xml +++ b/res/xml/device_info_settings.xml @@ -95,6 +95,11 @@ + + + + resolvedPackages = + pm.queryIntentActivities(intent, PackageManager.GET_RESOLVED_FILTER); + for (ResolveInfo info : resolvedPackages) { + if (info.activityInfo != null) { + if (!TextUtils.isEmpty(info.activityInfo.packageName)) { + try { + ApplicationInfo ai = pm.getApplicationInfo(info.activityInfo.packageName, 0); + if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { + // Package is on the system image + if (TextUtils.equals( + info.activityInfo.packageName, feedbackReporter)) { + return feedbackReporter; + } + } + } catch (PackageManager.NameNotFoundException e) { + // No need to do anything here. + } + } + } + } + return null; + } } +