Issue:
"
Reproduction Steps:
- Flash a new PRD daily build on Jaws or Nazare.
- Open camera app, then press Home button to exit.
- Navigate to settings->system->Gestures->System navigation.
- Switch system navigation between "3-button navigation" and "Gesture navigation" for several times.
- Open camera app again from recent apps and observe.
"
Solution:
“
Solution: When user change system navigation, SystemNavigationGestureSettings kill the com.symbol.zcam if it running background.
“
packages/apps/Settings/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 62314ed..6484bf0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,4 +1,4 @@
-<!-- Copyright (c) 2021 XXX Technologies Corporation and/or its affiliates. All rights reserved.
+<!-- Copyright (c) 2021-2022 XXX Technologies Corporation and/or its affiliates. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -19,6 +19,7 @@
<original-package android:name="com.android.settings" />
+ <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<uses-permission android:name="android.permission.REQUEST_NETWORK_SCORES" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
diff --git a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
index bed14a8..971dc05 100644
--- a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
+++ b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2018 The Android Open Source Project
- *
+ * Copyright (c) 2022 XXX Technologies Corporation and/or its affiliates. All rights reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -24,6 +24,8 @@
import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_GONE;
import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_SETTING;
+import android.os.SystemProperties;
+import android.app.ActivityManager;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
@@ -55,6 +57,8 @@
import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.widget.RadioButtonPreference;
+import com.xxx.util.XXXUtils;
+
import java.util.ArrayList;
import java.util.List;
@@ -106,6 +110,23 @@
return SettingsEnums.SETTINGS_GESTURE_SWIPE_UP;
}
+ //BSPA-198543 Kill the com.symbol.zcam if it running background.
+ @Override
+ public void onResume() {
+ super.onResume();
+ final Context context = getContext();
+ if ((XXXUtils.isXXX().orElse(false) &&
+ SystemProperties.getInt("ro.product.first_api_level", -1) == 30)) {
+ ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ for (ActivityManager.RunningAppProcessInfo info : activityManager.getRunningAppProcesses()) {
+ if (info.processName.equals("com.symbol.zcam")) {
+ activityManager.killBackgroundProcesses("com.symbol.zcam");
+ break;
+ }
+ }
+ }
+ }
+
@Override
public void updateCandidates() {
final String defaultKey = getDefaultKey();