Loading packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +8 −7 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.systemui.statusbar.policy.RemoteInputView; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.ArrayList; import java.util.List; import java.util.List; import java.util.Objects; /** /** * Keeps track of the currently active {@link RemoteInputView}s. * Keeps track of the currently active {@link RemoteInputView}s. Loading Loading @@ -108,8 +109,8 @@ public class RemoteInputController { * @param token a token identifying the view that is managing the remote input * @param token a token identifying the view that is managing the remote input */ */ public void addRemoteInput(NotificationEntry entry, Object token) { public void addRemoteInput(NotificationEntry entry, Object token) { Preconditions.checkNotNull(entry); Objects.requireNonNull(entry); Preconditions.checkNotNull(token); Objects.requireNonNull(token); boolean found = pruneWeakThenRemoveAndContains( boolean found = pruneWeakThenRemoveAndContains( entry /* contains */, null /* remove */, token /* removeToken */); entry /* contains */, null /* remove */, token /* removeToken */); Loading @@ -129,7 +130,7 @@ public class RemoteInputController { * entry. If null, the entry is removed regardless. * entry. If null, the entry is removed regardless. */ */ public void removeRemoteInput(NotificationEntry entry, Object token) { public void removeRemoteInput(NotificationEntry entry, Object token) { Preconditions.checkNotNull(entry); Objects.requireNonNull(entry); pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); Loading @@ -143,8 +144,8 @@ public class RemoteInputController { * @param token the token of the view managing the remote input. * @param token the token of the view managing the remote input. */ */ public void addSpinning(String key, Object token) { public void addSpinning(String key, Object token) { Preconditions.checkNotNull(key); Objects.requireNonNull(key); Preconditions.checkNotNull(token); Objects.requireNonNull(token); mSpinning.put(key, token); mSpinning.put(key, token); } } Loading @@ -158,7 +159,7 @@ public class RemoteInputController { * entry. If null, the entry is removed regardless. * entry. If null, the entry is removed regardless. */ */ public void removeSpinning(String key, Object token) { public void removeSpinning(String key, Object token) { Preconditions.checkNotNull(key); Objects.requireNonNull(key); if (token == null || mSpinning.get(key) == token) { if (token == null || mSpinning.get(key) == token) { mSpinning.remove(key); mSpinning.remove(key); Loading Loading @@ -237,7 +238,7 @@ public class RemoteInputController { public void addCallback(Callback callback) { public void addCallback(Callback callback) { Preconditions.checkNotNull(callback); Objects.requireNonNull(callback); mCallbacks.add(callback); mCallbacks.add(callback); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationListController.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -16,14 +16,14 @@ package com.android.systemui.statusbar.notification; package com.android.systemui.statusbar.notification; import static com.android.internal.util.Preconditions.checkNotNull; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import java.util.Objects; /** /** * Root controller for the list of notifications in the shade. * Root controller for the list of notifications in the shade. * * Loading @@ -39,9 +39,9 @@ public class NotificationListController { NotificationEntryManager entryManager, NotificationEntryManager entryManager, NotificationListContainer listContainer, NotificationListContainer listContainer, DeviceProvisionedController deviceProvisionedController) { DeviceProvisionedController deviceProvisionedController) { mEntryManager = checkNotNull(entryManager); mEntryManager = Objects.requireNonNull(entryManager); mListContainer = checkNotNull(listContainer); mListContainer = Objects.requireNonNull(listContainer); mDeviceProvisionedController = checkNotNull(deviceProvisionedController); mDeviceProvisionedController = Objects.requireNonNull(deviceProvisionedController); } } /** /** Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -35,8 +35,6 @@ import static android.service.notification.NotificationListenerService.REASON_TI import static android.service.notification.NotificationListenerService.REASON_UNAUTOBUNDLED; import static android.service.notification.NotificationListenerService.REASON_UNAUTOBUNDLED; import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED; import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED; import static com.android.internal.util.Preconditions.checkNotNull; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.NonNull; Loading @@ -60,6 +58,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Collections; import java.util.List; import java.util.List; import java.util.Map; import java.util.Map; import java.util.Objects; import javax.inject.Inject; import javax.inject.Inject; import javax.inject.Singleton; import javax.inject.Singleton; Loading Loading @@ -170,7 +169,7 @@ public class NotifCollection { @CancellationReason int reason, @CancellationReason int reason, @NonNull DismissedByUserStats stats) { @NonNull DismissedByUserStats stats) { Assert.isMainThread(); Assert.isMainThread(); checkNotNull(stats); Objects.requireNonNull(stats); checkForReentrantCall(); checkForReentrantCall(); removeNotification(entry.getKey(), null, reason, stats); removeNotification(entry.getKey(), null, reason, stats); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_NOTIFICAT import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import static com.android.internal.util.Preconditions.checkNotNull; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManager.BUCKET_ALERTING; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManager.BUCKET_ALERTING; import android.annotation.NonNull; import android.annotation.NonNull; Loading Loading @@ -162,9 +161,9 @@ public final class NotificationEntry extends ListEntry { public NotificationEntry( public NotificationEntry( @NonNull StatusBarNotification sbn, @NonNull StatusBarNotification sbn, @NonNull Ranking ranking) { @NonNull Ranking ranking) { super(checkNotNull(checkNotNull(sbn).getKey())); super(Objects.requireNonNull(Objects.requireNonNull(sbn).getKey())); checkNotNull(ranking); Objects.requireNonNull(ranking); mKey = sbn.getKey(); mKey = sbn.getKey(); setSbn(sbn); setSbn(sbn); Loading Loading @@ -194,8 +193,8 @@ public final class NotificationEntry extends ListEntry { * TODO: Make this package-private * TODO: Make this package-private */ */ public void setSbn(@NonNull StatusBarNotification sbn) { public void setSbn(@NonNull StatusBarNotification sbn) { checkNotNull(sbn); Objects.requireNonNull(sbn); checkNotNull(sbn.getKey()); Objects.requireNonNull(sbn.getKey()); if (!sbn.getKey().equals(mKey)) { if (!sbn.getKey().equals(mKey)) { throw new IllegalArgumentException("New key " + sbn.getKey() throw new IllegalArgumentException("New key " + sbn.getKey() Loading Loading @@ -223,8 +222,8 @@ public final class NotificationEntry extends ListEntry { * TODO: Make this package-private * TODO: Make this package-private */ */ public void setRanking(@NonNull Ranking ranking) { public void setRanking(@NonNull Ranking ranking) { checkNotNull(ranking); Objects.requireNonNull(ranking); checkNotNull(ranking.getKey()); Objects.requireNonNull(ranking.getKey()); if (!ranking.getKey().equals(mKey)) { if (!ranking.getKey().equals(mKey)) { throw new IllegalArgumentException("New key " + ranking.getKey() throw new IllegalArgumentException("New key " + ranking.getKey() Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationRowBinderImpl.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.collection; package com.android.systemui.statusbar.notification.collection; import static com.android.internal.util.Preconditions.checkNotNull; import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT; import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_HEADS_UP; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_HEADS_UP; Loading Loading @@ -51,6 +50,8 @@ import com.android.systemui.statusbar.phone.NotificationGroupManager; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.Objects; /** Handles inflating and updating views for notifications. */ /** Handles inflating and updating views for notifications. */ public class NotificationRowBinderImpl implements NotificationRowBinder { public class NotificationRowBinderImpl implements NotificationRowBinder { Loading Loading @@ -265,7 +266,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { row.inflateViews(); row.inflateViews(); // bind the click event to the content area // bind the click event to the content area checkNotNull(mNotificationClicker).register(row, sbn); Objects.requireNonNull(mNotificationClicker).register(row, sbn); } } private void logNotificationExpansion(String key, boolean userAction, boolean expanded) { private void logNotificationExpansion(String key, boolean userAction, boolean expanded) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java +8 −7 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.systemui.statusbar.policy.RemoteInputView; import java.lang.ref.WeakReference; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.ArrayList; import java.util.List; import java.util.List; import java.util.Objects; /** /** * Keeps track of the currently active {@link RemoteInputView}s. * Keeps track of the currently active {@link RemoteInputView}s. Loading Loading @@ -108,8 +109,8 @@ public class RemoteInputController { * @param token a token identifying the view that is managing the remote input * @param token a token identifying the view that is managing the remote input */ */ public void addRemoteInput(NotificationEntry entry, Object token) { public void addRemoteInput(NotificationEntry entry, Object token) { Preconditions.checkNotNull(entry); Objects.requireNonNull(entry); Preconditions.checkNotNull(token); Objects.requireNonNull(token); boolean found = pruneWeakThenRemoveAndContains( boolean found = pruneWeakThenRemoveAndContains( entry /* contains */, null /* remove */, token /* removeToken */); entry /* contains */, null /* remove */, token /* removeToken */); Loading @@ -129,7 +130,7 @@ public class RemoteInputController { * entry. If null, the entry is removed regardless. * entry. If null, the entry is removed regardless. */ */ public void removeRemoteInput(NotificationEntry entry, Object token) { public void removeRemoteInput(NotificationEntry entry, Object token) { Preconditions.checkNotNull(entry); Objects.requireNonNull(entry); pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token); Loading @@ -143,8 +144,8 @@ public class RemoteInputController { * @param token the token of the view managing the remote input. * @param token the token of the view managing the remote input. */ */ public void addSpinning(String key, Object token) { public void addSpinning(String key, Object token) { Preconditions.checkNotNull(key); Objects.requireNonNull(key); Preconditions.checkNotNull(token); Objects.requireNonNull(token); mSpinning.put(key, token); mSpinning.put(key, token); } } Loading @@ -158,7 +159,7 @@ public class RemoteInputController { * entry. If null, the entry is removed regardless. * entry. If null, the entry is removed regardless. */ */ public void removeSpinning(String key, Object token) { public void removeSpinning(String key, Object token) { Preconditions.checkNotNull(key); Objects.requireNonNull(key); if (token == null || mSpinning.get(key) == token) { if (token == null || mSpinning.get(key) == token) { mSpinning.remove(key); mSpinning.remove(key); Loading Loading @@ -237,7 +238,7 @@ public class RemoteInputController { public void addCallback(Callback callback) { public void addCallback(Callback callback) { Preconditions.checkNotNull(callback); Objects.requireNonNull(callback); mCallbacks.add(callback); mCallbacks.add(callback); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationListController.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -16,14 +16,14 @@ package com.android.systemui.statusbar.notification; package com.android.systemui.statusbar.notification; import static com.android.internal.util.Preconditions.checkNotNull; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.statusbar.NotificationVisibility; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import java.util.Objects; /** /** * Root controller for the list of notifications in the shade. * Root controller for the list of notifications in the shade. * * Loading @@ -39,9 +39,9 @@ public class NotificationListController { NotificationEntryManager entryManager, NotificationEntryManager entryManager, NotificationListContainer listContainer, NotificationListContainer listContainer, DeviceProvisionedController deviceProvisionedController) { DeviceProvisionedController deviceProvisionedController) { mEntryManager = checkNotNull(entryManager); mEntryManager = Objects.requireNonNull(entryManager); mListContainer = checkNotNull(listContainer); mListContainer = Objects.requireNonNull(listContainer); mDeviceProvisionedController = checkNotNull(deviceProvisionedController); mDeviceProvisionedController = Objects.requireNonNull(deviceProvisionedController); } } /** /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -35,8 +35,6 @@ import static android.service.notification.NotificationListenerService.REASON_TI import static android.service.notification.NotificationListenerService.REASON_UNAUTOBUNDLED; import static android.service.notification.NotificationListenerService.REASON_UNAUTOBUNDLED; import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED; import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED; import static com.android.internal.util.Preconditions.checkNotNull; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.NonNull; Loading @@ -60,6 +58,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Collections; import java.util.List; import java.util.List; import java.util.Map; import java.util.Map; import java.util.Objects; import javax.inject.Inject; import javax.inject.Inject; import javax.inject.Singleton; import javax.inject.Singleton; Loading Loading @@ -170,7 +169,7 @@ public class NotifCollection { @CancellationReason int reason, @CancellationReason int reason, @NonNull DismissedByUserStats stats) { @NonNull DismissedByUserStats stats) { Assert.isMainThread(); Assert.isMainThread(); checkNotNull(stats); Objects.requireNonNull(stats); checkForReentrantCall(); checkForReentrantCall(); removeNotification(entry.getKey(), null, reason, stats); removeNotification(entry.getKey(), null, reason, stats); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_NOTIFICAT import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR; import static com.android.internal.util.Preconditions.checkNotNull; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManager.BUCKET_ALERTING; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManager.BUCKET_ALERTING; import android.annotation.NonNull; import android.annotation.NonNull; Loading Loading @@ -162,9 +161,9 @@ public final class NotificationEntry extends ListEntry { public NotificationEntry( public NotificationEntry( @NonNull StatusBarNotification sbn, @NonNull StatusBarNotification sbn, @NonNull Ranking ranking) { @NonNull Ranking ranking) { super(checkNotNull(checkNotNull(sbn).getKey())); super(Objects.requireNonNull(Objects.requireNonNull(sbn).getKey())); checkNotNull(ranking); Objects.requireNonNull(ranking); mKey = sbn.getKey(); mKey = sbn.getKey(); setSbn(sbn); setSbn(sbn); Loading Loading @@ -194,8 +193,8 @@ public final class NotificationEntry extends ListEntry { * TODO: Make this package-private * TODO: Make this package-private */ */ public void setSbn(@NonNull StatusBarNotification sbn) { public void setSbn(@NonNull StatusBarNotification sbn) { checkNotNull(sbn); Objects.requireNonNull(sbn); checkNotNull(sbn.getKey()); Objects.requireNonNull(sbn.getKey()); if (!sbn.getKey().equals(mKey)) { if (!sbn.getKey().equals(mKey)) { throw new IllegalArgumentException("New key " + sbn.getKey() throw new IllegalArgumentException("New key " + sbn.getKey() Loading Loading @@ -223,8 +222,8 @@ public final class NotificationEntry extends ListEntry { * TODO: Make this package-private * TODO: Make this package-private */ */ public void setRanking(@NonNull Ranking ranking) { public void setRanking(@NonNull Ranking ranking) { checkNotNull(ranking); Objects.requireNonNull(ranking); checkNotNull(ranking.getKey()); Objects.requireNonNull(ranking.getKey()); if (!ranking.getKey().equals(mKey)) { if (!ranking.getKey().equals(mKey)) { throw new IllegalArgumentException("New key " + ranking.getKey() throw new IllegalArgumentException("New key " + ranking.getKey() Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationRowBinderImpl.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.collection; package com.android.systemui.statusbar.notification.collection; import static com.android.internal.util.Preconditions.checkNotNull; import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT; import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_HEADS_UP; import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_HEADS_UP; Loading Loading @@ -51,6 +50,8 @@ import com.android.systemui.statusbar.phone.NotificationGroupManager; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.Objects; /** Handles inflating and updating views for notifications. */ /** Handles inflating and updating views for notifications. */ public class NotificationRowBinderImpl implements NotificationRowBinder { public class NotificationRowBinderImpl implements NotificationRowBinder { Loading Loading @@ -265,7 +266,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { row.inflateViews(); row.inflateViews(); // bind the click event to the content area // bind the click event to the content area checkNotNull(mNotificationClicker).register(row, sbn); Objects.requireNonNull(mNotificationClicker).register(row, sbn); } } private void logNotificationExpansion(String key, boolean userAction, boolean expanded) { private void logNotificationExpansion(String key, boolean userAction, boolean expanded) { Loading