Stop checking FeatureFlags for People Tile.
Revert "Use FeatureFlags to enable People Space" Revert "Use FeatureFlags to enable People Space" Revert "Exclude PeopleSpaceWidgetEnabler from Car" Revert submission 13586906-people_space_feature_flag_enable Reason for revert: Performance regression on idle Reverted Changes: I879e86ca3:Exclude PeopleSpaceWidgetEnabler from Car I6361985bc:Use FeatureFlags to enable People Space Ie6758b764:Use FeatureFlags to enable People Space Change-Id: I4da384de8524f60ba0fd203bee811aae2c81308f Test: manual
This commit is contained in:
@@ -144,10 +144,6 @@ Biometric UI.
|
||||
|
||||
Delegates SysUI events to WM Shell controllers.
|
||||
|
||||
### [com.android.systemui.people.widget.PeopleSpaceWidgetEnabler](/packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetEnabler.java)
|
||||
|
||||
Enables People Space widgets.
|
||||
|
||||
---
|
||||
|
||||
* [Plugins](/packages/SystemUI/docs/plugins.md)
|
||||
|
||||
@@ -315,7 +315,6 @@
|
||||
<item>com.android.systemui.accessibility.SystemActions</item>
|
||||
<item>com.android.systemui.toast.ToastUI</item>
|
||||
<item>com.android.systemui.wmshell.WMShell</item>
|
||||
<item>com.android.systemui.people.widget.PeopleSpaceWidgetEnabler</item>
|
||||
</string-array>
|
||||
|
||||
<!-- QS tile shape store width. negative implies fill configuration instead of stroke-->
|
||||
|
||||
@@ -19,15 +19,18 @@ package com.android.systemui;
|
||||
import android.app.ActivityThread;
|
||||
import android.app.Application;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Process;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.util.TimingsTraceLog;
|
||||
import android.view.SurfaceControl;
|
||||
@@ -37,6 +40,8 @@ import com.android.systemui.dagger.ContextComponentHelper;
|
||||
import com.android.systemui.dagger.GlobalRootComponent;
|
||||
import com.android.systemui.dagger.SysUIComponent;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.people.PeopleSpaceActivity;
|
||||
import com.android.systemui.people.widget.PeopleSpaceWidgetProvider;
|
||||
import com.android.systemui.shared.system.ThreadedRendererCompat;
|
||||
import com.android.systemui.util.NotificationChannels;
|
||||
|
||||
@@ -121,6 +126,26 @@ public class SystemUIApplication extends Application implements
|
||||
mServices[i].onBootCompleted();
|
||||
}
|
||||
}
|
||||
// If SHOW_PEOPLE_SPACE is true, enable People Space widget provider.
|
||||
// TODO(b/170396074): Migrate to new feature flag (go/silk-flags-howto)
|
||||
try {
|
||||
int showPeopleSpace = Settings.Global.getInt(context.getContentResolver(),
|
||||
Settings.Global.SHOW_PEOPLE_SPACE, 1);
|
||||
context.getPackageManager().setComponentEnabledSetting(
|
||||
new ComponentName(context, PeopleSpaceWidgetProvider.class),
|
||||
showPeopleSpace == 1
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
context.getPackageManager().setComponentEnabledSetting(
|
||||
new ComponentName(context, PeopleSpaceActivity.class),
|
||||
showPeopleSpace == 1
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Error enabling People Space widget:", e);
|
||||
}
|
||||
}
|
||||
}, bootCompletedFilter);
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.systemui.globalactions.GlobalActionsComponent;
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator;
|
||||
import com.android.systemui.keyguard.dagger.KeyguardModule;
|
||||
import com.android.systemui.media.systemsounds.HomeSoundEffectController;
|
||||
import com.android.systemui.people.widget.PeopleSpaceWidgetEnabler;
|
||||
import com.android.systemui.power.PowerUI;
|
||||
import com.android.systemui.privacy.television.TvOngoingPrivacyChip;
|
||||
import com.android.systemui.recents.Recents;
|
||||
@@ -185,10 +184,4 @@ public abstract class SystemUIBinder {
|
||||
@IntoMap
|
||||
@ClassKey(HomeSoundEffectController.class)
|
||||
public abstract SystemUI bindHomeSoundEffectController(HomeSoundEffectController sysui);
|
||||
|
||||
/** Inject into PeopleSpaceWidgetEnabler. */
|
||||
@Binds
|
||||
@IntoMap
|
||||
@ClassKey(PeopleSpaceWidgetEnabler.class)
|
||||
public abstract SystemUI bindPeopleSpaceWidgetEnabler(PeopleSpaceWidgetEnabler sysui);
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.people.widget;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.people.PeopleSpaceActivity;
|
||||
import com.android.systemui.statusbar.FeatureFlags;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Enables People Space widgets.
|
||||
*/
|
||||
@SysUISingleton
|
||||
public class PeopleSpaceWidgetEnabler extends SystemUI {
|
||||
private static final String TAG = "PeopleSpaceWdgtEnabler";
|
||||
private Context mContext;
|
||||
private FeatureFlags mFeatureFlags;
|
||||
|
||||
@Inject
|
||||
public PeopleSpaceWidgetEnabler(Context context, FeatureFlags featureFlags) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mFeatureFlags = featureFlags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
Log.d(TAG, "Starting service");
|
||||
try {
|
||||
boolean showPeopleSpace = mFeatureFlags.isPeopleTileEnabled();
|
||||
mContext.getPackageManager().setComponentEnabledSetting(
|
||||
new ComponentName(mContext, PeopleSpaceWidgetProvider.class),
|
||||
showPeopleSpace
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
mContext.getPackageManager().setComponentEnabledSetting(
|
||||
new ComponentName(mContext, PeopleSpaceActivity.class),
|
||||
showPeopleSpace
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Error enabling People Space widget:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.systemui.statusbar.notification.init
|
||||
|
||||
import android.content.Context
|
||||
import android.provider.Settings
|
||||
import android.service.notification.StatusBarNotification
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.people.widget.PeopleSpaceWidgetManager
|
||||
@@ -58,6 +60,7 @@ import javax.inject.Inject
|
||||
*/
|
||||
@SysUISingleton
|
||||
class NotificationsControllerImpl @Inject constructor(
|
||||
private val context: Context,
|
||||
private val featureFlags: FeatureFlags,
|
||||
private val notificationListener: NotificationListener,
|
||||
private val entryManager: NotificationEntryManager,
|
||||
@@ -129,7 +132,9 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
entryManager.attach(notificationListener)
|
||||
}
|
||||
|
||||
if (featureFlags.isPeopleTileEnabled) {
|
||||
val showPeopleSpace = Settings.Global.getInt(context.contentResolver,
|
||||
Settings.Global.SHOW_PEOPLE_SPACE, 1)
|
||||
if (showPeopleSpace == 1) {
|
||||
peopleSpaceWidgetManager.attach(notificationListener)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user