diff options
author | Makoto Onuki <omakoto@google.com> | 2020-10-13 23:32:18 +0000 |
---|---|---|
committer | Makoto Onuki <omakoto@google.com> | 2020-10-13 23:32:18 +0000 |
commit | 0fc7efd227c3bf05c774a603ae5cd1e7c4b617d0 (patch) | |
tree | 5e70eb4979c30f73dec4650c23c033b7576f3989 /src/com/android/stk | |
parent | ff6b58943240d0a502cbba4772fd158c4f9b1b57 (diff) | |
download | Stk-0fc7efd227c3bf05c774a603ae5cd1e7c4b617d0.tar.gz |
Revert "Follow rename of HomeVisibilityObserver"
Revert "Expose the HomeVisibilityListener API"
Revert "Add CTS for HomeVisibilityListener"
Revert submission 12775890-home-vis-listener
Reason for revert: broke build, b/170776449
Reverted Changes:
I8e6de3267:Add CTS for HomeVisibilityListener
I33d943603:Follow rename of HomeVisibilityObserver
I5d99f2bad:Expose the HomeVisibilityListener API
Change-Id: I1c4507ade4c84d114a199079cee40b3568d8710d
Diffstat (limited to 'src/com/android/stk')
-rw-r--r-- | src/com/android/stk/StkAppService.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java index 4b252d4..0f9f0e8 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.HomeVisibilityListener; +import android.app.HomeVisibilityObserver; 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 HomeVisibilityListener mHomeVisibilityListener = null; + private HomeVisibilityObserver mHomeVisibilityObserver = 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 (mHomeVisibilityListener == null) { - mHomeVisibilityListener = new HomeVisibilityListener() { + if (mHomeVisibilityObserver == null) { + mHomeVisibilityObserver = new HomeVisibilityObserver() { @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.addHomeVisibilityListener(Runnable::run, mHomeVisibilityListener); + am.registerHomeVisibilityObserver(mHomeVisibilityObserver); 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 (mHomeVisibilityListener != null) { + if (mHomeVisibilityObserver != null) { ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); - am.removeHomeVisibilityListener(mHomeVisibilityListener); + am.unregisterHomeVisibilityObserver(mHomeVisibilityObserver); CatLog.d(LOG_TAG, "Stopped to observe the foreground activity"); - mHomeVisibilityListener = null; + mHomeVisibilityObserver = null; } } |