Split out proguard_basic_keeps.flags

For 'LOCAL_PROGUARD_ENABLED := nosystem' we still include
proguard_basic_keeps.flags.

Change-Id: I43ee7e98d2aaeb84879441f90ab6839c0e8f4e65
diff --git a/core/java.mk b/core/java.mk
index ebfff18..f43bf3b 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -401,6 +401,8 @@
 ifneq ($(strip $(LOCAL_INSTRUMENTATION_FOR)$(filter tests,$(LOCAL_MODULE_TAGS))$(filter android.test.runner,$(LOCAL_JAVA_LIBRARIES))),)
 proguard_flags := $(proguard_flags) -include $(BUILD_SYSTEM)/proguard_tests.flags
 endif # test package
+else  # LOCAL_PROGUARD_ENABLED is nosystem
+proguard_flags += -include $(BUILD_SYSTEM)/proguard_basic_keeps.flags
 endif # LOCAL_PROGUARD_ENABLED is not nosystem
 
 ifneq ($(LOCAL_PROGUARD_ENABLED),)
diff --git a/core/proguard.flags b/core/proguard.flags
index 782d61a..d8ad3bd 100644
--- a/core/proguard.flags
+++ b/core/proguard.flags
@@ -20,58 +20,4 @@
 # that isn't explicitly part of the API
 -dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
 
-# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
-# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
-# class$ methods are inserted by some compilers to implement .class construct,
-# see http://proguard.sourceforge.net/manual/examples.html#library
--keepclassmembernames class * {
-    java.lang.Class class$(java.lang.String);
-    java.lang.Class class$(java.lang.String, boolean);
-}
-
-# Keep classes and methods that have the guava @VisibleForTesting annotation
--keep @com.google.common.annotations.VisibleForTesting class *
--keepclassmembers class * {
-@com.google.common.annotations.VisibleForTesting *;
-}
-
-# Keep serializable classes and necessary members for serializable classes
-# Copied from the ProGuard manual at http://proguard.sourceforge.net.
--keepnames class * implements java.io.Serializable
--keepclassmembers class * implements java.io.Serializable {
-    static final long serialVersionUID;
-    private static final java.io.ObjectStreamField[] serialPersistentFields;
-    !static !transient <fields>;
-    private void writeObject(java.io.ObjectOutputStream);
-    private void readObject(java.io.ObjectInputStream);
-    java.lang.Object writeReplace();
-    java.lang.Object readResolve();
-}
-
-# Please specify classes to be kept explicitly in your package's configuration.
-# -keep class * extends android.app.Activity
-# -keep class * extends android.view.View
-# -keep class * extends android.app.Service
-# -keep class * extends android.content.BroadcastReceiver
-# -keep class * extends android.content.ContentProvider
-# -keep class * extends android.preference.Preference
-# -keep class * extends android.app.BackupAgent
-
-#-keep class * implements android.os.Parcelable {
-#  public static final android.os.Parcelable$Creator *;
-#}
-
-# The support library contains references to newer platform versions.
-# Don't warn about those in case this app is linking against an older
-# platform version.  We know about them, and they are safe.
-# See proguard-android.txt in the SDK package.
--dontwarn android.support.**
+-include proguard_basic_keeps.flags
diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags
new file mode 100644
index 0000000..049ce88
--- /dev/null
+++ b/core/proguard_basic_keeps.flags
@@ -0,0 +1,55 @@
+# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+# class$ methods are inserted by some compilers to implement .class construct,
+# see http://proguard.sourceforge.net/manual/examples.html#library
+-keepclassmembernames class * {
+    java.lang.Class class$(java.lang.String);
+    java.lang.Class class$(java.lang.String, boolean);
+}
+
+# Keep classes and methods that have the guava @VisibleForTesting annotation
+-keep @com.google.common.annotations.VisibleForTesting class *
+-keepclassmembers class * {
+@com.google.common.annotations.VisibleForTesting *;
+}
+
+# Keep serializable classes and necessary members for serializable classes
+# Copied from the ProGuard manual at http://proguard.sourceforge.net.
+-keepnames class * implements java.io.Serializable
+-keepclassmembers class * implements java.io.Serializable {
+    static final long serialVersionUID;
+    private static final java.io.ObjectStreamField[] serialPersistentFields;
+    !static !transient <fields>;
+    private void writeObject(java.io.ObjectOutputStream);
+    private void readObject(java.io.ObjectInputStream);
+    java.lang.Object writeReplace();
+    java.lang.Object readResolve();
+}
+
+# Please specify classes to be kept explicitly in your package's configuration.
+# -keep class * extends android.app.Activity
+# -keep class * extends android.view.View
+# -keep class * extends android.app.Service
+# -keep class * extends android.content.BroadcastReceiver
+# -keep class * extends android.content.ContentProvider
+# -keep class * extends android.preference.Preference
+# -keep class * extends android.app.BackupAgent
+
+#-keep class * implements android.os.Parcelable {
+#  public static final android.os.Parcelable$Creator *;
+#}
+
+# The support library contains references to newer platform versions.
+# Don't warn about those in case this app is linking against an older
+# platform version.  We know about them, and they are safe.
+# See proguard-android.txt in the SDK package.
+-dontwarn android.support.**