From 38fdfe471ab3a1e372763144d36de8cebc554a5d Mon Sep 17 00:00:00 2001 From: Adam He Date: Mon, 13 Jul 2020 15:57:00 -0700 Subject: [PATCH 1/6] Updated docs for Autofill inline Session/controller. Fixes: 160730285 Test: atest android.autofillservice.cts.inline Change-Id: I83b5002f306c369999e1a131d5fda6ea5619e1dc --- .../autofill/AutofillInlineSessionController.java | 12 +++++++++--- .../AutofillInlineSuggestionsRequestSession.java | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/services/autofill/java/com/android/server/autofill/AutofillInlineSessionController.java b/services/autofill/java/com/android/server/autofill/AutofillInlineSessionController.java index 19248ca54611e..c25dd37bc7d9a 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillInlineSessionController.java +++ b/services/autofill/java/com/android/server/autofill/AutofillInlineSessionController.java @@ -31,9 +31,16 @@ import com.android.server.inputmethod.InputMethodManagerInternal; import java.util.Optional; import java.util.function.Consumer; - /** - * Controls the interaction with the IME for the inline suggestion sessions. + * Controls the interaction with the IME for the {@link AutofillInlineSuggestionsRequestSession}s. + * + *

The class maintains the inline suggestion session with the autofill service. There is at most + * one active inline suggestion session at any given corresponding to one focused view. + * New sessions are created only when {@link #onCreateInlineSuggestionsRequestLocked} is called.

+ * + *

The class manages the interaction between the {@link com.android.server.autofill.Session} and + * the inline suggestion session whenever inline suggestions can be provided. All calls to the + * inline suggestion session must be made through this controller.

*/ final class AutofillInlineSessionController { @NonNull @@ -66,7 +73,6 @@ final class AutofillInlineSessionController { mUiCallback = callback; } - /** * Requests the IME to create an {@link InlineSuggestionsRequest} for {@code autofillId}. * diff --git a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java index b2daae48bb0ea..84fbe9a75a18f 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java +++ b/services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java @@ -364,6 +364,9 @@ final class AutofillInlineSuggestionsRequestSession { } } + /** + * Internal implementation of {@link IInlineSuggestionsRequestCallback}. + */ private static final class InlineSuggestionsRequestCallbackImpl extends IInlineSuggestionsRequestCallback.Stub { From d79966114ab7966022be020e6034a2b60d097e84 Mon Sep 17 00:00:00 2001 From: Heemin Seog Date: Wed, 15 Jul 2020 16:06:30 -0700 Subject: [PATCH 2/6] Address lifecycle crash in car sysui We address this by removing the phone specific lifecycle view from car sysui. Bug: 161366224 Test: See bug for manual testing steps Change-Id: I1309aa938f1bcc5c634a531a2eca3a45f1eb2946 --- packages/CarSystemUI/res/layout/system_icons.xml | 6 ------ .../systemui/car/userswitcher/CarStatusBarHeader.java | 4 ---- 2 files changed, 10 deletions(-) diff --git a/packages/CarSystemUI/res/layout/system_icons.xml b/packages/CarSystemUI/res/layout/system_icons.xml index a7dd65eab5500..d23579294ce84 100644 --- a/packages/CarSystemUI/res/layout/system_icons.xml +++ b/packages/CarSystemUI/res/layout/system_icons.xml @@ -31,10 +31,4 @@ android:gravity="center_vertical" android:orientation="horizontal" /> - - \ No newline at end of file diff --git a/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/CarStatusBarHeader.java b/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/CarStatusBarHeader.java index bab67154e75d8..0a677bfaa7429 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/CarStatusBarHeader.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/userswitcher/CarStatusBarHeader.java @@ -26,7 +26,6 @@ import android.widget.LinearLayout; import androidx.annotation.IdRes; import com.android.settingslib.Utils; -import com.android.systemui.BatteryMeterView; import com.android.systemui.R; import com.android.systemui.plugins.DarkIconDispatcher; @@ -49,10 +48,7 @@ public class CarStatusBarHeader extends LinearLayout { float intensity = colorForeground == Color.WHITE ? 0f : 1f; Rect tintArea = new Rect(0, 0, 0, 0); - applyDarkness(R.id.battery, tintArea, intensity, colorForeground); applyDarkness(R.id.clock, tintArea, intensity, colorForeground); - - ((BatteryMeterView) findViewById(R.id.battery)).setForceShowPercent(true); } private void applyDarkness(@IdRes int id, Rect tintArea, float intensity, int color) { From 382ce9d1710e03bb78eefd69088c9211d92c7d9a Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 15 Jul 2020 18:36:27 -0700 Subject: [PATCH 3/6] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I65034363b946809dd196673a05a17fbb72db9a5f --- packages/SystemUI/res/values-gu/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml index 54f45ea652e94..53e0fc9f5e45f 100644 --- a/packages/SystemUI/res/values-gu/strings.xml +++ b/packages/SystemUI/res/values-gu/strings.xml @@ -21,7 +21,7 @@ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> "સિસ્ટમ UI" "સાફ કરો" - "કોઈ સૂચનાઓ નથી" + "કોઈ નોટિફિકેશન નથી" "ચાલુ" "નોટિફિકેશનો" "બૅટરી ટૂંક સમયમાં સમાપ્ત થશે" @@ -368,7 +368,7 @@ "સ્થાન બંધ" "મીડિયા ઉપકરણ" "RSSI" - "ફક્ત કટોકટીના કૉલ્સ" + "ફક્ત ઇમર્જન્સી કૉલ" "સેટિંગ" "સમય" "હું" @@ -517,7 +517,7 @@ "બધા સાઇલન્ટ નોટિફિકેશન સાફ કરો" "ખલેલ પાડશો નહીં દ્વારા થોભાવેલ નોટિફિકેશન" "હવે પ્રારંભ કરો" - "કોઈ સૂચનાઓ નથી" + "કોઈ નોટિફિકેશન નથી" "પ્રોફાઇલ મૉનિટર કરી શકાય છે" "નેટવર્ક મૉનિટર કરી શકાય છે" "નેટવર્ક મૉનિટર કરવામાં આવી શકે છે" From f0e3e4f4706117998a731cb3db76bebb6d80ec3b Mon Sep 17 00:00:00 2001 From: Henry Fang Date: Wed, 15 Jul 2020 15:40:08 -0700 Subject: [PATCH 4/6] Fix MediaCas CTS failure TRM is checking input parameters and won't allow null executor. Use context main executor to call Tuner Resource Manager (TRM) Also fix ConcurrentModificationException when use HashMap.forEach to free element in hashmap. Test: atest MediaCasTest bug: 161391585 Change-Id: Ie5111b46b5b601f0a5b56e5828d79771e153a210 --- media/java/android/media/MediaCas.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/media/java/android/media/MediaCas.java b/media/java/android/media/MediaCas.java index 590def4d4cedf..98ca2f9c42537 100644 --- a/media/java/android/media/MediaCas.java +++ b/media/java/android/media/MediaCas.java @@ -34,7 +34,6 @@ import android.media.tv.tunerresourcemanager.ResourceClientProfile; import android.media.tv.tunerresourcemanager.TunerResourceManager; import android.os.Bundle; import android.os.Handler; -import android.os.HandlerExecutor; import android.os.HandlerThread; import android.os.IHwBinder; import android.os.Looper; @@ -50,6 +49,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -392,7 +392,10 @@ public final class MediaCas implements AutoCloseable { @Override public void onReclaimResources() { synchronized (mSessionMap) { - mSessionMap.forEach((casSession, sessionResourceHandle) -> casSession.close()); + List sessionList = new ArrayList<>(mSessionMap.keySet()); + for (Session casSession: sessionList) { + casSession.close(); + } } mEventHandler.sendMessage(mEventHandler.obtainMessage( EventHandler.MSG_CAS_RESOURCE_LOST)); @@ -734,7 +737,7 @@ public final class MediaCas implements AutoCloseable { ResourceClientProfile profile = new ResourceClientProfile(tvInputServiceSessionId, priorityHint); mTunerResourceManager.registerClientProfile( - profile, new HandlerExecutor(mEventHandler), mResourceListener, clientId); + profile, context.getMainExecutor(), mResourceListener, clientId); mClientId = clientId[0]; } } From 23f0b1842a6f577e1ba72276861796023c8146dd Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Thu, 16 Jul 2020 10:43:40 -0700 Subject: [PATCH 5/6] Add logcat message for background started FGS. Bug: 161392994 Test: reboot device and observe adb logcat Change-Id: I29a1d916c1f1c203ae06c5a94fe95592b3b7e968 --- .../java/com/android/server/am/ActiveServices.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 56953708e3833..3f867f656c245 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -18,7 +18,6 @@ package com.android.server.am; import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND; import static android.content.pm.PackageManager.PERMISSION_GRANTED; -import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.os.Process.NFC_UID; import static android.os.Process.ROOT_UID; @@ -1361,13 +1360,12 @@ public final class ActiveServices { + String.format("0x%08X", manifestType) + " in service element of manifest file"); } - if ((foregroundServiceType & FOREGROUND_SERVICE_TYPE_LOCATION) != 0 - && !r.mAllowWhileInUsePermissionInFgs) { - // If the foreground service is not started from TOP process, do not allow it to - // have location capability, this prevents BG started FGS to have while-in-use - // location permission. + // If the foreground service is not started from TOP process, do not allow it to + // have while-in-use location/camera/microphone access. + if (!r.mAllowWhileInUsePermissionInFgs) { Slog.w(TAG, - "BG started FGS can not have location capability: service " + "Foreground service started from background can not have " + + "location/camera/microphone access: service " + r.shortInstanceName); } } From 0875efe1345c9f626dbaa5192fa1e784c4410e64 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Thu, 16 Jul 2020 10:51:30 -0700 Subject: [PATCH 6/6] Fix the ordering of the result of app kill info Bug: 161454542 Test: atest ApplicationExitInfoTest Test: atest CtsAppExitTestCases:ActivityManagerAppExitInfoTest Change-Id: I9b2b189f83bac29bda54b485294da9d9d58375e7 --- .../core/java/com/android/server/am/AppExitInfoTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/AppExitInfoTracker.java b/services/core/java/com/android/server/am/AppExitInfoTracker.java index 02fb34e73f7f6..374c215fc6d09 100644 --- a/services/core/java/com/android/server/am/AppExitInfoTracker.java +++ b/services/core/java/com/android/server/am/AppExitInfoTracker.java @@ -522,7 +522,7 @@ public final class AppExitInfoTracker { AppExitInfoContainer container = records.get(filterUid); if (container != null) { mTmpInfoList.clear(); - results.addAll(container.toListLocked(mTmpInfoList, filterPid)); + list.addAll(container.toListLocked(mTmpInfoList, filterPid)); } return AppExitInfoTracker.FOREACH_ACTION_NONE; });