API CHANGE: expose the backup-related ApplicationInfo flag masks

Fixes bug #2507582 by doing the following:

- Un-@hide the FLAG_ALLOW_BACKUP, FLAG_KILL_AFTER_RESTORE, and
  FLAG_RESTORE_ANY_VERSION mask constants in ApplicationInfo.  These
  correspond, respectively, to the <application> manifest tag's
  android:allowBackup, android:killAfterRestore, and
  android:restoreAnyVersion attributes.

- Remove the android:restoreNeedsApplication attribute and the
  corresponding FLAG_RESTORE_NEEDS_APPLICATION constant [which was still
  marked @hide].  We now always use the application's own Application
  class when performing a normal restore.  In the future when we support
  an externalized full-filesystem backup/restore operation, we will use
  an OS-defined agent class with a base-class Application instance, but
  this will not happen until a future release.

Also expands real documentation on the above ApplicationInfo constants;
that work is part of bug #2465360

Change-Id: I735d07a963ae80a01343637d83bef84e4c23fdcc
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 9736b01..c33f305 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -1448,8 +1448,8 @@
         if (allowBackup) {
             ai.flags |= ApplicationInfo.FLAG_ALLOW_BACKUP;
 
-            // backupAgent, killAfterRestore, restoreNeedsApplication, and restoreAnyVersion
-            // are only relevant if backup is possible for the given application.
+            // backupAgent, killAfterRestore, and restoreAnyVersion are only relevant
+            // if backup is possible for the given application.
             String backupAgent = sa.getNonConfigurationString(
                     com.android.internal.R.styleable.AndroidManifestApplication_backupAgent, 0);
             if (backupAgent != null) {
@@ -1465,11 +1465,6 @@
                     ai.flags |= ApplicationInfo.FLAG_KILL_AFTER_RESTORE;
                 }
                 if (sa.getBoolean(
-                        com.android.internal.R.styleable.AndroidManifestApplication_restoreNeedsApplication,
-                        false)) {
-                    ai.flags |= ApplicationInfo.FLAG_RESTORE_NEEDS_APPLICATION;
-                }
-                if (sa.getBoolean(
                         com.android.internal.R.styleable.AndroidManifestApplication_restoreAnyVersion,
                         false)) {
                     ai.flags |= ApplicationInfo.FLAG_RESTORE_ANY_VERSION;