OmniControl: add grid activity for DeviceRegistration
for devices that have that app installed
Change-Id: I34b029e93147484aee55752239b217489d99b6ad
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 91ee7d1..b1a190f 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -10,6 +10,7 @@
<entry key="app/src/main/res/drawable/grid_item_background.xml" value="0.30833333333333335" />
<entry key="app/src/main/res/drawable/grid_item_background_shape.xml" value="0.3104166666666667" />
<entry key="app/src/main/res/drawable/ic_bars_tile.xml" value="0.30885416666666665" />
+ <entry key="app/src/main/res/drawable/ic_google.xml" value="0.5051282051282051" />
<entry key="app/src/main/res/drawable/ic_homepage_bars.xml" value="0.5109375" />
<entry key="app/src/main/res/drawable/ic_launcher_background.xml" value="0.3067708333333333" />
<entry key="app/src/main/res/drawable/ic_launcher_foreground.xml" value="0.2869791666666667" />
diff --git a/app/src/main/java/org/omnirom/control/GridViewFragment.kt b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
index 33cd6b2..1254d4b 100644
--- a/app/src/main/java/org/omnirom/control/GridViewFragment.kt
+++ b/app/src/main/java/org/omnirom/control/GridViewFragment.kt
@@ -109,8 +109,8 @@
)
)
if (Utils.isAvailableApp(requireContext(), "org.omnirom.omnistyle")) {
- val wallpaperIntent = Intent()
- wallpaperIntent.component = ComponentName(
+ val intent = Intent()
+ intent.component = ComponentName(
"org.omnirom.omnistyle",
"org.omnirom.omnistyle.WallpaperActivity"
)
@@ -119,13 +119,13 @@
R.string.wallpaper_title,
R.string.wallpaper_summary,
R.drawable.ic_wallpaper,
- wallpaperIntent
+ intent
)
)
}
if (Utils.isAvailableApp(requireContext(), "eu.chainfire.opendelta")) {
- val wallpaperIntent = Intent()
- wallpaperIntent.component = ComponentName(
+ val intent = Intent()
+ intent.component = ComponentName(
"eu.chainfire.opendelta",
"eu.chainfire.opendelta.MainActivity"
)
@@ -134,13 +134,13 @@
R.string.system_update_title,
R.string.system_update_summary,
R.drawable.ic_system_update,
- wallpaperIntent
+ intent
)
)
}
if (Utils.isAvailableApp(requireContext(), "org.omnirom.device")) {
- val deviceIntent = Intent()
- deviceIntent.component = ComponentName(
+ val intent = Intent()
+ intent.component = ComponentName(
"org.omnirom.device",
"org.omnirom.device.DeviceSettings"
)
@@ -149,13 +149,13 @@
R.string.device_settings_title,
R.string.device_settings_summary,
R.drawable.ic_settings_omnigears,
- deviceIntent
+ intent
)
)
}
if (Utils.isAvailableApp(requireContext(), "org.omnirom.omnijaws")) {
- val wallpaperIntent = Intent()
- wallpaperIntent.component = ComponentName(
+ val intent = Intent()
+ intent.component = ComponentName(
"org.omnirom.omnijaws",
"org.omnirom.omnijaws.WeatherActivity"
)
@@ -164,7 +164,22 @@
R.string.weather_current_title,
R.string.weather_current_summary,
R.drawable.ic_weather,
- wallpaperIntent
+ intent
+ )
+ )
+ }
+ if (Utils.isAvailableApp(requireContext(), "org.omnirom.deviceregistration")) {
+ val intent = Intent()
+ intent.component = ComponentName(
+ "org.omnirom.deviceregistration",
+ "org.omnirom.deviceregistration.MainActivity"
+ )
+ gridItems.add(
+ IntentGridItem(
+ R.string.device_registration_title,
+ R.string.device_registration_summary,
+ R.drawable.ic_google,
+ intent
)
)
}
diff --git a/app/src/main/res/drawable/ic_google.xml b/app/src/main/res/drawable/ic_google.xml
new file mode 100644
index 0000000..0ff4e2d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_google.xml
@@ -0,0 +1,11 @@
+<!-- drawable/google.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="?android:textColorPrimary"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M21.35,11.1H12.18V13.83H18.69C18.36,17.64 15.19,19.27 12.19,19.27C8.36,19.27 5,16.25 5,12C5,7.9 8.2,4.73 12.2,4.73C15.29,4.73 17.1,6.7 17.1,6.7L19,4.72C19,4.72 16.56,2 12.1,2C6.42,2 2.03,6.8 2.03,12C2.03,17.05 6.16,22 12.25,22C17.6,22 21.5,18.33 21.5,12.91C21.5,11.76 21.35,11.1 21.35,11.1V11.1Z" />
+</vector>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fa55f7c..66c1d0b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -61,4 +61,8 @@
<string name="system_category">System</string>
<string name="show_cpu_title">Show CPU info</string>
<string name="show_cpu_summary">Screen overlay showing current CPU info</string>
+
+ <string name="device_registration_title">Google device registration</string>
+ <string name="device_registration_summary">Register device for Play Protect certification</string>
+
</resources>
\ No newline at end of file