Merge "Add dialog for COMPUTER profile"

This commit is contained in:
Evan Chen
2022-01-27 08:42:58 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -58,6 +58,14 @@
<!-- Description of the privileges the application will get if associated with the companion device of AUTOMOTIVE_PROJECTION profile (type) [CHAR LIMIT=NONE] -->
<string name="summary_automotive_projection"></string>
<!-- ================= 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="app_name" example="GMS">%1$s</xliff:g>&lt;/strong&gt; to access this information from your phone</string>
<!-- Description of the privileges the application will get if associated with the companion device of COMPUTER profile (type) [CHAR LIMIT=NONE] -->
<string name="summary_computer"></string>
<!-- ================= null profile ================= -->
<!-- A noun for a companion device with unspecified profile (type) [CHAR LIMIT=30] -->

View File

@@ -18,6 +18,7 @@ package com.android.companiondevicemanager;
import static android.companion.AssociationRequest.DEVICE_PROFILE_APP_STREAMING;
import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION;
import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER;
import static android.companion.AssociationRequest.DEVICE_PROFILE_WATCH;
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
@@ -317,6 +318,12 @@ public class CompanionDeviceActivity extends Activity {
this, R.string.summary_automotive_projection, appLabel, deviceName);
break;
case DEVICE_PROFILE_COMPUTER:
title = getHtmlFromResources(this, R.string.title_computer, appLabel);
summary = getHtmlFromResources(
this, R.string.summary_computer, appLabel, deviceName);
break;
default:
throw new RuntimeException("Unsupported profile " + deviceProfile);
}