Update default fallback idling state UX restrictions.
Update the fallback restrictions to be in sync with the default
restrictions found in the car_ux_restrictions_map.xml.
Bug: 111367243
Test: Validate idling UX restrictions to not require DO, when no mapping
XML is provided.
Change-Id: Ibcbb9dbafd99dfe0444a04ecd5b3c7dc590ee833
diff --git a/service/src/com/android/car/CarUxRestrictionsManagerService.java b/service/src/com/android/car/CarUxRestrictionsManagerService.java
index 23c4d32..a6807d6 100644
--- a/service/src/com/android/car/CarUxRestrictionsManagerService.java
+++ b/service/src/com/android/car/CarUxRestrictionsManagerService.java
@@ -428,7 +428,7 @@
break;
case CarDrivingStateEvent.DRIVING_STATE_IDLING:
restrictions = CarUxRestrictions.UX_RESTRICTIONS_BASELINE;
- requiresOpt = true;
+ requiresOpt = false;
break;
case CarDrivingStateEvent.DRIVING_STATE_MOVING:
default:
diff --git a/service/src/com/android/car/CarUxRestrictionsServiceHelper.java b/service/src/com/android/car/CarUxRestrictionsServiceHelper.java
index 236d915..348d3be 100644
--- a/service/src/com/android/car/CarUxRestrictionsServiceHelper.java
+++ b/service/src/com/android/car/CarUxRestrictionsServiceHelper.java
@@ -83,6 +83,10 @@
public boolean loadUxRestrictionsFromXml() throws IOException, XmlPullParserException {
mRestrictionsMap.clear();
XmlResourceParser parser = mContext.getResources().getXml(mXmlResource);
+ if (parser == null) {
+ Log.e(TAG, "Invalid Xml resource");
+ return false;
+ }
AttributeSet attrs = Xml.asAttributeSet(parser);
int type;
// Traverse till we get to the first tag