Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0018505
Snap for 4448085 from 250714c67ba9d2029bc88284672949a87b243b9a to oc-…
Nov 29, 2017
5f773b7
mtp: fix double free of thumbnail data
Oct 24, 2017
c767333
Throw OOME if Bitmap.nativeCreate fails
LeonScroggins Oct 3, 2017
949c64b
Adjust Uri host parsing to use last instead of first @.
Nov 7, 2017
5fdb800
Merge cherrypicks of [3287457, 3287458, 3286978, 3286979, 3287477, 32…
Nov 29, 2017
5025791
Swap the order of synthetic password wrapping
Oct 31, 2017
05c1a64
Merge cherrypicks of [3416661, 3417182, 3417738, 3417739, 3417758, 34…
Jan 4, 2018
7a722dc
OMS: Only allow trusted overlays to be registered.
Nov 14, 2017
31cc776
Merge cherrypicks of [3509911] into oc-m5-release
Jan 25, 2018
f18f319
Themes: Notifications: Expose a bool to disable dynamic colors
nicholaschum Aug 27, 2016
4b85726
Themes: Notification dynamic colors bool compatible with OMS7
KreAch3R Nov 14, 2016
79a8196
Themes: Notifications: extend dynamic notification bool for ambient n…
Adarsh-MR Nov 27, 2017
79d56d1
Themes: SystemUI: Use own drawables for QS expand icon
ivaniskandar Dec 5, 2016
fb542e2
Themes: Allow Navbar ripple color to be themed
Apr 14, 2016
3b1263a
Themes: SystemUI: Expose switch bar title
daveyannihilation Jan 1, 2017
798e285
Themes: graphics: ADB "N" icon compatible with OMS7
KreAch3R Feb 1, 2017
c16409c
Themes: Expose Keyboard Shortcuts Dialog
djdarkknight96 Mar 30, 2017
3e7303f
Themes: Expose Screenshot flash and background colors
ezio84 Mar 7, 2017
5401428
Themes: Allow volume slider and thumb to work with custom images.
bigrushdog Jan 10, 2016
00380f6
Themes: Expose Keyguard affordance circle background
Feb 2, 2017
c777245
Themes: base: expose toast colors for themes
Adarsh-MR Dec 9, 2017
f844e2d
Themes: Expose resolver hardcoded colors
Dec 9, 2016
3e6696b
Themes: Allow Immersive cling colors to be fully themed
nicholaschum Nov 17, 2015
af64826
Themes: Allow Permission Icons to be fully themed
nicholaschum Nov 24, 2015
5d6436c
Themes: SystemUI: Expose QS edit item decoration background color
ivaniskandar Sep 18, 2016
a5ce391
Themes: SystemUI: Expose QS background opacity
Nov 1, 2017
f4459ab
Fix Substratum themes making powermenu transparent in some cases
Dec 28, 2017
cfd5910
Themes: Expose power save mode color
ezio84 Oct 28, 2016
52efd18
Themes: SystemUI: expose screen pinning colors
Adarsh-MR Jan 9, 2018
a5a7864
Themes: Notification tint: add bool to enable algorithm for dark back…
SpiritCroc Feb 10, 2018
ec6bdd2
Merge tag 'android-8.1.0_r18' into o
Mar 8, 2018
1f99d83
Extras: Add dynamic theme shutdown and boot animation support
ivaniskandar Sep 17, 2017
0ef6d8a
Extras: Add dynamic theme sound effects support
nicholaschum Jul 17, 2016
2374ce8
Extras: Add dynamic theme fonts support for O
0xD34D Sep 16, 2017
5ba55a2
ApplicationsState: add filter for Substratum overlays [2/2]
KreAch3R Jul 4, 2016
9bd9a99
ThemeSafety: Introduce App Crash Intent
ivaniskandar Mar 9, 2017
277b31a
Hold "volume up" during boot to disable all overlays
KreAch3R Mar 11, 2017
d62f99e
OMS: StrictMode and files under /data/system/theme/
mickybart Nov 20, 2016
e540d2f
OMS: Add back overlay modified callback implementation
ivaniskandar Nov 3, 2017
cfef286
base: Introduce SubstratumService
ivaniskandar Jul 28, 2017
b84c655
SystemUI: Reload more assets on overlay change
ivaniskandar Feb 10, 2018
19118a7
Themes: Fix theming Qs expand/collapse drawable
Adarsh-MR Mar 22, 2018
358554b
Merge changes from topic 'sysserv' into o
msfjarvis Mar 28, 2018
7fd7a11
OMS: Dismantle FLAG_OVERLAY_TRUSTED check in isOverlayPackage
ivaniskandar Mar 10, 2018
b88f7c9
Merge branch 'o' of https://github.com/SubstratumResources/platform_f…
JagravNaik Mar 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ LOCAL_SRC_FILES += \
core/java/android/content/pm/IPinItemRequest.aidl \
core/java/android/content/pm/IShortcutService.aidl \
core/java/android/content/pm/permission/IRuntimePermissionPresenter.aidl \
core/java/android/content/substratum/ISubstratumService.aidl \
core/java/android/database/IContentObserver.aidl \
../av/camera/aidl/android/hardware/ICameraService.aidl \
../av/camera/aidl/android/hardware/ICameraServiceListener.aidl \
Expand Down Expand Up @@ -408,6 +409,7 @@ LOCAL_SRC_FILES += \
core/java/com/android/internal/os/IShellCallback.aidl \
core/java/com/android/internal/statusbar/IStatusBar.aidl \
core/java/com/android/internal/statusbar/IStatusBarService.aidl \
core/java/com/android/internal/substratum/ISubstratumHelperService.aidl \
core/java/com/android/internal/textservice/ISpellCheckerService.aidl \
core/java/com/android/internal/textservice/ISpellCheckerServiceCallback.aidl \
core/java/com/android/internal/textservice/ISpellCheckerSession.aidl \
Expand Down
7 changes: 5 additions & 2 deletions cmds/bootanimation/BootAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ namespace android {
static const char OEM_BOOTANIMATION_FILE[] = "/oem/media/bootanimation.zip";
static const char SYSTEM_BOOTANIMATION_FILE[] = "/system/media/bootanimation.zip";
static const char SYSTEM_ENCRYPTED_BOOTANIMATION_FILE[] = "/system/media/bootanimation-encrypted.zip";
static const char THEME_BOOTANIMATION_FILE[] = "/data/system/theme/bootanimation.zip";
static const char OEM_SHUTDOWNANIMATION_FILE[] = "/oem/media/shutdownanimation.zip";
static const char SYSTEM_SHUTDOWNANIMATION_FILE[] = "/system/media/shutdownanimation.zip";
static const char THEME_SHUTDOWNANIMATION_FILE[] = "/data/system/theme/shutdownanimation.zip";

static const char SYSTEM_DATA_DIR_PATH[] = "/data/system";
static const char SYSTEM_TIME_DIR_NAME[] = "time";
Expand Down Expand Up @@ -347,9 +349,10 @@ status_t BootAnimation::readyToRun() {
mZipFileName = getAnimationFileName(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE,mShuttingDown);
return NO_ERROR;
}
static const char* bootFiles[] = {OEM_BOOTANIMATION_FILE, SYSTEM_BOOTANIMATION_FILE};
static const char* bootFiles[] =
{THEME_BOOTANIMATION_FILE, OEM_BOOTANIMATION_FILE, SYSTEM_BOOTANIMATION_FILE};
static const char* shutdownFiles[] =
{OEM_SHUTDOWNANIMATION_FILE, SYSTEM_SHUTDOWNANIMATION_FILE};
{THEME_SHUTDOWNANIMATION_FILE, OEM_SHUTDOWNANIMATION_FILE, SYSTEM_SHUTDOWNANIMATION_FILE};

for (const char* f : (!mShuttingDown ? bootFiles : shutdownFiles)) {
if (access(getAnimationFileName(f,mShuttingDown), R_OK) == 0) {
Expand Down
15 changes: 10 additions & 5 deletions core/java/android/app/ActivityThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import android.database.sqlite.SQLiteDebug.DbStats;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.hardware.display.DisplayManagerGlobal;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
Expand Down Expand Up @@ -5093,11 +5094,15 @@ static void freeTextLayoutCachesIfNeeded(int configDiff) {
if (configDiff != 0) {
// Ask text layout engine to free its caches if there is a locale change
boolean hasLocaleConfigChange = ((configDiff & ActivityInfo.CONFIG_LOCALE) != 0);
if (hasLocaleConfigChange) {
Canvas.freeTextLayoutCaches();
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Cleared TextLayout Caches");
}
}
boolean hasFontConfigChange = ((configDiff & ActivityInfo.CONFIG_THEME_FONT) != 0);
if (hasLocaleConfigChange || hasFontConfigChange) {
Canvas.freeTextLayoutCaches();
if (hasFontConfigChange) {
Typeface.recreateDefaults();
}
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Cleared TextLayout Caches");
}
}
}

/**
Expand Down
105 changes: 78 additions & 27 deletions core/java/android/app/Notification.java

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions core/java/android/content/pm/ActivityInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,11 @@ public class ActivityInfo extends ComponentInfo
* {@link android.R.attr#configChanges} attribute.
*/
public static final int CONFIG_LAYOUT_DIRECTION = 0x2000;
/**
* Bit in {@link #configChanges} that indicates a font change occurred
* @hide
*/
public static final int CONFIG_THEME_FONT = 0x200000;
/**
* Bit in {@link #configChanges} that indicates that the activity
* can itself handle the change to the display color gamut or dynamic
Expand Down
26 changes: 22 additions & 4 deletions core/java/android/content/pm/PackageInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,26 @@ public class PackageInfo implements Parcelable {
/** @hide */
public int overlayPriority;

/** @hide */
public boolean isStaticOverlay;

/**
* Flag for use with {@link #overlayFlags}. Marks the overlay as static, meaning it cannot
* be enabled/disabled at runtime.
* @hide
*/
public static final int FLAG_OVERLAY_STATIC = 1 << 1;

/**
* Flag for use with {@link #overlayFlags}. Marks the overlay as trusted (not 3rd party).
* @hide
*/
public static final int FLAG_OVERLAY_TRUSTED = 1 << 2;

/**
* Modifiers that affect the state of this overlay. See {@link #FLAG_OVERLAY_STATIC},
* {@link #FLAG_OVERLAY_TRUSTED}.
* @hide
*/
public int overlayFlags;

public PackageInfo() {
}
Expand Down Expand Up @@ -342,8 +360,8 @@ public void writeToParcel(Parcel dest, int parcelableFlags) {
dest.writeString(restrictedAccountType);
dest.writeString(requiredAccountType);
dest.writeString(overlayTarget);
dest.writeInt(isStaticOverlay ? 1 : 0);
dest.writeInt(overlayPriority);
dest.writeInt(overlayFlags);
}

public static final Parcelable.Creator<PackageInfo> CREATOR
Expand Down Expand Up @@ -394,8 +412,8 @@ private PackageInfo(Parcel source) {
restrictedAccountType = source.readString();
requiredAccountType = source.readString();
overlayTarget = source.readString();
isStaticOverlay = source.readInt() != 0;
overlayPriority = source.readInt();
overlayFlags = source.readInt();

// The component lists were flattened with the redundant ApplicationInfo
// instances omitted. Distribute the canonical one here as appropriate.
Expand Down
10 changes: 9 additions & 1 deletion core/java/android/content/pm/PackageParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,15 @@ public static PackageInfo generatePackageInfo(PackageParser.Package p,
pi.requiredAccountType = p.mRequiredAccountType;
pi.overlayTarget = p.mOverlayTarget;
pi.overlayPriority = p.mOverlayPriority;
pi.isStaticOverlay = p.mIsStaticOverlay;

if (p.mIsStaticOverlay) {
pi.overlayFlags |= PackageInfo.FLAG_OVERLAY_STATIC;
}

if (p.mTrustedOverlay) {
pi.overlayFlags |= PackageInfo.FLAG_OVERLAY_TRUSTED;
}

pi.firstInstallTime = firstInstallTime;
pi.lastUpdateTime = lastUpdateTime;
if ((flags&PackageManager.GET_GIDS) != 0) {
Expand Down
6 changes: 5 additions & 1 deletion core/java/android/content/res/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ public void unset() {
int changed = 0;
if (delta.fontScale > 0 && fontScale != delta.fontScale) {
changed |= ActivityInfo.CONFIG_FONT_SCALE;
changed |= ActivityInfo.CONFIG_THEME_FONT;
fontScale = delta.fontScale;
}
if (delta.mcc != 0 && mcc != delta.mcc) {
Expand Down Expand Up @@ -1277,6 +1278,7 @@ public void unset() {
}
if (delta.assetsSeq != ASSETS_SEQ_UNDEFINED && delta.assetsSeq != assetsSeq) {
changed |= ActivityInfo.CONFIG_ASSETS_PATHS;
changed |= ActivityInfo.CONFIG_THEME_FONT;
assetsSeq = delta.assetsSeq;
}
if (delta.seq != 0) {
Expand Down Expand Up @@ -1342,6 +1344,7 @@ public int diff(Configuration delta, boolean compareUndefined, boolean publicOnl
int changed = 0;
if ((compareUndefined || delta.fontScale > 0) && fontScale != delta.fontScale) {
changed |= ActivityInfo.CONFIG_FONT_SCALE;
changed |= ActivityInfo.CONFIG_THEME_FONT;
}
if ((compareUndefined || delta.mcc != 0) && mcc != delta.mcc) {
changed |= ActivityInfo.CONFIG_MCC;
Expand Down Expand Up @@ -1431,6 +1434,7 @@ && getScreenLayoutNoDirection(screenLayout) !=
if ((compareUndefined || delta.assetsSeq != ASSETS_SEQ_UNDEFINED)
&& assetsSeq != delta.assetsSeq) {
changed |= ActivityInfo.CONFIG_ASSETS_PATHS;
changed |= ActivityInfo.CONFIG_THEME_FONT;
}

// Make sure that one of the values is not null and that they are not equal.
Expand Down Expand Up @@ -1462,7 +1466,7 @@ public static boolean needNewResources(@Config int configChanges,
// CONFIG_ASSETS_PATHS and CONFIG_FONT_SCALE are higher level configuration changes that
// all resources are subject to change with.
interestingChanges = interestingChanges | ActivityInfo.CONFIG_ASSETS_PATHS
| ActivityInfo.CONFIG_FONT_SCALE;
| ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_THEME_FONT;
return (configChanges & interestingChanges) != 0;
}

Expand Down
144 changes: 144 additions & 0 deletions core/java/android/content/substratum/ISubstratumService.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
/*
* Copyright (C) 2018 Projekt Substratum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package android.content.substratum;

interface ISubstratumService {

/**
* Install a list of specified overlay packages
*
* @param paths Filled in with a list of path names for packages to be installed from.
*/
void installOverlay(in List<String> paths);

/**
* Uninstall a list of specified overlay packages
*
* @param packages Filled in with a list of path names for packages to be installed from.
* @param restartUi Flag to automatically restart the SystemUI.
*/
void uninstallOverlay(in List<String> packages, boolean restartUi);

/**
* Switch the state of specified overlay packages
*
* @param packages Filled in with a list of package names to be switched.
* @param enable Whether to enable the specified overlays.
* @param restartUi Flag to automatically restart the SystemUI.
*/
void switchOverlay(in List<String> packages, boolean enable, boolean restartUi);

/**
* Change the priority of a specified list of overlays
*
* @param packages Filled in with a list of package names to be reordered.
* @param restartUi Flag to automatically restart the SystemUI.
*/
void setPriority(in List<String> packages, boolean restartUi);

/**
* Restart SystemUI
*/
void restartSystemUI();

/**
* Copy Method
*
* @param source Path of the source file.
* @param destination Path of the source file to be copied to.
*/
void copy(String source, String destination);

/**
* Move Method
*
* @param source Path of the source file.
* @param destination Path of the source file to be moved to.
*/
void move(String source, String destination);

/**
* Create Directory Method
*
* @param destination Path of the created destination folder.
*/
void mkdir(String destination);

/**
* Delete Directory Method
*
* @param destination Path of the directory to be deleted.
* @param withParent Flag to automatically delete the folder encompassing the folder.
*/
void deleteDirectory(String directory, boolean withParent);

/**
* Apply a specified bootanimation
*
* @param name Path to extract the bootanimation archive from.
*/
void applyBootanimation(String name);

/**
* Apply a specified font pack
*
* @param name Path to extract the font archive from.
*/
void applyFonts(String pid, String fileName);

/**
* Apply a specified sound pack
*
* @param name Path to extract the sounds archive from.
*/
void applySounds(String pid, String fileName);

/**
* Profile Applicator
*
* @param enable Filled in with a list of package names to be enabled.
* @param disable Filled in with a list of package names to be disabled.
* @param name Name of the profile to be applied.
* @param restartUi Flag to automatically restart the SystemUI.
*/
void applyProfile(in List<String> enable, in List<String> disable, String name,
boolean restartUi);

/**
* Apply a specified shutdownanimation
*
* @param name Path to extract the shutdown archive from.
* Use null to clear applied custom shutdown
*/
void applyShutdownAnimation(String name);

/**
* Returns information about all installed overlay packages for the
* specified user. If there are no installed overlay packages for this user,
* an empty map is returned (i.e. null is never returned). The returned map is a
* mapping of target package names to lists of overlays. Each list for a
* given target package is sorted in priority order, with the overlay with
* the highest priority at the end of the list.
*
* @param uid The user to get the OverlayInfos for.
* @return A Map<String, List<OverlayInfo>> with target package names
* mapped to lists of overlays; if no overlays exist for the
* requested user, an empty map is returned.
*/
Map getAllOverlays(in int uid);
}

3 changes: 2 additions & 1 deletion core/java/android/net/Uri.java
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,8 @@ public Uri getCanonicalUri() {
*/
public void checkFileUriExposed(String location) {
if ("file".equals(getScheme())
&& (getPath() != null) && !getPath().startsWith("/system/")) {
&& (getPath() != null) && !(getPath().startsWith("/system/") ||
getPath().startsWith("/data/system/theme/"))) {
StrictMode.onFileUriExposed(this, location);
}
}
Expand Down
10 changes: 6 additions & 4 deletions core/java/android/os/Process.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,11 @@ public static final ProcessStartResult start(final String processClass,
String instructionSet,
String appDataDir,
String invokeWith,
String[] zygoteArgs) {
String[] zygoteArgs,
boolean refreshFont) {
return zygoteProcess.start(processClass, niceName, uid, gid, gids,
debugFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, zygoteArgs);
abi, instructionSet, appDataDir, invokeWith, zygoteArgs, refreshFont);
}

/** @hide */
Expand All @@ -475,10 +476,11 @@ public static final ProcessStartResult startWebView(final String processClass,
String instructionSet,
String appDataDir,
String invokeWith,
String[] zygoteArgs) {
String[] zygoteArgs,
boolean refreshFont) {
return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids,
debugFlags, mountExternal, targetSdkVersion, seInfo,
abi, instructionSet, appDataDir, invokeWith, zygoteArgs);
abi, instructionSet, appDataDir, invokeWith, zygoteArgs, refreshFont);
}

/**
Expand Down
Loading