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

Commit 45099b0b authored by Sumedh Sen's avatar Sumedh Sen
Browse files

Make app store names bold in update owner dialog

As per latest mocks, app store names need to appear bold in update
ownership confirmation dialog.
Before: https://screenshot.googleplex.com/6EDQrp5HM46yk2P.png
After: https://screenshot.googleplex.com/7ucHAaipQZ3EToX.png

Bug: 279728191
Test: atest CtsPackageInstallTestCases:UpdateOwnershipEnforcementTest
Test: Manual, verify text matches mocks
Change-Id: Ib192ffb53a1346c694a664c6add3f5a9b330882e
parent ce82c0f4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -38,11 +38,11 @@
    <!-- Message for updating an existing app [CHAR LIMIT=NONE] -->
    <string name="install_confirm_question_update">Do you want to update this app?</string>
    <!-- Message for updating an existing app with update owner reminder [CHAR LIMIT=NONE] -->
    <string name="install_confirm_question_update_owner_reminder" product="tablet">Update this app from <xliff:g id="new_update_owner">%1$s</xliff:g>?\n\nThis app normally receives updates from <xliff:g id="existing_update_owner">%2$s</xliff:g>. By updating from a different source, you may receive future updates from any source on your tablet. App functionality may change.</string>
    <string name="install_confirm_question_update_owner_reminder" product="tablet">&lt;p>Update this app from &lt;b><xliff:g id="new_update_owner">%1$s</xliff:g>&lt;/b>\?&lt;/p>&lt;p>This app normally receives updates from &lt;b><xliff:g id="existing_update_owner">%2$s</xliff:g>&lt;/b>. By updating from a different source, you may receive future updates from any source on your tablet. App functionality may change.&lt;/p></string>
    <!-- Message for updating an existing app with update owner reminder [CHAR LIMIT=NONE] -->
    <string name="install_confirm_question_update_owner_reminder" product="tv">Update this app from <xliff:g id="new_update_owner">%1$s</xliff:g>?\n\nThis app normally receives updates from <xliff:g id="existing_update_owner">%2$s</xliff:g>. By updating from a different source, you may receive future updates from any source on your TV. App functionality may change.</string>
    <string name="install_confirm_question_update_owner_reminder" product="tv">&lt;p>Update this app from &lt;b><xliff:g id="new_update_owner">%1$s</xliff:g>&lt;/b>\?&lt;/p>&lt;p>This app normally receives updates from &lt;b><xliff:g id="existing_update_owner">%2$s</xliff:g>&lt;/b>. By updating from a different source, you may receive future updates from any source on your TV. App functionality may change.&lt;/p></string>
    <!-- Message for updating an existing app with update owner reminder [CHAR LIMIT=NONE] -->
    <string name="install_confirm_question_update_owner_reminder" product="default">Update this app from <xliff:g id="new_update_owner">%1$s</xliff:g>?\n\nThis app normally receives updates from <xliff:g id="existing_update_owner">%2$s</xliff:g>. By updating from a different source, you may receive future updates from any source on your phone. App functionality may change.</string>
    <string name="install_confirm_question_update_owner_reminder" product="default">&lt;p>Update this app from &lt;b><xliff:g id="new_update_owner">%1$s</xliff:g>&lt;/b>\?&lt;/p>&lt;p>This app normally receives updates from &lt;b><xliff:g id="existing_update_owner">%2$s</xliff:g>&lt;/b>. By updating from a different source, you may receive future updates from any source on your phone. App functionality may change.&lt;/p></string>
    <!-- [CHAR LIMIT=100] -->
    <string name="install_failed">App not installed.</string>
    <!-- Reason displayed when installation fails because the package was blocked
+7 −2
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@@ -144,9 +146,12 @@ public class PackageInstallerActivity extends AlertActivity {
            final CharSequence requestedUpdateOwnerLabel = getApplicationLabel(mCallingPackage);
            if (!TextUtils.isEmpty(existingUpdateOwnerLabel)
                    && mPendingUserActionReason == PackageInstaller.REASON_REMIND_OWNERSHIP) {
                viewToEnable.setText(
                String updateOwnerString =
                        getString(R.string.install_confirm_question_update_owner_reminder,
                                requestedUpdateOwnerLabel, existingUpdateOwnerLabel));
                                requestedUpdateOwnerLabel, existingUpdateOwnerLabel);
                Spanned styledUpdateOwnerString =
                        Html.fromHtml(updateOwnerString, Html.FROM_HTML_MODE_LEGACY);
                viewToEnable.setText(styledUpdateOwnerString);
                mOk.setText(R.string.update_anyway);
            } else {
                mOk.setText(R.string.update);