Switch framework-graphics to use java_sdk_library

Test: m droid checkapi
Bug: 155164730
Change-Id: I4cf46f173bebf0c35a335054e8dcb96f3bd907a3
Exempt-From-Owner-Approval: Build refactoring.
diff --git a/Android.bp b/Android.bp
index e93d967..dcb79f1 100644
--- a/Android.bp
+++ b/Android.bp
@@ -372,7 +372,7 @@
     name: "framework-updatable-stubs-module_libs_api",
     static_libs: [
         "framework-appsearch-stubs", // TODO: Update to module_libs_api when there is one.
-        "framework-graphics-stubs-module_libs_api",
+        "framework-graphics.stubs.module_lib",
         "framework-media.stubs.module_lib",
         "framework-mediaprovider.stubs.module_lib",
         "framework-permission.stubs.module_lib",
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 7f95702..56c5688 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -337,7 +337,7 @@
     srcs: [ ":api-stubs-docs-non-updatable" ],
     static_libs: [
         "conscrypt.module.public.api.stubs",
-        "framework-graphics-stubs-publicapi",
+        "framework-graphics.stubs",
         "framework-media.stubs",
         "framework-mediaprovider.stubs",
         "framework-permission.stubs",
@@ -369,7 +369,7 @@
     static_libs: [
         "conscrypt.module.public.api.stubs",
         "framework-appsearch-stubs", // TODO: standardize appsearch stubs
-        "framework-graphics-stubs-systemapi",
+        "framework-graphics.stubs.system",
         "framework-media.stubs.system",
         "framework-mediaprovider.stubs.system",
         "framework-permission.stubs.system",
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index de96f81..9ae5ad9 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -156,8 +156,12 @@
 // framework-graphics jar
 // ------------------------
 
-java_library {
+java_sdk_library {
     name: "framework-graphics",
+    defaults: ["framework-module-defaults"],
+    visibility: [
+        "//frameworks/base", // Framework
+    ],
 
     srcs: [
         ":framework-graphics-srcs",
@@ -167,15 +171,16 @@
         "android.graphics",
     ],
 
-    sdk_version: "module_current",
-
     // TODO: once framework-graphics is officially part of the
     // UI-rendering module this line would no longer be
     // needed.
     installable: true,
 
-    // Enable detection of apis used by this module
-    plugins: ["java_api_finder",],
+    // Disable api_lint that the defaults enable
+    // TODO: enable this
+    api_lint: {
+        enabled: false,
+    },
 }
 
 filegroup {
@@ -186,94 +191,6 @@
     path: "apex/java"
 }
 
-stubs_defaults {
-    name: "framework-graphics-stubs-srcs-defaults",
-    srcs: [ ":framework-graphics-srcs"],
-}
-
-droidstubs {
-    name: "framework-graphics-api-module_libs_api",
-    defaults: [
-        "framework-graphics-stubs-srcs-defaults",
-        "framework-module-api-defaults-module_libs_api",
-    ],
-    check_api: {
-        // Disable api_lint that the defaults enable
-        // TODO: enable this
-        api_lint: {
-            enabled: false,
-        },
-    },
-}
-
-droidstubs {
-    name: "framework-graphics-stubs-srcs-module_libs_api",
-    defaults: [
-        "framework-graphics-stubs-srcs-defaults",
-        "framework-module-stubs-defaults-module_libs_api",
-    ],
-}
-
-droidstubs {
-    name: "framework-graphics-stubs-srcs-publicapi",
-    defaults: [
-        "framework-graphics-stubs-srcs-defaults",
-        "framework-module-stubs-defaults-publicapi",
-    ],
-    check_api: {
-        // Disable api_lint that the defaults enable
-        // TODO: enable this
-        api_lint: {
-            enabled: false,
-        },
-    },
-}
-
-droidstubs {
-    name: "framework-graphics-stubs-srcs-systemapi",
-    defaults: [
-        "framework-graphics-stubs-srcs-defaults",
-        "framework-module-stubs-defaults-systemapi",
-    ],
-    check_api: {
-        // Disable api_lint that the defaults enable
-        // TODO: enable this
-        api_lint: {
-            enabled: false,
-        },
-    },
-}
-
-java_library {
-    name: "framework-graphics-stubs-module_libs_api",
-    srcs: [":framework-graphics-stubs-srcs-module_libs_api"],
-    defaults: ["framework-module-stubs-lib-defaults-module_libs_api"],
-    visibility: [
-        "//frameworks/base", // Framework
-        "//frameworks/base/libs/hwui", // UI-rendering module
-    ],
-}
-
-java_library {
-    name: "framework-graphics-stubs-publicapi",
-    srcs: [":framework-graphics-stubs-srcs-publicapi"],
-    defaults: ["framework-module-stubs-lib-defaults-publicapi"],
-    visibility: [
-        "//frameworks/base", // Framework
-        "//frameworks/base/libs/hwui", // UI-rendering module
-    ],
-}
-
-java_library {
-    name: "framework-graphics-stubs-systemapi",
-    srcs: [":framework-graphics-stubs-srcs-systemapi"],
-    defaults: ["framework-module-stubs-lib-defaults-systemapi"],
-    visibility: [
-        "//frameworks/base", // Framework
-        "//frameworks/base/libs/hwui", // UI-rendering module
-    ],
-}
-
 // ------------------------
 // APEX
 // ------------------------