Merge "Remove unused code from ExpandableNotificationRow" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a0e394b83e
@@ -26,10 +26,8 @@ import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
import android.app.INotificationManager;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.role.RoleManager;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
@@ -38,12 +36,9 @@ import android.graphics.Path;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.AnimatedVectorDrawable;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.Trace;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.ArraySet;
|
||||
@@ -86,7 +81,6 @@ import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.RemoteInputController;
|
||||
import com.android.systemui.statusbar.SmartReplyController;
|
||||
import com.android.systemui.statusbar.StatusBarIconView;
|
||||
@@ -141,8 +135,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
|
||||
private static final boolean DEBUG_ONMEASURE =
|
||||
Compile.IS_DEBUG && Log.isLoggable(TAG, Log.VERBOSE);
|
||||
private static final int DEFAULT_DIVIDER_ALPHA = 0x29;
|
||||
private static final int COLORED_DIVIDER_ALPHA = 0x7B;
|
||||
private static final int MENU_VIEW_INDEX = 0;
|
||||
public static final float DEFAULT_HEADER_VISIBLE_AMOUNT = 1.0f;
|
||||
private static final long RECENTLY_ALERTED_THRESHOLD_MS = TimeUnit.SECONDS.toMillis(30);
|
||||
@@ -278,7 +270,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
private boolean mShowNoBackground;
|
||||
private ExpandableNotificationRow mNotificationParent;
|
||||
private OnExpandClickListener mOnExpandClickListener;
|
||||
private View.OnClickListener mOnAppClickListener;
|
||||
private View.OnClickListener mOnFeedbackClickListener;
|
||||
private Path mExpandingClipPath;
|
||||
private boolean mIsInlineReplyAnimationFlagEnabled = false;
|
||||
@@ -371,7 +362,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
private float mTranslationWhenRemoved;
|
||||
private boolean mWasChildInGroupWhenRemoved;
|
||||
private NotificationInlineImageResolver mImageResolver;
|
||||
private NotificationMediaManager mMediaManager;
|
||||
@Nullable
|
||||
private OnExpansionChangedListener mExpansionChangedListener;
|
||||
@Nullable
|
||||
@@ -381,32 +371,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
private float mBottomRoundnessDuringLaunchAnimation;
|
||||
private float mSmallRoundness;
|
||||
|
||||
/**
|
||||
* Returns whether the given {@code statusBarNotification} is a system notification.
|
||||
* <b>Note</b>, this should be run in the background thread if possible as it makes multiple IPC
|
||||
* calls.
|
||||
*/
|
||||
private static Boolean isSystemNotification(Context context, StatusBarNotification sbn) {
|
||||
INotificationManager iNm = INotificationManager.Stub.asInterface(
|
||||
ServiceManager.getService(Context.NOTIFICATION_SERVICE));
|
||||
|
||||
boolean isSystem = false;
|
||||
try {
|
||||
isSystem = iNm.isPermissionFixed(sbn.getPackageName(), sbn.getUserId());
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "cannot reach NMS");
|
||||
}
|
||||
RoleManager rm = context.getSystemService(RoleManager.class);
|
||||
List<String> fixedRoleHolders = new ArrayList<>();
|
||||
fixedRoleHolders.addAll(rm.getRoleHolders(RoleManager.ROLE_DIALER));
|
||||
fixedRoleHolders.addAll(rm.getRoleHolders(RoleManager.ROLE_EMERGENCY));
|
||||
if (fixedRoleHolders.contains(sbn.getPackageName())) {
|
||||
isSystem = true;
|
||||
}
|
||||
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
public NotificationContentView[] getLayouts() {
|
||||
return Arrays.copyOf(mLayouts, mLayouts.length);
|
||||
}
|
||||
@@ -794,11 +758,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
mPrivateLayout.setRemoteInputController(r);
|
||||
}
|
||||
|
||||
|
||||
String getAppName() {
|
||||
return mAppName;
|
||||
}
|
||||
|
||||
public void addChildNotification(ExpandableNotificationRow row) {
|
||||
addChildNotification(row, -1);
|
||||
}
|
||||
@@ -1272,10 +1231,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
}
|
||||
}
|
||||
|
||||
public HeadsUpManager getHeadsUpManager() {
|
||||
return mHeadsUpManager;
|
||||
}
|
||||
|
||||
public void setGutsView(MenuItem item) {
|
||||
if (getGuts() != null && item.getGutsView() instanceof NotificationGuts.GutsContent) {
|
||||
getGuts().setGutsContent((NotificationGuts.GutsContent) item.getGutsView());
|
||||
@@ -1705,7 +1660,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
HeadsUpManager headsUpManager,
|
||||
RowContentBindStage rowContentBindStage,
|
||||
OnExpandClickListener onExpandClickListener,
|
||||
NotificationMediaManager notificationMediaManager,
|
||||
CoordinateOnClickListener onFeedbackClickListener,
|
||||
FalsingManager falsingManager,
|
||||
FalsingCollector falsingCollector,
|
||||
@@ -1736,7 +1690,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
mHeadsUpManager = headsUpManager;
|
||||
mRowContentBindStage = rowContentBindStage;
|
||||
mOnExpandClickListener = onExpandClickListener;
|
||||
mMediaManager = notificationMediaManager;
|
||||
setOnFeedbackClickListener(onFeedbackClickListener);
|
||||
mFalsingManager = falsingManager;
|
||||
mFalsingCollector = falsingCollector;
|
||||
@@ -2925,22 +2878,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
updateClickAndFocus();
|
||||
}
|
||||
|
||||
public static void applyTint(View v, int color) {
|
||||
int alpha;
|
||||
if (color != 0) {
|
||||
alpha = COLORED_DIVIDER_ALPHA;
|
||||
} else {
|
||||
color = 0xff000000;
|
||||
alpha = DEFAULT_DIVIDER_ALPHA;
|
||||
}
|
||||
if (v.getBackground() instanceof ColorDrawable) {
|
||||
ColorDrawable background = (ColorDrawable) v.getBackground();
|
||||
background.mutate();
|
||||
background.setColor(color);
|
||||
background.setAlpha(alpha);
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxExpandHeight() {
|
||||
return mPrivateLayout.getExpandHeight();
|
||||
}
|
||||
@@ -3257,10 +3194,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
return shouldShowPublic() ? mPublicLayout : mPrivateLayout;
|
||||
}
|
||||
|
||||
public View getExpandedContentView() {
|
||||
return getPrivateLayout().getExpandedChild();
|
||||
}
|
||||
|
||||
public void setLegacy(boolean legacy) {
|
||||
for (NotificationContentView l : mLayouts) {
|
||||
l.setLegacy(legacy);
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.PluginManager;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.SmartReplyController;
|
||||
import com.android.systemui.statusbar.notification.FeedbackIcon;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
@@ -74,7 +73,6 @@ public class ExpandableNotificationRowController implements NotifViewController
|
||||
private final NotificationListContainer mListContainer;
|
||||
private final RemoteInputViewSubcomponent.Factory mRemoteInputViewSubcomponentFactory;
|
||||
private final ActivatableNotificationViewController mActivatableNotificationViewController;
|
||||
private final NotificationMediaManager mMediaManager;
|
||||
private final PluginManager mPluginManager;
|
||||
private final SystemClock mClock;
|
||||
private final String mAppName;
|
||||
@@ -136,7 +134,6 @@ public class ExpandableNotificationRowController implements NotifViewController
|
||||
MetricsLogger metricsLogger,
|
||||
NotificationRowLogger logBufferLogger,
|
||||
NotificationListContainer listContainer,
|
||||
NotificationMediaManager mediaManager,
|
||||
SmartReplyConstants smartReplyConstants,
|
||||
SmartReplyController smartReplyController,
|
||||
PluginManager pluginManager,
|
||||
@@ -165,7 +162,6 @@ public class ExpandableNotificationRowController implements NotifViewController
|
||||
mListContainer = listContainer;
|
||||
mRemoteInputViewSubcomponentFactory = rivSubcomponentFactory;
|
||||
mActivatableNotificationViewController = activatableNotificationViewController;
|
||||
mMediaManager = mediaManager;
|
||||
mPluginManager = pluginManager;
|
||||
mClock = clock;
|
||||
mAppName = appName;
|
||||
@@ -212,7 +208,6 @@ public class ExpandableNotificationRowController implements NotifViewController
|
||||
mHeadsUpManager,
|
||||
mRowContentBindStage,
|
||||
mOnExpandClickListener,
|
||||
mMediaManager,
|
||||
mOnFeedbackClickListener,
|
||||
mFalsingManager,
|
||||
mFalsingCollector,
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.android.systemui.flags.Flags
|
||||
import com.android.systemui.plugins.FalsingManager
|
||||
import com.android.systemui.plugins.PluginManager
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
import com.android.systemui.statusbar.NotificationMediaManager
|
||||
import com.android.systemui.statusbar.SmartReplyController
|
||||
import com.android.systemui.statusbar.notification.collection.provider.NotificationDismissibilityProvider
|
||||
import com.android.systemui.statusbar.notification.collection.render.FakeNodeController
|
||||
@@ -73,7 +72,6 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() {
|
||||
private val logBufferLogger: NotificationRowLogger = mock()
|
||||
private val listContainer: NotificationListContainer = mock()
|
||||
private val childrenContainer: NotificationChildrenContainer = mock()
|
||||
private val mediaManager: NotificationMediaManager = mock()
|
||||
private val smartReplyConstants: SmartReplyConstants = mock()
|
||||
private val smartReplyController: SmartReplyController = mock()
|
||||
private val pluginManager: PluginManager = mock()
|
||||
@@ -95,6 +93,7 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() {
|
||||
private val bubblesManager: BubblesManager = mock()
|
||||
private val dragController: ExpandableNotificationRowDragController = mock()
|
||||
private val dismissibilityProvider: NotificationDismissibilityProvider = mock()
|
||||
|
||||
private lateinit var controller: ExpandableNotificationRowController
|
||||
|
||||
@Before
|
||||
@@ -108,7 +107,6 @@ class ExpandableNotificationRowControllerTest : SysuiTestCase() {
|
||||
metricsLogger,
|
||||
logBufferLogger,
|
||||
listContainer,
|
||||
mediaManager,
|
||||
smartReplyConstants,
|
||||
smartReplyController,
|
||||
pluginManager,
|
||||
|
||||
@@ -570,7 +570,6 @@ public class NotificationTestHelper {
|
||||
mHeadsUpManager,
|
||||
mBindStage,
|
||||
mock(OnExpandClickListener.class),
|
||||
mock(NotificationMediaManager.class),
|
||||
mock(ExpandableNotificationRow.CoordinateOnClickListener.class),
|
||||
new FalsingManagerFake(),
|
||||
new FalsingCollectorFake(),
|
||||
|
||||
Reference in New Issue
Block a user