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

Commit faed5fbf authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Add support for heavy-weight applications." into kraken

parents 7c035d8a 860755fa
Loading
Loading
Loading
Loading
+44 −11
Original line number Diff line number Diff line
@@ -4508,6 +4508,17 @@
 visibility="public"
>
</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"
 type="int"
 transient="false"
@@ -5916,17 +5927,6 @@
 visibility="public"
>
</field>
<field name="kraken_resource_pad65"
 type="int"
 transient="false"
 volatile="false"
 value="16843456"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="kraken_resource_pad7"
 type="int"
 transient="false"
@@ -21759,6 +21759,17 @@
 visibility="public"
>
</field>
<field name="IMPORTANCE_HEAVY_WEIGHT"
 type="int"
 transient="false"
 volatile="false"
 value="150"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="IMPORTANCE_SERVICE"
 type="int"
 transient="false"
@@ -44092,6 +44103,17 @@
 visibility="public"
>
</method>
<method name="getTargetPackage"
 return="java.lang.String"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="readIntentSenderOrNullFromParcel"
 return="android.content.IntentSender"
 abstract="false"
@@ -46286,6 +46308,17 @@
 visibility="public"
>
</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"
 type="int"
 transient="false"
+6 −0
Original line number Diff line number Diff line
@@ -725,6 +725,12 @@ public class ActivityManager {
         */
        public static final int IMPORTANCE_FOREGROUND = 100;
        
        /**
         * Constant for {@link #importance}: this process is running a
         * heavy-weight application and thus should not be killed.
         */
        public static final int IMPORTANCE_HEAVY_WEIGHT = 150;
        
        /**
         * Constant for {@link #importance}: this process is running something
         * that is considered to be actively visible to the user.
+17 −0
Original line number Diff line number Diff line
@@ -1251,6 +1251,13 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            reply.writeNoException();
            return true;
        }
        
        case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            finishHeavyWeightApp();
            reply.writeNoException();
            return true;
        }
        }
        
        return super.onTransact(code, data, reply, flags);
@@ -2758,5 +2765,15 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }
    
    public void finishHeavyWeightApp() throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }
    
    private IBinder mRemote;
}
+3 −0
Original line number Diff line number Diff line
@@ -303,6 +303,8 @@ public interface IActivityManager extends IInterface {
    
    public boolean isUserAMonkey() throws RemoteException;
    
    public void finishHeavyWeightApp() throws RemoteException;
    
    /*
     * Private non-Binder interfaces
     */
@@ -513,4 +515,5 @@ public interface IActivityManager extends IInterface {
    int WILL_ACTIVITY_BE_VISIBLE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+105;
    int START_ACTIVITY_WITH_CONFIG_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+106;
    int GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+107;
    int FINISH_HEAVY_WEIGHT_APP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+108;
}
+20 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.content;

import android.app.ActivityManagerNative;
import android.content.Context;
import android.content.Intent;
import android.content.IIntentSender;
@@ -169,6 +170,25 @@ public class IntentSender implements Parcelable {
        }
    }

    /**
     * Return the package name of the application that created this
     * IntentSender, that is the identity under which you will actually be
     * sending the Intent.  The returned string is supplied by the system, so
     * that an application can not spoof its package.
     *
     * @return The package name of the PendingIntent, or null if there is
     * none associated with it.
     */
    public String getTargetPackage() {
        try {
            return ActivityManagerNative.getDefault()
                .getPackageForIntentSender(mTarget);
        } catch (RemoteException e) {
            // Should never happen.
            return null;
        }
    }

    /**
     * Comparison operator on two IntentSender objects, such that true
     * is returned then they both represent the same operation from the
Loading