diff options
5 files changed, 58 insertions, 62 deletions
diff --git a/packages/SystemUI/res/drawable/dream_overlay_assistant_attention_indicator.xml b/packages/SystemUI/res/drawable/dream_overlay_assistant_attention_indicator.xml deleted file mode 100644 index bc1775ee64ae..000000000000 --- a/packages/SystemUI/res/drawable/dream_overlay_assistant_attention_indicator.xml +++ /dev/null @@ -1,35 +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. - --> - -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@id/background" - android:gravity="center"> - <shape android:shape="oval"> - <size - android:height="24px" - android:width="24px" - /> - <solid android:color="#FFFFFFFF" /> - </shape> - </item> - <item android:id="@id/icon" - android:gravity="center" - android:width="20px" - android:height="20px" - android:drawable="@drawable/ic_person_outline" - /> -</layer-list>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/ic_assistant_attention_indicator.xml b/packages/SystemUI/res/drawable/ic_assistant_attention_indicator.xml new file mode 100644 index 000000000000..a1e8b9d0443d --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_assistant_attention_indicator.xml @@ -0,0 +1,39 @@ +<?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"> + <group> + <path + android:pathData="M12 8.13333C12.7089 8.13333 13.2889 8.71333 13.2889 9.42221C13.2889 10.1311 12.7089 10.7111 12 10.7111C11.2911 10.7111 10.7111 10.1311 10.7111 9.42221C10.7111 8.71333 11.2911 8.13333 12 8.13333Z" + android:fillColor="#FFFFFF" + /> + <path + android:pathData="M12 13.9333C13.74 13.9333 15.7378 14.7647 15.8667 15.2222V15.8667H8.13333V15.2287C8.26221 14.7647 10.26 13.9333 12 13.9333Z" + android:fillColor="#FFFFFF" + /> + <path + android:pathData="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM9.42228 9.42224C9.42228 7.99802 10.5758 6.84447 12.0001 6.84447C13.4243 6.84447 14.5778 7.99802 14.5778 9.42224C14.5778 10.8465 13.4243 12 12.0001 12C10.5758 12 9.42228 10.8465 9.42228 9.42224ZM12 12.6445C10.2794 12.6445 6.84447 13.508 6.84447 15.2223V17.1556H17.1556V15.2223C17.1556 13.508 13.7207 12.6445 12 12.6445Z" + android:fillColor="#FFFFFF" + android:fillType="evenOdd" + /> + </group> +</vector> + + diff --git a/packages/SystemUI/res/drawable/ic_person_outline.xml b/packages/SystemUI/res/drawable/ic_person_outline.xml deleted file mode 100644 index d94714e0d51a..000000000000 --- a/packages/SystemUI/res/drawable/ic_person_outline.xml +++ /dev/null @@ -1,26 +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. - --> - -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="960" - android:viewportHeight="960" - android:tint="?attr/colorControlNormal"> - <path - android:fillColor="@android:color/black" - android:pathData="M480,480Q414,480 367,433Q320,386 320,320Q320,254 367,207Q414,160 480,160Q546,160 593,207Q640,254 640,320Q640,386 593,433Q546,480 480,480ZM160,800L160,688Q160,654 177.5,625.5Q195,597 224,582Q286,551 350,535.5Q414,520 480,520Q546,520 610,535.5Q674,551 736,582Q765,597 782.5,625.5Q800,654 800,688L800,800L160,800ZM240,720L720,720L720,688Q720,677 714.5,668Q709,659 700,654Q646,627 591,613.5Q536,600 480,600Q424,600 369,613.5Q314,627 260,654Q251,659 245.5,668Q240,677 240,688L240,720ZM480,400Q513,400 536.5,376.5Q560,353 560,320Q560,287 536.5,263.5Q513,240 480,240Q447,240 423.5,263.5Q400,287 400,320Q400,353 423.5,376.5Q447,400 480,400ZM480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320Q480,320 480,320ZM480,720L480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720Q480,720 480,720L480,720L480,720Z"/> -</vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/dream_overlay_status_bar_view.xml b/packages/SystemUI/res/layout/dream_overlay_status_bar_view.xml index ad9a775ed243..ec2edb52a039 100644 --- a/packages/SystemUI/res/layout/dream_overlay_status_bar_view.xml +++ b/packages/SystemUI/res/layout/dream_overlay_status_bar_view.xml @@ -113,7 +113,7 @@ android:layout_width="@dimen/dream_overlay_status_bar_icon_size" android:layout_height="match_parent" android:layout_marginStart="@dimen/dream_overlay_status_icon_margin" - android:src="@drawable/dream_overlay_assistant_attention_indicator" + android:src="@drawable/ic_assistant_attention_indicator" android:visibility="gone" android:contentDescription="@string/assistant_attention_content_description" /> diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java index 9305ab6f6968..7ccf70427327 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java @@ -7,6 +7,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityOptions; import android.app.SearchManager; +import android.app.StatusBarManager; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; @@ -439,6 +440,14 @@ public class AssistManager { public void onStartPerceiving() { mAssistUtils.enableVisualQueryDetection( mVisualQueryDetectionAttentionListener); + final StatusBarManager statusBarManager = + mContext.getSystemService(StatusBarManager.class); + if (statusBarManager != null) { + statusBarManager.setIcon("assist_attention", + R.drawable.ic_assistant_attention_indicator, + 0, "Attention Icon for Assistant"); + statusBarManager.setIconVisibility("assist_attention", false); + } } @Override @@ -447,11 +456,20 @@ public class AssistManager { // accordingly). handleVisualAttentionChanged(false); mAssistUtils.disableVisualQueryDetection(); + final StatusBarManager statusBarManager = + mContext.getSystemService(StatusBarManager.class); + if (statusBarManager != null) { + statusBarManager.removeIcon("assist_attention"); + } } }); } private void handleVisualAttentionChanged(boolean attentionGained) { + final StatusBarManager statusBarManager = mContext.getSystemService(StatusBarManager.class); + if (statusBarManager != null) { + statusBarManager.setIconVisibility("assist_attention", attentionGained); + } mVisualQueryAttentionListeners.forEach( attentionGained ? VisualQueryAttentionListener::onAttentionGained |