Merge "Disallow background run for admin users in auto."
diff --git a/car-lib/src/android/car/Car.java b/car-lib/src/android/car/Car.java
index 4a980af..673aec4 100644
--- a/car-lib/src/android/car/Car.java
+++ b/car-lib/src/android/car/Car.java
@@ -548,13 +548,11 @@
public void onServiceDisconnected(ComponentName name) {
synchronized (Car.this) {
- mService = null;
if (mConnectionState == STATE_DISCONNECTED) {
return;
}
- mConnectionState = STATE_DISCONNECTED;
}
- // unbind explicitly here.
+ // unbind explicitly and set connectionState to STATE_DISCONNECTED here.
disconnect();
mServiceConnectionListenerClient.onServiceDisconnected(name);
}
diff --git a/service/res/layout/activity_blocking.xml b/service/res/layout/activity_blocking.xml
index 5eddbf9..0c10016 100644
--- a/service/res/layout/activity_blocking.xml
+++ b/service/res/layout/activity_blocking.xml
@@ -20,16 +20,9 @@
android:orientation="vertical"
android:background="@color/activity_blocking_activity_background"
android:gravity="center">
- <TextView
- android:id="@+id/blocking_text"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:textAppearance="@style/ActivityBlockingActivityText" />
-
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:layout_marginTop="@dimen/common_margin"
android:orientation="horizontal"
android:gravity="center">
<ImageView
@@ -45,8 +38,23 @@
android:textAppearance="@style/ActivityBlockingActivityText" />
</LinearLayout>
+ <TextView
+ android:id="@+id/blocking_text"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="@dimen/common_margin"
+ android:gravity="center"
+ android:textAppearance="@style/ActivityBlockingActivityText" />
+
+ <!-- Show exit button if we need to (and are able to) restart the blocked task -->
+ <TextView
+ android:id="@+id/exit_button_message"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_marginTop="@dimen/common_margin"
+ android:textAppearance="@style/ActivityBlockingActivityText" />
<Button
- android:id="@+id/exit"
+ android:id="@+id/exit_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/common_margin"
diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml
index 69b9467..12e4511 100644
--- a/service/res/values/strings.xml
+++ b/service/res/values/strings.xml
@@ -13,51 +13,51 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources>
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_title" translatable="false">Car service</string>
<!-- For permissions -->
<!-- Permission text: can access your car's information [CHAR LIMIT=NONE] -->
<string name="car_permission_label">Car information</string>
<!-- Permission text: can access your car's information [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc">Access your car\'s information.</string>
+ <string name="car_permission_desc">Access your car\u2019s information.</string>
<!-- Permission text: apps can control car cabin [CHAR LIMIT=NONE] -->
<string name="car_permission_label_cabin">Car Cabin</string>
<!-- Permission text: apps can control car cabin [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_cabin">Access your car\'s accessories, including doors,
+ <string name="car_permission_desc_cabin">Access your car\u2019s accessories, including doors,
mirrors, seats, and windows.</string>
<!-- Permission text: apps can control car camera [CHAR LIMIT=NONE] -->
<string name="car_permission_label_camera">Car Camera</string>
<!-- Permission text: apps can control car camera [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_camera">Access your car\'s camera(s).</string>
+ <string name="car_permission_desc_camera">Access your car\u2019s camera(s).</string>
<!-- Permission text: can access your car's energy information [CHAR LIMIT=NONE] -->
<string name="car_permission_label_energy">Car energy</string>
<!-- Permission text: can access your car's energy information [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_energy">Access your car\'s energy information.</string>
+ <string name="car_permission_desc_energy">Access your car\u2019s energy information.</string>
<!-- Permission text: apps can control car hvac [CHAR LIMIT=NONE] -->
<string name="car_permission_label_hvac">Car Hvac</string>
<!-- Permission text: apps can control car hvac [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_hvac">Access your car\'s hvac.</string>
+ <string name="car_permission_desc_hvac">Access your car\u2019s hvac.</string>
<!-- Permission text: can access your car's mileage information [CHAR LIMIT=NONE] -->
<string name="car_permission_label_mileage">Car mileage</string>
<!-- Permission text: can access your car's mileage information [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_mileage">Access your car\'s mileage information.</string>
+ <string name="car_permission_desc_mileage">Access your car\u2019s mileage information.</string>
<!-- Permission text: can access your car's speed [CHAR LIMIT=NONE] -->
<string name="car_permission_label_speed">Car speed</string>
<!-- Permission text: can access your car's speed [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_speed">Access your car\'s speed.</string>
+ <string name="car_permission_desc_speed">Access your car\u2019s speed.</string>
<!-- Permission text: can access your car's dynamics state [CHAR LIMIT=NONE] -->
<string name="car_permission_label_vehicle_dynamics_state">Vehicle dynamics state</string>
<!-- Permission text: can access your car's dynamic state [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_vehicle_dynamics_state">Access your car\'s dynamics state</string>
+ <string name="car_permission_desc_vehicle_dynamics_state">Access your car\u2019s dynamics state</string>
<!-- Permission text: apps can access car-manufacturer specific data [CHAR LIMIT=NONE] -->
<string name="car_permission_label_vendor_extension">Car vendor channel</string>
<!-- Permission text: apps can access car-manufacturer specific data [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_vendor_extension">Access your car\'s vendor channel to
+ <string name="car_permission_desc_vendor_extension">Access your car\u2019s vendor channel to
exchange car-specific information.</string>
<!-- Permission text: apps can control car-radio [CHAR LIMIT=NONE] -->
<string name="car_permission_label_radio">Car Radio</string>
<!-- Permission text: apps can control car-radio [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_radio">Access your car\'s radio.</string>
+ <string name="car_permission_desc_radio">Access your car\u2019s radio.</string>
<!-- Permission text: apps can control car-projection [CHAR LIMIT=NONE] -->
<string name="car_permission_label_projection">Car Projection</string>
<!-- Permission text: apps can control car-audio-volume [CHAR LIMIT=NONE] -->
@@ -68,11 +68,11 @@
<string name="car_permission_desc_projection">Project phone interface on car display.</string>
<string name="car_permission_label_mock_vehicle_hal">Emulate vehicle HAL</string>
<!-- Permission text: can emulate information from your car [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_mock_vehicle_hal">Emulate your car\'s vehicle HAL for internal
+ <string name="car_permission_desc_mock_vehicle_hal">Emulate your car\u2019s vehicle HAL for internal
testing purpose.</string>
<!-- Permission text: can adjust the audio volume on your car [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_audio_volume">Control your car\'s audio volume.</string>
- <string name="car_permission_desc_audio_settings">Control your car\'s audio settings.</string>
+ <string name="car_permission_desc_audio_volume">Control your car\u2019s audio volume.</string>
+ <string name="car_permission_desc_audio_settings">Control your car\u2019s audio settings.</string>
<string name="car_permission_label_control_app_blocking">Application blocking</string>
<!-- Permission text: can emulate information from your car [CHAR LIMIT=NONE] -->
<string name="car_permission_desc_control_app_blocking">Control application blocking while
@@ -105,11 +105,13 @@
box and restart the car</string>
<!-- Blocking activity: Message to show to user when a feature of current application is not allowed. [CHAR LIMIT=120] -->
- <string name="activity_blocked_text">For your safety, this activity isn’t available while you’re driving</string>
+ <string name="activity_blocked_text">For your safety, this activity isn\u2019t available while driving.\nTo continue, wait until you\u2019re parked.</string>
+ <!-- Blocking activity: Message to accompany the exit_button that restarts the blocked app. [CHAR LIMIT=120] -->
+ <string name="exit_button_message">To start over with safe app features, select <xliff:g id="exit_button" example="Back">%s</xliff:g>.</string>
+ <!-- Blocking activity: Text for button that restarts the current blocked application. [CHAR LIMIT=15] -->
+ <string name="exit_button">Back</string>
<!-- Blocking activity: Text for button that shows debug info for non-user build. [CHAR LIMIT=10] -->
<string name="debug_button_text">Debug Info</string>
- <!-- Blocking activity: Text for button that restarts the current blocked application. [CHAR LIMIT=15] -->
- <string name="exit_button">Restart App</string>
<!-- Permission text: apps can control diagnostic data [CHAR LIMIT=NONE] -->
<string name="car_permission_label_diag_read">Diagnostic Data</string>
@@ -144,7 +146,7 @@
<!-- Permission text: apps read Engine Detailed [CHAR LIMIT=NONE] -->
<string name="car_permission_label_car_engine_detailed">Engine Detailed</string>
<!-- Permission text: apps can listen to Engine Detailed [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_car_engine_detailed">Access your car\'s detailed engine information</string>
+ <string name="car_permission_desc_car_engine_detailed">Access your car\u2019s detailed engine information</string>
<!-- Permission text: apps can access car's fuel door and ev charge port [CHAR LIMIT=NONE] -->
<string name="car_permission_label_car_energy_ports">Energy Ports</string>
@@ -154,27 +156,27 @@
<!-- Permission text: apps can access car's VIN information [CHAR LIMIT=NONE] -->
<string name="car_permission_label_car_identification">Car identification</string>
<!-- Permission text: apps can access car's VIN information [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_car_identification">Access car\'s identification</string>
+ <string name="car_permission_desc_car_identification">Access car\u2019s identification</string>
<!-- Permission text: apps can control car doors [CHAR LIMIT=NONE] -->
<string name="car_permission_label_control_car_doors">Car Doors</string>
<!-- Permission text: apps can control car doors [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_control_car_doors">Control car\'s doors</string>
+ <string name="car_permission_desc_control_car_doors">Control car\u2019s doors</string>
<!-- Permission text: apps can control car windows [CHAR LIMIT=NONE] -->
<string name="car_permission_label_control_car_windows">Car Windows</string>
<!-- Permission text: apps can control car windows [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_control_car_windows">Control car\'s windows</string>
+ <string name="car_permission_desc_control_car_windows">Control car\u2019s windows</string>
<!-- Permission text: apps can control car mirrors [CHAR LIMIT=NONE] -->
<string name="car_permission_label_control_car_mirrors">Car Mirrors</string>
<!-- Permission text: apps can control car mirrors [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_control_car_mirrors">Control car\'s mirrors</string>
+ <string name="car_permission_desc_control_car_mirrors">Control car\u2019s mirrors</string>
<!-- Permission text: apps can control car seats [CHAR LIMIT=NONE] -->
<string name="car_permission_label_control_car_seats">Car Seats</string>
<!-- Permission text: apps can control car seats [CHAR LIMIT=NONE] -->
- <string name="car_permission_desc_control_car_seats">Control car\'s seats</string>
+ <string name="car_permission_desc_control_car_seats">Control car\u2019s seats</string>
<!-- Permission text: apps read car's basic information [CHAR LIMIT=NONE] -->
<string name="car_permission_label_car_info">Car basic information</string>
diff --git a/service/src/com/android/car/pm/ActivityBlockingActivity.java b/service/src/com/android/car/pm/ActivityBlockingActivity.java
index aabdb72..15126a7 100644
--- a/service/src/com/android/car/pm/ActivityBlockingActivity.java
+++ b/service/src/com/android/car/pm/ActivityBlockingActivity.java
@@ -57,9 +57,10 @@
private Car mCar;
private CarUxRestrictionsManager mUxRManager;
- private TextView mBlockingText;
private TextView mBlockedAppName;
private ImageView mBlockedAppIcon;
+ private TextView mBlockingText;
+ private TextView mExitButtonMessage;
private Button mExitButton;
// Exiting depends on Car connection, which might not be available at the time exit was
@@ -76,7 +77,8 @@
mBlockingText = findViewById(R.id.blocking_text);
mBlockedAppName = findViewById(R.id.blocked_app_name);
mBlockedAppIcon = findViewById(R.id.blocked_app_icon);
- mExitButton = findViewById(R.id.exit);
+ mExitButton = findViewById(R.id.exit_button);
+ mExitButtonMessage = findViewById(R.id.exit_button_message);
mBlockingText.setText(getString(R.string.activity_blocked_text));
@@ -143,6 +145,9 @@
boolean showButton = mBlockedTaskId != INVALID_TASK_ID && isRootDO;
mExitButton.setVisibility(showButton ? View.VISIBLE : View.GONE);
mExitButton.setOnClickListener(v -> handleRestartingTask());
+ mExitButtonMessage.setVisibility(showButton ? View.VISIBLE : View.GONE);
+ mExitButtonMessage.setText(
+ getString(R.string.exit_button_message, getString(R.string.exit_button)));
// Show more debug info for non-user build.
if (Build.IS_ENG || Build.IS_USERDEBUG) {