Merge "Don't assert on uris with stack." into nyc-dev
diff --git a/core/java/android/app/ActivityTransitionState.java b/core/java/android/app/ActivityTransitionState.java
index 4a1aff7..02eb4d3 100644
--- a/core/java/android/app/ActivityTransitionState.java
+++ b/core/java/android/app/ActivityTransitionState.java
@@ -284,7 +284,7 @@
     }
 
     public boolean startExitBackTransition(final Activity activity) {
-        if (mEnteringNames == null) {
+        if (mEnteringNames == null || mCalledExitCoordinator != null) {
             return false;
         } else {
             if (!mHasExited) {
diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java
index a599584..8bf1e9a 100644
--- a/core/java/android/app/EnterTransitionCoordinator.java
+++ b/core/java/android/app/EnterTransitionCoordinator.java
@@ -150,6 +150,7 @@
                 }
             };
             decor.getViewTreeObserver().addOnPreDrawListener(mViewsReadyListener);
+            decor.invalidate();
         }
     }
 
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 6a8c8b0..dcd9b0c 100755
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2201,11 +2201,11 @@
                     // If the app is null, then it was probably removed because the process died,
                     // otherwise wtf
                     if (r.app != null) {
-                        Slog.wtfStack(TAG, "Service done with onDestroy, but not inDestroying: "
+                        Slog.w(TAG, "Service done with onDestroy, but not inDestroying: "
                                 + r + ", app=" + r.app);
                     }
                 } else if (r.executeNesting != 1) {
-                    Slog.wtfStack(TAG, "Service done with onDestroy, but executeNesting="
+                    Slog.w(TAG, "Service done with onDestroy, but executeNesting="
                             + r.executeNesting + ": " + r);
                     // Fake it to keep from ANR due to orphaned entry.
                     r.executeNesting = 1;
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index b5a8bf3..a8b1a4a 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2582,6 +2582,9 @@
         }
         if (notification.actions != null) {
             for (Notification.Action action: notification.actions) {
+                if (action.actionIntent == null) {
+                    continue;
+                }
                 am.setPendingIntentWhitelistDuration(action.actionIntent.getTarget(), duration);
                 setPendingIntentWhitelistDuration(am, duration, action.getExtras());
                 final RemoteInput[] remoteInputs = action.getRemoteInputs();
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index a2bdde4..eb4d755 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -2395,6 +2395,10 @@
             mPromoteSystemApps =
                     mIsUpgrade && ver.sdkVersion <= Build.VERSION_CODES.LOLLIPOP_MR1;
 
+            // When upgrading from pre-N, we need to handle package extraction like first boot,
+            // as there is no profiling data available.
+            mIsPreNUpgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.N;
+
             // save off the names of pre-existing system packages prior to scanning; we don't
             // want to automatically grant runtime permissions for new system apps
             if (mPromoteSystemApps) {
@@ -2407,11 +2411,6 @@
                 }
             }
 
-            // When upgrading from pre-N, we need to handle package extraction like first boot,
-            // as there is no profiling data available.
-            mIsPreNUpgrade = !mSettings.isNWorkDone();
-            mSettings.setNWorkDone();
-
             // Collect vendor overlay packages.
             // (Do this before scanning any apps.)
             // For security and version matching reason, only consider
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 75bd35c..dfd6dfe 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -191,7 +191,6 @@
     private static final String TAG_DEFAULT_BROWSER = "default-browser";
     private static final String TAG_DEFAULT_DIALER = "default-dialer";
     private static final String TAG_VERSION = "version";
-    private static final String TAG_N_WORK = "n-work";
 
     private static final String ATTR_NAME = "name";
     private static final String ATTR_USER = "user";
@@ -398,17 +397,6 @@
 
     public final KeySetManagerService mKeySetManagerService = new KeySetManagerService(mPackages);
 
-    /**
-     * Used to track whether N+ work has been done. This is similar to the file-system level
-     * and denotes that first-boot or upgrade-to-N work has been done.
-     *
-     * Note: the flag has been added to a) allow tracking while an API level check is impossible
-     *       and b) to merge upgrade as well as first boot (because the flag is false, by default).
-     *
-     * STOPSHIP: b/27872764
-     */
-    private boolean mIsNWorkDone = false;
-
     Settings(Object lock) {
         this(Environment.getDataDirectory(), lock);
     }
@@ -2396,10 +2384,6 @@
 
             mKeySetManagerService.writeKeySetManagerServiceLPr(serializer);
 
-            serializer.startTag(null, TAG_N_WORK);
-            serializer.attribute(null, ATTR_DONE, Boolean.toString(mIsNWorkDone));
-            serializer.endTag(null, TAG_N_WORK);
-
             serializer.endTag(null, "packages");
 
             serializer.endDocument();
@@ -2937,8 +2921,6 @@
                     ver.sdkVersion = XmlUtils.readIntAttribute(parser, ATTR_SDK_VERSION);
                     ver.databaseVersion = XmlUtils.readIntAttribute(parser, ATTR_SDK_VERSION);
                     ver.fingerprint = XmlUtils.readStringAttribute(parser, ATTR_FINGERPRINT);
-                } else if (TAG_N_WORK.equals(tagName)) {
-                    mIsNWorkDone = XmlUtils.readBooleanAttribute(parser, ATTR_DONE, false);
                 } else {
                     Slog.w(PackageManagerService.TAG, "Unknown element under <packages>: "
                             + parser.getName());
@@ -4233,14 +4215,6 @@
         return res;
     }
 
-    public boolean isNWorkDone() {
-        return mIsNWorkDone;
-    }
-
-    void setNWorkDone() {
-        mIsNWorkDone = true;
-    }
-
     static void printFlags(PrintWriter pw, int val, Object[] spec) {
         pw.print("[ ");
         for (int i=0; i<spec.length; i+=2) {