Fix bug #7651552 resetRtlProperties() is called way too often

- remove unnecessary calls to resetRtlProperties().
- now reset of RTL properties will only be done when adding a View
(and no more when removing it)

Change-Id: I0d42128c9f7df6085fb92bb5af5c9bd4d1ba88a3
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1747627..49da26d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -11854,8 +11854,6 @@
 
         mCurrentAnimation = null;
 
-        resetRtlProperties();
-        onRtlPropertiesChanged(LAYOUT_DIRECTION_DEFAULT);
         resetAccessibilityStateChanged();
     }
 
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 00723f3..dbbcde6 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3620,8 +3620,6 @@
             childHasTransientStateChanged(view, false);
         }
 
-        view.resetRtlProperties();
-
         onViewRemoved(view);
 
         needGlobalAttributesUpdate(false);
@@ -5372,21 +5370,6 @@
      * @hide
      */
     @Override
-    public void resetRtlProperties() {
-        super.resetRtlProperties();
-        int count = getChildCount();
-        for (int i = 0; i < count; i++) {
-            final View child = getChildAt(i);
-            if (child.isLayoutDirectionInherited()) {
-                child.resetRtlProperties();
-            }
-        }
-    }
-
-    /**
-     * @hide
-     */
-    @Override
     public void resetResolvedLayoutDirection() {
         super.resetResolvedLayoutDirection();