Addressing API Review feedback

Marked Insets class as final and added nullability
annotations for static factory methods

Change-Id: Id2092704e0e464bf783a5f33a90cad2e37972b57
Fixes: 113855954
Test: re-ran CTS test cases
diff --git a/api/current.txt b/api/current.txt
index f750e33..a3b5c7aaea 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -13784,7 +13784,7 @@
     field public static final int YV12 = 842094169; // 0x32315659
   }
 
-  public class Insets {
+  public final class Insets {
     method public static android.graphics.Insets of(int, int, int, int);
     method public static android.graphics.Insets of(android.graphics.Rect);
     field public static final android.graphics.Insets NONE;
diff --git a/graphics/java/android/graphics/Insets.java b/graphics/java/android/graphics/Insets.java
index 5a78530..c3449dd 100644
--- a/graphics/java/android/graphics/Insets.java
+++ b/graphics/java/android/graphics/Insets.java
@@ -16,6 +16,9 @@
 
 package android.graphics;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
 /**
  * An Insets instance holds four integer offsets which describe changes to the four
  * edges of a Rectangle. By convention, positive values move edges towards the
@@ -24,7 +27,7 @@
  * Insets are immutable so may be treated as values.
  *
  */
-public class Insets {
+public final class Insets {
     public static final Insets NONE = new Insets(0, 0, 0, 0);
 
     public final int left;
@@ -51,7 +54,7 @@
      *
      * @return Insets instance with the appropriate values
      */
-    public static Insets of(int left, int top, int right, int bottom) {
+    public static @NonNull Insets of(int left, int top, int right, int bottom) {
         if (left == 0 && top == 0 && right == 0 && bottom == 0) {
             return NONE;
         }
@@ -65,7 +68,7 @@
      *
      * @return an Insets instance with the appropriate values
      */
-    public static Insets of(Rect r) {
+    public static @NonNull Insets of(@Nullable Rect r) {
         return (r == null) ? NONE : of(r.left, r.top, r.right, r.bottom);
     }