diff --git a/res/values/strings.xml b/res/values/strings.xml index 123a8bf0091..529a363348d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5226,4 +5226,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; + } } +