Remove experimental immersive mode support. DO NOT MERGE
Bug: 2949215 Change-Id: I7d998ef571ef7e149bb96261430e92150b80b77d
This commit is contained in:
@@ -3740,48 +3740,6 @@ public class Activity extends ContextThemeWrapper
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bit indicating that this activity is "immersive" and should not be
|
||||
* interrupted by notifications if possible.
|
||||
*
|
||||
* This value is initially set by the manifest property
|
||||
* <code>android:immersive</code> but may be changed at runtime by
|
||||
* {@link #setImmersive}.
|
||||
*
|
||||
* @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
|
||||
* @hide
|
||||
*/
|
||||
public boolean isImmersive() {
|
||||
try {
|
||||
return ActivityManagerNative.getDefault().isImmersive(mToken);
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust the current immersive mode setting.
|
||||
*
|
||||
* Note that changing this value will have no effect on the activity's
|
||||
* {@link android.content.pm.ActivityInfo} structure; that is, if
|
||||
* <code>android:immersive</code> is set to <code>true</code>
|
||||
* in the application's manifest entry for this activity, the {@link
|
||||
* android.content.pm.ActivityInfo#flags ActivityInfo.flags} member will
|
||||
* always have its {@link android.content.pm.ActivityInfo#FLAG_IMMERSIVE
|
||||
* FLAG_IMMERSIVE} bit set.
|
||||
*
|
||||
* @see #isImmersive
|
||||
* @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE
|
||||
* @hide
|
||||
*/
|
||||
public void setImmersive(boolean i) {
|
||||
try {
|
||||
ActivityManagerNative.getDefault().setImmersive(mToken, i);
|
||||
} catch (RemoteException e) {
|
||||
// pass
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------ Internal API ------------------
|
||||
|
||||
final void setParent(Activity parent) {
|
||||
|
||||
@@ -1261,32 +1261,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
|
||||
return true;
|
||||
}
|
||||
|
||||
case IS_IMMERSIVE_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
IBinder token = data.readStrongBinder();
|
||||
boolean isit = isImmersive(token);
|
||||
reply.writeNoException();
|
||||
reply.writeInt(isit ? 1 : 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
case SET_IMMERSIVE_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
IBinder token = data.readStrongBinder();
|
||||
boolean imm = data.readInt() == 1;
|
||||
setImmersive(token, imm);
|
||||
reply.writeNoException();
|
||||
return true;
|
||||
}
|
||||
|
||||
case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
boolean isit = isTopActivityImmersive();
|
||||
reply.writeNoException();
|
||||
reply.writeInt(isit ? 1 : 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
case CRASH_APPLICATION_TRANSACTION: {
|
||||
data.enforceInterface(IActivityManager.descriptor);
|
||||
int uid = data.readInt();
|
||||
@@ -2858,46 +2832,6 @@ class ActivityManagerProxy implements IActivityManager
|
||||
reply.recycle();
|
||||
}
|
||||
|
||||
public void setImmersive(IBinder token, boolean immersive)
|
||||
throws RemoteException {
|
||||
Parcel data = Parcel.obtain();
|
||||
Parcel reply = Parcel.obtain();
|
||||
data.writeInterfaceToken(IActivityManager.descriptor);
|
||||
data.writeStrongBinder(token);
|
||||
data.writeInt(immersive ? 1 : 0);
|
||||
mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
|
||||
reply.readException();
|
||||
data.recycle();
|
||||
reply.recycle();
|
||||
}
|
||||
|
||||
public boolean isImmersive(IBinder token)
|
||||
throws RemoteException {
|
||||
Parcel data = Parcel.obtain();
|
||||
Parcel reply = Parcel.obtain();
|
||||
data.writeInterfaceToken(IActivityManager.descriptor);
|
||||
data.writeStrongBinder(token);
|
||||
mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
|
||||
reply.readException();
|
||||
boolean res = reply.readInt() == 1;
|
||||
data.recycle();
|
||||
reply.recycle();
|
||||
return res;
|
||||
}
|
||||
|
||||
public boolean isTopActivityImmersive()
|
||||
throws RemoteException {
|
||||
Parcel data = Parcel.obtain();
|
||||
Parcel reply = Parcel.obtain();
|
||||
data.writeInterfaceToken(IActivityManager.descriptor);
|
||||
mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
|
||||
reply.readException();
|
||||
boolean res = reply.readInt() == 1;
|
||||
data.recycle();
|
||||
reply.recycle();
|
||||
return res;
|
||||
}
|
||||
|
||||
public void crashApplication(int uid, int initialPid, String packageName,
|
||||
String message) throws RemoteException {
|
||||
Parcel data = Parcel.obtain();
|
||||
|
||||
@@ -311,10 +311,6 @@ public interface IActivityManager extends IInterface {
|
||||
|
||||
public void finishHeavyWeightApp() throws RemoteException;
|
||||
|
||||
public void setImmersive(IBinder token, boolean immersive) throws RemoteException;
|
||||
public boolean isImmersive(IBinder token) throws RemoteException;
|
||||
public boolean isTopActivityImmersive() throws RemoteException;
|
||||
|
||||
public void crashApplication(int uid, int initialPid, String packageName,
|
||||
String message) throws RemoteException;
|
||||
|
||||
|
||||
@@ -112,8 +112,6 @@ public class Notification implements Parcelable
|
||||
* An intent to launch instead of posting the notification to the status bar. Only for use with
|
||||
* extremely high-priority notifications demanding the user's attention, such as an incoming
|
||||
* call (handled in the core Android Phone app with a full-screen Activity).
|
||||
* Use with {@link #FLAG_HIGH_PRIORITY} to ensure that this notification will reach the user
|
||||
* even when other notifications are suppressed.
|
||||
*/
|
||||
public PendingIntent fullScreenIntent;
|
||||
|
||||
@@ -273,14 +271,6 @@ public class Notification implements Parcelable
|
||||
*/
|
||||
public static final int FLAG_FOREGROUND_SERVICE = 0x00000040;
|
||||
|
||||
/**
|
||||
* Bit to be bitwise-ored into the {@link #flags} field that should be set if this notification
|
||||
* represents a high-priority event that may be shown to the user even if notifications are
|
||||
* otherwise unavailable (that is, when the status bar is hidden). This flag is ideally used
|
||||
* in conjunction with {@link #fullScreenIntent}.
|
||||
*/
|
||||
public static final int FLAG_HIGH_PRIORITY = 0x00000080;
|
||||
|
||||
public int flags;
|
||||
|
||||
/**
|
||||
@@ -549,9 +539,6 @@ public class Notification implements Parcelable
|
||||
sb.append(Integer.toHexString(this.defaults));
|
||||
sb.append(",flags=0x");
|
||||
sb.append(Integer.toHexString(this.flags));
|
||||
if ((this.flags & FLAG_HIGH_PRIORITY) != 0) {
|
||||
sb.append("!!!1!one!");
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -149,22 +149,6 @@ public class ActivityInfo extends ComponentInfo
|
||||
* {@link android.R.attr#finishOnCloseSystemDialogs} attribute.
|
||||
*/
|
||||
public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100;
|
||||
/**
|
||||
* Bit in {@link #flags} corresponding to an immersive activity
|
||||
* that wishes not to be interrupted by notifications.
|
||||
* Applications that hide the system notification bar with
|
||||
* {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN}
|
||||
* may still be interrupted by high-priority notifications; for example, an
|
||||
* incoming phone call may use
|
||||
* {@link android.app.Notification#fullScreenIntent fullScreenIntent}
|
||||
* to present a full-screen in-call activity to the user, pausing the
|
||||
* current activity as a side-effect. An activity with
|
||||
* {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the
|
||||
* notification may be shown in some other way (such as a small floating
|
||||
* "toast" window).
|
||||
* {@see android.app.Notification#FLAG_HIGH_PRIORITY}
|
||||
*/
|
||||
public static final int FLAG_IMMERSIVE = 0x0200;
|
||||
/**
|
||||
* Options that have been set in the activity declaration in the
|
||||
* manifest.
|
||||
@@ -175,7 +159,6 @@ public class ActivityInfo extends ComponentInfo
|
||||
* {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS},
|
||||
* {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY},
|
||||
* {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS},
|
||||
* {@link #FLAG_IMMERSIVE}
|
||||
*/
|
||||
public int flags;
|
||||
|
||||
|
||||
@@ -1883,12 +1883,6 @@ public class PackageParser {
|
||||
a.info.flags |= ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
|
||||
}
|
||||
|
||||
if (sa.getBoolean(
|
||||
com.android.internal.R.styleable.AndroidManifestActivity_immersive,
|
||||
false)) {
|
||||
a.info.flags |= ActivityInfo.FLAG_IMMERSIVE;
|
||||
}
|
||||
|
||||
if (!receiver) {
|
||||
a.info.launchMode = sa.getInt(
|
||||
com.android.internal.R.styleable.AndroidManifestActivity_launchMode,
|
||||
|
||||
Reference in New Issue
Block a user