Merge "Update override config to include some changes from global config" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
88be465ce5
@@ -207,7 +207,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
|
|||||||
public static final int SCREENLAYOUT_COMPAT_NEEDED = 0x10000000;
|
public static final int SCREENLAYOUT_COMPAT_NEEDED = 0x10000000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bit mask of overall layout of the screen. Currently there are two
|
* Bit mask of overall layout of the screen. Currently there are four
|
||||||
* fields:
|
* fields:
|
||||||
* <p>The {@link #SCREENLAYOUT_SIZE_MASK} bits define the overall size
|
* <p>The {@link #SCREENLAYOUT_SIZE_MASK} bits define the overall size
|
||||||
* of the screen. They may be one of
|
* of the screen. They may be one of
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
|
|||||||
import static com.android.server.am.ActivityRecord.STARTING_WINDOW_REMOVED;
|
import static com.android.server.am.ActivityRecord.STARTING_WINDOW_REMOVED;
|
||||||
import static com.android.server.am.ActivityRecord.STARTING_WINDOW_SHOWN;
|
import static com.android.server.am.ActivityRecord.STARTING_WINDOW_SHOWN;
|
||||||
import static com.android.server.am.ActivityStackSupervisor.FindTaskResult;
|
import static com.android.server.am.ActivityStackSupervisor.FindTaskResult;
|
||||||
import static com.android.server.am.ActivityStackSupervisor.MOVING;
|
|
||||||
import static com.android.server.am.ActivityStackSupervisor.ON_TOP;
|
import static com.android.server.am.ActivityStackSupervisor.ON_TOP;
|
||||||
import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
|
import static com.android.server.am.ActivityStackSupervisor.PRESERVE_WINDOWS;
|
||||||
import static com.android.server.wm.AppTransition.TRANSIT_ACTIVITY_CLOSE;
|
import static com.android.server.wm.AppTransition.TRANSIT_ACTIVITY_CLOSE;
|
||||||
@@ -4464,6 +4463,7 @@ final class ActivityStack {
|
|||||||
// Short circuit: if the two configurations are equal (the common case), then there is
|
// Short circuit: if the two configurations are equal (the common case), then there is
|
||||||
// nothing to do.
|
// nothing to do.
|
||||||
final Configuration newConfig = mService.mConfiguration;
|
final Configuration newConfig = mService.mConfiguration;
|
||||||
|
r.task.sanitizeOverrideConfiguration(newConfig);
|
||||||
final Configuration taskConfig = r.task.mOverrideConfig;
|
final Configuration taskConfig = r.task.mOverrideConfig;
|
||||||
if (r.configuration.equals(newConfig)
|
if (r.configuration.equals(newConfig)
|
||||||
&& r.taskConfigOverride.equals(taskConfig)
|
&& r.taskConfigOverride.equals(taskConfig)
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_NEVER;
|
|||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
|
||||||
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
|
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
|
||||||
import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_PRIVILEGED;
|
import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_PRIVILEGED;
|
||||||
|
import static android.content.res.Configuration.SCREENLAYOUT_LONG_MASK;
|
||||||
|
import static android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK;
|
||||||
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
|
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ADD_REMOVE;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ADD_REMOVE;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_LOCKTASK;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_LOCKTASK;
|
||||||
@@ -1574,6 +1576,24 @@ final class TaskRecord {
|
|||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update fields that are not overridden for task from global configuration.
|
||||||
|
*
|
||||||
|
* @param globalConfig global configuration to update from.
|
||||||
|
*/
|
||||||
|
void sanitizeOverrideConfiguration(Configuration globalConfig) {
|
||||||
|
// screenLayout field is set in #calculateOverrideConfig but only part of it is really
|
||||||
|
// overridden - aspect ratio and size. Other flags (like layout direction) can be updated
|
||||||
|
// separately in global config and they also must be updated in override config.
|
||||||
|
int overrideScreenLayout = mOverrideConfig.screenLayout;
|
||||||
|
int newScreenLayout = globalConfig.screenLayout;
|
||||||
|
newScreenLayout = (newScreenLayout & ~SCREENLAYOUT_LONG_MASK)
|
||||||
|
| (overrideScreenLayout & SCREENLAYOUT_LONG_MASK);
|
||||||
|
newScreenLayout = (newScreenLayout & ~SCREENLAYOUT_SIZE_MASK)
|
||||||
|
| (overrideScreenLayout & SCREENLAYOUT_SIZE_MASK);
|
||||||
|
mOverrideConfig.screenLayout = newScreenLayout;
|
||||||
|
}
|
||||||
|
|
||||||
static Rect validateBounds(Rect bounds) {
|
static Rect validateBounds(Rect bounds) {
|
||||||
if (bounds != null && bounds.isEmpty()) {
|
if (bounds != null && bounds.isEmpty()) {
|
||||||
Slog.wtf(TAG, "Received strange task bounds: " + bounds, new Throwable());
|
Slog.wtf(TAG, "Received strange task bounds: " + bounds, new Throwable());
|
||||||
|
|||||||
Reference in New Issue
Block a user