summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2021-08-17 18:14:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-08-17 18:14:17 +0000
commit8cd8353f885cd7eaa7bbf1a66538268d4fe23bda (patch)
treeff1fe92131dd4899e97e80dd38cda5eed71c32d3 /src
parent28ced5f1d7a400951e081f9cba58f94bbcd5288a (diff)
parent3c44e35345bd3babed3e1185b22c2b3cd05f3ae3 (diff)
downloadStk-8cd8353f885cd7eaa7bbf1a66538268d4fe23bda.tar.gz
Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-mastertemp_sam_202323961
Diffstat (limited to 'src')
-rw-r--r--src/com/android/stk/StkAppService.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index c507171..46fc55a 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;
@@ -170,7 +170,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;
@@ -1850,8 +1850,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) {
@@ -1862,7 +1862,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");
}
}
@@ -1894,11 +1894,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;
}
}
@@ -2143,7 +2143,7 @@ public class StkAppService extends Service implements Runnable {
+ "] icon[" + msg.icon + "], sim id: " + slotId);
CatLog.d(LOG_TAG, "Add IdleMode text");
PendingIntent pendingIntent = PendingIntent.getService(mContext, 0,
- new Intent(mContext, StkAppService.class), 0);
+ new Intent(mContext, StkAppService.class), PendingIntent.FLAG_IMMUTABLE);
createAllChannels();
final Notification.Builder notificationBuilder = new Notification.Builder(
StkAppService.this, STK_NOTIFICATION_CHANNEL_ID);