From a4fc6da238a3892035f593839f917268feb7521e Mon Sep 17 00:00:00 2001 From: Ulyana Trafimovich Date: Tue, 6 Apr 2021 16:34:41 +0000 Subject: [PATCH] Revert "Enable smartspace" Revert "Enable smartspace" Revert submission 13984710-smartspace_ls Reason for revert: Broken test: com.android.devicehealthchecks.SystemAppCheck#system_app_crash on git_master on redfin-userdebug at 7262114 Reverted Changes: I77a4ef72c:Enable smartspace I77a4ef72c:Enable smartspace Bug: 184642387 Change-Id: I299bef5e730c632803c56cf0f1cd858caac4e49f Test: forrest run for the broken test --- packages/SystemUI/AndroidManifest.xml | 2 - .../plugins/BcSmartspaceDataPlugin.java | 16 --- packages/SystemUI/res/values/flags.xml | 2 - .../KeyguardClockSwitchController.java | 100 +----------------- .../systemui/statusbar/FeatureFlags.java | 4 - .../KeyguardClockSwitchControllerTest.java | 70 +----------- 6 files changed, 2 insertions(+), 192 deletions(-) diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 823cbb36fd912..42d7e587b668c 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -275,8 +275,6 @@ - - diff --git a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java index c090d8a3d8ce9..f8a9a04596731 100644 --- a/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java +++ b/packages/SystemUI/plugin/bcsmartspace/src/com/android/systemui/plugins/BcSmartspaceDataPlugin.java @@ -16,9 +16,7 @@ package com.android.systemui.plugins; -import android.app.smartspace.SmartspaceTarget; import android.os.Parcelable; -import android.view.ViewGroup; import com.android.systemui.plugins.annotations.ProvidesInterface; @@ -38,23 +36,9 @@ public interface BcSmartspaceDataPlugin extends Plugin { /** Unregister a listener. */ void unregisterListener(SmartspaceTargetListener listener); - /** - * Create a view to be shown within the parent. Do not add the view, as the parent - * will be responsible for correctly setting the LayoutParams - */ - SmartspaceView getView(ViewGroup parent); - - /** Updates Smartspace data and propagates it to any listeners. */ - void onTargetsAvailable(List targets); - /** Provides Smartspace data to registered listeners. */ interface SmartspaceTargetListener { /** Each Parcelable is a SmartspaceTarget that represents a card. */ void onSmartspaceTargetsUpdated(List targets); } - - /** View to which this plugin can be registered, in order to get updates. */ - interface SmartspaceView { - void registerDataProvider(BcSmartspaceDataPlugin plugin); - } } diff --git a/packages/SystemUI/res/values/flags.xml b/packages/SystemUI/res/values/flags.xml index 5c0309029bf70..6af982ddad728 100644 --- a/packages/SystemUI/res/values/flags.xml +++ b/packages/SystemUI/res/values/flags.xml @@ -52,6 +52,4 @@ false false - - false diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index 24b7cd118ed67..0675200f81e26 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -16,15 +16,8 @@ package com.android.keyguard; -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - import android.app.WallpaperManager; -import android.app.smartspace.SmartspaceConfig; -import android.app.smartspace.SmartspaceManager; -import android.app.smartspace.SmartspaceSession; import android.content.ContentResolver; -import android.content.Context; import android.content.res.Resources; import android.provider.Settings; import android.text.TextUtils; @@ -32,7 +25,6 @@ import android.text.format.DateFormat; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.widget.RelativeLayout; import com.android.internal.colorextraction.ColorExtractor; import com.android.keyguard.clock.ClockManager; @@ -40,12 +32,8 @@ import com.android.systemui.R; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; -import com.android.systemui.plugins.BcSmartspaceDataPlugin; import com.android.systemui.plugins.ClockPlugin; -import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.statusbar.StatusBarStateController; -import com.android.systemui.shared.plugins.PluginManager; -import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.notification.stack.AnimationProperties; @@ -55,7 +43,6 @@ import com.android.systemui.util.ViewController; import java.util.Locale; import java.util.TimeZone; -import java.util.concurrent.Executor; import javax.inject.Inject; @@ -81,13 +68,6 @@ public class KeyguardClockSwitchController extends ViewController() { - - @Override - public void onPluginConnected(BcSmartspaceDataPlugin plugin, Context pluginContext) { - if (!mIsSmartspaceEnabled) return; - - View ksa = mView.findViewById(R.id.keyguard_status_area); - int ksaIndex = mView.indexOfChild(ksa); - ksa.setVisibility(View.GONE); - - mSmartspaceView = plugin.getView(mView); - mSmartspaceView.registerDataProvider(plugin); - - RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( - MATCH_PARENT, WRAP_CONTENT); - lp.addRule(RelativeLayout.BELOW, R.id.new_lockscreen_clock_view); - mView.addView((View) mSmartspaceView, ksaIndex, lp); - - View nic = mView.findViewById( - com.android.systemui.R.id.left_aligned_notification_icon_container); - lp = (RelativeLayout.LayoutParams) nic.getLayoutParams(); - lp.addRule(RelativeLayout.BELOW, ((View) mSmartspaceView).getId()); - nic.setLayoutParams(lp); - - createSmartspaceSession(plugin); - } - - @Override - public void onPluginDisconnected(BcSmartspaceDataPlugin plugin) { - if (!mIsSmartspaceEnabled) return; - - mView.removeView((View) mSmartspaceView); - mView.findViewById(R.id.keyguard_status_area).setVisibility(View.VISIBLE); - - View nic = mView.findViewById( - com.android.systemui.R.id.left_aligned_notification_icon_container); - RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) - nic.getLayoutParams(); - lp.addRule(RelativeLayout.BELOW, R.id.keyguard_status_area); - nic.setLayoutParams(lp); - - mSmartspaceView = null; - } - - private void createSmartspaceSession(BcSmartspaceDataPlugin plugin) { - mSmartspaceSession = getContext().getSystemService(SmartspaceManager.class) - .createSmartspaceSession( - new SmartspaceConfig.Builder(getContext(), "lockscreen").build()); - mSmartspaceCallback = targets -> plugin.onTargetsAvailable(targets); - mSmartspaceSession.registerSmartspaceUpdates(mUiExecutor, mSmartspaceCallback); - mSmartspaceSession.requestSmartspaceUpdate(); - } - }; - mPluginManager.addPluginListener(mPluginListener, BcSmartspaceDataPlugin.class, false); } @Override @@ -233,13 +147,6 @@ public class KeyguardClockSwitchController extends ViewController