Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02486b13 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Hide heavy-weight API.

And give it a better name, for when it is later un-hidden.

Change-Id: Iae0d3054d44f873b9f953bc41d175a47802a185e
parent bc5d9d22
Loading
Loading
Loading
Loading
+0 −46
Original line number Original line Diff line number Diff line
@@ -4508,17 +4508,6 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="heavyWeight"
 type="int"
 transient="false"
 volatile="false"
 value="16843456"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="height"
<field name="height"
 type="int"
 type="int"
 transient="false"
 transient="false"
@@ -19543,17 +19532,6 @@
 visibility="public"
 visibility="public"
>
>
</method>
</method>
<method name="isImmersive"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="isTaskRoot"
<method name="isTaskRoot"
 return="boolean"
 return="boolean"
 abstract="false"
 abstract="false"
@@ -20507,19 +20485,6 @@
<parameter name="uri" type="android.net.Uri">
<parameter name="uri" type="android.net.Uri">
</parameter>
</parameter>
</method>
</method>
<method name="setImmersive"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="i" type="boolean">
</parameter>
</method>
<method name="setIntent"
<method name="setIntent"
 return="void"
 return="void"
 abstract="false"
 abstract="false"
@@ -46505,17 +46470,6 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="FLAG_HEAVY_WEIGHT"
 type="int"
 transient="false"
 volatile="false"
 value="1048576"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FLAG_KILL_AFTER_RESTORE"
<field name="FLAG_KILL_AFTER_RESTORE"
 type="int"
 type="int"
 transient="false"
 transient="false"
+2 −0
Original line number Original line Diff line number Diff line
@@ -3748,6 +3748,7 @@ public class Activity extends ContextThemeWrapper
     * {@link #setImmersive}.
     * {@link #setImmersive}.
     *
     *
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @hide
     */
     */
    public boolean isImmersive() {
    public boolean isImmersive() {
        try {
        try {
@@ -3770,6 +3771,7 @@ public class Activity extends ContextThemeWrapper
     *
     *
     * @see #isImmersive
     * @see #isImmersive
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
     * @hide
     */
     */
    public void setImmersive(boolean i) {
    public void setImmersive(boolean i) {
        try {
        try {
+13 −11
Original line number Original line Diff line number Diff line
@@ -272,17 +272,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
     */
    public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
    public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
    
    
    /**
     * Value for {@link #flags}: set to <code>true</code> if the application
     * has reported that it is heavy-weight, and thus can not participate in
     * the normal application lifecycle.
     * 
     * <p>Comes from the
     * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight}
     * attribute of the &lt;application&gt; tag.
     */
    public static final int FLAG_HEAVY_WEIGHT = 1<<20;
    
    /**
    /**
     * Value for {@link #flags}: this is true if the application has set
     * Value for {@link #flags}: this is true if the application has set
     * its android:neverEncrypt to true, false otherwise. It is used to specify
     * its android:neverEncrypt to true, false otherwise. It is used to specify
@@ -309,6 +298,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
     */
    public static final int FLAG_NATIVE_DEBUGGABLE = 1<<28;
    public static final int FLAG_NATIVE_DEBUGGABLE = 1<<28;


    /**
     * Value for {@link #flags}: set to <code>true</code> if the application
     * has reported that it is heavy-weight, and thus can not participate in
     * the normal application lifecycle.
     *
     * <p>Comes from the
     * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight}
     * attribute of the &lt;application&gt; tag.
     *
     * {@hide}
     */
    public static final int CANT_SAVE_STATE = 1<<27;

    /**
    /**
     * Flags associated with the application.  Any combination of
     * Flags associated with the application.  Any combination of
     * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
     * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
+14 −12
Original line number Original line Diff line number Diff line
@@ -1601,15 +1601,17 @@ public class PackageParser {
            ai.enabled = sa.getBoolean(
            ai.enabled = sa.getBoolean(
                    com.android.internal.R.styleable.AndroidManifestApplication_enabled, true);
                    com.android.internal.R.styleable.AndroidManifestApplication_enabled, true);
            
            
            if (false) {
                if (sa.getBoolean(
                if (sa.getBoolean(
                    com.android.internal.R.styleable.AndroidManifestApplication_heavyWeight,
                        com.android.internal.R.styleable.AndroidManifestApplication_cantSaveState,
                        false)) {
                        false)) {
                ai.flags |= ApplicationInfo.FLAG_HEAVY_WEIGHT;
                    ai.flags |= ApplicationInfo.CANT_SAVE_STATE;


                    // A heavy-weight application can not be in a custom process.
                    // A heavy-weight application can not be in a custom process.
                    // We can do direct compare because we intern all strings.
                    // We can do direct compare because we intern all strings.
                    if (ai.processName != null && ai.processName != ai.packageName) {
                    if (ai.processName != null && ai.processName != ai.packageName) {
                    outError[0] = "Heavy-weight applications can not use custom processes";
                        outError[0] = "cantSaveState applications can not use custom processes";
                    }
                }
                }
            }
            }
        }
        }
@@ -1907,7 +1909,7 @@ public class PackageParser {


        sa.recycle();
        sa.recycle();


        if (receiver && (owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) {
        if (receiver && (owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) {
            // A heavy-weight application can not have receives in its main process
            // A heavy-weight application can not have receives in its main process
            // We can do direct compare because we intern all strings.
            // We can do direct compare because we intern all strings.
            if (a.info.processName == owner.packageName) {
            if (a.info.processName == owner.packageName) {
@@ -2197,7 +2199,7 @@ public class PackageParser {


        sa.recycle();
        sa.recycle();


        if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) {
        if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) {
            // A heavy-weight application can not have providers in its main process
            // A heavy-weight application can not have providers in its main process
            // We can do direct compare because we intern all strings.
            // We can do direct compare because we intern all strings.
            if (p.info.processName == owner.packageName) {
            if (p.info.processName == owner.packageName) {
@@ -2438,7 +2440,7 @@ public class PackageParser {


        sa.recycle();
        sa.recycle();


        if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) {
        if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) {
            // A heavy-weight application can not have services in its main process
            // A heavy-weight application can not have services in its main process
            // We can do direct compare because we intern all strings.
            // We can do direct compare because we intern all strings.
            if (s.info.processName == owner.packageName) {
            if (s.info.processName == owner.packageName) {
+9 −7
Original line number Original line Diff line number Diff line
@@ -744,15 +744,17 @@
        <attr name="restoreNeedsApplication" />
        <attr name="restoreNeedsApplication" />
        <attr name="restoreAnyVersion" />
        <attr name="restoreAnyVersion" />
        <attr name="neverEncrypt" />
        <attr name="neverEncrypt" />
        <!-- Declare that this is a heavy-weight application.  This kind of
        <!-- Declare that this applicationn can't participate in the normal
             application is not able to save and restore its state on demand,
             state save/restore mechanism.  Since it is not able to save and
             so can not participate in the normal activity lifecycle.  It will
             restore its state on demand,
             it can not participate in the normal activity lifecycle.  It will
             not be killed while in the background; the user must explicitly
             not be killed while in the background; the user must explicitly
             quit it.  Only one such app can be running at a time; if the user
             quit it.  Only one such app can be running at a time; if the user
             tries to launch a second heavy-weight app, they will be prompted
             tries to launch a second such app, they will be prompted
             to quit the first before doing so.  While a heavy-weight
             to quit the first before doing so.  While the
             application is running, the user will be informed of this. -->
             application is running, the user will be informed of this.
        <attr name="heavyWeight" format="boolean" />
             @hide -->
        <attr name="cantSaveState" format="boolean" />
    </declare-styleable>
    </declare-styleable>
    
    
    <!-- The <code>permission</code> tag declares a security permission that can be
    <!-- The <code>permission</code> tag declares a security permission that can be
Loading