Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f13a6a17 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Add new section in Apps screen to show app installer name." into nyc-dev

parents 25d69a1a d6807c37
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3441,6 +3441,13 @@
        If you turn off notifications for this app, you may miss important alerts and updates.
    </string>
    <!-- Manage applications, individual application info screen, section heading for information about the app installer [CHAR_LIMIT=25] -->
    <string name="app_install_details_group_title">Store</string>
    <!-- Manage applications, individual application info screen, title for the option which will trigger application info in it's installer [CHAR_LIMIT=25] -->
    <string name="app_install_details_title">App details</string>
    <!-- Manage applications, individual application info screen, summary for the option which will trigger application info in it's installer [CHAR_LIMIT=50] -->
    <string name="app_install_details_summary">App installed from <xliff:g id="app_store">%1$s</xliff:g></string>
    <!-- App Ops Settings --> <skip />
    <!-- [CHAR LIMIT=NONE] App ops settings title, on main settings screen. If clicked, the user is taken to a settings screen for app operations -->
    <string name="app_ops_settings">App ops</string>
+21 −1
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ public class InstalledAppDetails extends AppInfoBase

    private Intent resolveIntent(Intent i) {
        ResolveInfo result = getContext().getPackageManager().resolveActivity(i, 0);
        return result != null ? new Intent(Intent.ACTION_APPLICATION_PREFERENCES)
        return result != null ? new Intent(i.getAction())
                .setClassName(result.activityInfo.packageName, result.activityInfo.name) : null;
    }

@@ -902,6 +902,26 @@ public class InstalledAppDetails extends AppInfoBase
                category.addPreference(pref);
            }
        }

        final String installerPackageName =
                getContext().getPackageManager().getInstallerPackageName(mPackageName);
        if (installerPackageName != null) {
            final Intent intent = new Intent(Intent.ACTION_SHOW_APP_INFO)
                    .setPackage(installerPackageName);
            final Intent result = resolveIntent(intent);
            if (result != null) {
                result.putExtra(Intent.EXTRA_PACKAGE_NAME, mPackageName);
                PreferenceCategory category = new PreferenceCategory(getPrefContext());
                category.setTitle(R.string.app_install_details_group_title);
                screen.addPreference(category);
                Preference pref = new Preference(getPrefContext());
                pref.setTitle(R.string.app_install_details_title);
                pref.setKey("app_info_store");
                pref.setSummary(getString(R.string.app_install_details_summary, mAppEntry.label));
                pref.setIntent(result);
                category.addPreference(pref);
            }
        }
    }

    private boolean hasPermission(String permission) {