Implement NNAPI compilation caching runtime.

Implement compilation caching in runtime and add compilation caching
tests.

The token from user is transformed during the partitioning process by
SHA256 hasher based on
- device name
- device version string
- execution preference
- which operation (index) is included in the partition

Add tests to test compilation caching and the partitioner.

Bug: 119616526
Test: NeuralNetworksTest_static
Change-Id: I41e9dce10d95f744382894299c0d68bb8d10c08c
Merged-In: I41e9dce10d95f744382894299c0d68bb8d10c08c
(cherry picked from commit 2bca01cd6de08d24b39b81c1ff7a764be4e5535b)
diff --git a/common/Android.bp b/common/Android.bp
index 0ee87f4..890f5d1 100644
--- a/common/Android.bp
+++ b/common/Android.bp
@@ -108,6 +108,7 @@
         "GraphDump.cpp",
         "IndexedShapeWrapper.cpp",
         "OperationsUtils.cpp",
+        "TokenHasher.cpp",
         "Utils.cpp",
         "ValidateHal.cpp",
         "operations/Activation.cpp",
@@ -158,6 +159,9 @@
         "[email protected]",
         "[email protected]",
     ],
+    static_libs: [
+        "libcrypto_static",
+    ],
     header_libs: [
         "libneuralnetworks_headers",
         "libtextclassifier_hash_headers",