Merge "Skip finishing menu activity when dismissing PiP" into pi-dev
diff --git a/Android.mk b/Android.mk
index a984a0f..d52b220 100644
--- a/Android.mk
+++ b/Android.mk
@@ -257,6 +257,15 @@
-federate AndroidX https://developer.android.com \
-federationapi AndroidX prebuilts/sdk/current/androidx-api.txt
+framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS := \
+ --manifest ./frameworks/base/core/res/AndroidManifest.xml \
+ --hide-package com.android.okhttp \
+ --hide-package com.android.org.conscrypt --hide-package com.android.server \
+ --hide RequiresPermission \
+ --hide MissingPermission --hide BroadcastBehavior \
+ --hide HiddenSuperclass --hide DeprecationMismatch --hide UnavailableSymbol \
+ --hide SdkConstant --hide HiddenTypeParameter --hide Todo --hide Typo
+
# ==== Public API diff ===========================
include $(CLEAR_VARS)
@@ -351,6 +360,40 @@
$(INTERNAL_PLATFORM_REMOVED_API_FILE)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
+# ==== the metalava api stubs and current.xml ===========================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
+LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
+LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
+LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
+LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
+LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
+LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
+LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
+
+LOCAL_MODULE := metalava-api-stubs
+LOCAL_DROIDDOC_USE_METALAVA := true
+
+LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/metalava_android_stubs_current_intermediates/src
+
+INTERNAL_PLATFORM_METALAVA_PUBLIC_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava_public_api.txt
+INTERNAL_PLATFORM_METALAVA_PUBLIC_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava_removed.txt
+
+LOCAL_DROIDDOC_OPTIONS:=\
+ $(framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS) \
+ --api $(INTERNAL_PLATFORM_METALAVA_PUBLIC_API_FILE) \
+ --removed-api $(INTERNAL_PLATFORM_METALAVA_PUBLIC_REMOVED_API_FILE) \
+ -nodocs
+
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_DROIDDOC)
+
+$(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_METALAVA_PUBLIC_API_FILE) \
+ $(INTERNAL_PLATFORM_METALAVA_PUBLIC_REMOVED_API_FILE)
+$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_METALAVA_PUBLIC_API_FILE))
+
# ==== the system api stubs ===================================
include $(CLEAR_VARS)
@@ -388,6 +431,41 @@
$(INTERNAL_PLATFORM_SYSTEM_EXACT_API_FILE)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
+# ==== the metalava system api stubs ===================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
+LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
+LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
+LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
+LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
+LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
+LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
+LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
+
+LOCAL_MODULE := metalava-system-api-stubs
+LOCAL_DROIDDOC_USE_METALAVA := true
+
+LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/metalava_android_system_stubs_current_intermediates/src
+
+INTERNAL_PLATFORM_METALAVA_SYSTEM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava-system-api.txt
+INTERNAL_PLATFORM_METALAVA_SYSTEM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava-system-removed.txt
+
+LOCAL_DROIDDOC_OPTIONS:=\
+ $(framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS) \
+ --show-annotation android.annotation.SystemApi \
+ --api $(INTERNAL_PLATFORM_METALAVA_SYSTEM_API_FILE) \
+ --removed-api $(INTERNAL_PLATFORM_METALAVA_SYSTEM_REMOVED_API_FILE) \
+ -nodocs
+
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_DROIDDOC)
+
+$(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_METALAVA_SYSTEM_API_FILE) \
+ $(INTERNAL_PLATFORM_METALAVA_SYSTEM_REMOVED_API_FILE) \
+$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_METALAVA_SYSTEM_API_FILE))
+
# ==== the test api stubs ===================================
include $(CLEAR_VARS)
@@ -426,6 +504,41 @@
$(INTERNAL_PLATFORM_TEST_EXACT_API_FILE)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
+# ==== the metalava test api stubs ===================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:=$(framework_docs_LOCAL_API_CHECK_SRC_FILES)
+LOCAL_GENERATED_SOURCES:=$(framework_docs_LOCAL_GENERATED_SOURCES)
+LOCAL_SRCJARS:=$(framework_docs_LOCAL_SRCJARS)
+LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_API_CHECK_JAVA_LIBRARIES)
+LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
+LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
+LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_API_CHECK_ADDITIONAL_JAVA_DIR)
+LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
+
+LOCAL_MODULE := metalava-test-api-stubs
+LOCAL_DROIDDOC_USE_METALAVA := true
+
+LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/metalava_android_test_stubs_current_intermediates/src
+
+INTERNAL_PLATFORM_METALAVA_TEST_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava-test-api.txt
+INTERNAL_PLATFORM_METALAVA_TEST_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/metalava-test-removed.txt
+
+LOCAL_DROIDDOC_OPTIONS:=\
+ $(framework_metalava_docs_LOCAL_DROIDDOC_OPTIONS) \
+ --show-annotation android.annotation.TestApi \
+ --api $(INTERNAL_PLATFORM_METALAVA_TEST_API_FILE) \
+ --removed-api $(INTERNAL_PLATFORM_METALAVA_TEST_REMOVED_API_FILE) \
+ -nodocs
+
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_DROIDDOC)
+
+$(full_target): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_METALAVA_TEST_API_FILE) \
+ $(INTERNAL_PLATFORM_METALAVA_TEST_REMOVED_API_FILE) \
+$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_METALAVA_TEST_API_FILE))
+
# ==== the complete hidden api list ===================================
include $(CLEAR_VARS)
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index 51d9327..cee71b2 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -2434,6 +2434,7 @@
Landroid/hardware/camera2/CaptureRequest;->JPEG_GPS_PROCESSING_METHOD:Landroid/hardware/camera2/CaptureRequest$Key;
Landroid/hardware/camera2/CaptureRequest;->JPEG_GPS_TIMESTAMP:Landroid/hardware/camera2/CaptureRequest$Key;
Landroid/hardware/camera2/CaptureRequest;->LED_TRANSMIT:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->mLogicalCameraSettings:Landroid/hardware/camera2/impl/CameraMetadataNative;
Landroid/hardware/camera2/CaptureRequest;->REQUEST_ID:Landroid/hardware/camera2/CaptureRequest$Key;
Landroid/hardware/camera2/CaptureRequest;->TONEMAP_CURVE_BLUE:Landroid/hardware/camera2/CaptureRequest$Key;
Landroid/hardware/camera2/CaptureRequest;->TONEMAP_CURVE_GREEN:Landroid/hardware/camera2/CaptureRequest$Key;
@@ -2446,6 +2447,7 @@
Landroid/hardware/camera2/CaptureResult;->JPEG_GPS_PROCESSING_METHOD:Landroid/hardware/camera2/CaptureResult$Key;
Landroid/hardware/camera2/CaptureResult;->JPEG_GPS_TIMESTAMP:Landroid/hardware/camera2/CaptureResult$Key;
Landroid/hardware/camera2/CaptureResult;->LED_TRANSMIT:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->mResults:Landroid/hardware/camera2/impl/CameraMetadataNative;
Landroid/hardware/camera2/CaptureResult;->QUIRKS_PARTIAL_RESULT:Landroid/hardware/camera2/CaptureResult$Key;
Landroid/hardware/camera2/CaptureResult;->REQUEST_FRAME_COUNT:Landroid/hardware/camera2/CaptureResult$Key;
Landroid/hardware/camera2/CaptureResult;->REQUEST_ID:Landroid/hardware/camera2/CaptureResult$Key;
@@ -3368,6 +3370,7 @@
Landroid/net/INetworkStatsService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/INetworkStatsService$Stub$Proxy;->getMobileIfaces()[Ljava/lang/String;
Landroid/net/INetworkStatsService;->forceUpdate()V
+Landroid/net/INetworkStatsService;->getDataLayerSnapshotForUid(I)Landroid/net/NetworkStats;
Landroid/net/INetworkStatsService;->getMobileIfaces()[Ljava/lang/String;
Landroid/net/INetworkStatsService;->openSession()Landroid/net/INetworkStatsSession;
Landroid/net/INetworkStatsService;->openSessionForUsageStats(ILjava/lang/String;)Landroid/net/INetworkStatsSession;
@@ -3800,6 +3803,7 @@
Landroid/os/AsyncTask;->mWorker:Landroid/os/AsyncTask$WorkerRunnable;
Landroid/os/AsyncTask;->sDefaultExecutor:Ljava/util/concurrent/Executor;
Landroid/os/AsyncTask;->setDefaultExecutor(Ljava/util/concurrent/Executor;)V
+Landroid/os/BaseBundle;->isParcelled()Z
Landroid/os/BaseBundle;->mMap:Landroid/util/ArrayMap;
Landroid/os/BaseBundle;->mParcelledData:Landroid/os/Parcel;
Landroid/os/BaseBundle;->unparcel()V
@@ -5502,6 +5506,7 @@
Landroid/telephony/TelephonyManager$MultiSimVariants;->values()[Landroid/telephony/TelephonyManager$MultiSimVariants;
Landroid/telephony/TelephonyManager;-><init>()V
Landroid/telephony/TelephonyManager;-><init>(Landroid/content/Context;)V
+Landroid/telephony/TelephonyManager;-><init>(Landroid/content/Context;I)V
Landroid/telephony/TelephonyManager;->ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED:Ljava/lang/String;
Landroid/telephony/TelephonyManager;->from(Landroid/content/Context;)Landroid/telephony/TelephonyManager;
Landroid/telephony/TelephonyManager;->getCallState(I)I
@@ -6788,6 +6793,7 @@
Landroid/widget/AbsListView;->smoothScrollBy(IIZZ)V
Landroid/widget/AbsListView;->trackMotionScroll(II)Z
Landroid/widget/AbsListView;->updateSelectorState()V
+Landroid/widget/AbsSeekBar;->drawThumb(Landroid/graphics/Canvas;)V
Landroid/widget/AbsSeekBar;->mDisabledAlpha:F
Landroid/widget/AbsSeekBar;->mIsDragging:Z
Landroid/widget/AbsSeekBar;->mIsUserSeekable:Z
@@ -8267,6 +8273,7 @@
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->endCall()Z
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->endCallForSubscriber(I)Z
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->getDeviceId(Ljava/lang/String;)Ljava/lang/String;
+Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->isRadioOn(Ljava/lang/String;)Z
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Lcom/android/internal/telephony/ITelephony$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ITelephony;
Lcom/android/internal/telephony/ITelephony$Stub;->DESCRIPTOR:Ljava/lang/String;
diff --git a/config/preloaded-classes b/config/preloaded-classes
index 86499f8..2971ef8 100644
--- a/config/preloaded-classes
+++ b/config/preloaded-classes
@@ -6375,7 +6375,6 @@
sun.nio.fs.NativeBuffer
sun.nio.fs.NativeBuffer$Deallocator
sun.nio.fs.NativeBuffers
-sun.nio.fs.UnixChannelFactory
sun.nio.fs.UnixChannelFactory$Flags
sun.nio.fs.UnixConstants
sun.nio.fs.UnixException
diff --git a/config/preloaded-classes-blacklist b/config/preloaded-classes-blacklist
index f140879..8b8d640 100644
--- a/config/preloaded-classes-blacklist
+++ b/config/preloaded-classes-blacklist
@@ -1,3 +1,4 @@
android.net.ConnectivityThread$Singleton
android.os.FileObserver
android.widget.Magnifier
+sun.nio.fs.UnixChannelFactory
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index 7338bfe..1d5f49a 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -207,7 +207,7 @@
/**
* Allow DeviceIdleController to tell us about what apps are whitelisted.
*/
- public abstract void setDeviceIdleWhitelist(int[] appids);
+ public abstract void setDeviceIdleWhitelist(int[] allAppids, int[] exceptIdleAppids);
/**
* Update information about which app IDs are on the temp whitelist.
diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java
index 9db642b..494b547 100644
--- a/core/java/android/app/LoadedApk.java
+++ b/core/java/android/app/LoadedApk.java
@@ -745,6 +745,44 @@
}
}
+ // /vendor/lib, /odm/lib and /product/lib are added to the native lib search
+ // paths of the classloader. Note that this is done AFTER the classloader is
+ // created by ApplicationLoaders.getDefault().getClassLoader(...). The
+ // reason is because if we have added the paths when creating the classloader
+ // above, the paths are also added to the search path of the linker namespace
+ // 'classloader-namespace', which will allow ALL libs in the paths to apps.
+ // Since only the libs listed in <partition>/etc/public.libraries.txt can be
+ // available to apps, we shouldn't add the paths then.
+ //
+ // However, we need to add the paths to the classloader (Java) though. This
+ // is because when a native lib is requested via System.loadLibrary(), the
+ // classloader first tries to find the requested lib in its own native libs
+ // search paths. If a lib is not found in one of the paths, dlopen() is not
+ // called at all. This can cause a problem that a vendor public native lib
+ // is accessible when directly opened via dlopen(), but inaccesible via
+ // System.loadLibrary(). In order to prevent the problem, we explicitly
+ // add the paths only to the classloader, and not to the native loader
+ // (linker namespace).
+ List<String> extraLibPaths = new ArrayList<>(3);
+ String abiSuffix = VMRuntime.getRuntime().is64Bit() ? "64" : "";
+ if (!defaultSearchPaths.contains("/vendor/lib")) {
+ extraLibPaths.add("/vendor/lib" + abiSuffix);
+ }
+ if (!defaultSearchPaths.contains("/odm/lib")) {
+ extraLibPaths.add("/odm/lib" + abiSuffix);
+ }
+ if (!defaultSearchPaths.contains("/product/lib")) {
+ extraLibPaths.add("/product/lib" + abiSuffix);
+ }
+ if (!extraLibPaths.isEmpty()) {
+ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
+ try {
+ ApplicationLoaders.getDefault().addNative(mClassLoader, extraLibPaths);
+ } finally {
+ StrictMode.setThreadPolicy(oldPolicy);
+ }
+ }
+
if (addedPaths != null && addedPaths.size() > 0) {
final String add = TextUtils.join(File.pathSeparator, addedPaths);
ApplicationLoaders.getDefault().addPath(mClassLoader, add);
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 8d56c3e..1ea93a4 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -2676,7 +2676,8 @@
return true;
}
for (int i = 0; i < firstAs.length; i++) {
- if (!Objects.equals(firstAs[i].title, secondAs[i].title)) {
+ if (!Objects.equals(String.valueOf(firstAs[i].title),
+ String.valueOf(secondAs[i].title))) {
return true;
}
RemoteInput[] firstRs = firstAs[i].getRemoteInputs();
@@ -2691,25 +2692,10 @@
return true;
}
for (int j = 0; j < firstRs.length; j++) {
- if (!Objects.equals(firstRs[j].getLabel(), secondRs[j].getLabel())) {
+ if (!Objects.equals(String.valueOf(firstRs[j].getLabel()),
+ String.valueOf(secondRs[j].getLabel()))) {
return true;
}
- CharSequence[] firstCs = firstRs[j].getChoices();
- CharSequence[] secondCs = secondRs[j].getChoices();
- if (firstCs == null) {
- firstCs = new CharSequence[0];
- }
- if (secondCs == null) {
- secondCs = new CharSequence[0];
- }
- if (firstCs.length != secondCs.length) {
- return true;
- }
- for (int k = 0; k < firstCs.length; k++) {
- if (!Objects.equals(firstCs[k], secondCs[k])) {
- return true;
- }
- }
}
}
}
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index 437153b..0fb84b7 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -384,7 +384,7 @@
if (scheme != null) {
if (scheme.equalsIgnoreCase("tel") || scheme.equalsIgnoreCase("sip")
|| scheme.equalsIgnoreCase("sms") || scheme.equalsIgnoreCase("smsto")
- || scheme.equalsIgnoreCase("mailto")) {
+ || scheme.equalsIgnoreCase("mailto") || scheme.equalsIgnoreCase("nfc")) {
StringBuilder builder = new StringBuilder(64);
builder.append(scheme);
builder.append(':');
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 3d76c250..8e8565c35 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -138,15 +138,6 @@
}
/**
- * Dump proxy debug information.
- *
- * @hide
- */
- public static void dumpProxyDebugInfo() {
- BinderProxy.dumpProxyDebugInfo();
- }
-
- /**
* Check if binder transaction tracing is enabled.
*
* @hide
@@ -950,7 +941,8 @@
// about to crash.
final int totalUnclearedSize = unclearedSize();
if (totalUnclearedSize >= CRASH_AT_SIZE) {
- dumpProxyDebugInfo();
+ dumpProxyInterfaceCounts();
+ dumpPerUidProxyCounts();
Runtime.getRuntime().gc();
throw new AssertionError("Binder ProxyMap has too many entries: "
+ totalSize + " (total), " + totalUnclearedSize + " (uncleared), "
@@ -1035,11 +1027,21 @@
private static ProxyMap sProxyMap = new ProxyMap();
/**
+ * Dump proxy debug information.
+ *
+ * Note: this method is not thread-safe; callers must serialize with other
+ * accesses to sProxyMap, in particular {@link #getInstance(long, long)}.
+ *
* @hide
*/
- public static void dumpProxyDebugInfo() {
- sProxyMap.dumpProxyInterfaceCounts();
- sProxyMap.dumpPerUidProxyCounts();
+ private static void dumpProxyDebugInfo() {
+ if (Build.IS_DEBUGGABLE) {
+ sProxyMap.dumpProxyInterfaceCounts();
+ // Note that we don't call dumpPerUidProxyCounts(); this is because this
+ // method may be called as part of the uid limit being hit, and calling
+ // back into the UID tracking code would cause us to try to acquire a mutex
+ // that is held during that callback.
+ }
}
/**
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index aa97b2a..09af85d 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -1004,6 +1004,32 @@
return TextUtils.packRangeInLong(0, getLineEnd(line));
}
+ /**
+ * Checks if the trailing BiDi level should be used for an offset
+ *
+ * This method is useful when the offset is at the BiDi level transition point and determine
+ * which run need to be used. For example, let's think about following input: (L* denotes
+ * Left-to-Right characters, R* denotes Right-to-Left characters.)
+ * Input (Logical Order): L1 L2 L3 R1 R2 R3 L4 L5 L6
+ * Input (Display Order): L1 L2 L3 R3 R2 R1 L4 L5 L6
+ *
+ * Then, think about selecting the range (3, 6). The offset=3 and offset=6 are ambiguous here
+ * since they are at the BiDi transition point. In Android, the offset is considered to be
+ * associated with the trailing run if the BiDi level of the trailing run is higher than of the
+ * previous run. In this case, the BiDi level of the input text is as follows:
+ *
+ * Input (Logical Order): L1 L2 L3 R1 R2 R3 L4 L5 L6
+ * BiDi Run: [ Run 0 ][ Run 1 ][ Run 2 ]
+ * BiDi Level: 0 0 0 1 1 1 0 0 0
+ *
+ * Thus, offset = 3 is part of Run 1 and this method returns true for offset = 3, since the BiDi
+ * level of Run 1 is higher than the level of Run 0. Similarly, the offset = 6 is a part of Run
+ * 1 and this method returns false for the offset = 6 since the BiDi level of Run 1 is higher
+ * than the level of Run 2.
+ *
+ * @returns true if offset is at the BiDi level transition point and trailing BiDi level is
+ * higher than previous BiDi level. See above for the detail.
+ */
private boolean primaryIsTrailingPrevious(int offset) {
int line = getLineForOffset(offset);
int lineStart = getLineStart(line);
@@ -1054,6 +1080,41 @@
}
/**
+ * Computes in linear time the results of calling
+ * #primaryIsTrailingPrevious for all offsets on a line.
+ * @param line The line giving the offsets we compute the information for
+ * @return The array of results, indexed from 0, where 0 corresponds to the line start offset
+ */
+ private boolean[] primaryIsTrailingPreviousAllLineOffsets(int line) {
+ int lineStart = getLineStart(line);
+ int lineEnd = getLineEnd(line);
+ int[] runs = getLineDirections(line).mDirections;
+
+ boolean[] trailing = new boolean[lineEnd - lineStart + 1];
+
+ byte[] level = new byte[lineEnd - lineStart + 1];
+ for (int i = 0; i < runs.length; i += 2) {
+ int start = lineStart + runs[i];
+ int limit = start + (runs[i + 1] & RUN_LENGTH_MASK);
+ if (limit > lineEnd) {
+ limit = lineEnd;
+ }
+ level[limit - lineStart - 1] =
+ (byte) ((runs[i + 1] >>> RUN_LEVEL_SHIFT) & RUN_LEVEL_MASK);
+ }
+
+ for (int i = 0; i < runs.length; i += 2) {
+ int start = lineStart + runs[i];
+ byte currentLevel = (byte) ((runs[i + 1] >>> RUN_LEVEL_SHIFT) & RUN_LEVEL_MASK);
+ trailing[start - lineStart] = currentLevel > (start == lineStart
+ ? (getParagraphDirection(line) == 1 ? 0 : 1)
+ : level[start - lineStart - 1]);
+ }
+
+ return trailing;
+ }
+
+ /**
* Get the primary horizontal position for the specified text offset.
* This is the location where a new character would be inserted in
* the paragraph's primary direction.
@@ -1133,6 +1194,60 @@
}
/**
+ * Computes in linear time the results of calling
+ * #getHorizontal for all offsets on a line.
+ * @param line The line giving the offsets we compute information for
+ * @param clamped Whether to clamp the results to the width of the layout
+ * @param primary Whether the results should be the primary or the secondary horizontal
+ * @return The array of results, indexed from 0, where 0 corresponds to the line start offset
+ */
+ private float[] getLineHorizontals(int line, boolean clamped, boolean primary) {
+ int start = getLineStart(line);
+ int end = getLineEnd(line);
+ int dir = getParagraphDirection(line);
+ boolean hasTab = getLineContainsTab(line);
+ Directions directions = getLineDirections(line);
+
+ TabStops tabStops = null;
+ if (hasTab && mText instanceof Spanned) {
+ // Just checking this line should be good enough, tabs should be
+ // consistent across all lines in a paragraph.
+ TabStopSpan[] tabs = getParagraphSpans((Spanned) mText, start, end, TabStopSpan.class);
+ if (tabs.length > 0) {
+ tabStops = new TabStops(TAB_INCREMENT, tabs); // XXX should reuse
+ }
+ }
+
+ TextLine tl = TextLine.obtain();
+ tl.set(mPaint, mText, start, end, dir, directions, hasTab, tabStops);
+ boolean[] trailings = primaryIsTrailingPreviousAllLineOffsets(line);
+ if (!primary) {
+ for (int offset = 0; offset < trailings.length; ++offset) {
+ trailings[offset] = !trailings[offset];
+ }
+ }
+ float[] wid = tl.measureAllOffsets(trailings, null);
+ TextLine.recycle(tl);
+
+ if (clamped) {
+ for (int offset = 0; offset <= wid.length; ++offset) {
+ if (wid[offset] > mWidth) {
+ wid[offset] = mWidth;
+ }
+ }
+ }
+ int left = getParagraphLeft(line);
+ int right = getParagraphRight(line);
+
+ int lineStartPos = getLineStartPos(line, left, right);
+ float[] horizontal = new float[end - start + 1];
+ for (int offset = 0; offset < horizontal.length; ++offset) {
+ horizontal[offset] = lineStartPos + wid[offset];
+ }
+ return horizontal;
+ }
+
+ /**
* Get the leftmost position that should be exposed for horizontal
* scrolling on the specified line.
*/
@@ -1360,6 +1475,8 @@
// XXX: we don't care about tabs as we just use TextLine#getOffsetToLeftRightOf here.
tl.set(mPaint, mText, lineStartOffset, lineEndOffset, getParagraphDirection(line), dirs,
false, null);
+ final HorizontalMeasurementProvider horizontal =
+ new HorizontalMeasurementProvider(line, primary);
final int max;
if (line == getLineCount() - 1) {
@@ -1369,7 +1486,7 @@
!isRtlCharAt(lineEndOffset - 1)) + lineStartOffset;
}
int best = lineStartOffset;
- float bestdist = Math.abs(getHorizontal(best, primary) - horiz);
+ float bestdist = Math.abs(horizontal.get(lineStartOffset) - horiz);
for (int i = 0; i < dirs.mDirections.length; i += 2) {
int here = lineStartOffset + dirs.mDirections[i];
@@ -1385,7 +1502,7 @@
guess = (high + low) / 2;
int adguess = getOffsetAtStartOf(guess);
- if (getHorizontal(adguess, primary) * swap >= horiz * swap) {
+ if (horizontal.get(adguess) * swap >= horiz * swap) {
high = guess;
} else {
low = guess;
@@ -1399,9 +1516,9 @@
int aft = tl.getOffsetToLeftRightOf(low - lineStartOffset, isRtl) + lineStartOffset;
low = tl.getOffsetToLeftRightOf(aft - lineStartOffset, !isRtl) + lineStartOffset;
if (low >= here && low < there) {
- float dist = Math.abs(getHorizontal(low, primary) - horiz);
+ float dist = Math.abs(horizontal.get(low) - horiz);
if (aft < there) {
- float other = Math.abs(getHorizontal(aft, primary) - horiz);
+ float other = Math.abs(horizontal.get(aft) - horiz);
if (other < dist) {
dist = other;
@@ -1416,7 +1533,7 @@
}
}
- float dist = Math.abs(getHorizontal(here, primary) - horiz);
+ float dist = Math.abs(horizontal.get(here) - horiz);
if (dist < bestdist) {
bestdist = dist;
@@ -1424,7 +1541,7 @@
}
}
- float dist = Math.abs(getHorizontal(max, primary) - horiz);
+ float dist = Math.abs(horizontal.get(max) - horiz);
if (dist <= bestdist) {
best = max;
@@ -1435,6 +1552,46 @@
}
/**
+ * Responds to #getHorizontal queries, by selecting the better strategy between:
+ * - calling #getHorizontal explicitly for each query
+ * - precomputing all #getHorizontal measurements, and responding to any query in constant time
+ * The first strategy is used for LTR-only text, while the second is used for all other cases.
+ * The class is currently only used in #getOffsetForHorizontal, so reuse with care in other
+ * contexts.
+ */
+ private class HorizontalMeasurementProvider {
+ private final int mLine;
+ private final boolean mPrimary;
+
+ private float[] mHorizontals;
+ private int mLineStartOffset;
+
+ HorizontalMeasurementProvider(final int line, final boolean primary) {
+ mLine = line;
+ mPrimary = primary;
+ init();
+ }
+
+ private void init() {
+ final Directions dirs = getLineDirections(mLine);
+ if (dirs == DIRS_ALL_LEFT_TO_RIGHT) {
+ return;
+ }
+
+ mHorizontals = getLineHorizontals(mLine, false, mPrimary);
+ mLineStartOffset = getLineStart(mLine);
+ }
+
+ float get(final int offset) {
+ if (mHorizontals == null) {
+ return getHorizontal(offset, mPrimary);
+ } else {
+ return mHorizontals[offset - mLineStartOffset];
+ }
+ }
+ }
+
+ /**
* Return the text offset after the last character on the specified line.
*/
public final int getLineEnd(int line) {
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index fcb7d62..5bfd3e9 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -388,6 +388,98 @@
}
/**
+ * @see #measure(int, boolean, FontMetricsInt)
+ * @return The measure results for all possible offsets
+ */
+ float[] measureAllOffsets(boolean[] trailing, FontMetricsInt fmi) {
+ float[] measurement = new float[mLen + 1];
+
+ int[] target = new int[mLen + 1];
+ for (int offset = 0; offset < target.length; ++offset) {
+ target[offset] = trailing[offset] ? offset - 1 : offset;
+ }
+ if (target[0] < 0) {
+ measurement[0] = 0;
+ }
+
+ float h = 0;
+
+ if (!mHasTabs) {
+ if (mDirections == Layout.DIRS_ALL_LEFT_TO_RIGHT) {
+ for (int offset = 0; offset <= mLen; ++offset) {
+ measurement[offset] = measureRun(0, offset, mLen, false, fmi);
+ }
+ return measurement;
+ }
+ if (mDirections == Layout.DIRS_ALL_RIGHT_TO_LEFT) {
+ for (int offset = 0; offset <= mLen; ++offset) {
+ measurement[offset] = measureRun(0, offset, mLen, true, fmi);
+ }
+ return measurement;
+ }
+ }
+
+ char[] chars = mChars;
+ int[] runs = mDirections.mDirections;
+ for (int i = 0; i < runs.length; i += 2) {
+ int runStart = runs[i];
+ int runLimit = runStart + (runs[i + 1] & Layout.RUN_LENGTH_MASK);
+ if (runLimit > mLen) {
+ runLimit = mLen;
+ }
+ boolean runIsRtl = (runs[i + 1] & Layout.RUN_RTL_FLAG) != 0;
+
+ int segstart = runStart;
+ for (int j = mHasTabs ? runStart : runLimit; j <= runLimit; ++j) {
+ int codept = 0;
+ if (mHasTabs && j < runLimit) {
+ codept = chars[j];
+ if (codept >= 0xD800 && codept < 0xDC00 && j + 1 < runLimit) {
+ codept = Character.codePointAt(chars, j);
+ if (codept > 0xFFFF) {
+ ++j;
+ continue;
+ }
+ }
+ }
+
+ if (j == runLimit || codept == '\t') {
+ float oldh = h;
+ boolean advance = (mDir == Layout.DIR_RIGHT_TO_LEFT) == runIsRtl;
+ float w = measureRun(segstart, j, j, runIsRtl, fmi);
+ h += advance ? w : -w;
+
+ float baseh = advance ? oldh : h;
+ FontMetricsInt crtfmi = advance ? fmi : null;
+ for (int offset = segstart; offset <= j && offset <= mLen; ++offset) {
+ if (target[offset] >= segstart && target[offset] < j) {
+ measurement[offset] =
+ baseh + measureRun(segstart, offset, j, runIsRtl, crtfmi);
+ }
+ }
+
+ if (codept == '\t') {
+ if (target[j] == j) {
+ measurement[j] = h;
+ }
+ h = mDir * nextTab(h * mDir);
+ if (target[j + 1] == j) {
+ measurement[j + 1] = h;
+ }
+ }
+
+ segstart = j + 1;
+ }
+ }
+ }
+ if (target[mLen] == mLen) {
+ measurement[mLen] = h;
+ }
+
+ return measurement;
+ }
+
+ /**
* Draws a unidirectional (but possibly multi-styled) run of text.
*
*
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 37aca26..fc34a25 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -278,7 +278,8 @@
TRANSIT_KEYGUARD_OCCLUDE,
TRANSIT_KEYGUARD_UNOCCLUDE,
TRANSIT_TRANSLUCENT_ACTIVITY_OPEN,
- TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE
+ TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE,
+ TRANSIT_CRASHING_ACTIVITY_CLOSE
})
@Retention(RetentionPolicy.SOURCE)
@interface TransitionType {}
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index a22f345..621a745 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -450,8 +450,10 @@
public void removeView(DateTimeView v) {
synchronized (mAttachedViews) {
- mAttachedViews.remove(v);
- if (mAttachedViews.isEmpty()) {
+ final boolean removed = mAttachedViews.remove(v);
+ // Only unregister once when we remove the last view in the list otherwise we risk
+ // trying to unregister a receiver that is no longer registered.
+ if (removed && mAttachedViews.isEmpty()) {
unregister(getApplicationContextIfAvailable(v.getContext()));
}
}
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 10de449..d07721a 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -1688,6 +1688,11 @@
if (ims == null) {
return false;
}
+ final boolean wasContentChanged = ims.mContentChanged;
+ if (!wasContentChanged && !ims.mSelectionModeChanged) {
+ return false;
+ }
+ ims.mContentChanged = false;
ims.mSelectionModeChanged = false;
final ExtractedTextRequest req = ims.mExtractedTextRequest;
if (req == null) {
@@ -1703,7 +1708,7 @@
+ " end=" + ims.mChangedEnd
+ " delta=" + ims.mChangedDelta);
}
- if (ims.mChangedStart < 0 && !ims.mContentChanged) {
+ if (ims.mChangedStart < 0 && !wasContentChanged) {
ims.mChangedStart = EXTRACT_NOTHING;
}
if (extractTextInternal(req, ims.mChangedStart, ims.mChangedEnd,
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index 4f567d2..c31f17a 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -934,7 +934,7 @@
public static final int TARGET_STANDARD = 2;
private static final int MAX_SERVICE_TARGETS = 4;
- private static final int MAX_TARGETS_PER_SERVICE = 4;
+ private static final int MAX_TARGETS_PER_SERVICE = 2;
private final List<ChooserTargetInfo> mServiceTargets = new ArrayList<>();
private final List<TargetInfo> mCallerTargets = new ArrayList<>();
@@ -942,6 +942,8 @@
private float mLateFee = 1.f;
+ private boolean mTargetsNeedPruning = false;
+
private final BaseChooserTargetComparator mBaseTargetComparator
= new BaseChooserTargetComparator();
@@ -1030,7 +1032,13 @@
}
if (mServiceTargets != null) {
- pruneServiceTargets();
+ if (getDisplayInfoCount() == 0) {
+ // b/109676071: When packages change, onListRebuilt() is called before
+ // ResolverActivity.mDisplayList is re-populated; pruning now would cause the
+ // list to disappear briefly, so instead we detect this case (the
+ // set of targets suddenly dropping to zero) and remember to prune later.
+ mTargetsNeedPruning = true;
+ }
}
if (DEBUG) Log.d(TAG, "List built querying services");
queryTargetServices(this);
@@ -1117,6 +1125,14 @@
public void addServiceResults(DisplayResolveInfo origTarget, List<ChooserTarget> targets) {
if (DEBUG) Log.d(TAG, "addServiceResults " + origTarget + ", " + targets.size()
+ " targets");
+
+ if (mTargetsNeedPruning && targets.size() > 0) {
+ // First proper update since we got an onListRebuilt() with (transient) 0 items.
+ // Clear out the target list and rebuild.
+ mServiceTargets.clear();
+ mTargetsNeedPruning = false;
+ }
+
final float parentScore = getScore(origTarget);
Collections.sort(targets, mBaseTargetComparator);
float lastScore = 0;
@@ -1169,17 +1185,6 @@
}
mServiceTargets.add(chooserTargetInfo);
}
-
- private void pruneServiceTargets() {
- if (DEBUG) Log.d(TAG, "pruneServiceTargets");
- for (int i = mServiceTargets.size() - 1; i >= 0; i--) {
- final ChooserTargetInfo cti = mServiceTargets.get(i);
- if (!hasResolvedTarget(cti.getResolveInfo())) {
- if (DEBUG) Log.d(TAG, " => " + i + " " + cti);
- mServiceTargets.remove(i);
- }
- }
- }
}
static class BaseChooserTargetComparator implements Comparator<ChooserTarget> {
diff --git a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
index 1959301..d8ee4dd 100644
--- a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
+++ b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
@@ -112,7 +112,7 @@
}
case KeyEvent.KEYCODE_CALL: {
- if (getKeyguardManager().inKeyguardRestrictedInputMode() || dispatcher == null) {
+ if (isNotInstantAppAndKeyguardRestricted(dispatcher)) {
break;
}
if (event.getRepeatCount() == 0) {
@@ -139,7 +139,7 @@
}
case KeyEvent.KEYCODE_CAMERA: {
- if (getKeyguardManager().inKeyguardRestrictedInputMode() || dispatcher == null) {
+ if (isNotInstantAppAndKeyguardRestricted(dispatcher)) {
break;
}
if (event.getRepeatCount() == 0) {
@@ -164,7 +164,7 @@
}
case KeyEvent.KEYCODE_SEARCH: {
- if (getKeyguardManager().inKeyguardRestrictedInputMode() || dispatcher == null) {
+ if (isNotInstantAppAndKeyguardRestricted(dispatcher)) {
break;
}
if (event.getRepeatCount() == 0) {
@@ -202,6 +202,11 @@
return false;
}
+ private boolean isNotInstantAppAndKeyguardRestricted(KeyEvent.DispatcherState dispatcher) {
+ return !mContext.getPackageManager().isInstantApp()
+ && (getKeyguardManager().inKeyguardRestrictedInputMode() || dispatcher == null);
+ }
+
boolean onKeyUp(int keyCode, KeyEvent event) {
if (DEBUG) {
Log.d(TAG, "up " + keyCode);
@@ -238,7 +243,7 @@
}
case KeyEvent.KEYCODE_CAMERA: {
- if (getKeyguardManager().inKeyguardRestrictedInputMode()) {
+ if (isNotInstantAppAndKeyguardRestricted(dispatcher)) {
break;
}
if (event.isTracking() && !event.isCanceled()) {
@@ -248,7 +253,7 @@
}
case KeyEvent.KEYCODE_CALL: {
- if (getKeyguardManager().inKeyguardRestrictedInputMode()) {
+ if (isNotInstantAppAndKeyguardRestricted(dispatcher)) {
break;
}
if (event.isTracking() && !event.isCanceled()) {
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp
index 375d68b..1ea4ed1 100644
--- a/core/jni/android_media_AudioRecord.cpp
+++ b/core/jni/android_media_AudioRecord.cpp
@@ -368,10 +368,19 @@
// of the Java object (in mNativeCallbackCookie) so we can free the memory in finalize()
env->SetLongField(thiz, javaAudioRecordFields.nativeCallbackCookie, (jlong)lpCallbackData);
+ if (paa != NULL) {
+ // audio attributes were copied in AudioRecord creation
+ free(paa);
+ paa = NULL;
+ }
+
return (jint) AUDIO_JAVA_SUCCESS;
// failure:
native_init_failure:
+ if (paa != NULL) {
+ free(paa);
+ }
env->DeleteGlobalRef(lpCallbackData->audioRecord_class);
env->DeleteGlobalRef(lpCallbackData->audioRecord_ref);
delete lpCallbackData;
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 1b206fd..c3ba9ba 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -108,6 +108,7 @@
jclass mClass;
jmethodID mGetInstance;
jmethodID mSendDeathNotice;
+ jmethodID mDumpProxyDebugInfo;
// Object state.
jfieldID mNativeData; // Field holds native pointer to BinderProxyNativeData.
@@ -1006,9 +1007,27 @@
static void android_os_BinderInternal_proxyLimitcallback(int uid)
{
JNIEnv *env = AndroidRuntime::getJNIEnv();
+ {
+ // Calls into BinderProxy must be serialized
+ AutoMutex _l(gProxyLock);
+ env->CallStaticObjectMethod(gBinderProxyOffsets.mClass,
+ gBinderProxyOffsets.mDumpProxyDebugInfo);
+ }
+ if (env->ExceptionCheck()) {
+ ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
+ report_exception(env, excep.get(),
+ "*** Uncaught exception in dumpProxyDebugInfo");
+ }
+
env->CallStaticVoidMethod(gBinderInternalOffsets.mClass,
gBinderInternalOffsets.mProxyLimitCallback,
uid);
+
+ if (env->ExceptionCheck()) {
+ ScopedLocalRef<jthrowable> excep(env, env->ExceptionOccurred());
+ report_exception(env, excep.get(),
+ "*** Uncaught exception in binderProxyLimitCallbackFromNative");
+ }
}
static void android_os_BinderInternal_setBinderProxyCountEnabled(JNIEnv* env, jobject clazz,
@@ -1389,6 +1408,8 @@
"(JJ)Landroid/os/BinderProxy;");
gBinderProxyOffsets.mSendDeathNotice = GetStaticMethodIDOrDie(env, clazz, "sendDeathNotice",
"(Landroid/os/IBinder$DeathRecipient;)V");
+ gBinderProxyOffsets.mDumpProxyDebugInfo = GetStaticMethodIDOrDie(env, clazz, "dumpProxyDebugInfo",
+ "()V");
gBinderProxyOffsets.mNativeData = GetFieldIDOrDie(env, clazz, "mNativeData", "J");
clazz = FindClassOrDie(env, "java/lang/Class");
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index bdfaea5..a9e51f4 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -291,12 +291,9 @@
<string name="permgrouplab_camera" msgid="4820372495894586615">"କ୍ୟାମେରା"</string>
<string name="permgroupdesc_camera" msgid="3250611594678347720">"ଫଟୋ ନିଏ ଓ ଭିଡିଓ ରେକର୍ଡ କରେ"</string>
<string name="permgrouprequest_camera" msgid="1299833592069671756">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>କୁ ଫଟୋ ଉଠାଇବାକୁ ଏବଂ ଭିଡିଓ ରେକର୍ଡ କରିବାକୁ ଅନୁମତି ଦେବେ କି?"</string>
- <!-- no translation found for permgrouplab_calllog (8798646184930388160) -->
- <skip />
- <!-- no translation found for permgroupdesc_calllog (3006237336748283775) -->
- <skip />
- <!-- no translation found for permgrouprequest_calllog (8487355309583773267) -->
- <skip />
+ <string name="permgrouplab_calllog" msgid="8798646184930388160">"କଲ୍ ଲଗ୍"</string>
+ <string name="permgroupdesc_calllog" msgid="3006237336748283775">"ଫୋନ୍ କଲ୍ ଲଗ୍ ପଢ଼ନ୍ତୁ ଓ ଲେଖନ୍ତୁ"</string>
+ <string name="permgrouprequest_calllog" msgid="8487355309583773267">"ଆପଣଙ୍କର ଫୋନ୍ର କଲ୍ ଲଗ୍ ଆକ୍ସେସ୍ କରିବା ପାଇଁ <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>କୁ ଅନୁମତି ଦେବେ କି?"</string>
<string name="permgrouplab_phone" msgid="5229115638567440675">"ଫୋନ୍"</string>
<string name="permgroupdesc_phone" msgid="6234224354060641055">"ଫୋନ୍ କଲ୍ କରେ ଏବଂ ପରିଚାଳନା କରେ"</string>
<string name="permgrouprequest_phone" msgid="9166979577750581037">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>କୁ ଫୋନ୍ କଲ୍ କରିବାକୁ ତଥା ପରିଚାଳନା କରିବାକୁ ଅନୁମତି ଦେବେ କି?"</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 95e5ac8..0b5dd7e 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -519,6 +519,10 @@
<!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
<bool translatable="false" name="config_wifi_dual_band_support">false</bool>
+ <!-- Boolean indicating whether the wifi chipset requires the softap band be -->
+ <!-- converted from 5GHz to ANY due to hardware restrictions -->
+ <bool translatable="false" name="config_wifi_convert_apband_5ghz_to_any">false</bool>
+
<!-- Boolean indicating whether 802.11r Fast BSS Transition is enabled on this platform -->
<bool translatable="false" name="config_wifi_fast_bss_transition_enabled">false</bool>
@@ -2518,9 +2522,11 @@
property. If this is false, then the following recents config flags are ignored. -->
<bool name="config_hasRecents">true</bool>
- <!-- Component name for the activity that will be presenting the Recents UI, which will receive
- special permissions for API related to fetching and presenting recent tasks. -->
- <string name="config_recentsComponentName" translatable="false">com.android.systemui/.recents.RecentsActivity</string>
+ <!-- Component name for the activity that will be presenting the Recents UI, which will receive special permissions for API related
+ to fetching and presenting recent tasks. The default configuration uses Launcehr3QuickStep as default launcher and points to
+ the corresponding recents component. When using a different default launcher, change this appropriately or use the default
+ systemui implementation: com.android.systemui/.recents.RecentsActivity -->
+ <string name="config_recentsComponentName" translatable="false">com.android.launcher3/com.android.quickstep.RecentsActivity</string>
<!-- The minimum number of visible recent tasks to be presented to the user through the
SystemUI. Can be -1 if there is no minimum limit. -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index faf9093..f80abc1 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1867,6 +1867,7 @@
<java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" />
<java-symbol type="bool" name="config_wifi_background_scan_support" />
<java-symbol type="bool" name="config_wifi_dual_band_support" />
+ <java-symbol type="bool" name="config_wifi_convert_apband_5ghz_to_any" />
<java-symbol type="bool" name="config_wifi_fast_bss_transition_enabled" />
<java-symbol type="bool" name="config_wimaxEnabled" />
<java-symbol type="bool" name="show_ongoing_ime_switcher" />
diff --git a/core/res/res/xml/default_zen_mode_config.xml b/core/res/res/xml/default_zen_mode_config.xml
index 35a0cc2..cb4e5c4 100644
--- a/core/res/res/xml/default_zen_mode_config.xml
+++ b/core/res/res/xml/default_zen_mode_config.xml
@@ -23,7 +23,7 @@
reminders="false" events="false" repeatCallers="true" />
<!-- all visual effects that exist as of P -->
- <disallow suppressedVisualEffect="511" />
+ <disallow visualEffects="511" />
<!-- whether there are notification channels that can bypass dnd -->
<state areChannelsBypassingDnd="false" />
diff --git a/core/tests/coretests/src/android/widget/DateTimeViewTest.java b/core/tests/coretests/src/android/widget/DateTimeViewTest.java
new file mode 100644
index 0000000..fbf0d36
--- /dev/null
+++ b/core/tests/coretests/src/android/widget/DateTimeViewTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.widget;
+
+import android.support.test.InstrumentationRegistry;
+import android.support.test.annotation.UiThreadTest;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class DateTimeViewTest {
+
+ @UiThreadTest
+ @Test
+ public void additionalOnDetachedFromWindow_noException() {
+ final DateTimeView dateTimeView = new DateTimeView(InstrumentationRegistry.getContext());
+ dateTimeView.onAttachedToWindow();
+ dateTimeView.onAttachedToWindow();
+ // Even there is an additional detach (abnormal), DateTimeView should not unregister
+ // receiver again that raises "java.lang.IllegalArgumentException: Receiver not registered".
+ dateTimeView.onDetachedFromWindow();
+ }
+}
diff --git a/keystore/java/android/security/KeyChain.java b/keystore/java/android/security/KeyChain.java
index 066e17c..030fa60 100644
--- a/keystore/java/android/security/KeyChain.java
+++ b/keystore/java/android/security/KeyChain.java
@@ -352,8 +352,11 @@
* selected alias or null will be returned via the
* KeyChainAliasCallback callback.
*
- * <p>The device or profile owner can intercept this before the activity
- * is shown, to pick a specific private key alias.
+ * <p>A device policy controller (as a device or profile owner) can
+ * intercept the request before the activity is shown, to pick a
+ * specific private key alias by implementing
+ * {@link android.app.admin.DeviceAdminReceiver#onChoosePrivateKeyAlias
+ * onChoosePrivateKeyAlias}.
*
* <p>{@code keyTypes} and {@code issuers} may be used to
* highlight suggested choices to the user, although to cope with
@@ -363,7 +366,7 @@
* <p>{@code host} and {@code port} may be used to give the user
* more context about the server requesting the credentials.
*
- * <p>{@code alias} allows the chooser to preselect an existing
+ * <p>{@code alias} allows the caller to preselect an existing
* alias which will still be subject to user confirmation.
*
* @param activity The {@link Activity} context to use for
@@ -403,18 +406,21 @@
* selected alias or null will be returned via the
* KeyChainAliasCallback callback.
*
- * <p>The device or profile owner can intercept this before the activity
- * is shown, to pick a specific private key alias.</p>
+ * <p>A device policy controller (as a device or profile owner) can
+ * intercept the request before the activity is shown, to pick a
+ * specific private key alias by implementing
+ * {@link android.app.admin.DeviceAdminReceiver#onChoosePrivateKeyAlias
+ * onChoosePrivateKeyAlias}.
*
* <p>{@code keyTypes} and {@code issuers} may be used to
* highlight suggested choices to the user, although to cope with
* sometimes erroneous values provided by servers, the user may be
* able to override these suggestions.
*
- * <p>{@code host} and {@code port} may be used to give the user
- * more context about the server requesting the credentials.
+ * <p>{@code uri} may be used to give the user more context about
+ * the server requesting the credentials.
*
- * <p>{@code alias} allows the chooser to preselect an existing
+ * <p>{@code alias} allows the caller to preselect an existing
* alias which will still be subject to user confirmation.
*
* @param activity The {@link Activity} context to use for
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index b644cc3..861dc0f 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6824,8 +6824,16 @@
}
} else if (ctype == RES_TABLE_LIBRARY_TYPE) {
+
if (group->dynamicRefTable.entries().size() == 0) {
- status_t err = group->dynamicRefTable.load((const ResTable_lib_header*) chunk);
+ const ResTable_lib_header* lib = (const ResTable_lib_header*) chunk;
+ status_t err = validate_chunk(&lib->header, sizeof(*lib),
+ endPos, "ResTable_lib_header");
+ if (err != NO_ERROR) {
+ return (mError=err);
+ }
+
+ err = group->dynamicRefTable.load(lib);
if (err != NO_ERROR) {
return (mError=err);
}
diff --git a/media/jni/android_media_ImageWriter.cpp b/media/jni/android_media_ImageWriter.cpp
index f8f7a90..031e373 100644
--- a/media/jni/android_media_ImageWriter.cpp
+++ b/media/jni/android_media_ImageWriter.cpp
@@ -252,7 +252,14 @@
* after disconnect. MEDIA or CAMERA are treated the same internally. The producer listener
* will be cleared after disconnect call.
*/
- producer->connect(/*api*/NATIVE_WINDOW_API_CAMERA, /*listener*/ctx);
+ res = producer->connect(/*api*/NATIVE_WINDOW_API_CAMERA, /*listener*/ctx);
+ if (res != OK) {
+ ALOGE("%s: Connecting to surface producer interface failed: %s (%d)",
+ __FUNCTION__, strerror(-res), res);
+ jniThrowRuntimeException(env, "Failed to connect to native window");
+ return 0;
+ }
+
jlong nativeCtx = reinterpret_cast<jlong>(ctx.get());
// Get the dimension and format of the producer.
diff --git a/packages/InputDevices/res/values-in/strings.xml b/packages/InputDevices/res/values-in/strings.xml
index 0c3bd7e..16b2010 100644
--- a/packages/InputDevices/res/values-in/strings.xml
+++ b/packages/InputDevices/res/values-in/strings.xml
@@ -31,7 +31,7 @@
<string name="keyboard_layout_icelandic" msgid="5836645650912489642">"Islandia"</string>
<string name="keyboard_layout_brazilian" msgid="5117896443147781939">"Brasil"</string>
<string name="keyboard_layout_portuguese" msgid="2888198587329660305">"Portugis"</string>
- <string name="keyboard_layout_slovak" msgid="2469379934672837296">"Slowakia"</string>
+ <string name="keyboard_layout_slovak" msgid="2469379934672837296">"Slovakia"</string>
<string name="keyboard_layout_slovenian" msgid="1735933028924982368">"Slovenia"</string>
<string name="keyboard_layout_turkish" msgid="7736163250907964898">"Turki"</string>
<string name="keyboard_layout_ukrainian" msgid="8176637744389480417">"Ukraina"</string>
diff --git a/packages/PrintSpooler/res/values-hy/strings.xml b/packages/PrintSpooler/res/values-hy/strings.xml
index 56045be..0009397 100644
--- a/packages/PrintSpooler/res/values-hy/strings.xml
+++ b/packages/PrintSpooler/res/values-hy/strings.xml
@@ -99,8 +99,8 @@
<item msgid="79513688117503758">"Կարճեզր"</item>
</string-array>
<string-array name="orientation_labels">
- <item msgid="4061931020926489228">"Դիմանկար"</item>
- <item msgid="3199660090246166812">"Լանդշաֆտ"</item>
+ <item msgid="4061931020926489228">"Ուղղաձիգ"</item>
+ <item msgid="3199660090246166812">"Հորիզոնական"</item>
</string-array>
<string name="print_write_error_message" msgid="5787642615179572543">"Հնարավոր չէ գրել ֆայլում"</string>
<string name="print_error_default_message" msgid="8602678405502922346">"Չհաջողվեց: Նորից փորձեք:"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java b/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
index 3eb7913..4c45a75 100644
--- a/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
+++ b/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
@@ -164,7 +164,7 @@
* @return All users other than user with userId.
*/
public List<UserInfo> getAllUsersExceptUser(int userId) {
- List<UserInfo> others = getAllUsers();
+ List<UserInfo> others = mUserManager.getUsers(/* excludeDying= */true);
for (Iterator<UserInfo> iterator = others.iterator(); iterator.hasNext(); ) {
UserInfo userInfo = iterator.next();
@@ -183,7 +183,7 @@
if (isHeadlessSystemUser()) {
return getAllUsersExcludesSystemUser();
}
- return mUserManager.getUsers(true /* excludeDying */);
+ return mUserManager.getUsers(/* excludeDying= */true);
}
// User information accessors
diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
index 4301fdb..94189bb 100644
--- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml
+++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
@@ -35,8 +35,7 @@
android:layout_gravity="start"
android:gravity="center_vertical"
android:singleLine="true"
- android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
- android:textSize="@dimen/qs_time_collapsed_size"
+ android:textAppearance="@style/TextAppearance.QS.TileLabel"
systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm" />
<com.android.systemui.statusbar.phone.StatusIconContainer
diff --git a/packages/SystemUI/res/values-hi-ldrtl/strings.xml b/packages/SystemUI/res/values-hi-ldrtl/strings.xml
index 6200b8d..df86c57 100644
--- a/packages/SystemUI/res/values-hi-ldrtl/strings.xml
+++ b/packages/SystemUI/res/values-hi-ldrtl/strings.xml
@@ -19,5 +19,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="recents_quick_scrub_onboarding" msgid="3449337212132057178">"ऐप्लिकेशन को तेज़ी से स्विच करने के लिए उसे बाईं ओर खींचें और छोड़ें"</string>
+ <string name="recents_quick_scrub_onboarding" msgid="3449337212132057178">"ऐप्लिकेशन को तेज़ी से बदलने के लिए उसे बाईं ओर खींचें और छोड़ें"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index ad3d758..6cb5d7c 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -292,8 +292,8 @@
<string name="accessibility_quick_settings_rotation" msgid="4231661040698488779">"Ավտոմատ պտտել էկրանը"</string>
<string name="accessibility_quick_settings_rotation_value" msgid="8187398200140760213">"<xliff:g id="ID_1">%s</xliff:g> ռեժիմ"</string>
<string name="quick_settings_rotation_locked_label" msgid="6359205706154282377">"Պտտումը կողպված է"</string>
- <string name="quick_settings_rotation_locked_portrait_label" msgid="5102691921442135053">"Դիմանկար"</string>
- <string name="quick_settings_rotation_locked_landscape_label" msgid="8553157770061178719">"Լանդշաֆտ"</string>
+ <string name="quick_settings_rotation_locked_portrait_label" msgid="5102691921442135053">"Ուղղաձիգ"</string>
+ <string name="quick_settings_rotation_locked_landscape_label" msgid="8553157770061178719">"Հորիզոնական"</string>
<string name="quick_settings_ime_label" msgid="7073463064369468429">"Մուտքագրման եղանակը"</string>
<string name="quick_settings_location_label" msgid="5011327048748762257">"Տեղորոշում"</string>
<string name="quick_settings_location_off_label" msgid="7464544086507331459">"Անջատել տեղադրությունը"</string>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 950a40b..a223d44 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -95,8 +95,7 @@
<string name="accessibility_unlock_button" msgid="128158454631118828">"ଅନଲକ୍ କରନ୍ତୁ"</string>
<string name="accessibility_waiting_for_fingerprint" msgid="4808860050517462885">"ଆଙ୍ଗୁଠି ଚିହ୍ନ ପାଇଁ ଅପେକ୍ଷା କରିଛି"</string>
<string name="accessibility_unlock_without_fingerprint" msgid="7541705575183694446">"ଆଙ୍ଗୁଠିଚିହ୍ନ ବ୍ୟବହାର ନକରି ଅନଲକ୍ କରନ୍ତୁ"</string>
- <!-- no translation found for accessibility_scanning_face (769545173211758586) -->
- <skip />
+ <string name="accessibility_scanning_face" msgid="769545173211758586">"ଫେସ୍ ସ୍କାନିଙ୍ଗ କରାଯାଉଛି"</string>
<string name="accessibility_send_smart_reply" msgid="7766727839703044493">"ପଠାନ୍ତୁ"</string>
<string name="unlock_label" msgid="8779712358041029439">"ଅନଲକ୍"</string>
<string name="phone_label" msgid="2320074140205331708">"ଫୋନ୍ ଖୋଲନ୍ତୁ"</string>
@@ -857,6 +856,5 @@
<string name="auto_saver_enabled_text" msgid="874711029884777579">"ଚାର୍ଜ <xliff:g id="PERCENTAGE">%d</xliff:g>%%ରୁ କମ୍ ହେଲେ ବ୍ୟାଟେରୀ ସେଭର୍ ଆପେ ଅନ୍ ହୋଇଯିବ।"</string>
<string name="open_saver_setting_action" msgid="8314624730997322529">"ସେଟିଙ୍ଗ"</string>
<string name="auto_saver_okay_action" msgid="2701221740227683650">"ବୁଝିଲି"</string>
- <!-- no translation found for heap_dump_tile_name (9141031328971226374) -->
- <skip />
+ <string name="heap_dump_tile_name" msgid="9141031328971226374">"SysUI ହିପ୍ ଡମ୍ପ୍ କରନ୍ତୁ"</string>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9a3bdf2..4433532 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -204,7 +204,7 @@
<dimen name="status_bar_padding_end">6dp</dimen>
<!-- the radius of the overflow dot in the status bar -->
- <dimen name="overflow_dot_radius">1dp</dimen>
+ <dimen name="overflow_dot_radius">2dp</dimen>
<!-- the padding between dots in the icon overflow -->
<dimen name="overflow_icon_dot_padding">3dp</dimen>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/RecentsTaskLoadPlan.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/RecentsTaskLoadPlan.java
index 76204df..a04a6a3 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/RecentsTaskLoadPlan.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/RecentsTaskLoadPlan.java
@@ -20,6 +20,7 @@
import android.app.ActivityManager;
import android.app.KeyguardManager;
+import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -102,9 +103,14 @@
ActivityManager.RecentTaskInfo t = mRawTasks.get(i);
// Compose the task key
+ final ComponentName sourceComponent = t.origActivity != null
+ // Activity alias if there is one
+ ? t.origActivity
+ // The real activity if there is no alias (or the target if there is one)
+ : t.realActivity;
final int windowingMode = t.configuration.windowConfiguration.getWindowingMode();
TaskKey taskKey = new TaskKey(t.persistentId, windowingMode, t.baseIntent,
- t.userId, t.lastActiveTime);
+ sourceComponent, t.userId, t.lastActiveTime);
boolean isFreeformTask = windowingMode == WINDOWING_MODE_FREEFORM;
boolean isStackTask = !isFreeformTask;
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/Task.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/Task.java
index 6af89fc..b51004b 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/Task.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/Task.java
@@ -60,12 +60,17 @@
@ViewDebug.ExportedProperty(category="recents")
public long lastActiveTime;
+ // The source component name which started this task
+ public final ComponentName sourceComponent;
+
private int mHashCode;
- public TaskKey(int id, int windowingMode, Intent intent, int userId, long lastActiveTime) {
+ public TaskKey(int id, int windowingMode, Intent intent,
+ ComponentName sourceComponent, int userId, long lastActiveTime) {
this.id = id;
this.windowingMode = windowingMode;
this.baseIntent = intent;
+ this.sourceComponent = sourceComponent;
this.userId = userId;
this.lastActiveTime = lastActiveTime;
updateHashCode();
diff --git a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
index b03ea90..3b647c1 100644
--- a/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
+++ b/packages/SystemUI/shared/tests/src/com/android/systemui/shared/recents/model/HighResThumbnailLoaderTest.java
@@ -26,6 +26,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.content.ComponentName;
import android.os.Looper;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
@@ -61,7 +62,7 @@
MockitoAnnotations.initMocks(this);
mLoader = new HighResThumbnailLoader(mMockActivityManagerWrapper, Looper.getMainLooper(),
false /* reducedResolution */);
- mTask.key = new TaskKey(0, WINDOWING_MODE_UNDEFINED, null, 0, 0);
+ mTask.key = new TaskKey(0, WINDOWING_MODE_UNDEFINED, null, null, 0, 0);
when(mMockActivityManagerWrapper.getTaskThumbnail(anyInt(), anyBoolean()))
.thenReturn(mThumbnailData);
mLoader.setVisible(true);
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
index bb05caa..67bdd21 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java
@@ -328,7 +328,7 @@
}
public boolean hasHeader() {
- return mTitle.getVisibility() == VISIBLE;
+ return mHasHeader;
}
/**
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index 976b454..49dba68 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -231,9 +231,9 @@
if (view == mClockView) {
float clockScale = smallClock ? mSmallClockScale : 1;
Paint.Style style = smallClock ? Paint.Style.FILL_AND_STROKE : Paint.Style.FILL;
+ mClockView.animate().cancel();
if (shouldAnimate) {
mClockView.setY(oldTop + heightOffset);
- mClockView.animate().cancel();
mClockView.animate()
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
.setDuration(duration)
@@ -257,10 +257,10 @@
} else if (view == mClockSeparator) {
boolean hasSeparator = hasHeader && !mPulsing;
float alpha = hasSeparator ? 1 : 0;
+ mClockSeparator.animate().cancel();
if (shouldAnimate) {
boolean isAwake = mDarkAmount != 0;
mClockSeparator.setY(oldTop + heightOffset);
- mClockSeparator.animate().cancel();
mClockSeparator.animate()
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
.setDuration(duration)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index e24d65a..872f33a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -345,6 +345,7 @@
private final ArrayMap<String, Entry> mEntries = new ArrayMap<>();
private final ArrayList<Entry> mSortedAndFiltered = new ArrayList<>();
+ private final ArrayList<Entry> mFilteredForUser = new ArrayList<>();
private NotificationGroupManager mGroupManager;
@@ -429,6 +430,23 @@
return mSortedAndFiltered;
}
+ public ArrayList<Entry> getNotificationsForCurrentUser() {
+ mFilteredForUser.clear();
+
+ synchronized (mEntries) {
+ final int N = mEntries.size();
+ for (int i = 0; i < N; i++) {
+ Entry entry = mEntries.valueAt(i);
+ final StatusBarNotification sbn = entry.notification;
+ if (!mEnvironment.isNotificationForCurrentProfiles(sbn)) {
+ continue;
+ }
+ mFilteredForUser.add(entry);
+ }
+ }
+ return mFilteredForUser;
+ }
+
public Entry get(String key) {
return mEntries.get(key);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java
index 30fa0c2..06f26c9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationEntryManager.java
@@ -681,10 +681,10 @@
}
public void updateNotificationsOnDensityOrFontScaleChanged() {
- ArrayList<NotificationData.Entry> activeNotifications =
- mNotificationData.getActiveNotifications();
- for (int i = 0; i < activeNotifications.size(); i++) {
- NotificationData.Entry entry = activeNotifications.get(i);
+ ArrayList<NotificationData.Entry> userNotifications =
+ mNotificationData.getNotificationsForCurrentUser();
+ for (int i = 0; i < userNotifications.size(); i++) {
+ NotificationData.Entry entry = userNotifications.get(i);
boolean exposedGuts = mGutsManager.getExposedGuts() != null
&& entry.row.getGuts() == mGutsManager.getExposedGuts();
entry.row.onDensityOrFontScaleChanged();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 3063199..fac7768 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -482,8 +482,8 @@
iconTransformDistance = Math.min(iconTransformDistance, fullHeight);
if (isLastChild) {
fullHeight = Math.min(fullHeight, row.getMinHeight() - getIntrinsicHeight());
- iconTransformDistance = Math.min(iconTransformDistance, row.getMinHeight()
- - getIntrinsicHeight());
+ iconTransformDistance = Math.min(iconTransformDistance,
+ row.getMinHeight() - getIntrinsicHeight() * icon.getIconScale());
}
float viewEnd = viewStart + fullHeight;
if (expandingAnimated && mAmbientState.getScrollY() == 0
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index ebeea58..27cb077 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -122,7 +122,7 @@
private final boolean mBlocked;
private int mDensity;
private float mIconScale = 1.0f;
- private final Paint mDotPaint = new Paint();
+ private final Paint mDotPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
private float mDotRadius;
private int mStaticDotRadius;
private int mVisibleState = STATE_ICON;
@@ -425,13 +425,12 @@
}
if (mDotAppearAmount != 0.0f) {
float radius;
- float alpha;
+ float alpha = Color.alpha(mDecorColor) / 255.f;
if (mDotAppearAmount <= 1.0f) {
radius = mDotRadius * mDotAppearAmount;
- alpha = 1.0f;
} else {
float fadeOutAmount = mDotAppearAmount - 1.0f;
- alpha = 1.0f - fadeOutAmount;
+ alpha = alpha * (1.0f - fadeOutAmount);
radius = NotificationUtils.interpolate(mDotRadius, getWidth() / 4, fadeOutAmount);
}
mDotPaint.setAlpha((int) (alpha * 255));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
index d6bef12..ccbf483 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
@@ -260,7 +260,8 @@
break;
case STATE_HIDDEN:
default:
- setVisibility(View.INVISIBLE);
+ mMobileGroup.setVisibility(View.INVISIBLE);
+ mDotView.setVisibility(View.INVISIBLE);
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
index 59a0adc..0ed6b77 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
@@ -141,7 +141,8 @@
break;
case STATE_HIDDEN:
default:
- setVisibility(View.GONE);
+ mWifiGroup.setVisibility(View.GONE);
+ mDotView.setVisibility(View.GONE);
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 0fd8df0..2a1f92f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -607,6 +607,7 @@
updateNavButtonIcons();
updateSlippery();
+ setUpSwipeUpOnboarding(isQuickStepSwipeUpEnabled());
}
public void updateNavButtonIcons() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
index 609e032..77522e4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationDataTest.java
@@ -46,7 +46,6 @@
import android.service.notification.StatusBarNotification;
import android.support.test.annotation.UiThreadTest;
import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.util.ArraySet;
@@ -62,6 +61,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.ArrayList;
+
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWithLooper(setAsMainLooper = true)
@@ -280,6 +281,24 @@
}
@Test
+ public void testGetNotificationsForCurrentUser_shouldFilterNonCurrentUserNotifications()
+ throws Exception {
+ mNotificationData.add(mRow.getEntry());
+ ExpandableNotificationRow row2 = new NotificationTestHelper(getContext()).createRow();
+ mNotificationData.add(row2.getEntry());
+
+ when(mEnvironment.isNotificationForCurrentProfiles(
+ mRow.getEntry().notification)).thenReturn(false);
+ when(mEnvironment.isNotificationForCurrentProfiles(
+ row2.getEntry().notification)).thenReturn(true);
+ ArrayList<NotificationData.Entry> reuslt =
+ mNotificationData.getNotificationsForCurrentUser();
+
+ assertEquals(reuslt.size(), 1);
+ assertEquals(reuslt.get(0), row2.getEntry());
+ }
+
+ @Test
public void testIsExemptFromDndVisualSuppression_foreground() {
initStatusBarNotification(false);
when(mMockStatusBarNotification.getKey()).thenReturn(
diff --git a/services/autofill/java/com/android/server/autofill/Helper.java b/services/autofill/java/com/android/server/autofill/Helper.java
index cf310e9..f14c8f1 100644
--- a/services/autofill/java/com/android/server/autofill/Helper.java
+++ b/services/autofill/java/com/android/server/autofill/Helper.java
@@ -114,7 +114,7 @@
int sessionId, boolean compatMode) {
final LogMaker log = new LogMaker(category)
.addTaggedData(MetricsEvent.FIELD_AUTOFILL_SERVICE, servicePackageName)
- .addTaggedData(MetricsEvent.FIELD_AUTOFILL_SESSION_ID, sessionId);
+ .addTaggedData(MetricsEvent.FIELD_AUTOFILL_SESSION_ID, Integer.toString(sessionId));
if (compatMode) {
log.addTaggedData(MetricsEvent.FIELD_AUTOFILL_COMPAT_MODE, 1);
}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index fbbb76c..52c3f64 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -100,7 +100,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
@@ -2538,13 +2537,14 @@
}
}
pw.print(prefix); pw.print("mCurrentViewId: "); pw.println(mCurrentViewId);
- pw.print(prefix); pw.print("mViewStates size: "); pw.println(mViewStates.size());
pw.print(prefix); pw.print("mDestroyed: "); pw.println(mDestroyed);
pw.print(prefix); pw.print("mIsSaving: "); pw.println(mIsSaving);
pw.print(prefix); pw.print("mPendingSaveUi: "); pw.println(mPendingSaveUi);
- for (Map.Entry<AutofillId, ViewState> entry : mViewStates.entrySet()) {
- pw.print(prefix); pw.print("State for id "); pw.println(entry.getKey());
- entry.getValue().dump(prefix2, pw);
+ final int numberViews = mViewStates.size();
+ pw.print(prefix); pw.print("mViewStates size: "); pw.println(mViewStates.size());
+ for (int i = 0; i < numberViews; i++) {
+ pw.print(prefix); pw.print("ViewState at #"); pw.println(i);
+ mViewStates.valueAt(i).dump(prefix2, pw);
}
pw.print(prefix); pw.print("mContexts: " );
@@ -2555,7 +2555,7 @@
pw.print(prefix2); pw.print(context);
if (sVerbose) {
- pw.println(context.getStructure() + " (look at logcat)");
+ pw.println("AssistStructure dumped at logcat)");
// TODO: add method on AssistStructure to dump on pw
context.getStructure().dump(false);
diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java
index aa86ea8..786d757 100644
--- a/services/core/java/com/android/server/AppOpsService.java
+++ b/services/core/java/com/android/server/AppOpsService.java
@@ -1335,10 +1335,10 @@
int watchedUid = -1;
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
- if (mContext.checkCallingOrSelfPermission(Manifest.permission.WATCH_APPOPS)
- != PackageManager.PERMISSION_GRANTED) {
- watchedUid = callingUid;
- }
+ // TODO: should have a privileged permission to protect this.
+ // Also, if the caller has requested WATCH_FOREGROUND_CHANGES, should we require
+ // the USAGE_STATS permission since this can provide information about when an
+ // app is in the foreground?
Preconditions.checkArgumentInRange(op, AppOpsManager.OP_NONE,
AppOpsManager._NUM_OP - 1, "Invalid op code: " + op);
if (callback == null) {
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 2d2c4cd..c995c1e 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -4690,7 +4690,7 @@
// The NetworkAgentInfo does not know whether clatd is running on its network or not. Before
// we do anything else, make sure its LinkProperties are accurate.
if (networkAgent.clatd != null) {
- networkAgent.clatd.fixupLinkProperties(oldLp);
+ networkAgent.clatd.fixupLinkProperties(oldLp, newLp);
}
updateInterfaces(newLp, oldLp, netId, networkAgent.networkCapabilities);
diff --git a/services/core/java/com/android/server/DeviceIdleController.java b/services/core/java/com/android/server/DeviceIdleController.java
index 0f4702c..b8f395b 100644
--- a/services/core/java/com/android/server/DeviceIdleController.java
+++ b/services/core/java/com/android/server/DeviceIdleController.java
@@ -1535,7 +1535,8 @@
filter.addAction(Intent.ACTION_SCREEN_ON);
getContext().registerReceiver(mInteractivityReceiver, filter);
- mLocalActivityManager.setDeviceIdleWhitelist(mPowerSaveWhitelistAllAppIdArray);
+ mLocalActivityManager.setDeviceIdleWhitelist(
+ mPowerSaveWhitelistAllAppIdArray, mPowerSaveWhitelistExceptIdleAppIdArray);
mLocalPowerManager.setDeviceIdleWhitelist(mPowerSaveWhitelistAllAppIdArray);
mLocalActivityManager.registerScreenObserver(mScreenObserver);
@@ -2576,11 +2577,8 @@
mPowerSaveWhitelistUserAppIdArray = buildAppIdArray(null,
mPowerSaveWhitelistUserApps, mPowerSaveWhitelistUserAppIds);
if (mLocalActivityManager != null) {
- if (DEBUG) {
- Slog.d(TAG, "Setting activity manager whitelist to "
- + Arrays.toString(mPowerSaveWhitelistAllAppIdArray));
- }
- mLocalActivityManager.setDeviceIdleWhitelist(mPowerSaveWhitelistAllAppIdArray);
+ mLocalActivityManager.setDeviceIdleWhitelist(
+ mPowerSaveWhitelistAllAppIdArray, mPowerSaveWhitelistExceptIdleAppIdArray);
}
if (mLocalPowerManager != null) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index e95a932..2458234 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1376,11 +1376,16 @@
DeviceIdleController.LocalService mLocalDeviceIdleController;
/**
- * Set of app ids that are whitelisted for device idle and thus background check.
+ * Power-save whitelisted app-ids (not including except-idle-whitelisted ones).
*/
int[] mDeviceIdleWhitelist = new int[0];
/**
+ * Power-save whitelisted app-ids (including except-idle-whitelisted ones).
+ */
+ int[] mDeviceIdleExceptIdleWhitelist = new int[0];
+
+ /**
* Set of app ids that are temporarily allowed to escape bg check due to high-pri message
*/
int[] mDeviceIdleTempWhitelist = new int[0];
@@ -9316,7 +9321,7 @@
// If force-background-check is enabled, restrict all apps that aren't whitelisted.
if (mForceBackgroundCheck &&
!UserHandle.isCore(uid) &&
- !isOnDeviceIdleWhitelistLocked(uid)) {
+ !isOnDeviceIdleWhitelistLocked(uid, /*allowExceptIdleToo=*/ true)) {
if (DEBUG_BACKGROUND_CHECK) {
Slog.i(TAG, "Force background check: " +
uid + "/" + packageName + " restricted");
@@ -9354,7 +9359,7 @@
}
// Is this app on the battery whitelist?
- if (isOnDeviceIdleWhitelistLocked(uid)) {
+ if (isOnDeviceIdleWhitelistLocked(uid, /*allowExceptIdleToo=*/ false)) {
if (DEBUG_BACKGROUND_CHECK) {
Slog.i(TAG, "App " + uid + "/" + packageName
+ " on idle whitelist; not restricted in background");
@@ -9396,9 +9401,12 @@
? appRestrictedInBackgroundLocked(uid, packageName, packageTargetSdk)
: appServicesRestrictedInBackgroundLocked(uid, packageName,
packageTargetSdk);
- if (DEBUG_BACKGROUND_CHECK) Slog.d(TAG, "checkAllowBackground: uid=" + uid
- + " pkg=" + packageName + " startMode=" + startMode
- + " onwhitelist=" + isOnDeviceIdleWhitelistLocked(uid));
+ if (DEBUG_BACKGROUND_CHECK) {
+ Slog.d(TAG, "checkAllowBackground: uid=" + uid
+ + " pkg=" + packageName + " startMode=" + startMode
+ + " onwhitelist=" + isOnDeviceIdleWhitelistLocked(uid, false)
+ + " onwhitelist(ei)=" + isOnDeviceIdleWhitelistLocked(uid, true));
+ }
if (startMode == ActivityManager.APP_START_MODE_DELAYED) {
// This is an old app that has been forced into a "compatible as possible"
// mode of background check. To increase compatibility, we will allow other
@@ -9425,9 +9433,14 @@
/**
* @return whether a UID is in the system, user or temp doze whitelist.
*/
- boolean isOnDeviceIdleWhitelistLocked(int uid) {
+ boolean isOnDeviceIdleWhitelistLocked(int uid, boolean allowExceptIdleToo) {
final int appId = UserHandle.getAppId(uid);
- return Arrays.binarySearch(mDeviceIdleWhitelist, appId) >= 0
+
+ final int[] whitelist = allowExceptIdleToo
+ ? mDeviceIdleExceptIdleWhitelist
+ : mDeviceIdleWhitelist;
+
+ return Arrays.binarySearch(whitelist, appId) >= 0
|| Arrays.binarySearch(mDeviceIdleTempWhitelist, appId) >= 0
|| mPendingTempWhitelist.indexOfKey(uid) >= 0;
}
@@ -15305,7 +15318,6 @@
public void onLimitReached(int uid) {
Slog.wtf(TAG, "Uid " + uid + " sent too many Binders to uid "
+ Process.myUid());
- Binder.dumpProxyDebugInfo();
if (uid == Process.SYSTEM_UID) {
Slog.i(TAG, "Skipping kill (uid is SYSTEM)");
} else {
@@ -16969,6 +16981,8 @@
}
}
pw.println(" mDeviceIdleWhitelist=" + Arrays.toString(mDeviceIdleWhitelist));
+ pw.println(" mDeviceIdleExceptIdleWhitelist="
+ + Arrays.toString(mDeviceIdleExceptIdleWhitelist));
pw.println(" mDeviceIdleTempWhitelist=" + Arrays.toString(mDeviceIdleTempWhitelist));
if (mPendingTempWhitelist.size() > 0) {
pw.println(" mPendingTempWhitelist:");
@@ -21021,9 +21035,15 @@
}
private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
- int callingUid, int[] users) {
+ int callingUid, boolean callerInstantApp, int[] users) {
// TODO: come back and remove this assumption to triage all broadcasts
int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
+ // Instant apps should be able to send broadcasts to themselves, so we would
+ // match instant receivers and later the broadcast queue would enforce that
+ // the broadcast cannot be sent to a receiver outside the instant UID.
+ if (callerInstantApp) {
+ pmFlags |= PackageManager.MATCH_INSTANT;
+ }
List<ResolveInfo> receivers = null;
try {
@@ -21652,7 +21672,8 @@
// Need to resolve the intent to interested receivers...
if ((intent.getFlags()&Intent.FLAG_RECEIVER_REGISTERED_ONLY)
== 0) {
- receivers = collectReceiverComponents(intent, resolvedType, callingUid, users);
+ receivers = collectReceiverComponents(intent, resolvedType, callingUid,
+ callerInstantApp, users);
}
if (intent.getComponent() == null) {
if (userId == UserHandle.USER_ALL && callingUid == SHELL_UID) {
@@ -26421,9 +26442,10 @@
}
@Override
- public void setDeviceIdleWhitelist(int[] appids) {
+ public void setDeviceIdleWhitelist(int[] allAppids, int[] exceptIdleAppids) {
synchronized (ActivityManagerService.this) {
- mDeviceIdleWhitelist = appids;
+ mDeviceIdleWhitelist = allAppids;
+ mDeviceIdleExceptIdleWhitelist = exceptIdleAppids;
}
}
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 06924e4..75f2723 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -778,6 +778,13 @@
}
}
+ /**
+ * See {@link AppWindowContainerController#setWillCloseOrEnterPip(boolean)}
+ */
+ void setWillCloseOrEnterPip(boolean willCloseOrEnterPip) {
+ getWindowContainerController().setWillCloseOrEnterPip(willCloseOrEnterPip);
+ }
+
static class Token extends IApplicationToken.Stub {
private final WeakReference<ActivityRecord> weakActivity;
private final String name;
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 75ba52d..cc7a230 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1556,6 +1556,7 @@
if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Complete pause: " + prev);
if (prev != null) {
+ prev.setWillCloseOrEnterPip(false);
final boolean wasStopping = prev.isState(STOPPING);
prev.setState(PAUSED, "completePausedLocked");
if (prev.finishing) {
@@ -1653,6 +1654,13 @@
void addToStopping(ActivityRecord r, boolean scheduleIdle, boolean idleDelayed) {
if (!mStackSupervisor.mStoppingActivities.contains(r)) {
mStackSupervisor.mStoppingActivities.add(r);
+
+ // Some activity is waiting for another activity to become visible before it's being
+ // stopped, which means that we also want to wait with stopping this one to avoid
+ // flickers.
+ if (!mStackSupervisor.mActivitiesWaitingForVisibleActivity.isEmpty()) {
+ mStackSupervisor.mActivitiesWaitingForVisibleActivity.add(r);
+ }
}
// If we already have a few activities waiting to stop, then give up
@@ -2414,11 +2422,12 @@
mStackSupervisor.setLaunchSource(next.info.applicationInfo.uid);
boolean lastResumedCanPip = false;
+ ActivityRecord lastResumed = null;
final ActivityStack lastFocusedStack = mStackSupervisor.getLastStack();
if (lastFocusedStack != null && lastFocusedStack != this) {
// So, why aren't we using prev here??? See the param comment on the method. prev doesn't
// represent the last resumed activity. However, the last focus stack does if it isn't null.
- final ActivityRecord lastResumed = lastFocusedStack.mResumedActivity;
+ lastResumed = lastFocusedStack.mResumedActivity;
if (userLeaving && inMultiWindowMode() && lastFocusedStack.shouldBeVisible(next)) {
// The user isn't leaving if this stack is the multi-window mode and the last
// focused stack should still be visible.
@@ -2453,6 +2462,9 @@
mService.updateLruProcessLocked(next.app, true, null);
}
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
+ if (lastResumed != null) {
+ lastResumed.setWillCloseOrEnterPip(true);
+ }
return true;
} else if (mResumedActivity == next && next.isState(RESUMED)
&& mStackSupervisor.allResumedActivitiesComplete()) {
@@ -3553,8 +3565,8 @@
int taskNdx = mTaskHistory.indexOf(finishedTask);
final TaskRecord task = finishedTask;
int activityNdx = task.mActivities.indexOf(r);
- mWindowManager.prepareAppTransition(TRANSIT_CRASHING_ACTIVITY_CLOSE, false /* TODO */,
- 0, true /* forceOverride */);
+ mWindowManager.prepareAppTransition(TRANSIT_CRASHING_ACTIVITY_CLOSE,
+ false /* alwaysKeepCurrent */);
finishActivityLocked(r, Activity.RESULT_CANCELED, null, reason, false);
finishedTask = task;
// Also terminate any activities below it that aren't yet
@@ -5005,7 +5017,7 @@
// Force the destroy to skip right to removal.
r.app = null;
mWindowManager.prepareAppTransition(TRANSIT_CRASHING_ACTIVITY_CLOSE,
- false /* TODO */, 0, true /* forceOverride */);
+ false /* alwaysKeepCurrent */);
finishCurrentActivityLocked(r, FINISH_IMMEDIATELY, false,
"handleAppCrashedLocked");
}
diff --git a/services/core/java/com/android/server/am/KeyguardController.java b/services/core/java/com/android/server/am/KeyguardController.java
index ddf9552..30fa72f 100644
--- a/services/core/java/com/android/server/am/KeyguardController.java
+++ b/services/core/java/com/android/server/am/KeyguardController.java
@@ -129,6 +129,7 @@
mKeyguardShowing = keyguardShowing;
mAodShowing = aodShowing;
mSecondaryDisplayShowing = secondaryDisplayShowing;
+ mWindowManager.setAodShowing(aodShowing);
if (showingChanged) {
dismissDockedStackIfNeeded();
setKeyguardGoingAway(false);
diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
index fceacba..f523d59 100644
--- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java
+++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
@@ -224,15 +224,14 @@
}
/**
- * Copies the stacked clat link in oldLp, if any, to the LinkProperties in mNetwork.
+ * Copies the stacked clat link in oldLp, if any, to the passed LinkProperties.
* This is necessary because the LinkProperties in mNetwork come from the transport layer, which
* has no idea that 464xlat is running on top of it.
*/
- public void fixupLinkProperties(LinkProperties oldLp) {
+ public void fixupLinkProperties(LinkProperties oldLp, LinkProperties lp) {
if (!isRunning()) {
return;
}
- LinkProperties lp = mNetwork.linkProperties;
if (lp == null || lp.getAllInterfaceNames().contains(mIface)) {
return;
}
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index a9198983..b77c144 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -117,6 +117,7 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -895,6 +896,42 @@
.compareTo(MOST_IPV6_ADDRESSES_COUNT) >= 0;
}
+ /**
+ * Attempt to perform a seamless handover of VPNs by only updating LinkProperties without
+ * registering a new NetworkAgent. This is not always possible if the new VPN configuration
+ * has certain changes, in which case this method would just return {@code false}.
+ */
+ private boolean updateLinkPropertiesInPlaceIfPossible(NetworkAgent agent, VpnConfig oldConfig) {
+ // NetworkMisc cannot be updated without registering a new NetworkAgent.
+ if (oldConfig.allowBypass != mConfig.allowBypass) {
+ Log.i(TAG, "Handover not possible due to changes to allowBypass");
+ return false;
+ }
+
+ // TODO: we currently do not support seamless handover if the allowed or disallowed
+ // applications have changed. Consider diffing UID ranges and only applying the delta.
+ if (!Objects.equals(oldConfig.allowedApplications, mConfig.allowedApplications) ||
+ !Objects.equals(oldConfig.disallowedApplications, mConfig.disallowedApplications)) {
+ Log.i(TAG, "Handover not possible due to changes to whitelisted/blacklisted apps");
+ return false;
+ }
+
+ LinkProperties lp = makeLinkProperties();
+ final boolean hadInternetCapability = mNetworkCapabilities.hasCapability(
+ NetworkCapabilities.NET_CAPABILITY_INTERNET);
+ final boolean willHaveInternetCapability = providesRoutesToMostDestinations(lp);
+ if (hadInternetCapability != willHaveInternetCapability) {
+ // A seamless handover would have led to a change to INTERNET capability, which
+ // is supposed to be immutable for a given network. In this case bail out and do not
+ // perform handover.
+ Log.i(TAG, "Handover not possible due to changes to INTERNET capability");
+ return false;
+ }
+
+ agent.sendLinkProperties(lp);
+ return true;
+ }
+
private void agentConnect() {
LinkProperties lp = makeLinkProperties();
@@ -1003,13 +1040,11 @@
String oldInterface = mInterface;
Connection oldConnection = mConnection;
NetworkAgent oldNetworkAgent = mNetworkAgent;
- mNetworkAgent = null;
Set<UidRange> oldUsers = mNetworkCapabilities.getUids();
// Configure the interface. Abort if any of these steps fails.
ParcelFileDescriptor tun = ParcelFileDescriptor.adoptFd(jniCreate(config.mtu));
try {
- updateState(DetailedState.CONNECTING, "establish");
String interfaze = jniGetName(tun.getFd());
// TEMP use the old jni calls until there is support for netd address setting
@@ -1037,15 +1072,26 @@
mConfig = config;
// Set up forwarding and DNS rules.
- agentConnect();
+ // First attempt to do a seamless handover that only changes the interface name and
+ // parameters. If that fails, disconnect.
+ if (oldConfig != null
+ && updateLinkPropertiesInPlaceIfPossible(mNetworkAgent, oldConfig)) {
+ // Keep mNetworkAgent unchanged
+ } else {
+ mNetworkAgent = null;
+ updateState(DetailedState.CONNECTING, "establish");
+ // Set up forwarding and DNS rules.
+ agentConnect();
+ // Remove the old tun's user forwarding rules
+ // The new tun's user rules have already been added above so they will take over
+ // as rules are deleted. This prevents data leakage as the rules are moved over.
+ agentDisconnect(oldNetworkAgent);
+ }
if (oldConnection != null) {
mContext.unbindService(oldConnection);
}
- // Remove the old tun's user forwarding rules
- // The new tun's user rules have already been added so they will take over
- // as rules are deleted. This prevents data leakage as the rules are moved over.
- agentDisconnect(oldNetworkAgent);
+
if (oldInterface != null && !oldInterface.equals(interfaze)) {
jniReset(oldInterface);
}
diff --git a/services/core/java/com/android/server/connectivity/tethering/OffloadController.java b/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
index cff216c..a3c2998 100644
--- a/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
+++ b/services/core/java/com/android/server/connectivity/tethering/OffloadController.java
@@ -282,6 +282,7 @@
return stats;
}
+ @Override
public void setInterfaceQuota(String iface, long quotaBytes) {
mHandler.post(() -> {
if (quotaBytes == ITetheringStatsProvider.QUOTA_UNLIMITED) {
diff --git a/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java b/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
index 76195c4..207f867 100644
--- a/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
+++ b/services/core/java/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
@@ -355,6 +355,7 @@
boolean success;
String errMsg;
+ @Override
public String toString() {
if (success) {
return "ok";
diff --git a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
index 6371d77..fbee86a 100644
--- a/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
+++ b/services/core/java/com/android/server/connectivity/tethering/TetherInterfaceStateMachine.java
@@ -16,6 +16,8 @@
package com.android.server.connectivity.tethering;
+import static android.net.util.NetworkConstants.asByte;
+import static android.net.util.NetworkConstants.FF;
import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH;
import android.net.ConnectivityManager;
@@ -64,6 +66,7 @@
*/
public class TetherInterfaceStateMachine extends StateMachine {
private static final IpPrefix LINK_LOCAL_PREFIX = new IpPrefix("fe80::/64");
+ private static final byte DOUG_ADAMS = (byte) 42;
private static final String USB_NEAR_IFACE_ADDR = "192.168.42.129";
private static final int USB_PREFIX_LENGTH = 24;
@@ -204,7 +207,7 @@
ipAsString = USB_NEAR_IFACE_ADDR;
prefixLen = USB_PREFIX_LENGTH;
} else if (mInterfaceType == ConnectivityManager.TETHERING_WIFI) {
- ipAsString = WIFI_HOST_IFACE_ADDR;
+ ipAsString = getRandomWifiIPv4Address();
prefixLen = WIFI_HOST_IFACE_PREFIX_LENGTH;
} else {
// Nothing to do, BT does this elsewhere.
@@ -253,6 +256,16 @@
return true;
}
+ private String getRandomWifiIPv4Address() {
+ try {
+ byte[] bytes = NetworkUtils.numericToInetAddress(WIFI_HOST_IFACE_ADDR).getAddress();
+ bytes[3] = getRandomSanitizedByte(DOUG_ADAMS, asByte(0), asByte(1), FF);
+ return InetAddress.getByAddress(bytes).getHostAddress();
+ } catch (Exception e) {
+ return WIFI_HOST_IFACE_ADDR;
+ }
+ }
+
private boolean startIPv6() {
mInterfaceParams = mDeps.getInterfaceParams(mIfaceName);
if (mInterfaceParams == null) {
@@ -757,7 +770,7 @@
// Given a prefix like 2001:db8::/64 return an address like 2001:db8::1.
private static Inet6Address getLocalDnsIpFor(IpPrefix localPrefix) {
final byte[] dnsBytes = localPrefix.getRawAddress();
- dnsBytes[dnsBytes.length - 1] = getRandomNonZeroByte();
+ dnsBytes[dnsBytes.length - 1] = getRandomSanitizedByte(DOUG_ADAMS, asByte(0), asByte(1));
try {
return Inet6Address.getByAddress(null, dnsBytes, 0);
} catch (UnknownHostException e) {
@@ -766,10 +779,11 @@
}
}
- private static byte getRandomNonZeroByte() {
+ private static byte getRandomSanitizedByte(byte dflt, byte... excluded) {
final byte random = (byte) (new Random()).nextInt();
- // Don't pick the subnet-router anycast address, since that might be
- // in use on the upstream already.
- return (random != 0) ? random : 0x1;
+ for (int value : excluded) {
+ if (random == value) return dflt;
+ }
+ return random;
}
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 8f7fa1b..5ba1e0f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -4443,7 +4443,7 @@
if (index < 0) {
mNotificationList.add(r);
mUsageStats.registerPostedByApp(r);
- r.setInterruptive(true);
+ r.setInterruptive(isVisuallyInterruptive(null, r));
} else {
old = mNotificationList.get(index);
mNotificationList.set(index, r);
@@ -4530,6 +4530,14 @@
return true;
}
+ if (r == null) {
+ if (DEBUG_INTERRUPTIVENESS) {
+ Log.v(TAG, "INTERRUPTIVENESS: "
+ + r.getKey() + " is not interruptive: null");
+ }
+ return false;
+ }
+
Notification oldN = old.sbn.getNotification();
Notification newN = r.sbn.getNotification();
@@ -4543,7 +4551,7 @@
// Ignore visual interruptions from foreground services because users
// consider them one 'session'. Count them for everything else.
- if (r != null && (r.sbn.getNotification().flags & FLAG_FOREGROUND_SERVICE) != 0) {
+ if ((r.sbn.getNotification().flags & FLAG_FOREGROUND_SERVICE) != 0) {
if (DEBUG_INTERRUPTIVENESS) {
Log.v(TAG, "INTERRUPTIVENESS: "
+ r.getKey() + " is not interruptive: foreground service");
@@ -4551,6 +4559,15 @@
return false;
}
+ // Ignore summary updates because we don't display most of the information.
+ if (r.sbn.isGroup() && r.sbn.getNotification().isGroupSummary()) {
+ if (DEBUG_INTERRUPTIVENESS) {
+ Log.v(TAG, "INTERRUPTIVENESS: "
+ + r.getKey() + " is not interruptive: summary");
+ }
+ return false;
+ }
+
final String oldTitle = String.valueOf(oldN.extras.get(Notification.EXTRA_TITLE));
final String newTitle = String.valueOf(newN.extras.get(Notification.EXTRA_TITLE));
if (!Objects.equals(oldTitle, newTitle)) {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 605644e..1010ce1 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4789,7 +4789,8 @@
// require the permission to be held; the calling uid and given user id referring
// to the same user is not sufficient
mPermissionManager.enforceCrossUserPermission(
- Binder.getCallingUid(), userId, false, false, true,
+ Binder.getCallingUid(), userId, false, false,
+ !isRecentsAccessingChildProfiles(Binder.getCallingUid(), userId),
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission at "
+ Debug.getCallers(5));
} else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0 && isCallerSystemUser
@@ -6628,7 +6629,8 @@
}
}
return applyPostResolutionFilter(
- list, instantAppPkgName, allowDynamicSplits, filterCallingUid, userId, intent);
+ list, instantAppPkgName, allowDynamicSplits, filterCallingUid, resolveForStart,
+ userId, intent);
}
// reader
@@ -6647,7 +6649,7 @@
xpResult.add(xpResolveInfo);
return applyPostResolutionFilter(
filterIfNotSystemUser(xpResult, userId), instantAppPkgName,
- allowDynamicSplits, filterCallingUid, userId, intent);
+ allowDynamicSplits, filterCallingUid, resolveForStart, userId, intent);
}
// Check for results in the current profile.
@@ -6687,14 +6689,16 @@
// result straight away.
result.add(xpDomainInfo.resolveInfo);
return applyPostResolutionFilter(result, instantAppPkgName,
- allowDynamicSplits, filterCallingUid, userId, intent);
+ allowDynamicSplits, filterCallingUid, resolveForStart, userId,
+ intent);
}
} else if (result.size() <= 1 && !addInstant) {
// No result in parent user and <= 1 result in current profile, and we
// are not going to add emphemeral app, so we can return the result without
// further processing.
return applyPostResolutionFilter(result, instantAppPkgName,
- allowDynamicSplits, filterCallingUid, userId, intent);
+ allowDynamicSplits, filterCallingUid, resolveForStart, userId,
+ intent);
}
// We have more than one candidate (combining results from current and parent
// profile), so we need filtering and sorting.
@@ -6730,7 +6734,8 @@
Collections.sort(result, mResolvePrioritySorter);
}
return applyPostResolutionFilter(
- result, instantAppPkgName, allowDynamicSplits, filterCallingUid, userId, intent);
+ result, instantAppPkgName, allowDynamicSplits, filterCallingUid, resolveForStart,
+ userId, intent);
}
private List<ResolveInfo> maybeAddInstantAppInstaller(List<ResolveInfo> result, Intent intent,
@@ -6940,8 +6945,8 @@
* @return A filtered list of resolved activities.
*/
private List<ResolveInfo> applyPostResolutionFilter(List<ResolveInfo> resolveInfos,
- String ephemeralPkgName, boolean allowDynamicSplits, int filterCallingUid, int userId,
- Intent intent) {
+ String ephemeralPkgName, boolean allowDynamicSplits, int filterCallingUid,
+ boolean resolveForStart, int userId, Intent intent) {
final boolean blockInstant = intent.isWebIntent() && areWebInstantAppsDisabled();
for (int i = resolveInfos.size() - 1; i >= 0; i--) {
final ResolveInfo info = resolveInfos.get(i);
@@ -7000,6 +7005,13 @@
} else if (ephemeralPkgName.equals(info.activityInfo.packageName)) {
// caller is same app; don't need to apply any other filtering
continue;
+ } else if (resolveForStart
+ && (intent.isWebIntent()
+ || (intent.getFlags() & Intent.FLAG_ACTIVITY_MATCH_EXTERNAL) != 0)
+ && intent.getPackage() == null
+ && intent.getComponent() == null) {
+ // ephemeral apps can launch other ephemeral apps indirectly
+ continue;
}
// allow activities that have been explicitly exposed to ephemeral apps
final boolean isEphemeralApp = info.activityInfo.applicationInfo.isInstantApp();
@@ -7578,7 +7590,8 @@
}
}
return applyPostResolutionFilter(
- list, instantAppPkgName, allowDynamicSplits, callingUid, userId, intent);
+ list, instantAppPkgName, allowDynamicSplits, callingUid, false, userId,
+ intent);
}
// reader
@@ -7588,14 +7601,16 @@
final List<ResolveInfo> result =
mReceivers.queryIntent(intent, resolvedType, flags, userId);
return applyPostResolutionFilter(
- result, instantAppPkgName, allowDynamicSplits, callingUid, userId, intent);
+ result, instantAppPkgName, allowDynamicSplits, callingUid, false, userId,
+ intent);
}
final PackageParser.Package pkg = mPackages.get(pkgName);
if (pkg != null) {
final List<ResolveInfo> result = mReceivers.queryIntentForPackage(
intent, resolvedType, flags, pkg.receivers, userId);
return applyPostResolutionFilter(
- result, instantAppPkgName, allowDynamicSplits, callingUid, userId, intent);
+ result, instantAppPkgName, allowDynamicSplits, callingUid, false, userId,
+ intent);
}
return Collections.emptyList();
}
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 1ae59cb..c9aa1ef 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -833,11 +833,11 @@
getSystemPackage(textClassifierPackageName);
if (textClassifierPackage != null
&& doesPackageSupportRuntimePermissions(textClassifierPackage)) {
- grantRuntimePermissions(textClassifierPackage, PHONE_PERMISSIONS, false, userId);
- grantRuntimePermissions(textClassifierPackage, SMS_PERMISSIONS, false, userId);
- grantRuntimePermissions(textClassifierPackage, CALENDAR_PERMISSIONS, false, userId);
- grantRuntimePermissions(textClassifierPackage, LOCATION_PERMISSIONS, false, userId);
- grantRuntimePermissions(textClassifierPackage, CONTACTS_PERMISSIONS, false, userId);
+ grantRuntimePermissions(textClassifierPackage, PHONE_PERMISSIONS, true, userId);
+ grantRuntimePermissions(textClassifierPackage, SMS_PERMISSIONS, true, userId);
+ grantRuntimePermissions(textClassifierPackage, CALENDAR_PERMISSIONS, true, userId);
+ grantRuntimePermissions(textClassifierPackage, LOCATION_PERMISSIONS, true, userId);
+ grantRuntimePermissions(textClassifierPackage, CONTACTS_PERMISSIONS, true, userId);
}
}
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 03e34d3..7d6b896 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -816,6 +816,8 @@
private final MutableBoolean mTmpBoolean = new MutableBoolean(false);
+ private boolean mAodShowing;
+
private static final int MSG_ENABLE_POINTER_LOCATION = 1;
private static final int MSG_DISABLE_POINTER_LOCATION = 2;
private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3;
@@ -3058,8 +3060,15 @@
boolean keyguardLocked = isKeyguardLocked();
boolean hideDockDivider = attrs.type == TYPE_DOCK_DIVIDER
&& !mWindowManagerInternal.isStackVisible(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
+ // If AOD is showing, the IME should be hidden. However, sometimes the AOD is considered
+ // hidden because it's in the process of hiding, but it's still being shown on screen.
+ // In that case, we want to continue hiding the IME until the windows have completed
+ // drawing. This way, we know that the IME can be safely shown since the other windows are
+ // now shown.
+ final boolean hideIme =
+ win.isInputMethodWindow() && (mAodShowing || !mWindowManagerDrawComplete);
return (keyguardLocked && !allowWhenLocked && win.getDisplayId() == DEFAULT_DISPLAY)
- || hideDockDivider;
+ || hideDockDivider || hideIme;
}
/** {@inheritDoc} */
@@ -8980,4 +8989,13 @@
public void onLockTaskStateChangedLw(int lockTaskState) {
mImmersiveModeConfirmation.onLockTaskModeChangedLw(lockTaskState);
}
+
+ @Override
+ public boolean setAodShowing(boolean aodShowing) {
+ if (mAodShowing != aodShowing) {
+ mAodShowing = aodShowing;
+ return true;
+ }
+ return false;
+ }
}
diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
index 02dd6e6..a02ee22 100644
--- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java
+++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
@@ -1774,4 +1774,11 @@
* {@link ActivityManager#LOCK_TASK_MODE_PINNED}.
*/
void onLockTaskStateChangedLw(int lockTaskState);
+
+ /**
+ * Updates the flag about whether AOD is showing.
+ *
+ * @return whether the value was changed.
+ */
+ boolean setAodShowing(boolean aodShowing);
}
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 2f174c2..d73606f 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -2003,8 +2003,11 @@
case TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE: {
return "TRANSIT_TRANSLUCENT_ACTIVITY_CLOSE";
}
+ case TRANSIT_CRASHING_ACTIVITY_CLOSE: {
+ return "TRANSIT_CRASHING_ACTIVITY_CLOSE";
+ }
default: {
- return "<UNKNOWN>";
+ return "<UNKNOWN: " + transition + ">";
}
}
}
@@ -2133,15 +2136,17 @@
+ " " + this
+ " alwaysKeepCurrent=" + alwaysKeepCurrent
+ " Callers=" + Debug.getCallers(3));
+ final boolean allowSetCrashing = !isKeyguardTransit(mNextAppTransition)
+ && transit == TRANSIT_CRASHING_ACTIVITY_CLOSE;
if (forceOverride || isKeyguardTransit(transit) || !isTransitionSet()
- || mNextAppTransition == TRANSIT_NONE) {
+ || mNextAppTransition == TRANSIT_NONE || allowSetCrashing) {
setAppTransition(transit, flags);
}
// We never want to change from a Keyguard transit to a non-Keyguard transit, as our logic
// relies on the fact that we always execute a Keyguard transition after preparing one. We
// also don't want to change away from a crashing transition.
- else if (!alwaysKeepCurrent && !isKeyguardTransit(transit)
- && transit != TRANSIT_CRASHING_ACTIVITY_CLOSE) {
+ else if (!alwaysKeepCurrent && !isKeyguardTransit(mNextAppTransition)
+ && mNextAppTransition != TRANSIT_CRASHING_ACTIVITY_CLOSE) {
if (transit == TRANSIT_TASK_OPEN && isTransitionEqual(TRANSIT_TASK_CLOSE)) {
// Opening a new task always supersedes a close for the anim.
setAppTransition(transit, flags);
diff --git a/services/core/java/com/android/server/wm/AppWindowContainerController.java b/services/core/java/com/android/server/wm/AppWindowContainerController.java
index 644e3c3..4f15c5d 100644
--- a/services/core/java/com/android/server/wm/AppWindowContainerController.java
+++ b/services/core/java/com/android/server/wm/AppWindowContainerController.java
@@ -753,6 +753,21 @@
return mListener != null && mListener.keyDispatchingTimedOut(reason, windowPid);
}
+ /**
+ * Notifies AWT that this app is waiting to pause in order to determine if it will enter PIP.
+ * This information helps AWT know that the app is in the process of pausing before it gets the
+ * signal on the WM side.
+ */
+ public void setWillCloseOrEnterPip(boolean willCloseOrEnterPip) {
+ synchronized (mWindowMap) {
+ if (mContainer == null) {
+ return;
+ }
+
+ mContainer.setWillCloseOrEnterPip(willCloseOrEnterPip);
+ }
+ }
+
@Override
public String toString() {
return "AppWindowContainerController{"
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 0ba5a56..e45de45 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -32,12 +32,11 @@
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-import static android.view.WindowManager.TRANSIT_DOCK_TASK_FROM_RECENTS;
import static android.view.WindowManager.TRANSIT_WALLPAPER_OPEN;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static android.view.WindowManager.TRANSIT_UNSET;
-import static com.android.server.wm.AppTransition.isKeyguardGoingAwayTransit;
+
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
@@ -257,6 +256,13 @@
private RemoteAnimationDefinition mRemoteAnimationDefinition;
private AnimatingAppWindowTokenRegistry mAnimatingAppWindowTokenRegistry;
+ /**
+ * A flag to determine if this AWT is in the process of closing or entering PIP. This is needed
+ * to help AWT know that the app is in the process of closing but hasn't yet started closing on
+ * the WM side.
+ */
+ private boolean mWillCloseOrEnterPip;
+
AppWindowToken(WindowManagerService service, IApplicationToken token, boolean voiceInteraction,
DisplayContent dc, long inputDispatchingTimeoutNanos, boolean fullscreen,
boolean showForAllUsers, int targetSdk, int orientation, int rotationAnimationHint,
@@ -2235,4 +2241,21 @@
boolean isLetterboxOverlappingWith(Rect rect) {
return mLetterbox != null && mLetterbox.isOverlappingWith(rect);
}
+
+ /**
+ * Sets if this AWT is in the process of closing or entering PIP.
+ * {@link #mWillCloseOrEnterPip}}
+ */
+ void setWillCloseOrEnterPip(boolean willCloseOrEnterPip) {
+ mWillCloseOrEnterPip = willCloseOrEnterPip;
+ }
+
+ /**
+ * Returns whether this AWT is considered closing. Conditions are either
+ * 1. Is this app animating and was requested to be hidden
+ * 2. App is delayed closing since it might enter PIP.
+ */
+ boolean isClosingOrEnteringPip() {
+ return (isAnimating() && hiddenRequested) || mWillCloseOrEnterPip;
+ }
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index b59e728..b0e6208 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -2510,7 +2510,7 @@
// since its above other stacks in the ordering list, but layed out below the others.
if (curTarget != null && curTarget.isDisplayedLw() && curTarget.isClosing()
&& (target == null || target.isActivityTypeHome())) {
- if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "New target is home while current target is"
+ if (DEBUG_INPUT_METHOD) Slog.v(TAG_WM, "New target is home while current target is "
+ "closing, not changing");
return curTarget;
}
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index c59540b..76c9c26 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -1682,6 +1682,10 @@
if (finalStackSize != null) {
setPinnedStackSize(finalStackSize, null);
+ } else {
+ // We have been canceled, so the final stack size is null, still run the
+ // animation-end logic
+ onPipAnimationEndResize();
}
try {
@@ -1693,6 +1697,9 @@
} catch (RemoteException e) {
// I don't believe you...
}
+ } else {
+ // No PiP animation, just run the normal animation-end logic
+ onPipAnimationEndResize();
}
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
index 7b775f5..c366e4d 100644
--- a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
+++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
@@ -54,7 +54,7 @@
static final boolean DEBUG_STARTING_WINDOW_VERBOSE = false;
static final boolean DEBUG_STARTING_WINDOW = DEBUG_STARTING_WINDOW_VERBOSE || false;
static final boolean DEBUG_WALLPAPER = false;
- static final boolean DEBUG_WALLPAPER_LIGHT = true || DEBUG_WALLPAPER;
+ static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER;
static final boolean DEBUG_DRAG = false;
static final boolean DEBUG_SCREEN_ON = false;
static final boolean DEBUG_SCREENSHOT = false;
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 2885b6f..7a2c28b 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -7588,4 +7588,17 @@
mPolicy.onLockTaskStateChangedLw(lockTaskState);
}
}
+
+ /**
+ * Updates {@link WindowManagerPolicy} with new value about whether AOD is showing. If AOD
+ * has changed, this will trigger a {@link WindowSurfacePlacer#performSurfacePlacement} to
+ * ensure the new value takes effect.
+ */
+ public void setAodShowing(boolean aodShowing) {
+ synchronized (mWindowMap) {
+ if (mPolicy.setAodShowing(aodShowing)) {
+ mWindowPlacerLocked.performSurfacePlacement();
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index febc1a9..bee70a0 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -20,8 +20,6 @@
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.MODE_DEFAULT;
import static android.app.AppOpsManager.OP_NONE;
-import static android.app.AppOpsManager.OP_SYSTEM_ALERT_WINDOW;
-import static android.app.AppOpsManager.OP_TOAST_WINDOW;
import static android.os.PowerManager.DRAW_WAKE_LOCK;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -2737,8 +2735,7 @@
}
boolean isClosing() {
- return mAnimatingExit || (mAppToken != null && mAppToken.isAnimating()
- && mAppToken.hiddenRequested);
+ return mAnimatingExit || (mAppToken != null && mAppToken.isClosingOrEnteringPip());
}
void addWinAnimatorToList(ArrayList<WindowStateAnimator> animators) {
diff --git a/services/net/java/android/net/util/NetworkConstants.java b/services/net/java/android/net/util/NetworkConstants.java
index 53fd01f..de04fd0 100644
--- a/services/net/java/android/net/util/NetworkConstants.java
+++ b/services/net/java/android/net/util/NetworkConstants.java
@@ -53,7 +53,7 @@
public static final int ETHER_HEADER_LEN = 14;
- private static final byte FF = asByte(0xff);
+ public static final byte FF = asByte(0xff);
public static final byte[] ETHER_ADDR_BROADCAST = {
FF, FF, FF, FF, FF, FF
};
diff --git a/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
index 8e5aec3..be7d781 100644
--- a/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/AppTransitionTests.java
@@ -17,6 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.TRANSIT_ACTIVITY_OPEN;
+import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static org.junit.Assert.assertEquals;
@@ -35,7 +36,7 @@
/**
* Test class for {@link AppTransition}.
*
- * runtest frameworks-services -c com.android.server.wm.AppTransitionTests
+ * atest AppTransitionTests
*/
@SmallTest
@Presubmit
@@ -60,10 +61,31 @@
}
@Test
+ public void testKeyguardKeep() throws Exception {
+ mWm.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, false /* alwaysKeepCurrent */);
+ mWm.prepareAppTransition(TRANSIT_ACTIVITY_OPEN, false /* alwaysKeepCurrent */);
+ assertEquals(TRANSIT_KEYGUARD_GOING_AWAY, mWm.mAppTransition.getAppTransition());
+ }
+
+ @Test
public void testForceOverride() throws Exception {
mWm.prepareAppTransition(TRANSIT_KEYGUARD_UNOCCLUDE, false /* alwaysKeepCurrent */);
mWm.prepareAppTransition(TRANSIT_ACTIVITY_OPEN, false /* alwaysKeepCurrent */,
0 /* flags */, true /* forceOverride */);
assertEquals(TRANSIT_ACTIVITY_OPEN, mWm.mAppTransition.getAppTransition());
}
+
+ @Test
+ public void testCrashing() throws Exception {
+ mWm.prepareAppTransition(TRANSIT_ACTIVITY_OPEN, false /* alwaysKeepCurrent */);
+ mWm.prepareAppTransition(TRANSIT_CRASHING_ACTIVITY_CLOSE, false /* alwaysKeepCurrent */);
+ assertEquals(TRANSIT_CRASHING_ACTIVITY_CLOSE, mWm.mAppTransition.getAppTransition());
+ }
+
+ @Test
+ public void testKeepKeyguard_withCrashing() throws Exception {
+ mWm.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, false /* alwaysKeepCurrent */);
+ mWm.prepareAppTransition(TRANSIT_CRASHING_ACTIVITY_CLOSE, false /* alwaysKeepCurrent */);
+ assertEquals(TRANSIT_KEYGUARD_GOING_AWAY, mWm.mAppTransition.getAppTransition());
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
index 50f3fbe..ee028ba 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java
@@ -598,4 +598,9 @@
@Override
public void onLockTaskStateChangedLw(int lockTaskState) {
}
+
+ @Override
+ public boolean setAodShowing(boolean aodShowing) {
+ return false;
+ }
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 41b4718..a408438 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -2919,6 +2919,29 @@
}
@Test
+ public void testVisualDifference_summary() {
+ Notification.Builder nb1 = new Notification.Builder(mContext, "")
+ .setGroup("bananas")
+ .setFlag(Notification.FLAG_GROUP_SUMMARY, true)
+ .setContentText("foo");
+ StatusBarNotification sbn1 = new StatusBarNotification(PKG, PKG, 0, "tag", mUid, 0,
+ nb1.build(), new UserHandle(mUid), null, 0);
+ NotificationRecord r1 =
+ new NotificationRecord(mContext, sbn1, mock(NotificationChannel.class));
+
+ Notification.Builder nb2 = new Notification.Builder(mContext, "")
+ .setGroup("bananas")
+ .setFlag(Notification.FLAG_GROUP_SUMMARY, true)
+ .setContentText("bar");
+ StatusBarNotification sbn2 = new StatusBarNotification(PKG, PKG, 0, "tag", mUid, 0,
+ nb2.build(), new UserHandle(mUid), null, 0);
+ NotificationRecord r2 =
+ new NotificationRecord(mContext, sbn2, mock(NotificationChannel.class));
+
+ assertFalse(mService.isVisuallyInterruptive(r1, r2));
+ }
+
+ @Test
public void testHideAndUnhideNotificationsOnSuspendedPackageBroadcast() {
// post 2 notification from this package
final NotificationRecord notif1 = generateNotificationRecord(
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
index 975fbcc..9db823c 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
@@ -39,11 +39,15 @@
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
+import android.graphics.Typeface;
import android.graphics.drawable.Icon;
import android.net.Uri;
import android.os.Build;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
+import android.text.SpannableStringBuilder;
+import android.text.Spanned;
+import android.text.style.StyleSpan;
import android.widget.RemoteViews;
import com.android.server.UiServiceTestCase;
@@ -465,6 +469,25 @@
}
@Test
+ public void testActionsDifferentSpannables() {
+ PendingIntent intent = mock(PendingIntent.class);
+ Icon icon = mock(Icon.class);
+
+ Notification n1 = new Notification.Builder(mContext, "test")
+ .addAction(new Notification.Action.Builder(icon,
+ new SpannableStringBuilder().append("test1",
+ new StyleSpan(Typeface.BOLD),
+ Spanned.SPAN_EXCLUSIVE_EXCLUSIVE),
+ intent).build())
+ .build();
+ Notification n2 = new Notification.Builder(mContext, "test")
+ .addAction(new Notification.Action.Builder(icon, "test1", intent).build())
+ .build();
+
+ assertFalse(Notification.areActionsVisiblyDifferent(n1, n2));
+ }
+
+ @Test
public void testActionsDifferentNumber() {
PendingIntent intent = mock(PendingIntent.class);
Icon icon = mock(Icon.class);
@@ -497,29 +520,7 @@
}
@Test
- public void testActionsMoreOptionsThanChoices() {
- PendingIntent intent1 = mock(PendingIntent.class);
- PendingIntent intent2 = mock(PendingIntent.class);
- Icon icon = mock(Icon.class);
-
- Notification n1 = new Notification.Builder(mContext, "test")
- .addAction(new Notification.Action.Builder(icon, "TEXT 1", intent1).build())
- .addAction(new Notification.Action.Builder(icon, "TEXT 2", intent1)
- .addRemoteInput(new RemoteInput.Builder("a")
- .setChoices(new CharSequence[] {"i", "m"})
- .build())
- .build())
- .build();
- Notification n2 = new Notification.Builder(mContext, "test")
- .addAction(new Notification.Action.Builder(icon, "TEXT 1", intent2).build())
- .addAction(new Notification.Action.Builder(icon, "TEXT 2", intent1).build())
- .build();
-
- assertTrue(Notification.areActionsVisiblyDifferent(n1, n2));
- }
-
- @Test
- public void testActionsDifferentRemoteInputs() {
+ public void testActionsIgnoresRemoteInputs() {
PendingIntent intent = mock(PendingIntent.class);
Icon icon = mock(Icon.class);
@@ -538,7 +539,7 @@
.build())
.build();
- assertTrue(Notification.areActionsVisiblyDifferent(n1, n2));
+ assertFalse(Notification.areActionsVisiblyDifferent(n1, n2));
}
}
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java
index a7d3f78..e6584c5 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsService.java
@@ -710,7 +710,7 @@
final int callingUid = Binder.getCallingUid();
final int callingUserId = UserHandle.getUserId(callingUid);
- if (mPackageManagerInternal.getPackageUid(pkg, PackageManager.MATCH_ANY_USER,
+ if (mPackageManagerInternal.getPackageUid(pkg, /*flags=*/ 0,
callingUserId) != callingUid) {
throw new SecurityException("Calling uid " + pkg + " cannot query events"
+ "for package " + pkg);
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index a7fffca..66ccc6c 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -107,6 +107,8 @@
boolean isDualBandSupported();
+ boolean needs5GHzToAnyApBandConversion();
+
DhcpInfo getDhcpInfo();
boolean isScanAlwaysAvailable();
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index a19965d..25f35d0 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -1763,6 +1763,19 @@
}
/**
+ * Check if the chipset requires conversion of 5GHz Only apBand to ANY.
+ * @return {@code true} if required, {@code false} otherwise.
+ * @hide
+ */
+ public boolean isDualModeSupported() {
+ try {
+ return mService.needs5GHzToAnyApBandConversion();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Return the DHCP-assigned addresses from the last successful DHCP request,
* if any.
* @return the DHCP information