am 69a4817e: Immersive activity API.

Merge commit '69a4817e3e1e368e758ff8c238deb5ee26963c04' into gingerbread-plus-aosp

* commit '69a4817e3e1e368e758ff8c238deb5ee26963c04':
  Immersive activity API.
This commit is contained in:
Daniel Sandler
2010-06-23 13:36:25 -07:00
committed by Android Git Automerger
6 changed files with 170 additions and 0 deletions

View File

@@ -8725,6 +8725,35 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
}
}
public void setImmersive(IBinder token, boolean immersive) {
synchronized(this) {
int index = (token != null) ? indexOfTokenLocked(token) : -1;
if (index < 0) {
throw new IllegalArgumentException();
}
HistoryRecord r = (HistoryRecord)mHistory.get(index);
r.immersive = immersive;
}
}
public boolean isImmersive(IBinder token) {
synchronized (this) {
int index = (token != null) ? indexOfTokenLocked(token) : -1;
if (index < 0) {
throw new IllegalArgumentException();
}
HistoryRecord r = (HistoryRecord)mHistory.get(index);
return r.immersive;
}
}
public boolean isTopActivityImmersive() {
synchronized (this) {
HistoryRecord r = topRunningActivityLocked(null);
return (r != null) ? r.immersive : false;
}
}
public final void enterSafeMode() {
synchronized(this) {
// It only makes sense to do this before the system is ready

View File

@@ -101,6 +101,7 @@ class HistoryRecord extends IApplicationToken.Stub {
boolean idle; // has the activity gone idle?
boolean hasBeenLaunched;// has this activity ever been launched?
boolean frozenBeforeDestroy;// has been frozen but not yet destroyed.
boolean immersive; // immersive mode (don't interrupt if possible)
String stringName; // for caching of toString().
@@ -153,6 +154,7 @@ class HistoryRecord extends IApplicationToken.Stub {
pw.print(prefix); pw.print("keysPaused="); pw.print(keysPaused);
pw.print(" inHistory="); pw.print(inHistory);
pw.print(" persistent="); pw.print(persistent);
pw.print(" immersive="); pw.print(immersive);
pw.print(" launchMode="); pw.println(launchMode);
pw.print(prefix); pw.print("fullscreen="); pw.print(fullscreen);
pw.print(" visible="); pw.print(visible);
@@ -278,6 +280,8 @@ class HistoryRecord extends IApplicationToken.Stub {
} else {
isHomeActivity = false;
}
immersive = (aInfo.flags & ActivityInfo.FLAG_IMMERSIVE) != 0;
} else {
realActivity = null;
taskAffinity = null;
@@ -289,6 +293,7 @@ class HistoryRecord extends IApplicationToken.Stub {
packageName = null;
fullscreen = true;
isHomeActivity = false;
immersive = false;
}
}