summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beth Thibodeau <ethibodeau@google.com> 2019-05-21 14:18:42 -0400
committer Beth Thibodeau <ethibodeau@google.com> 2019-05-21 14:29:02 -0400
commit5af18c187809a09174100e991d025678cdeff5a1 (patch)
tree6fae7b6ec16d0b938babc33d31405e84fd60ab88
parent743288a029deba1df1e0d01eca5d5db9dd855fc5 (diff)
Remove AgingHelper code
Fixes: 132217006 Test: atest ExtServicesUnitTests Change-Id: I1388fe97aa43aaf8d4eb9339aee5a96a9bf7fbad
-rw-r--r--packages/ExtServices/src/android/ext/services/notification/Assistant.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/packages/ExtServices/src/android/ext/services/notification/Assistant.java b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
index 69aa0f917a5d..d01878aef37d 100644
--- a/packages/ExtServices/src/android/ext/services/notification/Assistant.java
+++ b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
@@ -30,11 +30,9 @@ import android.app.Notification;
import android.app.NotificationChannel;
import android.content.Context;
import android.content.pm.IPackageManager;
-import android.ext.services.notification.AgingHelper.Callback;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
-import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.service.notification.Adjustment;
@@ -76,8 +74,6 @@ import java.util.concurrent.Executors;
public class Assistant extends NotificationAssistantService {
private static final String TAG = "ExtAssistant";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- public static final boolean AGE_NOTIFICATIONS = SystemProperties.getBoolean(
- "debug.age_notifs", false);
private static final String TAG_ASSISTANT = "assistant";
private static final String TAG_IMPRESSION = "impression-set";
@@ -94,7 +90,6 @@ public class Assistant extends NotificationAssistantService {
private SmartActionsHelper mSmartActionsHelper;
private NotificationCategorizer mNotificationCategorizer;
- private AgingHelper mAgingHelper;
// key : impressions tracker
// TODO: prune deleted channels and apps
@@ -125,9 +120,6 @@ public class Assistant extends NotificationAssistantService {
getApplicationContext().getContentResolver(), getUserId(), this::updateThresholds);
mSmartActionsHelper = new SmartActionsHelper(getContext(), mSettings);
mNotificationCategorizer = new NotificationCategorizer();
- mAgingHelper = new AgingHelper(getContext(),
- mNotificationCategorizer,
- new AgingCallback());
mSmsHelper = new SmsHelper(this);
mSmsHelper.initialize();
}
@@ -313,7 +305,6 @@ public class Assistant extends NotificationAssistantService {
sbn.getPackageName(), sbn.getKey(), sbn.getUserId()));
}
mLiveNotifications.put(sbn.getKey(), entry);
- mAgingHelper.onNotificationPosted(entry);
}
} catch (Throwable e) {
Log.e(TAG, "Error occurred processing post", e);
@@ -328,8 +319,6 @@ public class Assistant extends NotificationAssistantService {
return;
}
- mAgingHelper.onNotificationRemoved(sbn.getKey());
-
boolean updatedImpressions = false;
String channelId = mLiveNotifications.remove(sbn.getKey()).getChannel().getId();
String key = getKey(sbn.getPackageName(), sbn.getUserId(), channelId);
@@ -374,22 +363,6 @@ public class Assistant extends NotificationAssistantService {
@Override
public void onNotificationsSeen(List<String> keys) {
- try {
- if (keys == null) {
- return;
- }
-
- for (String key : keys) {
- NotificationEntry entry = mLiveNotifications.get(key);
-
- if (entry != null) {
- entry.setSeen();
- mAgingHelper.onNotificationSeen(entry);
- }
- }
- } catch (Throwable e) {
- Slog.e(TAG, "Error occurred processing seen", e);
- }
}
@Override
@@ -456,9 +429,6 @@ public class Assistant extends NotificationAssistantService {
@Override
public void onListenerDisconnected() {
- if (mAgingHelper != null) {
- mAgingHelper.onDestroy();
- }
}
private boolean isForCurrentUser(StatusBarNotification sbn) {
@@ -541,21 +511,4 @@ public class Assistant extends NotificationAssistantService {
}
}
}
-
- protected final class AgingCallback implements Callback {
- @Override
- public void sendAdjustment(String key, int newImportance) {
- if (AGE_NOTIFICATIONS) {
- NotificationEntry entry = mLiveNotifications.get(key);
- if (entry != null) {
- Bundle bundle = new Bundle();
- bundle.putInt(KEY_IMPORTANCE, newImportance);
- Adjustment adjustment = new Adjustment(entry.getSbn().getPackageName(), key,
- bundle, "aging", entry.getSbn().getUserId());
- adjustNotification(adjustment);
- }
- }
- }
- }
-
}