summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2020-10-13 23:39:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-10-13 23:39:48 +0000
commitd117fefdfc10c2aa38280f0aa394339ead48c71c (patch)
tree5e70eb4979c30f73dec4650c23c033b7576f3989
parent5580c81f92aaa858a3478c23ef13644d19fc8150 (diff)
parent0fc7efd227c3bf05c774a603ae5cd1e7c4b617d0 (diff)
downloadplatform_packages_apps_Stk-d117fefdfc10c2aa38280f0aa394339ead48c71c.tar.gz
platform_packages_apps_Stk-d117fefdfc10c2aa38280f0aa394339ead48c71c.tar.bz2
platform_packages_apps_Stk-d117fefdfc10c2aa38280f0aa394339ead48c71c.zip
Merge "Revert "Follow rename of HomeVisibilityObserver""
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/com/android/stk/StkAppService.java16
2 files changed, 8 insertions, 9 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 81ba3d8..4a644c3 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -26,7 +26,6 @@
<uses-permission android:name="android.permission.REAL_GET_TASKS"/>
<uses-permission android:name="android.permission.RECEIVE_STK_COMMANDS" />
<uses-permission android:name="android.permission.SET_ACTIVITY_WATCHER" />
- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
<uses-permission android:name="android.permission.USER_ACTIVITY" />
<uses-permission android:name="android.permission.VIBRATE" />
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;
}
}