Fix bug #3388534 Long file names are improperly displayed when played

- force ellipsising when there are more lines found than maxLines
- do not care about lines when we have reached maxLines
- also fix relayouting when changing maxLines thru setMaxLines()
- do not allow START / MIDDLE ellipsis when there are multiple lines
(and print a log accordingly)

Change-Id: I90f5a7f5200a220aceee01fb7300bec2c4c3a075
diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java
index eabeef0..421e995 100644
--- a/core/java/android/text/Layout.java
+++ b/core/java/android/text/Layout.java
@@ -880,6 +880,10 @@
             }
         }
         Directions directions = getLineDirections(line);
+        // Returned directions can actually be null
+        if (directions == null) {
+            return 0f;
+        }
         int dir = getParagraphDirection(line);
 
         TextLine tl = TextLine.obtain();
@@ -1781,17 +1785,6 @@
         }
     }
 
-    /**
-     * Inform this layout that not all of its lines will be displayed, because a maximum number of
-     * lines has been set on the associated TextView.
-     *
-     * A non strictly positive value means that all lines are displayed.
-     *
-     * @param lineCount number of visible lines
-     * @hide
-     */
-    public void setMaximumVisibleLineCount(int lineCount) {}
-
     private CharSequence mText;
     private TextPaint mPaint;
     /* package */ TextPaint mWorkPaint;