Merge "Fix issue #3001368: API REVIEW: android.app.Activity" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
4e6baf2473
@@ -1631,35 +1631,11 @@ public class Activity extends ContextThemeWrapper
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This functionality will be removed in the future; please do
|
||||
* not use.
|
||||
*
|
||||
* Control whether this activity is required to be persistent. By default
|
||||
* activities are not persistent; setting this to true will prevent the
|
||||
* system from stopping this activity or its process when running low on
|
||||
* resources.
|
||||
*
|
||||
* <p><em>You should avoid using this method</em>, it has severe negative
|
||||
* consequences on how well the system can manage its resources. A better
|
||||
* approach is to implement an application service that you control with
|
||||
* {@link Context#startService} and {@link Context#stopService}.
|
||||
*
|
||||
* @param isPersistent Control whether the current activity must be
|
||||
* persistent, true if so, false for the normal
|
||||
* behavior.
|
||||
* @deprecated As of {@link android.os.Build.VERSION_CODES#GINGERBREAD}
|
||||
* this is a no-op.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setPersistent(boolean isPersistent) {
|
||||
if (mParent == null) {
|
||||
try {
|
||||
ActivityManagerNative.getDefault()
|
||||
.setPersistent(mToken, isPersistent);
|
||||
} catch (RemoteException e) {
|
||||
// Empty
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("setPersistent() not yet supported for embedded activities");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -345,17 +345,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
|
||||
return true;
|
||||
}
|
||||
|
||||
case SET_PERSISTENT_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
IBinder token = data.readStrongBinder();
|
||||
boolean isPersistent = data.readInt() != 0;
|
||||
if (token != null) {
|
||||
setPersistent(token, isPersistent);
|
||||
}
|
||||
reply.writeNoException();
|
||||
return true;
|
||||
}
|
||||
|
||||
case ATTACH_APPLICATION_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
IApplicationThread app = ApplicationThreadNative.asInterface(
|
||||
@@ -1589,18 +1578,6 @@ class ActivityManagerProxy implements IActivityManager
|
||||
data.recycle();
|
||||
reply.recycle();
|
||||
}
|
||||
public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException
|
||||
{
|
||||
Parcel data = Parcel.obtain();
|
||||
Parcel reply = Parcel.obtain();
|
||||
data.writeInterfaceToken(IActivityManager.descriptor);
|
||||
data.writeStrongBinder(token);
|
||||
data.writeInt(isPersistent ? 1 : 0);
|
||||
mRemote.transact(SET_PERSISTENT_TRANSACTION, data, reply, 0);
|
||||
reply.readException();
|
||||
data.recycle();
|
||||
reply.recycle();
|
||||
}
|
||||
public void attachApplication(IApplicationThread app) throws RemoteException
|
||||
{
|
||||
Parcel data = Parcel.obtain();
|
||||
|
||||
@@ -116,7 +116,6 @@ public interface IActivityManager extends IInterface {
|
||||
public void unbroadcastIntent(IApplicationThread caller, Intent intent) throws RemoteException;
|
||||
/* oneway */
|
||||
public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException;
|
||||
public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException;
|
||||
public void attachApplication(IApplicationThread app) throws RemoteException;
|
||||
/* oneway */
|
||||
public void activityIdle(IBinder token, Configuration config) throws RemoteException;
|
||||
@@ -444,7 +443,7 @@ public interface IActivityManager extends IInterface {
|
||||
int REPORT_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
|
||||
int GET_CONTENT_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
|
||||
int PUBLISH_CONTENT_PROVIDERS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
|
||||
int SET_PERSISTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
|
||||
|
||||
int FINISH_SUB_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31;
|
||||
int GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
|
||||
int START_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
|
||||
|
||||
Reference in New Issue
Block a user