Fixed a bug where systemui could crash while cloning

Because cloning wasn't synchronized, the notification
could become a non-root temporarily which in turn could
lead to a crash.
1. We're now properly synchronizing the cloning, such that
this can't happen anymore
2. We're now only cloning the old statusbar notification lightly
instead of heavily to avoid this altogether

Test: manual, update decoratedcustomview notifications really fast
Change-Id: Ia6525eec64ad9a26956ca2198e20198f55b2173c
Fixes: 62181033
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index e534233..7117137 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -2342,7 +2342,7 @@
     }
 
 
-    public RemoteViews clone() {
+    public synchronized RemoteViews clone() {
         Preconditions.checkState(mIsRoot, "RemoteView has been attached to another RemoteView. "
                 + "May only clone the root of a RemoteView hierarchy.");
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 58844ad..c0691c1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -438,7 +438,7 @@
                 final int N = mEntries.size();
                 for (int i = 0; i < N; i++) {
                     Entry entry = mEntries.valueAt(i);
-                    final StatusBarNotification oldSbn = entry.notification.clone();
+                    final StatusBarNotification oldSbn = entry.notification.cloneLight();
                     final String overrideGroupKey = getOverrideGroupKey(entry.key);
                     if (!Objects.equals(oldSbn.getOverrideGroupKey(), overrideGroupKey)) {
                         entry.notification.setOverrideGroupKey(overrideGroupKey);