Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 041ca057 authored by Roman Birg's avatar Roman Birg Committed by Andy Mast
Browse files

Themes: Squashed for caf [1/6]



frameworks: add keyguard wallpaper functionality to WallpaperManager

Adapted for cm-12.

Original Id: I0eb1b5578b705c2ade4c0772fa86e09478b9f73e
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>

Conflicts:
	core/res/res/values/cm_strings.xml

Id: I1625f0569a66ad77e18b8377c519a07b7de6afdc

Themes: Port to CM12 [1/6]

Themes: Aapt port

Id: I106d447daf7935bada65e78911d8973ce0ca27ae

Themes: Port our additions to idmap

Id: I2e47cc23de4e7c0b884cccbd87c7d77079ac6824

Themes: remove legacy theme support from idmap

Id: I17dfe35f9985d8cef790b26a8bcda738ea65917c

Themes: Forward port changes to Installer.java

Id: If64e856773e50f5ed74f2358e0c590abad724689

Themes: Add clean spec for aapt

Id: I68f5f63f7e83b99230860dd2d8646e96da484b62

androidfw: Port CM overlay contributions

Id: Id7b7f5f35011922c668fcea3a8aec5b42bd28653

androidfw: Port addOverlayPath and removeOverlayPath

Id: I279db083af28fd8941f3227f2a7512ff094742c1

androidfw: Port addCommonOverlayPath

Id: I12d2fe05a04f6a7e553c330505a475346374b507

androidfw: Port addIconPath

Id: Ide3db28cde0c7f93edd9e7ad626ebace8d4105cc

androidfw: Allow package ID to be overriden at runtime

Id: Ieca3a0ae070a6c0ad0cf2b73b5944d83397d08b9

Aapt: Zip Parsing Test Cases w/ Refactoring

Id: I28f9115700e186136432138d228111ebcfbd0480

Themes: Update tests for idmap

Id: I3dae5bd376d122eab397863378599ae0ac7c6734

androidfw: Add test case for overriding package id

Id: I2668c529e24a55cd6bc8437406fc284b853a75e7

androidfw: Add tests for bags

The overlayOverridesStyleAttribute will currently fail since
our changes to allow theming styles is not currently implemented.

Id: Idfacc4382baf4152c839799a22b6cbe015ef2197

androidfw: Don't consider package ids 0x60 and 0x61 as dynamic

Package IDs that are not 0x01 (system) or 0x7f (app) are treated
as dynamic references.  Overlays are assigned specific package
ids that fall within the region of shared libraries.  This patch
treats them the same as system and app resource packages.

Id: Ieecaa889bed50490796351302405a38f77c84f4e

Theme Parsing & Info

Id: I3583d7e8ca704402e3d8c6e1c7cea1645b91c06f

Port ThemeUtils and its dependencies

This is pretty much copy/paste from cm-11.0

Id: I406860a259136ccca107b981aca0369851df445e

Themes: AndroidManifest and Intent port

Id: Ib97e8539301d20d120fd8b49891fdaae8205fe42

ComposedIconInfo Port (w/ stubbed IconPackHelper)

IconPackHelper is stubbed out so that PMService can reference it,
we'll need to port the Resource stack before porting the implementation.

Id: I59b680511de525e1d375a4f3be04347686b5e81b

Port PackageManagerService and other dependencies

Id: I11629d1e5eee21e01c060bc6c0393aae96034b69

Themes: Add in ThemeService

See also: external/selinux. The policy must be added
in order for the service to start without a security exception.

Id: Ic6f64796b264e430e9706a17a3fd2a35085fd1ca
TODO: ThemeService / Keyguard interaction
TODO: SystemServer - AppsLaunchFailure

Add AppsLaunchFailure

Id: I09a3826f89c62cb898866408e807f269616f48fc

androidfw: Update bags tests

The overlayOverridesStyleAttribute was updated such that it does
not check the attribute of the theme before adding the overlay.
The bag is cached on the first call and the next call, after the
overlay is attached, returns that pre-computed bag so the test would
always fail.  We now simply check that the attribute matches the one
in the overlay, and if so then the test passes.

This patch also adds a new test to check that an overlay can reference
and access resources that are unique to the overlay.  Currently this
test fails.

Id: I3892df3f0d9443a73eaa11b3d5e97cfe86620a73

androidfw: Add test for referencing overlay styles as parents

Id: I4fa3bd447c888e96176955924ebe7ee5c784ab55

androidfw: Allow referencing and retrieving overlay resources

This patch allows a theme to reference it's own resources.  Overlays
get their own group which contains those resources that are not idmapped.
Idmapped resources end up in the target's group.

Id: Ibc119ddcdb35d44a8afec3c6152bcab2909cda18

androidfw: Fill in missing attributes from overlay style

Id: I74051b379b73c728c6a2aa4bc62f3cd268a40b53

Protect windowNoTitle and windowActionBar attributes

This patch creates a new method to define "protected" attributes. These
are attributes like windowActionBar which should not be modified by
a theme.

Some apps (eg gmail) use the appcompat library which
has its own Actionbar classes. When an app uses its own
Actionbar it must not include the default actionbar which is
achieved through the windowActionBar attribute.

Some themes may try to change these attributes, which can will cause
the app to crash.

Id: Ie3bb7285eed09f3f13facf9d142ea9eb83796eec

Themes: Use SYSTEM_DEFAULT in ThemeService

Id: I52794dd98ca2f64aa50046ecdd7f79f27c21dd98

androidfw: Test missing parent attributes are merged in

This test checks that an overlaid style contains any attributes
that were in the original style but omitted in the overlaid style.

Id: I6b496ef2eb0a7ef27b4fafdfda5bdf7ccffad989

androidfw: Add test case for protected attributes

For this test to pass a protected attribute, such as windowNoTitle,
must be equal to the original and not the value specified in the
overlay.

Id: Ic03f11214a1fc4139e3c48d7e72694a80f819023

Themes: Attach theme and icon resources from java

Id: I9ffa0ce96a4af603b78b32d6b190f9698d3e4b4f

Themes: Icons, icons, icons!

Let there be icons.  Legacy icons and composed icons are included
in this patch.

Id: I9fedafa270f1c4dc30c9c8ffd4cf619895e688e6

Themes: Retrieve explicitly themed context and resources

Id: I4e41c251aee47361b183b60089bf5666540f653e

Themes: Add themeChange config change to manifest

Id: Ia84c0089a79637906e4f75fa38a56e8ff3b21a2b

Themes: Register THEME_SERVICE in ContextImpl

Id: I608a0b65c7e2ff0d69bae7bf343916f2b985f4a0

Themes: Remove legacy theme support

Id: I25887843d31f705425aa40f9a23482fd2cafaef8

androidfw: correctly index paths in idmap

Since we added the mtime values for the target and overlay, the
indices are increased by two.

Id: Ie0f5474d425945d58a12021cd2739240d2e98c0a

androidfw: Fix opening assets from theme resources

Id: Iedb51163a62b046cdf7fda1ad1b55cc1ee409047

Themes: Consider overlaid resource as "best fit"

Id: Ife8342a49eb9502be52f085f88161b113332e9e6

Themes: Save and restore theme config

Id: I3fcd445fb458aa6ed09397c05df6eb66d9be7235

Themes: Let ThemeService process additional themes

Id: I45837f26948367d5cc6c520e8c53f9da60bd1fda

AAPT: Don't applyVersionForCompatibility on android

When compiling themes with aapt, we do not want aapt to call
applyVersionForCompatibility as this causes the entries in the
resource table to have an incorrect path.

Id: Ie2c69533b3659c7b7458d6e4b7bdc84946d1be8e

androidfw: Don't consider package id 0x5f as dynamic

Package id 0x5f is reserved for common overlay resources and needs
to be reserved so that it is not considered a dynamic.

Id: Id27b8e0e2231ee8541365274d512e347afcfd05b

AAPT: Include resources.arsc in apk

Common resources needs the resources.arsc in the resources.apk
so that it can be included when processing other overlays.  Without
it, common resources cannot be referenced.

Id: I4aee29f660e4a0aa1909240dc0ca5680f0a2d135

Themes: Add keyguard wallpaper support to theme service

Id: Ib8f8acd55ab4d2b6ef06ee0a630dc50c4f870beb

Themes: Don't pre-process non .9.png images

When creating a resources.apk we do not need to pre-process
the normal .png images as those can be referenced directly from
the theme's apk.

Id: Iaf846a03ead9ecb1e68c040eac6e0ecbfc6e5875

Themes: Adjust offsets for idmap hashes

Idmap now has a header so the indices to the hashes need to be
incremented by one.

Id: If1fb183cc116ef9e3ad6cb4e17b6e44763e9e72a

Themes: Use single ThemeInfo instead of an array

We only ever used the first index so there is no need to use
an array of ThemeInfo(s)

Id: I9e2af076bc17396a0c978be3c0d31c41277db3df

New converter for Kitkat -> L fonts.xml

L introduced a new fonts xml format. Its great, but our themes will
keep using hte old format. This provides a converter and
test cases. The parser was taken from the chooser and remains
mostly unchanged with the exception of a getName() helper method.

Id: Ia1d42c9e50eb7b52d2d98fe6dbeee530bef3adc2

Themes: Port theme bootanimation support to CM12

Id: Ie016884b0e3b77e08732308923ac44e0975e0116

Resources: Clear drawable cache

Id: I04b5b78cce703194a2baeff9c51d2e4733b8ccc9

Font switching

Id: Ia43060a7db624102cdcd9b0d9dc7148441401584

Zygote changes

Id: Ie3681cf0d2b9929661cf1214e899cef9a5f37471

Recreate String Blocks

Id: I4747ebd1a0908b76ae7214b0584948353d426fc5

add a getter for the x and y offsets of the wallpaper window

Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37

Themes: Don't spam logcat with CREATING STRING CACHE

When processing resources with AAPT on the device, it spams the
logcat with warning messages about CREATING STRING CACHE.  Change
ALOGW to ALOGV so it will only show when verbose logging is enabled.

Id: I5b591c3336e176dd71cebe672d60721c29651b00

SystemUI: Audio Volume Panel

Id: I78c471864af401b274597339b8451e65931fdb32

AmService uiContext port

Id: Ida251d7f80797b0ec78b3d20cf60a795d6c4c1f0

Cleanly detach theme assets

Types from an overlay are added to the target group's
TypeList and need to be removed when the overlay assets
are detached.  Failing to remove these types results in
resources not being retieved due to the erroneous types.

Id: I4a9c624e30309e61fce905ced45c55acd3ac4845

Themes: GlobalAction Port

Id: Ifd87e04f94a284e77f1c48bec9fd75d69c45c47e

Themes: Do not store forward locked themes in ASEC containers

If a theme is in a asec container and is applied, when the
device is rebooted the device will get stuck in a nasty boot loop since
the theme resources must be read and the asec container is not ready yet.

Id: I1d93d8175d5c40b34c222974960c43352012a5ad

Use systemui's applied theme for notifications.

Notifications contain RemoteViews which are inflated using the
application's context for which this notification belongs to.  This
can look out of place if SystemUI is using a different theme than the
rest of the system.

This patch will use SystemUIs theme when inflating the RemoteViews,
giving us a more consistent look in the notification drawer.

Id: I9514ce7fcc4858bad3d3c4190f55c1f5a1441d7c

SysUI: Add theme support

This ports over the changes needed to facilitate a theme change in
SystemUI.

Id: I673fb79db90994371a9c0627746a97414132f0ba

Themes: Allow composing of VectorDrawable

Base icons can be vector drawables.  This patch allows them to be
composed.  Currently, VectorDrawables cannot have filters applied
since they do not have a method to get the Paint object like
BitmapDrawable and PaintDrawable.

Id: I762c8e1f4d1c945b8ebc164bbd7944120324bd42

Themes: Add target api to ThemesContract

This will allow the ThemesProvider to track the api a theme was
built for.  We may want to let the user know when a theme may not
be designed for the version of CM installed on their device.

Id: Idf0e6cef0ce9ac5e221ce5ff7e0b155ae0258d5f

Access Themed ResTables from compiled theme apk [1/2]

Before this patch the ResTable for a theme/app was created and
accessed seperate from the compiled APK. Since the compiled APK
has its own copy of the resources.arsc, we can just reuse the table
in the APK instead.

Id: I106a2434e74784bc04014831098f49fe128bc7e2

Themes: Port AppsLaunchFailureReceiver to CM12

Id: I5c3265e64aef1536ba5fceed0ec89082e786b686

Themes: Bump idmap hash version to 3

Due to changes in idmap, we need to force the recreation of resource
cache when upgrading from CM11 to CM12.

Id: I25c1e2c598bca889818e2d685651e3214c30ab3c

Remove debug logs

Id: Ia5cfa83ddf6da195e20526a94ba154864b8d0ecb

Send target sdk version to aapt [1/2]

If vector drawables are used in a theme we must have a minSdkVersion of 21 passed
to aapt or else aapt will Segfault.

Id: I687ee146f9f80543bbcdd06d93891cb3b23001c4

Add missing imports to ActivityThread

Id: I09fe07807ed824ccb938e0e174b06653c613c403

Themes: Dynamically add/remove content from StatusBarWindow

StatusBarWindowView has logic for resizing and fading content
which doesn't always behave correctly if this view is not the
root.  Rather than create a container, this patch uses the
existing StatusBarWindowView as the container and the inflated
status bar is then added to this view.

Id: Ia93d25a589419145f95d75b1b56eb3c2f300f935

Themes: don't use preloaded drawables when themed

If we have themed assets we should try and load those rather than
pulling from the preloaded drawables.  This allows us to continue
and preload drawables in ZygoteInit while maintaining the ability
to theme those preloaded assets.

Id: I68cfc099d328ece0791b6d0e5cf11d07097fd1fd

CM11 -> CM12 Upgrade [1/3]

- Introduce a new secure setting "THEME_PREV_BOOT_API_LEVEL".
  This field will always be set to the previous api level for themes.
  So if we upgrade from CM11 to CM12 this value will differ from the current API
  causing an upgrade to trigger

- When moving from CM11 -> CM12, unapply incompatible overlays

- Rename "holo" to "system" in secure settings themeConfig

- Provide a testing downgrade script to put the secure settings db into a state
  similiar to CM11 (at least for themes)

Id: I71be2c0ad83e60ffe8c574f913e5eaecb9700045

Themes: Add constant for system target API

Id: I0a6caf65c9e8b0feeef1ae848ba4683235304e8c

Conflicts:
	core/java/android/provider/Settings.java
	core/res/AndroidManifest.xml
	core/res/res/values/cm_strings.xml
	core/res/res/values/symbols.xml
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	services/core/java/com/android/server/pm/PackageManagerService.java
	services/java/com/android/server/SystemServer.java

Id: I6196d5c395c400f90cddaeb4113e094fc6a9a7e0

Themes: Hide LegacyFontParser and THEME_PREV_BOOT_API_LEVEL

Id: Ic43367a80dd6583b91fa6e0548af0866a832ac2a

Clean host static libaapt

Id: I4b00f171577b85ad02e7e7e398425a46bdfc5466

Themes: Fix GlobalAction Background

Id: Ic9451cbf31ca8671b16ed4eaef53c694a478e052

Themes: Call startKeyguard() when recreating status bar

mStatusBarKeyguardViewManager holds on to a reference of ScrimController
and we need to update this otherwise the scrim will remain on the screen
and consume all touch events.

This is easily reproduced by changing a theme and then turning the screen
off and on to display the keyguard.  Once the keyguard is dismissed the
scrim remains on the screen.

Id: Ie050a951117ed4aebef4ea3343366b9b9361b8a6

Themes: Restructure resource cache [1/2]

The new structure is as follows:
/data/resource-cache/
        ├─ theme1_pkg_name
        |     ├─ target1_pkg_name
        |     |     ├─ idmap
        |     |     └─ resources.apk
        |     ├─ target2_pkg_name
        |     ·
        |     ·
        |     ·
        |     ├─ targetN_pkg_name
        |     └─ icons
        |           ├─ hash
        |           └─ resources.apk
        ├─ theme2_pkg_name
        ·
        ·
        ·
        └─ themeN_pkg_name

Id: Id39688c88929733b42368c1f20ef0e25848a3390

Themes: Ensure themed fonts always have fallbacks

We need to ensure that if fonts are being used from a theme that
we include any families from the system that the theme did not
include.  We also need to add the Roboto fonts as fallback.

The system sans-serif fonts (Roboto) are added as fallback fonts.
This ensures we have a fallback for glyphs that are not in the
themed fonts.

Id: Iebb634ef4d01fedd132858410a5d392e74800acf

Themes: Don't add common assets if files cannot be accessed

If resApkPath does not exist, asset manaager will load the resources
from the theme's apk which end up overriding resources in the 0x7f
package id.  This causes apps, such as SystemUI, to crash endlessly.

The correct behavior is to not add common overlay assets if the
files that are being passed in as paths cannot be accessed.  The
same behavior is already used in AssetManager::addOverlayPath()

Id: If5e90baeda5f07973f268060dcb6d73dae657603

Themes: Update LoadedApk resources.

Ported from cm-11.0 with lazy loading of resources

Id: I324eb5ebc106a531afc4b44ea5d32f272250f6a8

Themes: System theme should clear wallpaper

CM12's default lockscreen wallpaper is clear. So
applying the system default should clear the wallpaper.

Id: I9a269985009f96c18948aa8db9cef64c245fe431

Themes: Watch all app crashes for problematic themes

Only watching for exceptions that occur during an apps launch may
not be sufficient to catch possible bad themes causing issues.
This patch monitors all app crashes and broadcasts that there was
a crash if either Resources.NotFoundException or InflateException
are thrown.  The remaining logic is the same as when an app launch
failure occurred.

We also display a notification to the user so that they know why
their theme was reset to the system theme.

Id: I0761d02587b5b81deee4a31a89f515dbc7cc5fe6

Conflicts:
	core/res/res/values/cm_strings.xml
	core/res/res/values/cm_symbols.xml

Themes: Allow setting a default theme

This is a forward port from cm-11.0

Id: I045e1e3a0e561331f0964fe33ec25d2d2a82794a

Conflicts:
	packages/SettingsProvider/res/values/defaults.xml
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

Themes: Check common resource paths at java layer

This solves two problems:
1. It won't try to attach common resources that do not exist
2. Avoids call down to the native layer if they don't exist

Id: I7b58b3f8a2540b6f62bd54feb21a3e33320c8e47

Themes: Let garbage collector free up native instances

This patch introduces typefaces which mirror the public ones but
are not final so they can be garbage collected and the native
instance freed without causing native crashes when we try to
unreference them manually during a font change.

Id: I488fb8f05e9b2bcaac07fccbea267f93c93f6dd6

Themes: Handle case when keyguard is showing during theme change

After we recreate the status bar we need to check if the keyguard
was showing and if so make sure it is showing after the theme
change.  We also need to make sure the phone status bar is not
visible if the keyguard was showing, otherwise you see two status
bars.

Id: Iba09e3e5c8cf52d49f292423a50034a3cf84d9c1

Themes: Use mRealPackage, when available, for idmapping

Some packages replace existing apps and take on their package name,
i.e. com.cyanogenmod.trebuchet -> com.android.launcher3.  When this
happens pkg.packageName becomes the name of the package it is
overriding and mRealPackage will be the original package name.

Because it is possible for the resources in the new package to not
match up with the package it replaced, we need to perform the idmap
using the original package name.

Id: Ic22c7005274ae5c4ea29d9a4b29f9b9f40719e68

Themes: Clear bag cache when removing overlay assets

The bag cache needs to be cleared from the group that was being
overlaid, otherwise it will be referencing styles and attributes
that may no longer exist.

Id: Ieef3ff2c55a643e12e9c4b8b4f6d5fd54da663d7

Themes: Allow notification shadows to be rounded

If a theme has a very large rounded rectangle it is obvious
the notification's shadow is a rectangle. So this patch
set the shadow to be drawn as a rounded rect like the notification itself.

Id: I560fc5c4a4ce3d052d98b14af978a28c13b6caca

Conflicts:
	packages/SystemUI/res/values/cm_dimens.xml

Themes: Get boot theme config from ThemeUtils

mBootThemeConfig is always null right now because we ever assign
it using ThemeUtils.getBootThemeDirty().  This patch makes sure we
take care of that now.

Id: I3bb8a3361f0bea8f31d1a03762378bc7ff316127

Change-Id: I68d96635fb71753a1feee1179d52f79423bf4075
parent f5cbc865
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment