Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/cm-13.0' into cm-13.0-mt6592
Browse files Browse the repository at this point in the history
  • Loading branch information
fire855 committed Apr 26, 2016
2 parents 78657da + 08d2d0b commit dd68e2b
Show file tree
Hide file tree
Showing 413 changed files with 14,618 additions and 1,574 deletions.
22 changes: 9 additions & 13 deletions cmds/bootanimation/BootAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <time.h>
#include <pthread.h>
#include <sys/select.h>
#include <sys/syscall.h>

#include <cutils/properties.h>

Expand Down Expand Up @@ -438,19 +439,14 @@ status_t BootAnimation::readyToRun() {
return NO_ERROR;

if (fd != NULL) {
// We could use readahead..
// ... if bionic supported it :(
//readahead(fd, 0, INT_MAX);
void *crappyBuffer = malloc(2*1024*1024);
if (crappyBuffer != NULL) {
// Read all the zip
while (!feof(fd))
fread(crappyBuffer, 1024, 2*1024, fd);

free(crappyBuffer);
} else {
ALOGW("Unable to allocate memory to preload the animation");
}
// Since including fcntl.h doesn't give us the wrapper, use the syscall.
// 32 bits takes LO/HI offset (we don't care about endianness of 0).
#if defined(__aarch64__) || defined(__x86_64__)
if (syscall(__NR_readahead, fd, 0, INT_MAX))
#else
if (syscall(__NR_readahead, fd, 0, 0, INT_MAX))
#endif
ALOGW("Unable to cache the animation");
fclose(fd);
}
#endif
Expand Down
59 changes: 34 additions & 25 deletions core/java/android/app/IconPackHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -633,33 +633,42 @@ public static void getValue(Resources res, int resId, TypedValue outValue,
}
TypedValue tempValue = new TypedValue();
tempValue.setTo(outValue);
outValue.assetCookie = COMPOSED_ICON_COOKIE;
outValue.data = resId & (COMPOSED_ICON_COOKIE << 24 | 0x00ffffff);
outValue.string = getCachedIconPath(pkgName, resId, outValue.density);
int hashCode = outValue.string.hashCode() & 0x7fffffff;
int defaultSwatchColor = 0;

if (!(new File(outValue.string.toString()).exists())) {
// compose the icon and cache it
int back = 0;
if (iconInfo.swatchType != ComposedIconInfo.SwatchType.None) {
back = iconInfo.iconPaletteBack;
if (iconInfo.defaultSwatchColors.length > 0) {
defaultSwatchColor =iconInfo.defaultSwatchColors[
hashCode % iconInfo.defaultSwatchColors.length];
// Catch all exceptions and restore outValue to tempValue if one occurs
try {
outValue.assetCookie = COMPOSED_ICON_COOKIE;
outValue.data = resId & (COMPOSED_ICON_COOKIE << 24 | 0x00ffffff);
outValue.string = getCachedIconPath(pkgName, resId, outValue.density);
int hashCode = outValue.string.hashCode() & 0x7fffffff;
int defaultSwatchColor = 0;

if (!(new File(outValue.string.toString()).exists())) {
// compose the icon and cache it
int back = 0;
if (iconInfo.swatchType != ComposedIconInfo.SwatchType.None) {
back = iconInfo.iconPaletteBack;
if (iconInfo.defaultSwatchColors.length > 0) {
defaultSwatchColor = iconInfo.defaultSwatchColors[
hashCode % iconInfo.defaultSwatchColors.length];
}
} else if (iconInfo.iconBacks != null && iconInfo.iconBacks.length > 0) {
back = iconInfo.iconBacks[hashCode % iconInfo.iconBacks.length];
}
if (DEBUG) {
Log.d(TAG, "Composing icon for " + pkgName);
}
Bitmap bmp = createIconBitmap(baseIcon, res, back, defaultSwatchColor,
iconInfo);
if (!cacheComposedIcon(bmp,
getCachedIconName(pkgName, resId, outValue.density))) {
Log.w(TAG, "Unable to cache icon " + outValue.string);
// restore the original TypedValue
outValue.setTo(tempValue);
}
} else if (iconInfo.iconBacks != null && iconInfo.iconBacks.length > 0) {
back = iconInfo.iconBacks[hashCode % iconInfo.iconBacks.length];
}
if (DEBUG) {
Log.d(TAG, "Composing icon for " + pkgName);
}
Bitmap bmp = createIconBitmap(baseIcon, res, back, defaultSwatchColor, iconInfo);
if (!cacheComposedIcon(bmp, getCachedIconName(pkgName, resId, outValue.density))) {
Log.w(TAG, "Unable to cache icon " + outValue.string);
// restore the original TypedValue
outValue.setTo(tempValue);
}
} catch (Exception e) {
// catch all, restore the original value and log it
outValue.setTo(tempValue);
Log.w(TAG, "getValue failed for " + outValue.string, e);
}
}

Expand Down
12 changes: 12 additions & 0 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6444,6 +6444,18 @@ public static final class Global extends NameValueTable {
*/
public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";

/**
* A semi-colon separated list of Bluetooth interoperability workarounds.
* Each entry is a partial Bluetooth device address string and an integer representing
* the feature to be disabled, separated by a comma. The integer must correspond
* to a interoperability feature as defined in "interop.h" in /system/bt.
* <p>
* Example: <br/>
* "00:11:22,0;01:02:03:04,2"
* @hide
*/
public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";

/**
* The policy for deciding when Wi-Fi should go to sleep (which will in
* turn switch to using the mobile data as an Internet connection).
Expand Down
20 changes: 10 additions & 10 deletions core/java/com/android/internal/widget/LockPatternUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public byte[] verifyPattern(List<LockPatternView.Cell> pattern, long challenge,
throws RequestThrottledException {
try {
VerifyCredentialResponse response =
getLockSettings().verifyPattern(patternToString(pattern), challenge, userId);
getLockSettings().verifyPattern(patternToString(pattern, userId), challenge, userId);
if (response == null) {
// Shouldn't happen
return null;
Expand Down Expand Up @@ -291,7 +291,7 @@ public boolean checkPattern(List<LockPatternView.Cell> pattern, int userId)
throws RequestThrottledException {
try {
VerifyCredentialResponse response =
getLockSettings().checkPattern(patternToString(pattern), userId);
getLockSettings().checkPattern(patternToString(pattern, userId), userId);

if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
return true;
Expand Down Expand Up @@ -518,7 +518,7 @@ public void saveLockPattern(List<LockPatternView.Cell> pattern, String savedPatt
+ MIN_LOCK_PATTERN_SIZE + " dots long.");
}

getLockSettings().setLockPattern(patternToString(pattern), savedPattern, userId);
getLockSettings().setLockPattern(patternToString(pattern, userId), savedPattern, userId);
DevicePolicyManager dpm = getDevicePolicyManager();

// Update the device encryption password.
Expand All @@ -527,7 +527,7 @@ public void saveLockPattern(List<LockPatternView.Cell> pattern, String savedPatt
if (!shouldEncryptWithCredentials(true)) {
clearEncryptionPassword();
} else {
String stringPattern = patternToString(pattern);
String stringPattern = patternToString(pattern, userId);
updateEncryptionPassword(StorageManager.CRYPT_TYPE_PATTERN, stringPattern);
}
}
Expand Down Expand Up @@ -878,8 +878,8 @@ public static List<LockPatternView.Cell> stringToPattern(String string, byte gri
* @param pattern The pattern.
* @return The pattern in string form.
*/
public String patternToString(List<LockPatternView.Cell> pattern) {
return patternToString(pattern, getLockPatternSize());
public String patternToString(List<LockPatternView.Cell> pattern, int userId) {
return patternToString(pattern, getLockPatternSize(userId));
}

/**
Expand Down Expand Up @@ -1100,8 +1100,8 @@ public boolean isTactileFeedbackEnabled() {
/**
* @return the pattern lockscreen size
*/
public byte getLockPatternSize() {
long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, UserHandle.USER_CURRENT);
public byte getLockPatternSize(int userId) {
long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, userId);
if (size > 0 && size < 128) {
return (byte) size;
}
Expand All @@ -1111,8 +1111,8 @@ public byte getLockPatternSize() {
/**
* Set the pattern lockscreen size
*/
public void setLockPatternSize(long size) {
setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, UserHandle.USER_CURRENT);
public void setLockPatternSize(long size, int userId) {
setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, userId);
}

public void setVisibleDotsEnabled(boolean enabled, int userId) {
Expand Down
70 changes: 70 additions & 0 deletions core/res/res/values-csb-rPL/cm_strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
Copyright (C) 2012-2015 The CyanogenMod Project
Copyright (c) 2013, The Linux Foundation. All rights reserved.
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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- label for item that screenshots in phone options dialog -->
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- Title of an application permission, listed so the user can choose whether they want the application to do this. -->
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<!-- label for item that reboots the phone in phone options dialog -->
<!-- label for current user in phone options dialog -->
<!-- Reboot menu -->
<!-- Button to reboot the phone, within the Reboot Options dialog -->
<!-- Button to reboot the phone into recovery, within the Reboot Options dialog -->
<!-- Button to reboot the phone into bootloader, within the Reboot Options dialog -->
<!-- Button to reboot the phone into download, within the Reboot Options dialog -->
<!-- Button to soft reboot the device, within the Reboot Options dialog -->
<!-- Title of dialog to confirm rebooting. -->
<!-- Reboot Confirmation Dialog. When the user chooses to reboot the device, there will
be a confirmation dialog. This is the message. -->
<!-- Reboot Progress Dialog. This is shown if the user chooses to reboot the phone. -->
<!-- Long-press back kill application -->
<!-- ADB over network notification -->
<!-- ADB over USB and network notification -->
<!-- ADB notification message-->
<!-- ADB custom tile -->
<!-- Title of an application permission, listed so the user can choose whether they want the application to do this. -->
<!-- stylus gestures support -->
<!-- Zen mode buttons -->
<!-- Wifi Hotspot disabled due to subscription change -->
<!-- WiFi turn off notification action text -->
<!-- Privacy Guard -->
<!-- Text of the checkbox for the permission confirmation dialog to remember the user's choice. [CHAR LIMIT=40] -->
<!-- App ops requests -->
<!-- Notify user that they are in Lock-to-app (for devices without navbar) -->
<!-- Template for showing cellular network operator name while LTE calling is enabled -->
<!-- Keyguard strings -->
<!-- Sequence of characters used to separate carrier message strings in keyguard. Typically just vertical line
with spaces on either side. [CHAR LIMIT=3] -->
<!-- Protected Apps Notification -->
<!-- Battery fully charged notification -->
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose
whether they want to allow the application to do this. -->
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose
whether they want to allow the application to do this. -->
<!-- Uicc hotswapped event configuration needed notification -->
</resources>
Loading

0 comments on commit dd68e2b

Please sign in to comment.