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

Commit 8ae47f5d authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Fix the hardcoded "phone" in COMPUTER summary

ag/33149787 fixed the app name regression but removed the device type
handling. Adding it back and removing the custom COMPUTER profile
logic in the activity.

No-op for phones, device name will be correct on tablets and other
devices.

Bug: 411421690
Test: presubmit & manual
Flag: EXEMPT trivial bugfix
Change-Id: I6c4f1142c0b84040a285ea2738f138b0e12b5edb
parent db990e60
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -87,7 +87,8 @@
    <!-- ================= DEVICE_PROFILE_COMPUTER ================= -->

    <!-- Confirmation for associating an application with a companion device of COMPUTER profile (type) [CHAR LIMIT=NONE] -->
    <string name="title_computer">Allow &lt;strong&gt;<xliff:g id="display_name" example="Chromebook">%1$s</xliff:g>&lt;/strong&gt; to access this information from your phone</string>
    <string name="title_computer">Allow &lt;strong&gt;<xliff:g id="display_name" example="Chromebook">%3$s</xliff:g>&lt;/strong&gt; to access this information from your <xliff:g id="device_type" example="phone">%2$s</xliff:g></string>

    <!-- Description of the helper dialog for COMPUTER profile. [CHAR LIMIT=NONE] -->
    <string name="helper_summary_computer"><xliff:g id="app_name" example="GMS">%1$s</xliff:g> is requesting permission on behalf of your <xliff:g id="device_name" example="Chromebook">%2$s</xliff:g> to access your <xliff:g id="device_type" example="phone">%3$s</xliff:g>\u2019s photos, media, and notifications</string>

+2 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.companiondevicemanager;

import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER;
import static android.companion.CompanionDeviceManager.RESULT_INTERNAL_ERROR;
import static android.companion.CompanionDeviceManager.RESULT_SECURITY_ERROR;
import static android.companion.CompanionDeviceManager.RESULT_USER_REJECTED;
@@ -497,12 +496,8 @@ public class CompanionAssociationActivity extends FragmentActivity implements
            return;
        }

        if (DEVICE_PROFILE_COMPUTER.equals(deviceProfile)) {
            title = getHtmlFromResources(this, PROFILE_TITLES.get(deviceProfile), deviceName);
        } else {
        title = getHtmlFromResources(this, PROFILE_TITLES.get(deviceProfile), mAppLabel,
                getString(R.string.device_type), deviceName);
        }

        if (deviceIcon != null) {
            mDeviceIcon.setImageIcon(deviceIcon);