summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2020-10-06 14:15:40 -0700
committerHall Liu <hallliu@google.com>2020-10-06 14:15:40 -0700
commitff6b58943240d0a502cbba4772fd158c4f9b1b57 (patch)
treeea882248f62da9dbbee1c08ad5f65b09df5bfc72 /src
parent89fbd8a511263482f760d3127d9c11c4c5c2a03f (diff)
downloadStk-ff6b58943240d0a502cbba4772fd158c4f9b1b57.tar.gz
Follow rename of HomeVisibilityObserver
Rename to HomeVisibilityListener Bug: 170226810 Test: atest ActivityManagerTest Change-Id: I33d943603735e9a334c9b8f68439ac190b5e2ba8
Diffstat (limited to 'src')
-rw-r--r--src/com/android/stk/StkAppService.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 0f9f0e8..4b252d4 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -24,7 +24,7 @@ import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.AlertDialog;
-import android.app.HomeVisibilityObserver;
+import android.app.HomeVisibilityListener;
import android.app.KeyguardManager;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -171,7 +171,7 @@ public class StkAppService extends Service implements Runnable {
private AppInterface[] mStkService = null;
private StkContext[] mStkContext = null;
private int mSimCount = 0;
- private HomeVisibilityObserver mHomeVisibilityObserver = null;
+ private HomeVisibilityListener mHomeVisibilityListener = null;
private BroadcastReceiver mLocaleChangeReceiver = null;
private TonePlayer mTonePlayer = null;
private Vibrator mVibrator = null;
@@ -1841,8 +1841,8 @@ public class StkAppService extends Service implements Runnable {
}
private synchronized void registerHomeVisibilityObserver() {
- if (mHomeVisibilityObserver == null) {
- mHomeVisibilityObserver = new HomeVisibilityObserver() {
+ if (mHomeVisibilityListener == null) {
+ mHomeVisibilityListener = new HomeVisibilityListener() {
@Override
public void onHomeVisibilityChanged(boolean isHomeActivityVisible) {
if (isHomeActivityVisible) {
@@ -1853,7 +1853,7 @@ public class StkAppService extends Service implements Runnable {
}
};
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
- am.registerHomeVisibilityObserver(mHomeVisibilityObserver);
+ am.addHomeVisibilityListener(Runnable::run, mHomeVisibilityListener);
CatLog.d(LOG_TAG, "Started to observe the foreground activity");
}
}
@@ -1885,11 +1885,11 @@ public class StkAppService extends Service implements Runnable {
}
private synchronized void unregisterHomeVisibilityObserver() {
- if (mHomeVisibilityObserver != null) {
+ if (mHomeVisibilityListener != null) {
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
- am.unregisterHomeVisibilityObserver(mHomeVisibilityObserver);
+ am.removeHomeVisibilityListener(mHomeVisibilityListener);
CatLog.d(LOG_TAG, "Stopped to observe the foreground activity");
- mHomeVisibilityObserver = null;
+ mHomeVisibilityListener = null;
}
}