Merge "Move CarUxRestrictionsUtil into utils package" into pi-car-dev
diff --git a/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/PagedRecyclerView.java b/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/PagedRecyclerView.java
index 1091b90..f5a8e12 100644
--- a/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/PagedRecyclerView.java
+++ b/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/PagedRecyclerView.java
@@ -45,6 +45,7 @@
import com.android.car.ui.pagedrecyclerview.decorations.linear.LinearOffsetItemDecoration;
import com.android.car.ui.pagedrecyclerview.decorations.linear.LinearOffsetItemDecoration.OffsetPosition;
import com.android.car.ui.toolbar.Toolbar;
+import com.android.car.ui.utils.CarUxRestrictionsUtil;
import com.android.internal.annotations.VisibleForTesting;
import java.lang.annotation.Retention;
diff --git a/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtil.java b/car-ui-lib/src/com/android/car/ui/utils/CarUxRestrictionsUtil.java
similarity index 93%
rename from car-ui-lib/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtil.java
rename to car-ui-lib/src/com/android/car/ui/utils/CarUxRestrictionsUtil.java
index dd74116..355050a 100644
--- a/car-ui-lib/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtil.java
+++ b/car-ui-lib/src/com/android/car/ui/utils/CarUxRestrictionsUtil.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.car.ui.pagedrecyclerview;
+package com.android.car.ui.utils;
import static android.car.drivingstate.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH;
@@ -56,13 +56,13 @@
CarUxRestrictionsManager.OnUxRestrictionsChangedListener listener =
(carUxRestrictions) -> {
if (carUxRestrictions == null) {
- this.mCarUxRestrictions = getDefaultRestrictions();
+ mCarUxRestrictions = getDefaultRestrictions();
} else {
- this.mCarUxRestrictions = carUxRestrictions;
+ mCarUxRestrictions = carUxRestrictions;
}
for (OnUxRestrictionsChangedListener observer : mObservers) {
- observer.onRestrictionsChanged(this.mCarUxRestrictions);
+ observer.onRestrictionsChanged(mCarUxRestrictions);
}
};
@@ -121,7 +121,7 @@
}
/**
- * Returns whether any of the given flags is blocked by the current restrictions. If null is
+ * Returns whether any of the given flags are blocked by the specified restrictions. If null is
* given, the method returns true for safety.
*/
public static boolean isRestricted(
diff --git a/car-ui-lib/tests/paintbooth/AndroidManifest.xml b/car-ui-lib/tests/paintbooth/AndroidManifest.xml
index 8b3cce7..7d5e392 100644
--- a/car-ui-lib/tests/paintbooth/AndroidManifest.xml
+++ b/car-ui-lib/tests/paintbooth/AndroidManifest.xml
@@ -54,6 +54,8 @@
<activity
android:name=".toolbar.ToolbarActivity"
android:exported="false"
- android:parentActivityName=".MainActivity"/>
+ android:parentActivityName=".MainActivity">
+ <meta-data android:name="distractionOptimized" android:value="true"/>
+ </activity>
</application>
</manifest>
diff --git a/car-ui-lib/tests/robotests/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtilTest.java b/car-ui-lib/tests/robotests/src/com/android/car/ui/utils/CarUxRestrictionsUtilTest.java
similarity index 98%
rename from car-ui-lib/tests/robotests/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtilTest.java
rename to car-ui-lib/tests/robotests/src/com/android/car/ui/utils/CarUxRestrictionsUtilTest.java
index f9a3427..fe6f80c 100644
--- a/car-ui-lib/tests/robotests/src/com/android/car/ui/pagedrecyclerview/CarUxRestrictionsUtilTest.java
+++ b/car-ui-lib/tests/robotests/src/com/android/car/ui/utils/CarUxRestrictionsUtilTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.car.ui.pagedrecyclerview;
+package com.android.car.ui.utils;
import static com.google.common.truth.Truth.assertThat;