Remove all control experiments
And plugins, and flags, and any associated code Bug: 148207527 Test: atest SystemUiTests Change-Id: Id1b800d6ec96b5297e6ed4792ca003d45b61e53e
This commit is contained in:
@@ -56,11 +56,6 @@ Expected interface: [ClockPlugin](/packages/SystemUI/plugin/src/com/android/syst
|
||||
|
||||
Use: Allows replacement of the keyguard main clock.
|
||||
|
||||
### Action: com.android.systemui.action.PLUGIN_NPV
|
||||
Expected interface: [NPVPlugin](/packages/SystemUI/plugin/src/com/android/systemui/plugins/NPVPlugin.java)
|
||||
|
||||
Use: Attach a view under QQS for prototyping.
|
||||
|
||||
# Global plugin dependencies
|
||||
These classes can be accessed by any plugin using PluginDependency as long as they @Requires them.
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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.plugins;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.systemui.plugins.annotations.ProvidesInterface;
|
||||
|
||||
/**
|
||||
* Test plugin for home controls
|
||||
*/
|
||||
@ProvidesInterface(action = HomeControlsPlugin.ACTION, version = HomeControlsPlugin.VERSION)
|
||||
public interface HomeControlsPlugin extends Plugin {
|
||||
|
||||
String ACTION = "com.android.systemui.action.PLUGIN_HOME_CONTROLS";
|
||||
int VERSION = 1;
|
||||
|
||||
/**
|
||||
* Pass the container for the plugin to use however it wants. Ideally the plugin impl
|
||||
* will add home controls to this space.
|
||||
*/
|
||||
void sendParentGroup(ViewGroup group);
|
||||
|
||||
/**
|
||||
* When visible, will poll for updates.
|
||||
*/
|
||||
void setVisible(boolean visible);
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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.plugins;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.android.systemui.plugins.annotations.ProvidesInterface;
|
||||
|
||||
/**
|
||||
* Plugin to attach custom views under QQS.
|
||||
*
|
||||
* A parent view is provided to the plugin to which they can add Views.
|
||||
* <br>
|
||||
* The parent is a {@link FrameLayout} with same background as QS and 96dp height.
|
||||
*
|
||||
* {@see NPVPluginManager}
|
||||
* {@see status_bar_expanded_plugin_frame}
|
||||
*/
|
||||
@ProvidesInterface(action = NPVPlugin.ACTION, version = NPVPlugin.VERSION)
|
||||
public interface NPVPlugin extends Plugin {
|
||||
String ACTION = "com.android.systemui.action.PLUGIN_NPV";
|
||||
int VERSION = 1;
|
||||
|
||||
/**
|
||||
* Attach views to the parent.
|
||||
*
|
||||
* @param parent a {@link FrameLayout} to which to attach views. Preferably a root view.
|
||||
* @return a view attached to parent.
|
||||
*/
|
||||
View attachToRoot(FrameLayout parent);
|
||||
|
||||
/**
|
||||
* Indicate to the plugin when it is listening (QS expanded)
|
||||
* @param listening
|
||||
*/
|
||||
default void setListening(boolean listening) {};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/home_controls_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="@integer/notification_panel_layout_gravity"
|
||||
android:visibility="gone"
|
||||
android:padding="8dp"
|
||||
android:layout_margin="5dp"
|
||||
android:background="?android:attr/colorBackgroundFloating">
|
||||
</FrameLayout>
|
||||
@@ -42,32 +42,6 @@
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/divider_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/transparent" >
|
||||
|
||||
<android.widget.Space
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="@integer/qqs_split_fraction" />
|
||||
|
||||
<com.android.systemui.DarkReceiverImpl
|
||||
android:id="@+id/divider"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="1dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
<android.widget.Space
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="@integer/qs_split_fraction" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/status_bar_contents"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -55,9 +55,6 @@
|
||||
android:clipChildren="false"
|
||||
systemui:viewType="com.android.systemui.plugins.qs.QS" />
|
||||
|
||||
<!-- Temporary area to test out home controls -->
|
||||
<include layout="@layout/home_controls" />
|
||||
|
||||
<com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
|
||||
android:id="@+id/notification_stack_scroller"
|
||||
android:layout_marginTop="@dimen/notification_panel_margin_top"
|
||||
|
||||
@@ -31,7 +31,6 @@ import android.metrics.LogMaker;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.util.AttributeSet;
|
||||
@@ -62,7 +61,6 @@ import com.android.systemui.qs.external.CustomTile;
|
||||
import com.android.systemui.settings.BrightnessController;
|
||||
import com.android.systemui.settings.ToggleSliderView;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.statusbar.phone.NPVPluginManager;
|
||||
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
|
||||
import com.android.systemui.statusbar.policy.BrightnessMirrorController.BrightnessMirrorListener;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
@@ -120,7 +118,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
|
||||
|
||||
private FrameLayout mPluginFrame;
|
||||
private final PluginManager mPluginManager;
|
||||
private NPVPluginManager mNPVPluginManager;
|
||||
|
||||
private final LocalMediaManager.DeviceCallback mDeviceCallback =
|
||||
new LocalMediaManager.DeviceCallback() {
|
||||
@@ -201,14 +198,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
|
||||
findViewById(R.id.brightness_slider), broadcastDispatcher);
|
||||
mDumpController = dumpController;
|
||||
mPluginManager = pluginManager;
|
||||
if (mPluginManager != null && Settings.System.getInt(
|
||||
mContext.getContentResolver(), "npv_plugin_flag", 0) == 2) {
|
||||
mPluginFrame = (FrameLayout) LayoutInflater.from(mContext).inflate(
|
||||
R.layout.status_bar_expanded_plugin_frame, this, false);
|
||||
addView(mPluginFrame);
|
||||
mNPVPluginManager = new NPVPluginManager(mPluginFrame, mPluginManager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -556,7 +545,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
|
||||
if (mListening) {
|
||||
refreshAllTiles();
|
||||
}
|
||||
if (mNPVPluginManager != null) mNPVPluginManager.setListening(listening);
|
||||
}
|
||||
|
||||
public void setListening(boolean listening, boolean expanded) {
|
||||
|
||||
@@ -16,7 +16,6 @@ package com.android.systemui.qs.tileimpl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.ContextThemeWrapper;
|
||||
|
||||
@@ -33,7 +32,6 @@ import com.android.systemui.qs.tiles.BluetoothTile;
|
||||
import com.android.systemui.qs.tiles.CastTile;
|
||||
import com.android.systemui.qs.tiles.CellularTile;
|
||||
import com.android.systemui.qs.tiles.ColorInversionTile;
|
||||
import com.android.systemui.qs.tiles.ControlsTile;
|
||||
import com.android.systemui.qs.tiles.DataSaverTile;
|
||||
import com.android.systemui.qs.tiles.DndTile;
|
||||
import com.android.systemui.qs.tiles.FlashlightTile;
|
||||
@@ -60,7 +58,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
|
||||
private final Provider<WifiTile> mWifiTileProvider;
|
||||
private final Provider<BluetoothTile> mBluetoothTileProvider;
|
||||
private final Provider<ControlsTile> mControlsTileProvider;
|
||||
private final Provider<CellularTile> mCellularTileProvider;
|
||||
private final Provider<DndTile> mDndTileProvider;
|
||||
private final Provider<ColorInversionTile> mColorInversionTileProvider;
|
||||
@@ -85,7 +82,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
@Inject
|
||||
public QSFactoryImpl(Provider<WifiTile> wifiTileProvider,
|
||||
Provider<BluetoothTile> bluetoothTileProvider,
|
||||
Provider<ControlsTile> controlsTileProvider,
|
||||
Provider<CellularTile> cellularTileProvider,
|
||||
Provider<DndTile> dndTileProvider,
|
||||
Provider<ColorInversionTile> colorInversionTileProvider,
|
||||
@@ -106,7 +102,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
Provider<ScreenRecordTile> screenRecordTileProvider) {
|
||||
mWifiTileProvider = wifiTileProvider;
|
||||
mBluetoothTileProvider = bluetoothTileProvider;
|
||||
mControlsTileProvider = controlsTileProvider;
|
||||
mCellularTileProvider = cellularTileProvider;
|
||||
mDndTileProvider = dndTileProvider;
|
||||
mColorInversionTileProvider = colorInversionTileProvider;
|
||||
@@ -146,11 +141,6 @@ public class QSFactoryImpl implements QSFactory {
|
||||
return mWifiTileProvider.get();
|
||||
case "bt":
|
||||
return mBluetoothTileProvider.get();
|
||||
case "controls":
|
||||
if (Settings.System.getInt(mHost.getContext().getContentResolver(),
|
||||
"npv_plugin_flag", 0) == 3) {
|
||||
return mControlsTileProvider.get();
|
||||
} else return null;
|
||||
case "cell":
|
||||
return mCellularTileProvider.get();
|
||||
case "dnd":
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2014 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.qs.tiles;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.NPVPlugin;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
import com.android.systemui.plugins.qs.QSTile.BooleanState;
|
||||
import com.android.systemui.qs.QSHost;
|
||||
import com.android.systemui.qs.tileimpl.QSTileImpl;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
||||
/**
|
||||
* Temporary control test for prototyping
|
||||
*/
|
||||
public class ControlsTile extends QSTileImpl<BooleanState> {
|
||||
private ControlsDetailAdapter mDetailAdapter;
|
||||
private final ActivityStarter mActivityStarter;
|
||||
private PluginManager mPluginManager;
|
||||
private NPVPlugin mPlugin;
|
||||
private Intent mHomeAppIntent;
|
||||
|
||||
@Inject
|
||||
public ControlsTile(QSHost host,
|
||||
ActivityStarter activityStarter,
|
||||
PluginManager pluginManager) {
|
||||
super(host);
|
||||
mActivityStarter = activityStarter;
|
||||
mPluginManager = pluginManager;
|
||||
mDetailAdapter = (ControlsDetailAdapter) createDetailAdapter();
|
||||
|
||||
mHomeAppIntent = new Intent(Intent.ACTION_VIEW);
|
||||
mHomeAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mHomeAppIntent.setComponent(new ComponentName("com.google.android.apps.chromecast.app",
|
||||
"com.google.android.apps.chromecast.app.DiscoveryActivity"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailAdapter getDetailAdapter() {
|
||||
return mDetailAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BooleanState newTileState() {
|
||||
return new BooleanState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleSetListening(boolean listening) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDetailListening(boolean listening) {
|
||||
if (mPlugin == null) return;
|
||||
|
||||
mPlugin.setListening(listening);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleClick() {
|
||||
showDetail(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent getLongClickIntent() {
|
||||
return mHomeAppIntent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleSecondaryClick() {
|
||||
showDetail(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getTileLabel() {
|
||||
return "Controls";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleUpdateState(BooleanState state, Object arg) {
|
||||
state.icon = ResourceIcon.get(R.drawable.ic_lightbulb_outline_gm2_24px);
|
||||
state.label = "Controls";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsDetailView() {
|
||||
return getDetailAdapter() != null && mQSSettingsPanelOption == QSSettingsPanel.OPEN_CLICK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetricsCategory() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String composeChangeAnnouncement() {
|
||||
if (mState.value) {
|
||||
return "On";
|
||||
} else {
|
||||
return "Off";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DetailAdapter createDetailAdapter() {
|
||||
mDetailAdapter = new ControlsDetailAdapter();
|
||||
return mDetailAdapter;
|
||||
}
|
||||
|
||||
private class ControlsDetailAdapter implements DetailAdapter {
|
||||
private View mDetailView;
|
||||
protected FrameLayout mHomeControlsLayout;
|
||||
|
||||
public CharSequence getTitle() {
|
||||
return "Controls";
|
||||
}
|
||||
|
||||
public Boolean getToggleState() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean getToggleEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public View createDetailView(Context context, View convertView, final ViewGroup parent) {
|
||||
if (convertView != null) return convertView;
|
||||
|
||||
mHomeControlsLayout = (FrameLayout) LayoutInflater.from(context).inflate(
|
||||
R.layout.home_controls, parent, false);
|
||||
mHomeControlsLayout.setVisibility(View.VISIBLE);
|
||||
parent.addView(mHomeControlsLayout);
|
||||
|
||||
mPluginManager.addPluginListener(
|
||||
new PluginListener<NPVPlugin>() {
|
||||
@Override
|
||||
public void onPluginConnected(NPVPlugin plugin,
|
||||
Context pluginContext) {
|
||||
mPlugin = plugin;
|
||||
mPlugin.attachToRoot(mHomeControlsLayout);
|
||||
mPlugin.setListening(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginDisconnected(NPVPlugin plugin) {
|
||||
mPlugin.setListening(false);
|
||||
mHomeControlsLayout.removeAllViews();
|
||||
|
||||
}
|
||||
}, NPVPlugin.class, false);
|
||||
return mHomeControlsLayout;
|
||||
}
|
||||
|
||||
public Intent getSettingsIntent() {
|
||||
return mHomeAppIntent;
|
||||
}
|
||||
|
||||
public void setToggleState(boolean state) {
|
||||
|
||||
}
|
||||
|
||||
public int getMetricsCategory() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean hasHeader() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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.phone
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup.MarginLayoutParams
|
||||
import android.widget.FrameLayout
|
||||
import com.android.systemui.plugins.NPVPlugin
|
||||
import com.android.systemui.plugins.PluginListener
|
||||
import com.android.systemui.qs.TouchAnimator
|
||||
import com.android.systemui.shared.plugins.PluginManager
|
||||
|
||||
/**
|
||||
* Manages the NPVPlugin view and state
|
||||
*
|
||||
* Abstracts NPVPlugin from NPV and helps animate on expansion and respond to changes in Config.
|
||||
*/
|
||||
class NPVPluginManager(
|
||||
var parent: FrameLayout,
|
||||
val pluginManager: PluginManager
|
||||
) : PluginListener<NPVPlugin> {
|
||||
|
||||
private var plugin: NPVPlugin? = null
|
||||
private var animator = createAnimator()
|
||||
private var yOffset = 0f
|
||||
|
||||
private fun createAnimator() = TouchAnimator.Builder()
|
||||
.addFloat(parent, "alpha", 1f, 0f)
|
||||
.addFloat(parent, "scaleY", 1f, 0f)
|
||||
.build()
|
||||
|
||||
init {
|
||||
pluginManager.addPluginListener(NPVPlugin.ACTION, this, NPVPlugin::class.java, false)
|
||||
parent.pivotY = 0f
|
||||
}
|
||||
|
||||
override fun onPluginConnected(plugin: NPVPlugin, pluginContext: Context) {
|
||||
parent.removeAllViews()
|
||||
plugin.attachToRoot(parent)
|
||||
this.plugin = plugin
|
||||
parent.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
fun changeVisibility(visibility: Int) {
|
||||
parent.visibility = if (plugin != null) visibility else View.GONE
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
plugin?.onDestroy()
|
||||
pluginManager.removePluginListener(this)
|
||||
}
|
||||
|
||||
override fun onPluginDisconnected(plugin: NPVPlugin) {
|
||||
if (this.plugin == plugin) {
|
||||
this.plugin = null
|
||||
parent.removeAllViews()
|
||||
parent.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun setListening(listening: Boolean) {
|
||||
plugin?.setListening(listening)
|
||||
}
|
||||
|
||||
fun setExpansion(expansion: Float, headerTranslation: Float, heightDiff: Float) {
|
||||
parent.setTranslationY(expansion * heightDiff + headerTranslation + yOffset)
|
||||
if (!expansion.isNaN()) animator.setPosition(expansion)
|
||||
}
|
||||
|
||||
fun replaceFrameLayout(newParent: FrameLayout) {
|
||||
newParent.visibility = parent.visibility
|
||||
parent.removeAllViews()
|
||||
plugin?.attachToRoot(newParent)
|
||||
parent = newParent
|
||||
animator = createAnimator()
|
||||
}
|
||||
|
||||
fun getHeight() =
|
||||
if (plugin != null) {
|
||||
parent.height + (parent.getLayoutParams() as MarginLayoutParams).topMargin
|
||||
} else 0
|
||||
|
||||
fun setYOffset(y: Float) {
|
||||
yOffset = y
|
||||
parent.setTranslationY(yOffset)
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,8 @@ import android.animation.ValueAnimator;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Fragment;
|
||||
import android.app.StatusBarManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
@@ -40,8 +38,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.hardware.biometrics.BiometricSourceType;
|
||||
import android.os.PowerManager;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.DeviceConfig;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.util.MathUtils;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -57,7 +53,6 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.util.LatencyTracker;
|
||||
@@ -73,13 +68,10 @@ import com.android.systemui.doze.DozeLog;
|
||||
import com.android.systemui.fragments.FragmentHostManager;
|
||||
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.HomeControlsPlugin;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
import com.android.systemui.qs.QSFragment;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.FlingAnimationUtils;
|
||||
import com.android.systemui.statusbar.GestureRecorder;
|
||||
@@ -113,7 +105,6 @@ import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
|
||||
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
|
||||
import com.android.systemui.statusbar.policy.ZenModeController;
|
||||
import com.android.systemui.util.InjectionInflationController;
|
||||
import com.android.systemui.util.Utils;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
@@ -173,8 +164,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private final ConfigurationController mConfigurationController;
|
||||
private final FlingAnimationUtils.Builder mFlingAnimationUtilsBuilder;
|
||||
|
||||
private double mQqsSplitFraction;
|
||||
|
||||
// Cap and total height of Roboto font. Needs to be adjusted when font for the big clock is
|
||||
// changed.
|
||||
private static final int CAP_HEIGHT = 1456;
|
||||
@@ -258,7 +247,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private View mQsNavbarScrim;
|
||||
private NotificationsQuickSettingsContainer mNotificationContainerParent;
|
||||
private NotificationStackScrollLayout mNotificationStackScroller;
|
||||
private FrameLayout mHomeControlsLayout;
|
||||
private boolean mAnimateNextPositionUpdate;
|
||||
|
||||
private int mTrackingPointer;
|
||||
@@ -446,9 +434,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
*/
|
||||
private boolean mDelayShowingKeyguardStatusBar;
|
||||
|
||||
private PluginManager mPluginManager;
|
||||
private FrameLayout mPluginFrame;
|
||||
private NPVPluginManager mNPVPluginManager;
|
||||
private int mOldLayoutDirection;
|
||||
|
||||
@Inject
|
||||
@@ -457,7 +442,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
NotificationWakeUpCoordinator coordinator, PulseExpansionHandler pulseExpansionHandler,
|
||||
DynamicPrivacyController dynamicPrivacyController,
|
||||
KeyguardBypassController bypassController, FalsingManager falsingManager,
|
||||
PluginManager pluginManager, ShadeController shadeController,
|
||||
ShadeController shadeController,
|
||||
NotificationLockscreenUserManager notificationLockscreenUserManager,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
KeyguardStateController keyguardStateController,
|
||||
@@ -523,7 +508,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
});
|
||||
mBottomAreaShadeAlphaAnimator.setDuration(160);
|
||||
mBottomAreaShadeAlphaAnimator.setInterpolator(Interpolators.ALPHA_OUT);
|
||||
mPluginManager = pluginManager;
|
||||
mShadeController = shadeController;
|
||||
mLockscreenUserManager = notificationLockscreenUserManager;
|
||||
mEntryManager = notificationEntryManager;
|
||||
@@ -553,7 +537,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mBigClockContainer = mView.findViewById(R.id.big_clock_container);
|
||||
keyguardClockSwitch.setBigClockContainer(mBigClockContainer);
|
||||
|
||||
mHomeControlsLayout = mView.findViewById(R.id.home_controls_layout);
|
||||
mNotificationContainerParent = mView.findViewById(R.id.notification_container_parent);
|
||||
mNotificationStackScroller = mView.findViewById(R.id.notification_stack_scroller);
|
||||
mNotificationStackScroller.setOnHeightChangedListener(mOnHeightChangedListener);
|
||||
@@ -563,12 +546,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mKeyguardBottomArea = mView.findViewById(R.id.keyguard_bottom_area);
|
||||
mQsNavbarScrim = mView.findViewById(R.id.qs_navbar_scrim);
|
||||
mLastOrientation = mResources.getConfiguration().orientation;
|
||||
mPluginFrame = mView.findViewById(R.id.plugin_frame);
|
||||
if (Settings.System.getInt(mView.getContext().getContentResolver(), "npv_plugin_flag", 0)
|
||||
== 1) {
|
||||
mNPVPluginManager = new NPVPluginManager(mPluginFrame, mPluginManager);
|
||||
}
|
||||
|
||||
|
||||
initBottomArea();
|
||||
|
||||
@@ -592,19 +569,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
}
|
||||
});
|
||||
|
||||
mPluginManager.addPluginListener(new PluginListener<HomeControlsPlugin>() {
|
||||
|
||||
@Override
|
||||
public void onPluginConnected(HomeControlsPlugin plugin, Context pluginContext) {
|
||||
plugin.sendParentGroup(mHomeControlsLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginDisconnected(HomeControlsPlugin plugin) {
|
||||
|
||||
}
|
||||
}, HomeControlsPlugin.class, false);
|
||||
|
||||
mView.setRtlChangeListener(layoutDirection -> {
|
||||
if (layoutDirection != mOldLayoutDirection) {
|
||||
mAffordanceHelper.onRtlPropertiesChanged();
|
||||
@@ -637,9 +601,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
com.android.internal.R.dimen.status_bar_height);
|
||||
mHeadsUpInset = statusbarHeight + mResources.getDimensionPixelSize(
|
||||
R.dimen.heads_up_status_bar_padding);
|
||||
mQqsSplitFraction = ((float) mResources.getInteger(R.integer.qqs_split_fraction)) / (
|
||||
mResources.getInteger(R.integer.qqs_split_fraction) + mResources.getInteger(
|
||||
R.integer.qs_split_fraction));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -679,18 +640,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
lp.gravity = panelGravity;
|
||||
mNotificationStackScroller.setLayoutParams(lp);
|
||||
}
|
||||
int sideMargin = mResources.getDimensionPixelOffset(R.dimen.notification_side_paddings);
|
||||
int topMargin = sideMargin;
|
||||
lp = (FrameLayout.LayoutParams) mPluginFrame.getLayoutParams();
|
||||
if (lp.width != qsWidth || lp.gravity != panelGravity || lp.leftMargin != sideMargin
|
||||
|| lp.rightMargin != sideMargin || lp.topMargin != topMargin) {
|
||||
lp.width = qsWidth;
|
||||
lp.gravity = panelGravity;
|
||||
lp.leftMargin = sideMargin;
|
||||
lp.rightMargin = sideMargin;
|
||||
lp.topMargin = topMargin;
|
||||
mPluginFrame.setLayoutParams(lp);
|
||||
}
|
||||
}
|
||||
|
||||
private void reInflateViews() {
|
||||
@@ -732,41 +681,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
if (mOnReinflationListener != null) {
|
||||
mOnReinflationListener.run();
|
||||
}
|
||||
reinflatePluginContainer();
|
||||
}
|
||||
|
||||
private void reinflatePluginContainer() {
|
||||
int index = mView.indexOfChild(mPluginFrame);
|
||||
mView.removeView(mPluginFrame);
|
||||
mPluginFrame = (FrameLayout) mInjectionInflationController.injectable(
|
||||
LayoutInflater.from(mView.getContext())).inflate(
|
||||
R.layout.status_bar_expanded_plugin_frame, mView, false);
|
||||
mView.addView(mPluginFrame, index);
|
||||
|
||||
Resources res = mView.getResources();
|
||||
int qsWidth = res.getDimensionPixelSize(R.dimen.qs_panel_width);
|
||||
int panelGravity = mView.getResources().getInteger(
|
||||
R.integer.notification_panel_layout_gravity);
|
||||
FrameLayout.LayoutParams lp;
|
||||
int sideMargin = res.getDimensionPixelOffset(R.dimen.notification_side_paddings);
|
||||
int topMargin = res.getDimensionPixelOffset(
|
||||
com.android.internal.R.dimen.quick_qs_total_height);
|
||||
if (Utils.useQsMediaPlayer(mView.getContext())) {
|
||||
topMargin = res.getDimensionPixelOffset(
|
||||
com.android.internal.R.dimen.quick_qs_total_height_with_media);
|
||||
}
|
||||
lp = (FrameLayout.LayoutParams) mPluginFrame.getLayoutParams();
|
||||
if (lp.width != qsWidth || lp.gravity != panelGravity || lp.leftMargin != sideMargin
|
||||
|| lp.rightMargin != sideMargin || lp.topMargin != topMargin) {
|
||||
lp.width = qsWidth;
|
||||
lp.gravity = panelGravity;
|
||||
lp.leftMargin = sideMargin;
|
||||
lp.rightMargin = sideMargin;
|
||||
lp.topMargin = topMargin;
|
||||
mPluginFrame.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
if (mNPVPluginManager != null) mNPVPluginManager.replaceFrameLayout(mPluginFrame);
|
||||
}
|
||||
|
||||
private void initBottomArea() {
|
||||
@@ -1266,17 +1180,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
// earlier so the state is already up to date when dragging down.
|
||||
setListening(true);
|
||||
}
|
||||
if (isQsSplitEnabled() && !mKeyguardShowing) {
|
||||
if (mQsExpandImmediate) {
|
||||
mNotificationStackScroller.setVisibility(View.GONE);
|
||||
mQsFrame.setVisibility(View.VISIBLE);
|
||||
mHomeControlsLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mNotificationStackScroller.setVisibility(View.VISIBLE);
|
||||
mQsFrame.setVisibility(View.GONE);
|
||||
mHomeControlsLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1286,17 +1189,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
|| y <= mQs.getView().getY() + mQs.getView().getHeight());
|
||||
}
|
||||
|
||||
private boolean isOnQsEndArea(float x) {
|
||||
if (!isQsSplitEnabled()) return false;
|
||||
if (mView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
|
||||
return x >= mQsFrame.getX() + mQqsSplitFraction * mQsFrame.getWidth()
|
||||
&& x <= mQsFrame.getX() + mQsFrame.getWidth();
|
||||
} else {
|
||||
return x >= mQsFrame.getX()
|
||||
&& x <= mQsFrame.getX() + (1 - mQqsSplitFraction) * mQsFrame.getWidth();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isOpenQsEvent(MotionEvent event) {
|
||||
final int pointerCount = event.getPointerCount();
|
||||
final int action = event.getActionMasked();
|
||||
@@ -1317,9 +1209,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
MotionEvent.BUTTON_SECONDARY) || event.isButtonPressed(
|
||||
MotionEvent.BUTTON_TERTIARY));
|
||||
|
||||
final boolean onHeaderRight = isOnQsEndArea(event.getX());
|
||||
|
||||
return twoFingerDrag || stylusButtonClickDrag || mouseButtonClickDrag || onHeaderRight;
|
||||
return twoFingerDrag || stylusButtonClickDrag || mouseButtonClickDrag;
|
||||
}
|
||||
|
||||
private void handleQsDown(MotionEvent event) {
|
||||
@@ -1659,10 +1549,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mBarState != StatusBarState.KEYGUARD && (!mQsExpanded
|
||||
|| mQsExpansionFromOverscroll));
|
||||
updateEmptyShadeView();
|
||||
if (mNPVPluginManager != null) {
|
||||
mNPVPluginManager.changeVisibility(
|
||||
(mBarState != StatusBarState.KEYGUARD) ? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
|
||||
mQsNavbarScrim.setVisibility(
|
||||
mBarState == StatusBarState.SHADE && mQsExpanded && !mStackScrollerOverscrolling
|
||||
&& mQsScrimEnabled ? View.VISIBLE : View.INVISIBLE);
|
||||
@@ -1718,9 +1605,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
float qsExpansionFraction = getQsExpansionFraction();
|
||||
mQs.setQsExpansion(qsExpansionFraction, getHeaderTranslation());
|
||||
int heightDiff = mQs.getDesiredHeight() - mQs.getQsMinExpansionHeight();
|
||||
if (mNPVPluginManager != null) {
|
||||
mNPVPluginManager.setExpansion(qsExpansionFraction, getHeaderTranslation(), heightDiff);
|
||||
}
|
||||
mNotificationStackScroller.setQsExpansionFraction(qsExpansionFraction);
|
||||
}
|
||||
|
||||
@@ -2015,7 +1899,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
targetHeight =
|
||||
mQsMinExpansionHeight + t * (mQsMaxExpansionHeight - mQsMinExpansionHeight);
|
||||
setQsExpansion(targetHeight);
|
||||
mHomeControlsLayout.setTranslationY(targetHeight);
|
||||
}
|
||||
updateExpandedHeight(expandedHeight);
|
||||
updateHeader();
|
||||
@@ -2150,7 +2033,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
appearAmount = mNotificationStackScroller.calculateAppearFractionBypass();
|
||||
}
|
||||
startHeight = -mQs.getQsMinExpansionHeight();
|
||||
if (mNPVPluginManager != null) startHeight -= mNPVPluginManager.getHeight();
|
||||
}
|
||||
float translation = MathUtils.lerp(startHeight, 0, Math.min(1.0f, appearAmount))
|
||||
+ mExpandOffset;
|
||||
@@ -2294,7 +2176,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mKeyguardStatusBar.setListening(listening);
|
||||
if (mQs == null) return;
|
||||
mQs.setListening(listening);
|
||||
if (mNPVPluginManager != null) mNPVPluginManager.setListening(listening);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3029,11 +2910,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mOnReinflationListener = onReinflationListener;
|
||||
}
|
||||
|
||||
public static boolean isQsSplitEnabled() {
|
||||
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||
SystemUiDeviceConfigFlags.QS_SPLIT_ENABLED, false);
|
||||
}
|
||||
|
||||
public void setAlpha(float alpha) {
|
||||
mView.setAlpha(alpha);
|
||||
}
|
||||
@@ -3500,9 +3376,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUiModeChanged() {
|
||||
reinflatePluginContainer();
|
||||
}
|
||||
public void onUiModeChanged() {}
|
||||
}
|
||||
|
||||
private class StatusBarStateListener implements StateListener {
|
||||
@@ -3517,11 +3391,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
|
||||
mBarState = statusBarState;
|
||||
mKeyguardShowing = keyguardShowing;
|
||||
if (mKeyguardShowing && isQsSplitEnabled()) {
|
||||
mNotificationStackScroller.setVisibility(View.VISIBLE);
|
||||
mQsFrame.setVisibility(View.VISIBLE);
|
||||
mHomeControlsLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (oldState == StatusBarState.KEYGUARD && (goingToFullShade
|
||||
|| statusBarState == StatusBarState.SHADE_LOCKED)) {
|
||||
@@ -3544,7 +3413,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
} else {
|
||||
mKeyguardStatusBar.setAlpha(1f);
|
||||
mKeyguardStatusBar.setVisibility(keyguardShowing ? View.VISIBLE : View.INVISIBLE);
|
||||
((PhoneStatusBarView) mBar).maybeShowDivider(keyguardShowing);
|
||||
if (keyguardShowing && oldState != mBarState) {
|
||||
if (mQs != null) {
|
||||
mQs.hideImmediately();
|
||||
@@ -3622,10 +3490,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
int oldMaxHeight = mQsMaxExpansionHeight;
|
||||
if (mQs != null) {
|
||||
mQsMinExpansionHeight = mKeyguardShowing ? 0 : mQs.getQsMinExpansionHeight();
|
||||
if (mNPVPluginManager != null) {
|
||||
mNPVPluginManager.setYOffset(mQsMinExpansionHeight);
|
||||
mQsMinExpansionHeight += mNPVPluginManager.getHeight();
|
||||
}
|
||||
mQsMaxExpansionHeight = mQs.getDesiredHeight();
|
||||
mNotificationStackScroller.setMaxTopPadding(
|
||||
mQsMaxExpansionHeight + mQsNotificationTopPadding);
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
||||
private final PhoneStatusBarView mView;
|
||||
private final float mIconAlphaWhenOpaque;
|
||||
|
||||
private View mLeftSide, mStatusIcons, mBattery, mClock, mDivider;
|
||||
private View mLeftSide, mStatusIcons, mBattery, mClock;
|
||||
private Animator mCurrentAnimation;
|
||||
|
||||
public PhoneStatusBarTransitions(PhoneStatusBarView view) {
|
||||
@@ -46,7 +46,6 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
||||
mLeftSide = mView.findViewById(R.id.status_bar_left_side);
|
||||
mStatusIcons = mView.findViewById(R.id.statusIcons);
|
||||
mBattery = mView.findViewById(R.id.battery);
|
||||
mDivider = mView.findViewById(R.id.divider);
|
||||
applyModeBackground(-1, getMode(), false /*animate*/);
|
||||
applyMode(getMode(), false /*animate*/);
|
||||
}
|
||||
@@ -89,7 +88,6 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
||||
anims.playTogether(
|
||||
animateTransitionTo(mLeftSide, newAlpha),
|
||||
animateTransitionTo(mStatusIcons, newAlpha),
|
||||
animateTransitionTo(mDivider, newAlpha),
|
||||
animateTransitionTo(mBattery, newAlphaBC)
|
||||
);
|
||||
if (isLightsOut(mode)) {
|
||||
@@ -100,8 +98,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
||||
} else {
|
||||
mLeftSide.setAlpha(newAlpha);
|
||||
mStatusIcons.setAlpha(newAlpha);
|
||||
mDivider.setAlpha(newAlpha);
|
||||
mBattery.setAlpha(newAlphaBC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.provider.DeviceConfig;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.EventLog;
|
||||
import android.util.Pair;
|
||||
@@ -40,8 +39,6 @@ import android.view.accessibility.AccessibilityEvent;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
|
||||
import com.android.systemui.DarkReceiverImpl;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.EventLogTags;
|
||||
import com.android.systemui.R;
|
||||
@@ -81,9 +78,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
@Nullable
|
||||
private DisplayCutout mDisplayCutout;
|
||||
|
||||
private DarkReceiverImpl mSplitDivider;
|
||||
private View mDividerContainer;
|
||||
private QsSplitPropertyListener mPropertyListener;
|
||||
/**
|
||||
* Draw this many pixels into the left/right side of the cutout to optimally use the space
|
||||
*/
|
||||
@@ -115,10 +109,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
mBattery = findViewById(R.id.battery);
|
||||
mCutoutSpace = findViewById(R.id.cutout_space_view);
|
||||
mCenterIconSpace = findViewById(R.id.centered_icon_area);
|
||||
mSplitDivider = findViewById(R.id.divider);
|
||||
mDividerContainer = findViewById(R.id.divider_container);
|
||||
maybeShowDivider(true);
|
||||
mPropertyListener = new QsSplitPropertyListener(mDividerContainer);
|
||||
|
||||
updateResources();
|
||||
}
|
||||
@@ -128,26 +118,16 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
super.onAttachedToWindow();
|
||||
// Always have Battery meters in the status bar observe the dark/light modes.
|
||||
Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mBattery);
|
||||
Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mSplitDivider);
|
||||
maybeShowDivider(true);
|
||||
if (updateOrientationAndCutout(getResources().getConfiguration().orientation)) {
|
||||
updateLayoutForCutout();
|
||||
}
|
||||
if (mPropertyListener != null) {
|
||||
DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_SYSTEMUI,
|
||||
mContext.getMainExecutor(), mPropertyListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
Dependency.get(DarkIconDispatcher.class).removeDarkReceiver(mBattery);
|
||||
Dependency.get(DarkIconDispatcher.class).removeDarkReceiver(mSplitDivider);
|
||||
mDisplayCutout = null;
|
||||
if (mPropertyListener != null) {
|
||||
DeviceConfig.removeOnPropertiesChangedListener(mPropertyListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,7 +196,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
public void onPanelPeeked() {
|
||||
super.onPanelPeeked();
|
||||
mBar.makeExpandedVisible(false);
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,7 +204,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
// Close the status bar in the next frame so we can show the end of the animation.
|
||||
post(mHideExpandedRunnable);
|
||||
mIsFullyOpenedPanel = false;
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
public void removePendingHideExpandedRunnables() {
|
||||
@@ -239,7 +217,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
mPanel.getView().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
|
||||
}
|
||||
mIsFullyOpenedPanel = true;
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -263,28 +240,24 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
mBar.onTrackingStarted();
|
||||
mScrimController.onTrackingStarted();
|
||||
removePendingHideExpandedRunnables();
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClosingFinished() {
|
||||
super.onClosingFinished();
|
||||
mBar.onClosingFinished();
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrackingStopped(boolean expand) {
|
||||
super.onTrackingStopped(expand);
|
||||
mBar.onTrackingStopped(expand);
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExpandingFinished() {
|
||||
super.onExpandingFinished();
|
||||
mScrimController.onExpandingFinished();
|
||||
maybeShowDivider(!mBar.mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -416,31 +389,4 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
protected boolean shouldPanelBeVisible() {
|
||||
return mHeadsUpVisible || super.shouldPanelBeVisible();
|
||||
}
|
||||
|
||||
void maybeShowDivider(boolean showDivider) {
|
||||
int state =
|
||||
showDivider && NotificationPanelViewController.isQsSplitEnabled()
|
||||
? View.VISIBLE : View.GONE;
|
||||
mDividerContainer.setVisibility(state);
|
||||
}
|
||||
|
||||
private static class QsSplitPropertyListener implements
|
||||
DeviceConfig.OnPropertiesChangedListener {
|
||||
private final View mDivider;
|
||||
|
||||
QsSplitPropertyListener(View divider) {
|
||||
mDivider = divider;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPropertiesChanged(DeviceConfig.Properties properties) {
|
||||
if (properties.getNamespace().equals(DeviceConfig.NAMESPACE_SYSTEMUI)
|
||||
&& properties.getKeyset().contains(
|
||||
SystemUiDeviceConfigFlags.QS_SPLIT_ENABLED)) {
|
||||
boolean splitEnabled = properties.getBoolean(
|
||||
SystemUiDeviceConfigFlags.QS_SPLIT_ENABLED, false);
|
||||
mDivider.setVisibility(splitEnabled ? VISIBLE : GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,8 +129,6 @@ public class Utils {
|
||||
*/
|
||||
public static boolean useQsMediaPlayer(Context context) {
|
||||
int flag = Settings.System.getInt(context.getContentResolver(), "qs_media_player", 0);
|
||||
flag |= Settings.System.getInt(context.getContentResolver(), "npv_plugin_flag", 0);
|
||||
|
||||
return flag > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.classifier.FalsingManagerFake;
|
||||
import com.android.systemui.doze.DozeLog;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.shared.plugins.PluginManager;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.FlingAnimationUtils;
|
||||
import com.android.systemui.statusbar.KeyguardAffordanceView;
|
||||
@@ -133,8 +132,6 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private DynamicPrivacyController mDynamicPrivacyController;
|
||||
@Mock
|
||||
private PluginManager mPluginManager;
|
||||
@Mock
|
||||
private ShadeController mShadeController;
|
||||
@Mock
|
||||
private NotificationLockscreenUserManager mNotificationLockscreenUserManager;
|
||||
@@ -218,7 +215,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
mNotificationPanelViewController = new NotificationPanelViewController(mView,
|
||||
mInjectionInflationController,
|
||||
coordinator, expansionHandler, mDynamicPrivacyController, mKeyguardBypassController,
|
||||
mFalsingManager, mPluginManager, mShadeController,
|
||||
mFalsingManager, mShadeController,
|
||||
mNotificationLockscreenUserManager, mNotificationEntryManager,
|
||||
mKeyguardStateController, mStatusBarStateController, mDozeLog,
|
||||
mDozeParameters, mCommandQueue, mVibratorHelper,
|
||||
|
||||
Reference in New Issue
Block a user