Merge changes from topic "revert-25841762-AGTRBWBEPQ" into main
* changes:
Revert "[Satellite] DeviceBasedSatelliteViewModel"
Revert "[Sb] SingleBindableIcon implementation"
Revert "[Satellite] DeviceBasedSatelliteBindableIcon"
Revert "[Satellite] Input logging for the repository layer"
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 28adccd..5be29a6 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -57,7 +57,6 @@
<item><xliff:g id="id">@string/status_bar_screen_record</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_cast</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_ethernet</xliff:g></item>
- <item><xliff:g id="id">@string/status_bar_oem_satellite</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_wifi</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_hotspot</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_mobile</xliff:g></item>
@@ -103,7 +102,6 @@
<string translatable="false" name="status_bar_call_strength">call_strength</string>
<string translatable="false" name="status_bar_sensors_off">sensors_off</string>
<string translatable="false" name="status_bar_screen_record">screen_record</string>
- <string translatable="false" name="status_bar_oem_satellite">satellite</string>
<!-- Flag indicating whether the surface flinger has limited
alpha compositing functionality in hardware. If set, the window
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index ef12d8f..d12ef2b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3198,7 +3198,6 @@
<java-symbol type="string" name="status_bar_camera" />
<java-symbol type="string" name="status_bar_sensors_off" />
<java-symbol type="string" name="status_bar_screen_record" />
- <java-symbol type="string" name="status_bar_oem_satellite" />
<!-- Locale picker -->
<java-symbol type="id" name="locale_search_menu" />
diff --git a/packages/SystemUI/res/drawable/ic_satellite_connected_0.xml b/packages/SystemUI/res/drawable/ic_satellite_connected_0.xml
deleted file mode 100644
index 045c19e..0000000
--- a/packages/SystemUI/res/drawable/ic_satellite_connected_0.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:pathData="M14.73,3.36L17.63,6.2C17.83,6.39 17.83,6.71 17.63,6.91L16.89,7.65C16.69,7.85 16.37,7.85 16.18,7.65L13.34,4.78C13.15,4.59 13.15,4.28 13.34,4.08L14.01,3.37C14.2,3.17 14.52,3.16 14.72,3.36H14.73ZM14.37,1C13.85,1 13.32,1.2 12.93,1.61L11.56,3.06C10.8,3.84 10.81,5.09 11.58,5.86L15.13,9.41C15.52,9.8 16.03,10 16.55,10C17.07,10 17.58,9.8 17.97,9.41L19.42,7.96C20.21,7.17 20.2,5.89 19.4,5.12L15.77,1.57C15.38,1.19 14.88,1 14.37,1Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M4.73,13.36L7.63,16.2C7.83,16.39 7.83,16.71 7.63,16.91L6.89,17.65C6.69,17.85 6.37,17.85 6.18,17.65L3.34,14.78C3.15,14.59 3.15,14.28 3.34,14.08L4.01,13.37C4.2,13.17 4.52,13.16 4.72,13.36H4.73ZM4.37,11C3.85,11 3.32,11.2 2.93,11.61L1.56,13.06C0.8,13.84 0.81,15.09 1.58,15.86L5.13,19.41C5.52,19.8 6.03,20 6.55,20C7.07,20 7.58,19.8 7.97,19.41L9.42,17.96C10.21,17.17 10.2,15.89 9.4,15.12L5.77,11.57C5.38,11.19 4.88,11 4.37,11Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M8.622,5.368L5.372,8.618L10.112,13.358C11.009,14.255 12.464,14.255 13.362,13.358C14.259,12.46 14.259,11.005 13.362,10.108L8.622,5.368Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M16.766,3.169L13.471,6.464L14.532,7.525L17.827,4.23L16.766,3.169Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M14.728,5.226L3.478,16.476L4.538,17.536L15.788,6.286L14.728,5.226Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M12.63,9.38L9.38,12.63L4.67,7.92C3.77,7.02 3.77,5.57 4.67,4.67C5.57,3.77 7.02,3.77 7.92,4.67L12.63,9.38Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,22.48V21.48C11,21.21 11.22,21 11.49,20.99C16.63,20.8 20.75,16.62 20.99,11.48C21,11.21 21.21,11 21.48,11H22.48C22.76,11 23,11.24 22.99,11.52C22.72,17.73 17.73,22.73 11.52,22.99C11.24,23 11,22.77 11,22.48Z"
- android:fillAlpha="0.3"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,18.98V17.98C11,17.71 11.21,17.51 11.48,17.49C14.69,17.26 17.33,14.7 17.49,11.49C17.5,11.22 17.71,11.01 17.98,11.01H18.79C19.26,11.01 19.5,11.25 19.48,11.53C19.22,15.8 15.79,19.23 11.52,19.49C11.24,19.51 11,19.27 11,18.99V18.98Z"
- android:fillAlpha="0.3"
- android:fillColor="#fff"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/ic_satellite_connected_1.xml b/packages/SystemUI/res/drawable/ic_satellite_connected_1.xml
deleted file mode 100644
index 5e012ab..0000000
--- a/packages/SystemUI/res/drawable/ic_satellite_connected_1.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:pathData="M14.73,3.36L17.63,6.2C17.83,6.39 17.83,6.71 17.63,6.91L16.89,7.65C16.69,7.85 16.37,7.85 16.18,7.65L13.34,4.78C13.15,4.59 13.15,4.28 13.34,4.08L14.01,3.37C14.2,3.17 14.52,3.16 14.72,3.36H14.73ZM14.37,1C13.85,1 13.32,1.2 12.93,1.61L11.56,3.06C10.8,3.84 10.81,5.09 11.58,5.86L15.13,9.41C15.52,9.8 16.03,10 16.55,10C17.07,10 17.58,9.8 17.97,9.41L19.42,7.96C20.21,7.17 20.2,5.89 19.4,5.12L15.77,1.57C15.38,1.19 14.88,1 14.37,1Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M4.73,13.36L7.63,16.2C7.83,16.39 7.83,16.71 7.63,16.91L6.89,17.65C6.69,17.85 6.37,17.85 6.18,17.65L3.34,14.78C3.15,14.59 3.15,14.28 3.34,14.08L4.01,13.37C4.2,13.17 4.52,13.16 4.72,13.36H4.73ZM4.37,11C3.85,11 3.32,11.2 2.93,11.61L1.56,13.06C0.8,13.84 0.81,15.09 1.58,15.86L5.13,19.41C5.52,19.8 6.03,20 6.55,20C7.07,20 7.58,19.8 7.97,19.41L9.42,17.96C10.21,17.17 10.2,15.89 9.4,15.12L5.77,11.57C5.38,11.19 4.88,11 4.37,11Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M8.622,5.368L5.372,8.618L10.112,13.358C11.009,14.255 12.464,14.255 13.362,13.358C14.259,12.46 14.259,11.005 13.362,10.108L8.622,5.368Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M16.766,3.169L13.471,6.464L14.532,7.525L17.827,4.23L16.766,3.169Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M14.728,5.226L3.478,16.476L4.538,17.536L15.788,6.286L14.728,5.226Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M12.63,9.38L9.38,12.63L4.67,7.92C3.77,7.02 3.77,5.57 4.67,4.67C5.57,3.77 7.02,3.77 7.92,4.67L12.63,9.38Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,22.48V21.48C11,21.21 11.22,21 11.49,20.99C16.63,20.8 20.75,16.62 20.99,11.48C21,11.21 21.21,11 21.48,11H22.48C22.76,11 23,11.24 22.99,11.52C22.72,17.73 17.73,22.73 11.52,22.99C11.24,23 11,22.77 11,22.48Z"
- android:fillAlpha="0.3"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,18.98V17.98C11,17.71 11.21,17.51 11.48,17.49C14.69,17.26 17.33,14.7 17.49,11.49C17.5,11.22 17.71,11.01 17.98,11.01H18.79C19.26,11.01 19.5,11.25 19.48,11.53C19.22,15.8 15.79,19.23 11.52,19.49C11.24,19.51 11,19.27 11,18.99V18.98Z"
- android:fillColor="#fff"/>
-</vector>
-
diff --git a/packages/SystemUI/res/drawable/ic_satellite_connected_2.xml b/packages/SystemUI/res/drawable/ic_satellite_connected_2.xml
deleted file mode 100644
index d8a9a70..0000000
--- a/packages/SystemUI/res/drawable/ic_satellite_connected_2.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:pathData="M14.73,3.36L17.63,6.2C17.83,6.39 17.83,6.71 17.63,6.91L16.89,7.65C16.69,7.85 16.37,7.85 16.18,7.65L13.34,4.78C13.15,4.59 13.15,4.28 13.34,4.08L14.01,3.37C14.2,3.17 14.52,3.16 14.72,3.36H14.73ZM14.37,1C13.85,1 13.32,1.2 12.93,1.61L11.56,3.06C10.8,3.84 10.81,5.09 11.58,5.86L15.13,9.41C15.52,9.8 16.03,10 16.55,10C17.07,10 17.58,9.8 17.97,9.41L19.42,7.96C20.21,7.17 20.2,5.89 19.4,5.12L15.77,1.57C15.38,1.19 14.88,1 14.37,1Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M4.73,13.36L7.63,16.2C7.83,16.39 7.83,16.71 7.63,16.91L6.89,17.65C6.69,17.85 6.37,17.85 6.18,17.65L3.34,14.78C3.15,14.59 3.15,14.28 3.34,14.08L4.01,13.37C4.2,13.17 4.52,13.16 4.72,13.36H4.73ZM4.37,11C3.85,11 3.32,11.2 2.93,11.61L1.56,13.06C0.8,13.84 0.81,15.09 1.58,15.86L5.13,19.41C5.52,19.8 6.03,20 6.55,20C7.07,20 7.58,19.8 7.97,19.41L9.42,17.96C10.21,17.17 10.2,15.89 9.4,15.12L5.77,11.57C5.38,11.19 4.88,11 4.37,11Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M8.622,5.368L5.372,8.618L10.112,13.358C11.009,14.255 12.464,14.255 13.362,13.358C14.259,12.46 14.259,11.005 13.362,10.108L8.622,5.368Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M16.766,3.169L13.471,6.464L14.532,7.525L17.827,4.23L16.766,3.169Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M14.728,5.226L3.478,16.476L4.538,17.536L15.788,6.286L14.728,5.226Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M12.63,9.38L9.38,12.63L4.67,7.92C3.77,7.02 3.77,5.57 4.67,4.67C5.57,3.77 7.02,3.77 7.92,4.67L12.63,9.38Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,22.48V21.48C11,21.21 11.22,21 11.49,20.99C16.63,20.8 20.75,16.62 20.99,11.48C21,11.21 21.21,11 21.48,11H22.48C22.76,11 23,11.24 22.99,11.52C22.72,17.73 17.73,22.73 11.52,22.99C11.24,23 11,22.77 11,22.48Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M11,18.98V17.98C11,17.71 11.21,17.51 11.48,17.49C14.69,17.26 17.33,14.7 17.49,11.49C17.5,11.22 17.71,11.01 17.98,11.01H18.79C19.26,11.01 19.5,11.25 19.48,11.53C19.22,15.8 15.79,19.23 11.52,19.49C11.24,19.51 11,19.27 11,18.99V18.98Z"
- android:fillColor="#fff"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable/ic_satellite_not_connected.xml b/packages/SystemUI/res/drawable/ic_satellite_not_connected.xml
deleted file mode 100644
index dec9930..0000000
--- a/packages/SystemUI/res/drawable/ic_satellite_not_connected.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0"
- >
- <path
- android:pathData="M14.73,3.36L17.63,6.2C17.83,6.39 17.83,6.71 17.63,6.91L16.89,7.65C16.69,7.85 16.37,7.85 16.18,7.65L13.34,4.78C13.15,4.59 13.15,4.28 13.34,4.08L14.01,3.37C14.2,3.17 14.52,3.16 14.72,3.36H14.73ZM14.37,1C13.85,1 13.32,1.2 12.93,1.61L11.56,3.06C10.8,3.84 10.81,5.09 11.58,5.86L15.13,9.41C15.52,9.8 16.03,10 16.55,10C17.07,10 17.58,9.8 17.97,9.41L19.42,7.96C20.21,7.17 20.2,5.89 19.4,5.12L15.77,1.57C15.38,1.19 14.88,1 14.37,1Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M4.73,13.36L7.63,16.2C7.83,16.39 7.83,16.71 7.63,16.91L6.89,17.65C6.69,17.85 6.37,17.85 6.18,17.65L3.34,14.78C3.15,14.59 3.15,14.28 3.34,14.08L4.01,13.37C4.2,13.17 4.52,13.16 4.72,13.36H4.73ZM4.37,11C3.85,11 3.32,11.2 2.93,11.61L1.56,13.06C0.8,13.84 0.81,15.09 1.58,15.86L5.13,19.41C5.52,19.8 6.03,20 6.55,20C7.07,20 7.58,19.8 7.97,19.41L9.42,17.96C10.21,17.17 10.2,15.89 9.4,15.12L5.77,11.57C5.38,11.19 4.88,11 4.37,11Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M8.622,5.368L5.372,8.618L10.112,13.358C11.009,14.255 12.464,14.255 13.362,13.358C14.259,12.46 14.259,11.005 13.362,10.108L8.622,5.368Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M16.766,3.169L13.471,6.464L14.532,7.525L17.827,4.23L16.766,3.169Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M14.728,5.226L3.478,16.476L4.538,17.536L15.788,6.286L14.728,5.226Z"
- android:fillColor="#fff"/>
- <path
- android:pathData="M12.63,9.38L9.38,12.63L4.67,7.92C3.77,7.02 3.77,5.57 4.67,4.67C5.57,3.77 7.02,3.77 7.92,4.67L12.63,9.38Z"
- android:fillColor="#fff"/>
-</vector>
diff --git a/packages/SystemUI/res/layout/bindable_status_bar_icon.xml b/packages/SystemUI/res/layout/bindable_status_bar_icon.xml
deleted file mode 100644
index ee4d05c..0000000
--- a/packages/SystemUI/res/layout/bindable_status_bar_icon.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright (C) 2023 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.
- -->
-
-<!-- Base layout that provides a single bindable icon_view id image view -->
-<com.android.systemui.statusbar.pipeline.shared.ui.view.SingleBindableStatusBarIconView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- >
-
- <ImageView
- android:id="@+id/icon_view"
- android:layout_height="@dimen/status_bar_bindable_icon_size"
- android:layout_width="wrap_content"
- android:layout_gravity="center_vertical"
- android:padding="@dimen/status_bar_bindable_icon_padding"
- android:scaleType="fitCenter"
- />
-
-</com.android.systemui.statusbar.pipeline.shared.ui.view.SingleBindableStatusBarIconView>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9a4520c..798fc06b 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -151,8 +151,6 @@
<dimen name="status_bar_icon_size_sp">@*android:dimen/status_bar_icon_size_sp</dimen>
<!-- Original dp height of notification icons in the status bar -->
<dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>
- <dimen name="status_bar_bindable_icon_size">20sp</dimen>
- <dimen name="status_bar_bindable_icon_padding">2sp</dimen>
<!-- Default horizontal drawable padding for status bar icons. -->
<dimen name="status_bar_horizontal_padding">2.5sp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt
deleted file mode 100644
index 252945f..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2024 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.systemui.statusbar.pipeline.dagger
-
-import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository
-import javax.inject.Qualifier
-
-/** Detailed [DeviceBasedSatelliteRepository] logs */
-@Qualifier
-@MustBeDocumented
-@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
-annotation class OemSatelliteInputLog
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
index 2b90e64..e309c32 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
@@ -265,13 +265,6 @@
return factory.create("VerboseMobileViewLog", 100)
}
- @Provides
- @SysUISingleton
- @OemSatelliteInputLog
- fun provideOemSatelliteInputLog(factory: LogBufferFactory): LogBuffer {
- return factory.create("DeviceBasedSatelliteInputLog", 32)
- }
-
const val FIRST_MOBILE_SUB_SHOWING_NETWORK_TYPE_ICON =
"FirstMobileSubShowingNetworkTypeIcon"
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/icons/shared/BindableIconsRegistry.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/icons/shared/BindableIconsRegistry.kt
index 8400fb0..e3c3139 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/icons/shared/BindableIconsRegistry.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/icons/shared/BindableIconsRegistry.kt
@@ -18,7 +18,6 @@
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.pipeline.icons.shared.model.BindableIcon
-import com.android.systemui.statusbar.pipeline.satellite.ui.DeviceBasedSatelliteBindableIcon
import javax.inject.Inject
/**
@@ -39,12 +38,11 @@
class BindableIconsRegistryImpl
@Inject
constructor(
- /** Bindables go here */
- oemSatellite: DeviceBasedSatelliteBindableIcon
+/** Bindables go here */
) : BindableIconsRegistry {
/**
* Adding the injected bindables to this list will get them registered with
* StatusBarIconController
*/
- override val bindableIcons: List<BindableIcon> = listOf(oemSatellite)
+ override val bindableIcons: List<BindableIcon> = listOf()
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt
index 5e6e36d..de46a5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt
@@ -19,17 +19,11 @@
import android.os.OutcomeReceiver
import android.telephony.satellite.NtnSignalStrengthCallback
import android.telephony.satellite.SatelliteManager
-import android.telephony.satellite.SatelliteManager.SATELLITE_RESULT_SUCCESS
import android.telephony.satellite.SatelliteModemStateCallback
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.log.LogBuffer
-import com.android.systemui.log.core.LogLevel
-import com.android.systemui.log.core.MessageInitializer
-import com.android.systemui.log.core.MessagePrinter
-import com.android.systemui.statusbar.pipeline.dagger.OemSatelliteInputLog
import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository
import com.android.systemui.statusbar.pipeline.satellite.data.prod.SatelliteSupport.Companion.whenSupported
import com.android.systemui.statusbar.pipeline.satellite.data.prod.SatelliteSupport.NotSupported
@@ -129,7 +123,6 @@
satelliteManagerOpt: Optional<SatelliteManager>,
@Background private val bgDispatcher: CoroutineDispatcher,
@Application private val scope: CoroutineScope,
- @OemSatelliteInputLog private val logBuffer: LogBuffer,
private val systemClock: SystemClock,
) : DeviceBasedSatelliteRepository {
@@ -152,11 +145,6 @@
ensureMinUptime(systemClock, MIN_UPTIME)
satelliteSupport.value = satelliteManager.checkSatelliteSupported()
- logBuffer.i(
- { str1 = satelliteSupport.value.toString() },
- { "Checked for system support. support=$str1" },
- )
-
// We only need to check location availability if this mode is supported
if (satelliteSupport.value is Supported) {
isSatelliteAllowedForCurrentLocation.subscriptionCount
@@ -171,9 +159,6 @@
* connection might cause more frequent checks.
*/
while (true) {
- logBuffer.i {
- "requestIsSatelliteCommunicationAllowedForCurrentLocation"
- }
checkIsSatelliteAllowed()
delay(POLLING_INTERVAL_MS)
}
@@ -182,8 +167,6 @@
}
}
} else {
- logBuffer.i { "Satellite manager is null" }
-
satelliteSupport.value = NotSupported
}
}
@@ -198,21 +181,12 @@
private fun connectionStateFlow(sm: SupportedSatelliteManager): Flow<SatelliteConnectionState> =
conflatedCallbackFlow {
val cb = SatelliteModemStateCallback { state ->
- logBuffer.i({ int1 = state }) { "onSatelliteModemStateChanged: state=$int1" }
trySend(SatelliteConnectionState.fromModemState(state))
}
- var registered = false
+ sm.registerForSatelliteModemStateChanged(bgDispatcher.asExecutor(), cb)
- try {
- val res =
- sm.registerForSatelliteModemStateChanged(bgDispatcher.asExecutor(), cb)
- registered = res == SATELLITE_RESULT_SUCCESS
- } catch (e: Exception) {
- logBuffer.e("error registering for modem state", e)
- }
-
- awaitClose { if (registered) sm.unregisterForSatelliteModemStateChanged(cb) }
+ awaitClose { sm.unregisterForSatelliteModemStateChanged(cb) }
}
.flowOn(bgDispatcher)
@@ -223,21 +197,12 @@
private fun signalStrengthFlow(sm: SupportedSatelliteManager) =
conflatedCallbackFlow {
val cb = NtnSignalStrengthCallback { signalStrength ->
- logBuffer.i({ int1 = signalStrength.level }) {
- "onNtnSignalStrengthChanged: level=$int1"
- }
trySend(signalStrength.level)
}
- var registered = false
- try {
- sm.registerForNtnSignalStrengthChanged(bgDispatcher.asExecutor(), cb)
- registered = true
- } catch (e: Exception) {
- logBuffer.e("error registering for signal strength", e)
- }
+ sm.registerForNtnSignalStrengthChanged(bgDispatcher.asExecutor(), cb)
- awaitClose { if (registered) sm.unregisterForNtnSignalStrengthChanged(cb) }
+ awaitClose { sm.unregisterForNtnSignalStrengthChanged(cb) }
}
.flowOn(bgDispatcher)
@@ -248,15 +213,11 @@
bgDispatcher.asExecutor(),
object : OutcomeReceiver<Boolean, SatelliteManager.SatelliteException> {
override fun onError(e: SatelliteManager.SatelliteException) {
- logBuffer.e(
- "Found exception when checking availability",
- e,
- )
+ android.util.Log.e(TAG, "Found exception when checking for satellite: ", e)
isSatelliteAllowedForCurrentLocation.value = false
}
override fun onResult(allowed: Boolean) {
- logBuffer.i { allowed.toString() }
isSatelliteAllowedForCurrentLocation.value = allowed
}
}
@@ -278,12 +239,6 @@
}
override fun onError(error: SatelliteManager.SatelliteException) {
- logBuffer.e(
- "Exception when checking for satellite support. " +
- "Assuming it is not supported for this device.",
- error,
- )
-
// Assume that an error means it's not supported
continuation.resume(NotSupported)
}
@@ -309,19 +264,5 @@
delay(timeTilMinUptime)
}
}
-
- /** A couple of convenience logging methods rather than a whole class */
- private fun LogBuffer.i(
- initializer: MessageInitializer = {},
- printer: MessagePrinter,
- ) = this.log(TAG, LogLevel.INFO, initializer, printer)
-
- private fun LogBuffer.e(message: String, exception: Throwable? = null) =
- this.log(
- tag = TAG,
- level = LogLevel.ERROR,
- message = message,
- exception = exception,
- )
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/DeviceBasedSatelliteBindableIcon.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/DeviceBasedSatelliteBindableIcon.kt
deleted file mode 100644
index f5d0f6b..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/DeviceBasedSatelliteBindableIcon.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.ui
-
-import android.content.Context
-import com.android.internal.telephony.flags.Flags.oemEnabledSatelliteFlag
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.statusbar.pipeline.icons.shared.model.BindableIcon
-import com.android.systemui.statusbar.pipeline.icons.shared.model.ModernStatusBarViewCreator
-import com.android.systemui.statusbar.pipeline.satellite.ui.binder.DeviceBasedSatelliteIconBinder
-import com.android.systemui.statusbar.pipeline.satellite.ui.viewmodel.DeviceBasedSatelliteViewModel
-import com.android.systemui.statusbar.pipeline.shared.ui.view.SingleBindableStatusBarIconView
-import javax.inject.Inject
-
-@SysUISingleton
-class DeviceBasedSatelliteBindableIcon
-@Inject
-constructor(
- context: Context,
- viewModel: DeviceBasedSatelliteViewModel,
-) : BindableIcon {
- override val slot: String =
- context.getString(com.android.internal.R.string.status_bar_oem_satellite)
-
- override val initializer = ModernStatusBarViewCreator { context ->
- SingleBindableStatusBarIconView.createView(context).also { view ->
- view.initView(slot) { DeviceBasedSatelliteIconBinder.bind(view, viewModel) }
- }
- }
-
- override val shouldBindIcon: Boolean = oemEnabledSatelliteFlag()
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/binder/DeviceBasedSatelliteIconBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/binder/DeviceBasedSatelliteIconBinder.kt
deleted file mode 100644
index 59ac5f2..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/binder/DeviceBasedSatelliteIconBinder.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.ui.binder
-
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.lifecycleScope
-import androidx.lifecycle.repeatOnLifecycle
-import com.android.systemui.common.ui.binder.IconViewBinder
-import com.android.systemui.statusbar.pipeline.satellite.ui.viewmodel.DeviceBasedSatelliteViewModel
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.ModernStatusBarViewBinding
-import com.android.systemui.statusbar.pipeline.shared.ui.view.SingleBindableStatusBarIconView
-import kotlinx.coroutines.launch
-
-object DeviceBasedSatelliteIconBinder {
- fun bind(
- view: SingleBindableStatusBarIconView,
- viewModel: DeviceBasedSatelliteViewModel,
- ): ModernStatusBarViewBinding {
- return SingleBindableStatusBarIconView.withDefaultBinding(
- view = view,
- shouldBeVisible = { viewModel.icon.value != null }
- ) {
- lifecycleScope.launch {
- repeatOnLifecycle(Lifecycle.State.STARTED) {
- viewModel.icon.collect { newIcon ->
- if (newIcon == null) {
- view.iconView.setImageDrawable(null)
- } else {
- IconViewBinder.bind(newIcon, view.iconView)
- }
- }
- }
- }
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/model/SatelliteIconModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/model/SatelliteIconModel.kt
deleted file mode 100644
index 6938d66..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/model/SatelliteIconModel.kt
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.ui.model
-
-import com.android.systemui.common.shared.model.Icon
-import com.android.systemui.res.R
-import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState
-
-/**
- * Define the [Icon] that relates to a given satellite connection state + level. Note that for now
- * We don't need any data class box, so we can just use a simple mapping function.
- */
-object SatelliteIconModel {
- fun fromConnectionState(
- connectionState: SatelliteConnectionState,
- signalStrength: Int,
- ): Icon? =
- when (connectionState) {
- // TODO(b/316635648): check if this should be null
- SatelliteConnectionState.Unknown,
- SatelliteConnectionState.Off,
- SatelliteConnectionState.On ->
- Icon.Resource(
- res = R.drawable.ic_satellite_not_connected,
- contentDescription = null,
- )
- SatelliteConnectionState.Connected -> fromSignalStrength(signalStrength)
- }
-
- private fun fromSignalStrength(
- signalStrength: Int,
- ): Icon? =
- // TODO(b/316634365): these need content descriptions
- when (signalStrength) {
- // No signal
- 0 -> Icon.Resource(res = R.drawable.ic_satellite_connected_0, contentDescription = null)
-
- // Poor -> Moderate
- 1,
- 2 -> Icon.Resource(res = R.drawable.ic_satellite_connected_1, contentDescription = null)
-
- // Good -> Great
- 3,
- 4 -> Icon.Resource(res = R.drawable.ic_satellite_connected_2, contentDescription = null)
- else -> null
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt
deleted file mode 100644
index 0051161..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.ui.viewmodel
-
-import com.android.systemui.common.shared.model.Icon
-import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.statusbar.pipeline.satellite.domain.interactor.DeviceBasedSatelliteInteractor
-import com.android.systemui.statusbar.pipeline.satellite.ui.model.SatelliteIconModel
-import javax.inject.Inject
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.SharingStarted
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.combine
-import kotlinx.coroutines.flow.flatMapLatest
-import kotlinx.coroutines.flow.flowOf
-import kotlinx.coroutines.flow.stateIn
-
-/**
- * View-Model for the device-based satellite icon. This icon will only show in the status bar if
- * satellite is available AND all other service states are considered OOS.
- */
-@OptIn(ExperimentalCoroutinesApi::class)
-class DeviceBasedSatelliteViewModel
-@Inject
-constructor(
- interactor: DeviceBasedSatelliteInteractor,
- @Application scope: CoroutineScope,
-) {
- private val shouldShowIcon: StateFlow<Boolean> =
- interactor.areAllConnectionsOutOfService
- .flatMapLatest { allOos ->
- if (!allOos) {
- flowOf(false)
- } else {
- interactor.isSatelliteAllowed
- }
- }
- .stateIn(scope, SharingStarted.WhileSubscribed(), false)
-
- val icon: StateFlow<Icon?> =
- combine(
- shouldShowIcon,
- interactor.connectionState,
- interactor.signalStrength,
- ) { shouldShow, state, signalStrength ->
- if (shouldShow) {
- SatelliteIconModel.fromConnectionState(state, signalStrength)
- } else {
- null
- }
- }
- .stateIn(scope, SharingStarted.WhileSubscribed(), null)
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/ModernStatusBarView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/ModernStatusBarView.kt
index 25a2c9d..3b87bed 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/ModernStatusBarView.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/ModernStatusBarView.kt
@@ -103,7 +103,7 @@
*
* Creates a dot view, and uses [bindingCreator] to get and set the binding.
*/
- open fun initView(slot: String, bindingCreator: () -> ModernStatusBarViewBinding) {
+ fun initView(slot: String, bindingCreator: () -> ModernStatusBarViewBinding) {
// The dot view requires [slot] to be set, and the [binding] may require an instantiated dot
// view. So, this is the required order.
this.slot = slot
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconView.kt
deleted file mode 100644
index c663c37..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconView.kt
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.shared.ui.view
-
-import android.content.Context
-import android.content.res.ColorStateList
-import android.graphics.Color
-import android.util.AttributeSet
-import android.view.LayoutInflater
-import android.view.View
-import android.widget.ImageView
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.LifecycleOwner
-import androidx.lifecycle.lifecycleScope
-import androidx.lifecycle.repeatOnLifecycle
-import com.android.internal.annotations.VisibleForTesting
-import com.android.systemui.lifecycle.repeatWhenAttached
-import com.android.systemui.res.R
-import com.android.systemui.statusbar.StatusBarIconView
-import com.android.systemui.statusbar.StatusBarIconView.STATE_HIDDEN
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.ModernStatusBarViewBinding
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.ModernStatusBarViewVisibilityHelper
-import kotlinx.coroutines.awaitCancellation
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.launch
-
-/** Simple single-icon view that is bound to bindable_status_bar_icon.xml */
-class SingleBindableStatusBarIconView(
- context: Context,
- attrs: AttributeSet?,
-) : ModernStatusBarView(context, attrs) {
-
- internal lateinit var iconView: ImageView
- internal lateinit var dotView: StatusBarIconView
-
- override fun toString(): String {
- return "SingleBindableStatusBarIcon(" +
- "slot='$slot', " +
- "isCollecting=${binding.isCollecting()}, " +
- "visibleState=${StatusBarIconView.getVisibleStateString(visibleState)}); " +
- "viewString=${super.toString()}"
- }
-
- override fun initView(slot: String, bindingCreator: () -> ModernStatusBarViewBinding) {
- super.initView(slot, bindingCreator)
-
- iconView = requireViewById(R.id.icon_view)
- dotView = requireViewById(R.id.status_bar_dot)
- }
-
- companion object {
- fun createView(
- context: Context,
- ): SingleBindableStatusBarIconView {
- return LayoutInflater.from(context).inflate(R.layout.bindable_status_bar_icon, null)
- as SingleBindableStatusBarIconView
- }
-
- /**
- * Using a given binding [block], create the necessary scaffolding to handle the general
- * case of a single status bar icon. This includes eliding into a dot view when there is not
- * enough space, and handling tint.
- *
- * [block] should be a simple [launch] call that handles updating the single icon view with
- * its new view. Currently there is no simple way to e.g., extend to handle multiple tints
- * for dual-layered icons, and any more complex logic should probably find a way to return
- * its own version of [ModernStatusBarViewBinding].
- */
- fun withDefaultBinding(
- view: SingleBindableStatusBarIconView,
- shouldBeVisible: () -> Boolean,
- block: suspend LifecycleOwner.(View) -> Unit
- ): SingleBindableStatusBarIconViewBinding {
- @StatusBarIconView.VisibleState
- val visibilityState: MutableStateFlow<Int> = MutableStateFlow(STATE_HIDDEN)
-
- val iconTint: MutableStateFlow<Int> = MutableStateFlow(Color.WHITE)
- val decorTint: MutableStateFlow<Int> = MutableStateFlow(Color.WHITE)
-
- var isCollecting: Boolean = false
-
- view.repeatWhenAttached {
- // Child binding
- block(view)
-
- lifecycleScope.launch {
- repeatOnLifecycle(Lifecycle.State.STARTED) {
- // isVisible controls the visibility state of the outer group, and thus it
- // needs
- // to run in the CREATED lifecycle so it can continue to watch while
- // invisible
- // See (b/291031862) for details
- launch {
- visibilityState.collect { visibilityState ->
- // for b/296864006, we can not hide all the child views if
- // visibilityState is STATE_HIDDEN. Because hiding all child views
- // would cause the
- // getWidth() of this view return 0, and that would cause the
- // translation
- // calculation fails in StatusIconContainer. Therefore, like class
- // MobileIconBinder, instead of set the child views visibility to
- // View.GONE,
- // we set their visibility to View.INVISIBLE to make them invisible
- // but
- // keep the width.
- ModernStatusBarViewVisibilityHelper.setVisibilityState(
- visibilityState,
- view.iconView,
- view.dotView,
- )
- }
- }
-
- launch {
- iconTint.collect { tint ->
- val tintList = ColorStateList.valueOf(tint)
- view.iconView.imageTintList = tintList
- view.dotView.setDecorColor(tint)
- }
- }
-
- launch {
- decorTint.collect { decorTint -> view.dotView.setDecorColor(decorTint) }
- }
-
- try {
- awaitCancellation()
- } finally {
- isCollecting = false
- }
- }
- }
- }
-
- return object : SingleBindableStatusBarIconViewBinding {
- override val decorTint: Int
- get() = decorTint.value
-
- override val iconTint: Int
- get() = iconTint.value
-
- override fun getShouldIconBeVisible(): Boolean {
- return shouldBeVisible()
- }
-
- override fun onVisibilityStateChanged(state: Int) {
- visibilityState.value = state
- }
-
- override fun onIconTintChanged(newTint: Int, contrastTint: Int) {
- iconTint.value = newTint
- }
-
- override fun onDecorTintChanged(newTint: Int) {
- decorTint.value = newTint
- }
-
- override fun isCollecting(): Boolean {
- return isCollecting
- }
- }
- }
- }
-}
-
-@VisibleForTesting
-interface SingleBindableStatusBarIconViewBinding : ModernStatusBarViewBinding {
- val iconTint: Int
- val decorTint: Int
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt
index 7d91e8b..02e6fd5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt
@@ -35,7 +35,6 @@
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
-import com.android.systemui.log.core.FakeLogBuffer
import com.android.systemui.statusbar.pipeline.satellite.data.prod.DeviceBasedSatelliteRepositoryImpl.Companion.MIN_UPTIME
import com.android.systemui.statusbar.pipeline.satellite.data.prod.DeviceBasedSatelliteRepositoryImpl.Companion.POLLING_INTERVAL_MS
import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState
@@ -88,7 +87,6 @@
Optional.empty(),
dispatcher,
testScope.backgroundScope,
- FakeLogBuffer.Factory.create(),
systemClock,
)
@@ -102,22 +100,6 @@
}
@Test
- fun satelliteManagerThrows_doesNotCrash() =
- testScope.runTest {
- setupDefaultRepo()
-
- whenever(satelliteManager.registerForNtnSignalStrengthChanged(any(), any()))
- .thenThrow(SatelliteException(13))
-
- val conn by collectLastValue(underTest.connectionState)
- val strength by collectLastValue(underTest.signalStrength)
-
- // Flows have not emitted, we haven't crashed
- assertThat(conn).isNull()
- assertThat(strength).isNull()
- }
-
- @Test
fun connectionState_mapsFromSatelliteModemState() =
testScope.runTest {
setupDefaultRepo()
@@ -398,7 +380,6 @@
if (satMan != null) Optional.of(satMan) else Optional.empty(),
dispatcher,
testScope.backgroundScope,
- FakeLogBuffer.Factory.create(),
systemClock,
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt
deleted file mode 100644
index 21c038a..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModelTest.kt
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.ui.viewmodel
-
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.common.shared.model.Icon
-import com.android.systemui.coroutines.collectLastValue
-import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.FakeMobileIconsInteractor
-import com.android.systemui.statusbar.pipeline.mobile.util.FakeMobileMappingsProxy
-import com.android.systemui.statusbar.pipeline.satellite.data.prod.FakeDeviceBasedSatelliteRepository
-import com.android.systemui.statusbar.pipeline.satellite.domain.interactor.DeviceBasedSatelliteInteractor
-import com.android.systemui.util.mockito.mock
-import com.google.common.truth.Truth.assertThat
-import kotlin.test.Test
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.runTest
-import org.junit.Before
-import org.mockito.MockitoAnnotations
-
-@SmallTest
-class DeviceBasedSatelliteViewModelTest : SysuiTestCase() {
- private lateinit var underTest: DeviceBasedSatelliteViewModel
- private lateinit var interactor: DeviceBasedSatelliteInteractor
-
- private val repo = FakeDeviceBasedSatelliteRepository()
- private val mobileIconsInteractor = FakeMobileIconsInteractor(FakeMobileMappingsProxy(), mock())
-
- private val testScope = TestScope()
-
- @Before
- fun setUp() {
- MockitoAnnotations.initMocks(this)
-
- interactor =
- DeviceBasedSatelliteInteractor(
- repo,
- mobileIconsInteractor,
- testScope.backgroundScope,
- )
-
- underTest =
- DeviceBasedSatelliteViewModel(
- interactor,
- testScope.backgroundScope,
- )
- }
-
- @Test
- fun icon_nullWhenShouldNotShow_satelliteNotAllowed() =
- testScope.runTest {
- val latest by collectLastValue(underTest.icon)
-
- // GIVEN satellite is not allowed
- repo.isSatelliteAllowedForCurrentLocation.value = false
-
- // GIVEN all icons are OOS
- val i1 = mobileIconsInteractor.getMobileConnectionInteractorForSubId(1)
- i1.isInService.value = false
-
- // THEN icon is null because we should not be showing it
- assertThat(latest).isNull()
- }
-
- @Test
- fun icon_nullWhenShouldNotShow_notAllOos() =
- testScope.runTest {
- val latest by collectLastValue(underTest.icon)
-
- // GIVEN satellite is allowed
- repo.isSatelliteAllowedForCurrentLocation.value = true
-
- // GIVEN all icons are not OOS
- val i1 = mobileIconsInteractor.getMobileConnectionInteractorForSubId(1)
- i1.isInService.value = true
-
- // THEN icon is null because we have service
- assertThat(latest).isNull()
- }
-
- @Test
- fun icon_satelliteIsOff() =
- testScope.runTest {
- val latest by collectLastValue(underTest.icon)
-
- // GIVEN satellite is allowed
- repo.isSatelliteAllowedForCurrentLocation.value = true
-
- // GIVEN all icons are OOS
- val i1 = mobileIconsInteractor.getMobileConnectionInteractorForSubId(1)
- i1.isInService.value = false
-
- // THEN icon is null because we have service
- assertThat(latest).isInstanceOf(Icon::class.java)
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconViewTest.kt
deleted file mode 100644
index ca9df57..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ui/view/SingleBindableStatusBarIconViewTest.kt
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2023 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.systemui.statusbar.pipeline.shared.ui.view
-
-import android.graphics.Rect
-import android.testing.AndroidTestingRunner
-import android.testing.TestableLooper
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.statusbar.StatusBarIconView
-import com.google.common.truth.Truth.assertThat
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Being a simple subclass of [ModernStatusBarView], use the same basic test cases to verify the
- * root behavior, and add testing for the new [SingleBindableStatusBarIconView.withDefaultBinding]
- * method.
- */
-@SmallTest
-@RunWith(AndroidTestingRunner::class)
-@TestableLooper.RunWithLooper(setAsMainLooper = true)
-class SingleBindableStatusBarIconViewTest : SysuiTestCase() {
- private lateinit var binding: SingleBindableStatusBarIconViewBinding
-
- // Visibility is outsourced to view-models. This simulates it
- private var isVisible = true
- private var visibilityFn: () -> Boolean = { isVisible }
-
- @Test
- fun initView_hasCorrectSlot() {
- val view = createAndInitView()
-
- assertThat(view.slot).isEqualTo(SLOT_NAME)
- }
-
- @Test
- fun getVisibleState_icon_returnsIcon() {
- val view = createAndInitView()
-
- view.setVisibleState(StatusBarIconView.STATE_ICON, /* animate= */ false)
-
- assertThat(view.visibleState).isEqualTo(StatusBarIconView.STATE_ICON)
- }
-
- @Test
- fun getVisibleState_dot_returnsDot() {
- val view = createAndInitView()
-
- view.setVisibleState(StatusBarIconView.STATE_DOT, /* animate= */ false)
-
- assertThat(view.visibleState).isEqualTo(StatusBarIconView.STATE_DOT)
- }
-
- @Test
- fun getVisibleState_hidden_returnsHidden() {
- val view = createAndInitView()
-
- view.setVisibleState(StatusBarIconView.STATE_HIDDEN, /* animate= */ false)
-
- assertThat(view.visibleState).isEqualTo(StatusBarIconView.STATE_HIDDEN)
- }
-
- @Test
- fun onDarkChanged_bindingReceivesIconAndDecorTint() {
- val view = createAndInitView()
-
- view.onDarkChangedWithContrast(arrayListOf(), 0x12345678, 0x12344321)
-
- assertThat(binding.iconTint).isEqualTo(0x12345678)
- assertThat(binding.decorTint).isEqualTo(0x12345678)
- }
-
- @Test
- fun setStaticDrawableColor_bindingReceivesIconTint() {
- val view = createAndInitView()
-
- view.setStaticDrawableColor(0x12345678, 0x12344321)
-
- assertThat(binding.iconTint).isEqualTo(0x12345678)
- }
-
- @Test
- fun setDecorColor_bindingReceivesDecorColor() {
- val view = createAndInitView()
-
- view.setDecorColor(0x23456789)
-
- assertThat(binding.decorTint).isEqualTo(0x23456789)
- }
-
- @Test
- fun isIconVisible_usesBinding_true() {
- val view = createAndInitView()
-
- isVisible = true
-
- assertThat(view.isIconVisible).isEqualTo(true)
- }
-
- @Test
- fun isIconVisible_usesBinding_false() {
- val view = createAndInitView()
-
- isVisible = false
-
- assertThat(view.isIconVisible).isEqualTo(false)
- }
-
- @Test
- fun getDrawingRect_takesTranslationIntoAccount() {
- val view = createAndInitView()
-
- view.translationX = 50f
- view.translationY = 60f
-
- val drawingRect = Rect()
- view.getDrawingRect(drawingRect)
-
- assertThat(drawingRect.left).isEqualTo(view.left + 50)
- assertThat(drawingRect.right).isEqualTo(view.right + 50)
- assertThat(drawingRect.top).isEqualTo(view.top + 60)
- assertThat(drawingRect.bottom).isEqualTo(view.bottom + 60)
- }
-
- private fun createAndInitView(): SingleBindableStatusBarIconView {
- val view = SingleBindableStatusBarIconView.createView(context)
- binding = SingleBindableStatusBarIconView.withDefaultBinding(view, visibilityFn) {}
- view.initView(SLOT_NAME) { binding }
- return view
- }
-
- companion object {
- private const val SLOT_NAME = "test_slot"
- }
-}