Return unrestricted UxR when UxR is disabled via. adb shell cmd.
This is a quick fix that applies to all displays before the full
solution is implemented that respects per-display UxR config.
Bug: 256037970
Test: adb shell cmd car_service enable-uxr false, observe UxR in
UxRestrictions sample app to be unrestricted on all displays.
Test: adb shell cmd car_service enable-uxr true, observe UxR in
UxRestrictions sample app to be fully restricted on all displays.
Test: atest CarUxRestrictionsManagerServiceTest
Change-Id: I8c2d15a567b589f3e67ccac8f9354f519e158919
diff --git a/service/src/com/android/car/CarUxRestrictionsManagerService.java b/service/src/com/android/car/CarUxRestrictionsManagerService.java
index 57ed3de..1ce427d 100644
--- a/service/src/com/android/car/CarUxRestrictionsManagerService.java
+++ b/service/src/com/android/car/CarUxRestrictionsManagerService.java
@@ -428,6 +428,11 @@
Slogf.wtf(TAG, "getCurrentUxRestrictions() called before init()");
return null;
}
+
+ if (isDebugBuild() && !mUxRChangeBroadcastEnabled) {
+ Slogf.d(TAG, "Returning unrestricted UX Restriction due to setting");
+ return createUnrestrictedRestrictions();
+ }
restrictions = mCurrentUxRestrictions.get(getPhysicalPortLocked(displayId));
}
if (restrictions == null) {