OSDN Git Service

Restoring old methods for compatibility.
authorWinson Chung <winsonc@google.com>
Tue, 2 May 2017 22:14:23 +0000 (15:14 -0700)
committerWinson Chung <winsonc@google.com>
Tue, 2 May 2017 22:18:23 +0000 (15:18 -0700)
Bug: 37637423
Test: Build and test PIP apps
Change-Id: I9ccb49a3e42de55a249ab54bde2f3c5a1c179c1c

api/removed.txt
api/system-removed.txt
api/test-removed.txt
core/java/android/app/PictureInPictureArgs.java

index 1873499..e7b573b 100644 (file)
@@ -29,6 +29,8 @@ package android.app {
   }
 
   public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+    ctor public deprecated PictureInPictureArgs();
+    ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
     method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
     method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
     method public void copyOnlySet(android.app.PictureInPictureArgs);
@@ -41,6 +43,9 @@ package android.app {
     method public boolean hasSetAspectRatio();
     method public boolean hasSourceBoundsHint();
     method public boolean hasSourceBoundsHintInsets();
+    method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
+    method public deprecated void setAspectRatio(float);
+    method public deprecated void setSourceRectHint(android.graphics.Rect);
     method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
     method public void truncateActions(int);
     field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
index 60865a3..15de5c4 100644 (file)
@@ -29,6 +29,8 @@ package android.app {
   }
 
   public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+    ctor public deprecated PictureInPictureArgs();
+    ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
     method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
     method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
     method public void copyOnlySet(android.app.PictureInPictureArgs);
@@ -41,6 +43,9 @@ package android.app {
     method public boolean hasSetAspectRatio();
     method public boolean hasSourceBoundsHint();
     method public boolean hasSourceBoundsHintInsets();
+    method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
+    method public deprecated void setAspectRatio(float);
+    method public deprecated void setSourceRectHint(android.graphics.Rect);
     method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
     method public void truncateActions(int);
     field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
index 1873499..e7b573b 100644 (file)
@@ -29,6 +29,8 @@ package android.app {
   }
 
   public final deprecated class PictureInPictureArgs implements android.os.Parcelable {
+    ctor public deprecated PictureInPictureArgs();
+    ctor public deprecated PictureInPictureArgs(float, java.util.List<android.app.RemoteAction>);
     method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams);
     method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs);
     method public void copyOnlySet(android.app.PictureInPictureArgs);
@@ -41,6 +43,9 @@ package android.app {
     method public boolean hasSetAspectRatio();
     method public boolean hasSourceBoundsHint();
     method public boolean hasSourceBoundsHintInsets();
+    method public deprecated void setActions(java.util.List<android.app.RemoteAction>);
+    method public deprecated void setAspectRatio(float);
+    method public deprecated void setSourceRectHint(android.graphics.Rect);
     method public deprecated void setSourceRectHintInsets(android.graphics.Rect);
     method public void truncateActions(int);
     field public static final android.os.Parcelable.Creator<android.app.PictureInPictureArgs> CREATOR;
index 88e6b99..d7317f4 100644 (file)
@@ -133,7 +133,20 @@ public final class PictureInPictureArgs implements Parcelable {
     @Nullable
     private Rect mSourceRectHintInsets;
 
-    private PictureInPictureArgs() {
+    /**
+     * @hide
+     */
+    @Deprecated
+    public PictureInPictureArgs() {
+    }
+
+    /**
+     * @hide
+     */
+    @Deprecated
+    public PictureInPictureArgs(float aspectRatio, List<RemoteAction> actions) {
+        setAspectRatio(aspectRatio);
+        setActions(actions);
     }
 
     private PictureInPictureArgs(Parcel in) {
@@ -160,6 +173,40 @@ public final class PictureInPictureArgs implements Parcelable {
     }
 
     /**
+     * @hide
+     */
+    @Deprecated
+    public void setAspectRatio(float aspectRatio) {
+        // Temporary workaround
+        mAspectRatio = new Rational((int) (aspectRatio * 1000000000), 1000000000);
+    }
+
+    /**
+     * @hide
+     */
+    @Deprecated
+    public void setActions(List<RemoteAction> actions) {
+        if (mUserActions != null) {
+            mUserActions = null;
+        }
+        if (actions != null) {
+            mUserActions = new ArrayList<>(actions);
+        }
+    }
+
+    /**
+     * @hide
+     */
+    @Deprecated
+    public void setSourceRectHint(Rect launchBounds) {
+        if (launchBounds == null) {
+            mSourceRectHint = null;
+        } else {
+            mSourceRectHint = new Rect(launchBounds);
+        }
+    }
+
+    /**
      * Copies the set parameters from the other picture-in-picture args.
      * @hide
      */