Implement uninstall apps in CarSettings.
This follows as close as possible to the constraints implemented in Phone Settings. We don't yet have a mechanism for OEMs to define "keep enabled" packages, but it can be included in a later change. Phone Settings redirects to Device Admin pages which are not implemented in CarSettings for certain uninstall conditions. We disable the button for now pending adding those pages / direction from UX.
Bug: 79492615
Test: build and deploy, install/uninstall/enable/disable/force stop, RunCarSettingsRoboTests
Change-Id: I3a3f0a52eeb34f0b8708210a25b47f3ea75935e1
diff --git a/tests/robotests/src/com/android/car/settings/testutils/ShadowIconDrawableFactory.java b/tests/robotests/src/com/android/car/settings/testutils/ShadowIconDrawableFactory.java
new file mode 100644
index 0000000..29ab22c
--- /dev/null
+++ b/tests/robotests/src/com/android/car/settings/testutils/ShadowIconDrawableFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.car.settings.testutils;
+
+import android.content.pm.ApplicationInfo;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.util.IconDrawableFactory;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+
+@Implements(value = IconDrawableFactory.class)
+public class ShadowIconDrawableFactory {
+
+ @Implementation
+ protected Drawable getBadgedIcon(ApplicationInfo appInfo) {
+ return new ColorDrawable(0);
+ }
+}