Skip to content

Commit dd68e2b

Browse files
committed
Merge remote-tracking branch 'upstream/cm-13.0' into cm-13.0-mt6592
2 parents 78657da + 08d2d0b commit dd68e2b

413 files changed

Lines changed: 14618 additions & 1574 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmds/bootanimation/BootAnimation.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <time.h>
2828
#include <pthread.h>
2929
#include <sys/select.h>
30+
#include <sys/syscall.h>
3031

3132
#include <cutils/properties.h>
3233

@@ -438,19 +439,14 @@ status_t BootAnimation::readyToRun() {
438439
return NO_ERROR;
439440

440441
if (fd != NULL) {
441-
// We could use readahead..
442-
// ... if bionic supported it :(
443-
//readahead(fd, 0, INT_MAX);
444-
void *crappyBuffer = malloc(2*1024*1024);
445-
if (crappyBuffer != NULL) {
446-
// Read all the zip
447-
while (!feof(fd))
448-
fread(crappyBuffer, 1024, 2*1024, fd);
449-
450-
free(crappyBuffer);
451-
} else {
452-
ALOGW("Unable to allocate memory to preload the animation");
453-
}
442+
// Since including fcntl.h doesn't give us the wrapper, use the syscall.
443+
// 32 bits takes LO/HI offset (we don't care about endianness of 0).
444+
#if defined(__aarch64__) || defined(__x86_64__)
445+
if (syscall(__NR_readahead, fd, 0, INT_MAX))
446+
#else
447+
if (syscall(__NR_readahead, fd, 0, 0, INT_MAX))
448+
#endif
449+
ALOGW("Unable to cache the animation");
454450
fclose(fd);
455451
}
456452
#endif

core/java/android/app/IconPackHelper.java

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -633,33 +633,42 @@ public static void getValue(Resources res, int resId, TypedValue outValue,
633633
}
634634
TypedValue tempValue = new TypedValue();
635635
tempValue.setTo(outValue);
636-
outValue.assetCookie = COMPOSED_ICON_COOKIE;
637-
outValue.data = resId & (COMPOSED_ICON_COOKIE << 24 | 0x00ffffff);
638-
outValue.string = getCachedIconPath(pkgName, resId, outValue.density);
639-
int hashCode = outValue.string.hashCode() & 0x7fffffff;
640-
int defaultSwatchColor = 0;
641-
642-
if (!(new File(outValue.string.toString()).exists())) {
643-
// compose the icon and cache it
644-
int back = 0;
645-
if (iconInfo.swatchType != ComposedIconInfo.SwatchType.None) {
646-
back = iconInfo.iconPaletteBack;
647-
if (iconInfo.defaultSwatchColors.length > 0) {
648-
defaultSwatchColor =iconInfo.defaultSwatchColors[
649-
hashCode % iconInfo.defaultSwatchColors.length];
636+
// Catch all exceptions and restore outValue to tempValue if one occurs
637+
try {
638+
outValue.assetCookie = COMPOSED_ICON_COOKIE;
639+
outValue.data = resId & (COMPOSED_ICON_COOKIE << 24 | 0x00ffffff);
640+
outValue.string = getCachedIconPath(pkgName, resId, outValue.density);
641+
int hashCode = outValue.string.hashCode() & 0x7fffffff;
642+
int defaultSwatchColor = 0;
643+
644+
if (!(new File(outValue.string.toString()).exists())) {
645+
// compose the icon and cache it
646+
int back = 0;
647+
if (iconInfo.swatchType != ComposedIconInfo.SwatchType.None) {
648+
back = iconInfo.iconPaletteBack;
649+
if (iconInfo.defaultSwatchColors.length > 0) {
650+
defaultSwatchColor = iconInfo.defaultSwatchColors[
651+
hashCode % iconInfo.defaultSwatchColors.length];
652+
}
653+
} else if (iconInfo.iconBacks != null && iconInfo.iconBacks.length > 0) {
654+
back = iconInfo.iconBacks[hashCode % iconInfo.iconBacks.length];
655+
}
656+
if (DEBUG) {
657+
Log.d(TAG, "Composing icon for " + pkgName);
658+
}
659+
Bitmap bmp = createIconBitmap(baseIcon, res, back, defaultSwatchColor,
660+
iconInfo);
661+
if (!cacheComposedIcon(bmp,
662+
getCachedIconName(pkgName, resId, outValue.density))) {
663+
Log.w(TAG, "Unable to cache icon " + outValue.string);
664+
// restore the original TypedValue
665+
outValue.setTo(tempValue);
650666
}
651-
} else if (iconInfo.iconBacks != null && iconInfo.iconBacks.length > 0) {
652-
back = iconInfo.iconBacks[hashCode % iconInfo.iconBacks.length];
653-
}
654-
if (DEBUG) {
655-
Log.d(TAG, "Composing icon for " + pkgName);
656-
}
657-
Bitmap bmp = createIconBitmap(baseIcon, res, back, defaultSwatchColor, iconInfo);
658-
if (!cacheComposedIcon(bmp, getCachedIconName(pkgName, resId, outValue.density))) {
659-
Log.w(TAG, "Unable to cache icon " + outValue.string);
660-
// restore the original TypedValue
661-
outValue.setTo(tempValue);
662667
}
668+
} catch (Exception e) {
669+
// catch all, restore the original value and log it
670+
outValue.setTo(tempValue);
671+
Log.w(TAG, "getValue failed for " + outValue.string, e);
663672
}
664673
}
665674

core/java/android/provider/Settings.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6444,6 +6444,18 @@ public static final class Global extends NameValueTable {
64446444
*/
64456445
public static final String BLUETOOTH_DISABLED_PROFILES = "bluetooth_disabled_profiles";
64466446

6447+
/**
6448+
* A semi-colon separated list of Bluetooth interoperability workarounds.
6449+
* Each entry is a partial Bluetooth device address string and an integer representing
6450+
* the feature to be disabled, separated by a comma. The integer must correspond
6451+
* to a interoperability feature as defined in "interop.h" in /system/bt.
6452+
* <p>
6453+
* Example: <br/>
6454+
* "00:11:22,0;01:02:03:04,2"
6455+
* @hide
6456+
*/
6457+
public static final String BLUETOOTH_INTEROPERABILITY_LIST = "bluetooth_interoperability_list";
6458+
64476459
/**
64486460
* The policy for deciding when Wi-Fi should go to sleep (which will in
64496461
* turn switch to using the mobile data as an Internet connection).

core/java/com/android/internal/widget/LockPatternUtils.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public byte[] verifyPattern(List<LockPatternView.Cell> pattern, long challenge,
263263
throws RequestThrottledException {
264264
try {
265265
VerifyCredentialResponse response =
266-
getLockSettings().verifyPattern(patternToString(pattern), challenge, userId);
266+
getLockSettings().verifyPattern(patternToString(pattern, userId), challenge, userId);
267267
if (response == null) {
268268
// Shouldn't happen
269269
return null;
@@ -291,7 +291,7 @@ public boolean checkPattern(List<LockPatternView.Cell> pattern, int userId)
291291
throws RequestThrottledException {
292292
try {
293293
VerifyCredentialResponse response =
294-
getLockSettings().checkPattern(patternToString(pattern), userId);
294+
getLockSettings().checkPattern(patternToString(pattern, userId), userId);
295295

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

521-
getLockSettings().setLockPattern(patternToString(pattern), savedPattern, userId);
521+
getLockSettings().setLockPattern(patternToString(pattern, userId), savedPattern, userId);
522522
DevicePolicyManager dpm = getDevicePolicyManager();
523523

524524
// Update the device encryption password.
@@ -527,7 +527,7 @@ public void saveLockPattern(List<LockPatternView.Cell> pattern, String savedPatt
527527
if (!shouldEncryptWithCredentials(true)) {
528528
clearEncryptionPassword();
529529
} else {
530-
String stringPattern = patternToString(pattern);
530+
String stringPattern = patternToString(pattern, userId);
531531
updateEncryptionPassword(StorageManager.CRYPT_TYPE_PATTERN, stringPattern);
532532
}
533533
}
@@ -878,8 +878,8 @@ public static List<LockPatternView.Cell> stringToPattern(String string, byte gri
878878
* @param pattern The pattern.
879879
* @return The pattern in string form.
880880
*/
881-
public String patternToString(List<LockPatternView.Cell> pattern) {
882-
return patternToString(pattern, getLockPatternSize());
881+
public String patternToString(List<LockPatternView.Cell> pattern, int userId) {
882+
return patternToString(pattern, getLockPatternSize(userId));
883883
}
884884

885885
/**
@@ -1100,8 +1100,8 @@ public boolean isTactileFeedbackEnabled() {
11001100
/**
11011101
* @return the pattern lockscreen size
11021102
*/
1103-
public byte getLockPatternSize() {
1104-
long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, UserHandle.USER_CURRENT);
1103+
public byte getLockPatternSize(int userId) {
1104+
long size = getLong(Settings.Secure.LOCK_PATTERN_SIZE, -1, userId);
11051105
if (size > 0 && size < 128) {
11061106
return (byte) size;
11071107
}
@@ -1111,8 +1111,8 @@ public byte getLockPatternSize() {
11111111
/**
11121112
* Set the pattern lockscreen size
11131113
*/
1114-
public void setLockPatternSize(long size) {
1115-
setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, UserHandle.USER_CURRENT);
1114+
public void setLockPatternSize(long size, int userId) {
1115+
setLong(Settings.Secure.LOCK_PATTERN_SIZE, size, userId);
11161116
}
11171117

11181118
public void setVisibleDotsEnabled(boolean enabled, int userId) {
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--Generated by crowdin.com-->
3+
<!--
4+
Copyright (C) 2012-2015 The CyanogenMod Project
5+
Copyright (c) 2013, The Linux Foundation. All rights reserved.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
-->
19+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
20+
<!-- label for item that screenshots in phone options dialog -->
21+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
22+
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
23+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
24+
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
25+
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
26+
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
27+
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
28+
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
29+
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
30+
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
31+
<!-- Title of an application permission, listed so the user can choose whether they want the application to do this. -->
32+
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
33+
<!-- label for item that reboots the phone in phone options dialog -->
34+
<!-- label for current user in phone options dialog -->
35+
<!-- Reboot menu -->
36+
<!-- Button to reboot the phone, within the Reboot Options dialog -->
37+
<!-- Button to reboot the phone into recovery, within the Reboot Options dialog -->
38+
<!-- Button to reboot the phone into bootloader, within the Reboot Options dialog -->
39+
<!-- Button to reboot the phone into download, within the Reboot Options dialog -->
40+
<!-- Button to soft reboot the device, within the Reboot Options dialog -->
41+
<!-- Title of dialog to confirm rebooting. -->
42+
<!-- Reboot Confirmation Dialog. When the user chooses to reboot the device, there will
43+
be a confirmation dialog. This is the message. -->
44+
<!-- Reboot Progress Dialog. This is shown if the user chooses to reboot the phone. -->
45+
<!-- Long-press back kill application -->
46+
<!-- ADB over network notification -->
47+
<!-- ADB over USB and network notification -->
48+
<!-- ADB notification message-->
49+
<!-- ADB custom tile -->
50+
<!-- Title of an application permission, listed so the user can choose whether they want the application to do this. -->
51+
<!-- stylus gestures support -->
52+
<!-- Zen mode buttons -->
53+
<!-- Wifi Hotspot disabled due to subscription change -->
54+
<!-- WiFi turn off notification action text -->
55+
<!-- Privacy Guard -->
56+
<!-- Text of the checkbox for the permission confirmation dialog to remember the user's choice. [CHAR LIMIT=40] -->
57+
<!-- App ops requests -->
58+
<!-- Notify user that they are in Lock-to-app (for devices without navbar) -->
59+
<!-- Template for showing cellular network operator name while LTE calling is enabled -->
60+
<!-- Keyguard strings -->
61+
<!-- Sequence of characters used to separate carrier message strings in keyguard. Typically just vertical line
62+
with spaces on either side. [CHAR LIMIT=3] -->
63+
<!-- Protected Apps Notification -->
64+
<!-- Battery fully charged notification -->
65+
<!-- [CHAR LIMIT=NONE] Title of an application permission, listed so the user can choose
66+
whether they want to allow the application to do this. -->
67+
<!-- [CHAR LIMIT=NONE] Description of an application permission, listed so the user can choose
68+
whether they want to allow the application to do this. -->
69+
<!-- Uicc hotswapped event configuration needed notification -->
70+
</resources>

0 commit comments

Comments
 (0)