diff options
| author | 2015-11-23 12:34:22 -0800 | |
|---|---|---|
| committer | 2015-11-23 18:16:24 -0800 | |
| commit | 811dc3b42b4d3c967a2304bf1e01840147b1a528 (patch) | |
| tree | 64d4de6a67afcc31d410b6fc6f049bd8f0532025 | |
| parent | 95e6ad7b4204962a4fcf8d602d2d0689562dbae9 (diff) | |
Allow preloading of freefore multi window drawables.
Bug: 25081468
Change-Id: Ic6ec6050882e5362e1ab8734962d163fff04b53d
| -rw-r--r-- | core/java/android/content/pm/PackageManager.java | 2 | ||||
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 19 | ||||
| -rw-r--r-- | core/res/res/values/arrays.xml | 5 | ||||
| -rw-r--r-- | core/res/res/values/config.xml | 7 | ||||
| -rw-r--r-- | core/res/res/values/symbols.xml | 2 |
5 files changed, 31 insertions, 4 deletions
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 42fef3ba5aa0..0c28008b1b87 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -1729,6 +1729,8 @@ public abstract class PackageManager { * {@link #hasSystemFeature}: The device supports freeform window management. * Windows have title bars and can be moved and resized. */ + // If this feature is present, you also need to set + // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. @SdkConstant(SdkConstantType.FEATURE) public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT = "android.software.freeform_window_management"; diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index f78d8d8abab8..8e318a22750e 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -346,7 +346,7 @@ public class ZygoteInit { long startTime = SystemClock.uptimeMillis(); TypedArray ar = mResources.obtainTypedArray( com.android.internal.R.array.preloaded_drawables); - int N = preloadDrawables(runtime, ar); + int N = preloadDrawables(ar); ar.recycle(); Log.i(TAG, "...preloaded " + N + " resources in " + (SystemClock.uptimeMillis()-startTime) + "ms."); @@ -354,10 +354,21 @@ public class ZygoteInit { startTime = SystemClock.uptimeMillis(); ar = mResources.obtainTypedArray( com.android.internal.R.array.preloaded_color_state_lists); - N = preloadColorStateLists(runtime, ar); + N = preloadColorStateLists(ar); ar.recycle(); Log.i(TAG, "...preloaded " + N + " resources in " + (SystemClock.uptimeMillis()-startTime) + "ms."); + + if (mResources.getBoolean( + com.android.internal.R.bool.config_freeformWindowManagement)) { + startTime = SystemClock.uptimeMillis(); + ar = mResources.obtainTypedArray( + com.android.internal.R.array.preloaded_freeform_multi_window_drawables); + N = preloadDrawables(ar); + ar.recycle(); + Log.i(TAG, "...preloaded " + N + " resource in " + + (SystemClock.uptimeMillis() - startTime) + "ms."); + } } mResources.finishPreloading(); } catch (RuntimeException e) { @@ -365,7 +376,7 @@ public class ZygoteInit { } } - private static int preloadColorStateLists(VMRuntime runtime, TypedArray ar) { + private static int preloadColorStateLists(TypedArray ar) { int N = ar.length(); for (int i=0; i<N; i++) { int id = ar.getResourceId(i, 0); @@ -385,7 +396,7 @@ public class ZygoteInit { } - private static int preloadDrawables(VMRuntime runtime, TypedArray ar) { + private static int preloadDrawables(TypedArray ar) { int N = ar.length(); for (int i=0; i<N; i++) { int id = ar.getResourceId(i, 0); diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml index 33c41ef7afee..a6a456415689 100644 --- a/core/res/res/values/arrays.xml +++ b/core/res/res/values/arrays.xml @@ -364,6 +364,11 @@ <item>@color/search_url_text_material_light</item> </array> + <array name="preloaded_freeform_multi_window_drawables"> + <item>@drawable/decor_maximize_button_dark</item> + <item>@drawable/decor_maximize_button_light</item> + </array> + <!-- Used in LocalePicker --> <string-array translatable="false" name="special_locale_codes"> <!-- http://b/17150708 - ensure that the list of languages says "Arabic" diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 539baa59471b..d9e04728badd 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2377,4 +2377,11 @@ <!-- The BT name of the keyboard packaged with the device. If this is defined, SystemUI will automatically try to pair with it when the device exits tablet mode. --> <string translatable="false" name="config_packagedKeyboardName"></string> + + <!-- The device supports freeform window management. Windows have title bars and can be moved + and resized. If you set this to true, you also need to add + PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT feature to your device specification. + The duplication is necessary, because this information is used before the features are + available to the system.--> + <bool name="config_freeformWindowManagement">false</bool> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index edd355598c0f..49243e1542ca 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -311,6 +311,7 @@ <java-symbol type="bool" name="config_wifi_enable_wifi_firmware_debugging" /> <java-symbol type="bool" name="config_supportMicNearUltrasound" /> <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> + <java-symbol type="bool" name="config_freeformWindowManagement" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_threshold" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_boost_factor" /> <java-symbol type="integer" name="config_wifi_framework_5GHz_preference_penalty_threshold" /> @@ -1122,6 +1123,7 @@ <java-symbol type="array" name="networkAttributes" /> <java-symbol type="array" name="preloaded_color_state_lists" /> <java-symbol type="array" name="preloaded_drawables" /> + <java-symbol type="array" name="preloaded_freeform_multi_window_drawables" /> <java-symbol type="array" name="sim_colors" /> <java-symbol type="array" name="special_locale_codes" /> <java-symbol type="array" name="special_locale_names" /> |