summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/content/pm/PackageParser.java2
-rw-r--r--core/java/android/webkit/WebViewClassic.java74
-rw-r--r--core/java/android/widget/TextView.java2
-rw-r--r--core/res/res/drawable-hdpi/progress_bg_holo_dark.9.pngbin199 -> 178 bytes
-rw-r--r--core/res/res/drawable-mdpi/progress_bg_holo_dark.9.pngbin184 -> 168 bytes
-rw-r--r--core/res/res/drawable-xhdpi/progress_bg_holo_dark.9.pngbin199 -> 181 bytes
-rwxr-xr-xcore/res/res/values/config.xml7
-rw-r--r--core/res/res/values/public.xml2
-rw-r--r--data/fonts/Roboto-Light.ttfbin108220 -> 108216 bytes
-rw-r--r--data/fonts/Roboto-LightItalic.ttfbin111444 -> 111440 bytes
-rw-r--r--media/java/android/media/AudioService.java12
-rw-r--r--media/java/android/media/ExifInterface.java2
-rw-r--r--media/jni/Android.mk3
-rw-r--r--packages/SystemUI/res/drawable-sw600dp-tvdpi/notification_panel_bg.9.pngbin0 -> 931 bytes
-rw-r--r--packages/SystemUI/res/drawable-sw720dp-tvdpi/notification_panel_bg.9.pngbin0 -> 2212 bytes
-rw-r--r--packages/SystemUI/res/drawable-tvdpi/notification_panel_bg.9.pngbin0 -> 154 bytes
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java12
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java4
-rw-r--r--services/java/com/android/server/accessibility/TouchExplorer.java40
-rw-r--r--services/java/com/android/server/pm/PackageManagerService.java75
20 files changed, 157 insertions, 78 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 679a8aceb54c..b9811c826b87 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -129,7 +129,7 @@ public class PackageParser {
new PackageParser.SplitPermissionInfo[] {
new PackageParser.SplitPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
new String[] { android.Manifest.permission.READ_EXTERNAL_STORAGE },
- android.os.Build.VERSION_CODES.CUR_DEVELOPMENT+1),
+ android.os.Build.VERSION_CODES.JELLY_BEAN),
new PackageParser.SplitPermissionInfo(android.Manifest.permission.READ_CONTACTS,
new String[] { android.Manifest.permission.READ_CALL_LOG },
android.os.Build.VERSION_CODES.JELLY_BEAN),
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index d1da53be517e..611742b113a3 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -2065,31 +2065,31 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
*/
@Override
public void destroy() {
- destroyImpl();
- }
-
- private void destroyImpl() {
- ViewRootImpl viewRoot = mWebView.getViewRootImpl();
- if (viewRoot != null) {
+ if (mWebView.getViewRootImpl() != null) {
Log.e(LOGTAG, "Error: WebView.destroy() called while still attached!");
}
+ ensureFunctorDetached();
+ destroyJava();
+ destroyNative();
+ }
+ private void ensureFunctorDetached() {
if (mWebView.isHardwareAccelerated()) {
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
+ ViewRootImpl viewRoot = mWebView.getViewRootImpl();
if (drawGLFunction != 0 && viewRoot != null) {
- // functor should have been detached in onDetachedFromWindow, do
- // additionally here for safety
viewRoot.detachFunctor(drawGLFunction);
}
}
+ }
+ private void destroyJava() {
mCallbackProxy.blockMessages();
clearHelpers();
if (mListBoxDialog != null) {
mListBoxDialog.dismiss();
mListBoxDialog = null;
}
- if (mNativeClass != 0) nativeStopGL();
if (mWebViewCore != null) {
// Tell WebViewCore to destroy itself
synchronized (this) {
@@ -2100,12 +2100,36 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
// Remove any pending messages that might not be serviced yet.
mPrivateHandler.removeCallbacksAndMessages(null);
}
- if (mNativeClass != 0) {
- nativeDestroy();
- mNativeClass = 0;
+ }
+
+ private void destroyNative() {
+ if (mNativeClass == 0) return;
+ int nptr = mNativeClass;
+ mNativeClass = 0;
+ if (Thread.currentThread() == mPrivateHandler.getLooper().getThread()) {
+ // We are on the main thread and can safely delete
+ nativeDestroy(nptr);
+ } else {
+ mPrivateHandler.post(new DestroyNativeRunnable(nptr));
}
}
+ private static class DestroyNativeRunnable implements Runnable {
+
+ private int mNativePtr;
+
+ public DestroyNativeRunnable(int nativePtr) {
+ mNativePtr = nativePtr;
+ }
+
+ @Override
+ public void run() {
+ // nativeDestroy also does a stopGL()
+ nativeDestroy(mNativePtr);
+ }
+
+ }
+
/**
* See {@link WebView#enablePlatformNotifications()}
*/
@@ -4099,14 +4123,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
@Override
protected void finalize() throws Throwable {
try {
- if (mNativeClass != 0) {
- mPrivateHandler.post(new Runnable() {
- @Override
- public void run() {
- destroy();
- }
- });
- }
+ destroy();
} finally {
super.finalize();
}
@@ -5313,13 +5330,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
updateHwAccelerated();
- if (mWebView.isHardwareAccelerated()) {
- int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
- ViewRootImpl viewRoot = mWebView.getViewRootImpl();
- if (drawGLFunction != 0 && viewRoot != null) {
- viewRoot.detachFunctor(drawGLFunction);
- }
- }
+ ensureFunctorDetached();
}
@Override
@@ -6224,8 +6235,9 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
final int resultY = Math.max(0,
Math.min(mScrollingLayerRect.top + contentY, maxY));
- if (resultX != mScrollingLayerRect.left ||
- resultY != mScrollingLayerRect.top) {
+ if (resultX != mScrollingLayerRect.left
+ || resultY != mScrollingLayerRect.top
+ || (contentX | contentY) == 0) {
// In case we switched to dragging the page.
mTouchMode = TOUCH_DRAG_LAYER_MODE;
deltaX = contentX;
@@ -8507,7 +8519,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
private native void nativeCreate(int ptr, String drawableDir, boolean isHighEndGfx);
private native void nativeDebugDump();
- private native void nativeDestroy();
+ private static native void nativeDestroy(int ptr);
private native void nativeDraw(Canvas canvas, RectF visibleRect,
int color, int extra);
@@ -8526,7 +8538,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
private native int nativeGetBaseLayer(int nativeInstance);
private native void nativeCopyBaseContentToPicture(Picture pict);
private native boolean nativeHasContent();
- private native void nativeStopGL();
+ private native void nativeStopGL(int ptr);
private native void nativeDiscardAllTextures();
private native void nativeTileProfilingStart();
private native float nativeTileProfilingStop();
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 131b0754e4cb..01617da73b9a 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -4656,7 +4656,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// mInputType should already be EditorInfo.TYPE_NULL and mInput should be null
setMovementMethod(selectable ? ArrowKeyMovementMethod.getInstance() : null);
- setText(getText(), selectable ? BufferType.SPANNABLE : BufferType.NORMAL);
+ setText(mText, selectable ? BufferType.SPANNABLE : BufferType.NORMAL);
// Called by setText above, but safer in case of future code changes
mEditor.prepareCursorControllers();
diff --git a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
index 877fd2b5d6a3..a4c5b8bce584 100644
--- a/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
+++ b/core/res/res/drawable-hdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
index 155e5464e32f..b1f5cf3371c2 100644
--- a/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
+++ b/core/res/res/drawable-mdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progress_bg_holo_dark.9.png b/core/res/res/drawable-xhdpi/progress_bg_holo_dark.9.png
index c8b87d750138..349952808692 100644
--- a/core/res/res/drawable-xhdpi/progress_bg_holo_dark.9.png
+++ b/core/res/res/drawable-xhdpi/progress_bg_holo_dark.9.png
Binary files differ
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 09e3fbba7ff9..f623d48621eb 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -76,6 +76,13 @@
<item>0</item> <item>5</item> <!-- default: always increase volume by 5% -->
</integer-array>
+ <!-- The attenuation in dB applied to the sound effects played
+ through AudioManager.playSoundEffect() when no volume is specified. -->
+ <integer name="config_soundEffectVolumeDb">-6</integer>
+
+ <!-- The attenuation in dB applied to the lock/unlock sounds. -->
+ <integer name="config_lockSoundVolumeDb">-6</integer>
+
<!-- Flag indicating whether the AUDIO_BECOMING_NOISY notification should
be sent during a change to the audio output device. -->
<bool name="config_sendAudioBecomingNoisy">true</bool>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 48d5b31f5ec8..e1f15cff85a2 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -276,6 +276,8 @@
<java-symbol type="integer" name="db_wal_autocheckpoint" />
<java-symbol type="integer" name="max_action_buttons" />
<java-symbol type="integer" name="config_wifi_driver_stop_delay" />
+ <java-symbol type="integer" name="config_soundEffectVolumeDb" />
+ <java-symbol type="integer" name="config_lockSoundVolumeDb" />
<java-symbol type="color" name="tab_indicator_text_v4" />
diff --git a/data/fonts/Roboto-Light.ttf b/data/fonts/Roboto-Light.ttf
index e296c601cf81..2ae4dec9dc3f 100644
--- a/data/fonts/Roboto-Light.ttf
+++ b/data/fonts/Roboto-Light.ttf
Binary files differ
diff --git a/data/fonts/Roboto-LightItalic.ttf b/data/fonts/Roboto-LightItalic.ttf
index 3e6901d70849..44177ef687bd 100644
--- a/data/fonts/Roboto-LightItalic.ttf
+++ b/data/fonts/Roboto-LightItalic.ttf
Binary files differ
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 5da30bd6fa4a..a69912d3d36f 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -167,7 +167,6 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
private SoundPool mSoundPool;
private final Object mSoundEffectsLock = new Object();
private static final int NUM_SOUNDPOOL_CHANNELS = 4;
- private static final int SOUND_EFFECT_VOLUME = 1000;
// Internally master volume is a float in the 0.0 - 1.0 range,
// but to support integer based AudioManager API we translate it to 0 - 100
@@ -372,10 +371,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
private SoundPoolListenerThread mSoundPoolListenerThread;
// message looper for SoundPool listener
private Looper mSoundPoolLooper = null;
- // default volume applied to sound played with playSoundEffect()
- private static final int SOUND_EFFECT_DEFAULT_VOLUME_DB = 0;
- // volume applied to sound played with playSoundEffect() read from ro.config.sound_fx_volume
- private int SOUND_EFFECT_VOLUME_DB;
+ // volume applied to sound played with playSoundEffect()
+ private static int SOUND_EFFECT_VOLUME_DB;
// getActiveStreamType() will return STREAM_NOTIFICATION during this period after a notification
// stopped
private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000;
@@ -422,9 +419,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
"ro.config.vc_call_vol_steps",
MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL]);
- SOUND_EFFECT_VOLUME_DB = SystemProperties.getInt(
- "ro.config.sound_fx_volume",
- SOUND_EFFECT_DEFAULT_VOLUME_DB);
+ SOUND_EFFECT_VOLUME_DB = context.getResources().getInteger(
+ com.android.internal.R.integer.config_soundEffectVolumeDb);
mVolumePanel = new VolumePanel(context, this);
mMode = AudioSystem.MODE_NORMAL;
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 9d6c9f6c0466..3147ea5504c8 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -98,7 +98,7 @@ public class ExifInterface {
private static SimpleDateFormat sFormatter;
static {
- System.loadLibrary("exif");
+ System.loadLibrary("exif_jni");
sFormatter = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
sFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
}
diff --git a/media/jni/Android.mk b/media/jni/Android.mk
index 98e1bc5733ae..6294704dcf1d 100644
--- a/media/jni/Android.mk
+++ b/media/jni/Android.mk
@@ -37,6 +37,9 @@ LOCAL_SHARED_LIBRARIES := \
libexif \
libstagefright_amrnb_common \
+LOCAL_REQUIRED_MODULES := \
+ libexif_jni
+
LOCAL_STATIC_LIBRARIES := \
libstagefright_amrnbenc
diff --git a/packages/SystemUI/res/drawable-sw600dp-tvdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-tvdpi/notification_panel_bg.9.png
new file mode 100644
index 000000000000..727ee49a2713
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw600dp-tvdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-sw720dp-tvdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-tvdpi/notification_panel_bg.9.png
new file mode 100644
index 000000000000..571a7a516aba
--- /dev/null
+++ b/packages/SystemUI/res/drawable-sw720dp-tvdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-tvdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-tvdpi/notification_panel_bg.9.png
new file mode 100644
index 000000000000..c3a105cf7f68
--- /dev/null
+++ b/packages/SystemUI/res/drawable-tvdpi/notification_panel_bg.9.png
Binary files differ
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 11a1cd629660..85156998a242 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -251,7 +251,11 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
private int mLockSoundId;
private int mUnlockSoundId;
private int mLockSoundStreamId;
- private int mMasterStreamMaxVolume;
+
+ /**
+ * The volume applied to the lock/unlock sounds.
+ */
+ private final float mLockSoundVolume;
InfoCallbackImpl mInfoCallback = new InfoCallbackImpl() {
@@ -329,6 +333,9 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
if (soundPath == null || mUnlockSoundId == 0) {
if (DEBUG) Log.d(TAG, "failed to load sound from " + soundPath);
}
+ int lockSoundDefaultAttenuation = context.getResources().getInteger(
+ com.android.internal.R.integer.config_lockSoundVolumeDb);
+ mLockSoundVolume = (float)Math.pow(10, lockSoundDefaultAttenuation/20);
IntentFilter userFilter = new IntentFilter();
userFilter.addAction(Intent.ACTION_USER_SWITCHED);
userFilter.addAction(Intent.ACTION_USER_REMOVED);
@@ -1117,7 +1124,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
// If the stream is muted, don't play the sound
if (mAudioManager.isStreamMute(mMasterStreamType)) return;
- mLockSoundStreamId = mLockSounds.play(whichSound, 1.0f, 1.0f, 1, 0, 1.0f);
+ mLockSoundStreamId = mLockSounds.play(whichSound,
+ mLockSoundVolume, mLockSoundVolume, 1/*priortiy*/, 0/*loop*/, 1.0f/*rate*/);
}
}
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 3bddd9d025e0..9399fe932018 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -588,6 +588,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
}
}
+ int getActiveWindowId() {
+ return mSecurityPolicy.mActiveWindowId;
+ }
+
private Service getQueryBridge() {
if (mQueryBridge == null) {
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java
index 14784dce89d0..a36c67305d35 100644
--- a/services/java/com/android/server/accessibility/TouchExplorer.java
+++ b/services/java/com/android/server/accessibility/TouchExplorer.java
@@ -190,6 +190,9 @@ public class TouchExplorer {
// The long pressing pointer Y if coordinate remapping is needed.
private int mLongPressingPointerDeltaY;
+ // The id of the last touch explored window.
+ private int mLastTouchedWindowId;
+
/**
* Creates a new instance.
*
@@ -305,6 +308,11 @@ public class TouchExplorer {
mInjectedPointerTracker.mLastInjectedHoverEvent.recycle();
mInjectedPointerTracker.mLastInjectedHoverEvent = null;
}
+ mLastTouchedWindowId = -1;
+ } break;
+ case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
+ case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: {
+ mLastTouchedWindowId = event.getWindowId();
} break;
}
}
@@ -1078,13 +1086,15 @@ public class TouchExplorer {
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
Rect activeWindowBounds = mTempRect;
- mAms.getActiveWindowBounds(activeWindowBounds);
- if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
- if (!focusBounds.contains(clickLocationX, clickLocationY)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
+ if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
+ mAms.getActiveWindowBounds(activeWindowBounds);
+ if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
+ Rect focusBounds = mTempRect;
+ if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
+ if (!focusBounds.contains(clickLocationX, clickLocationY)) {
+ clickLocationX = focusBounds.centerX();
+ clickLocationY = focusBounds.centerY();
+ }
}
}
}
@@ -1308,13 +1318,15 @@ public class TouchExplorer {
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
Rect activeWindowBounds = mTempRect;
- mAms.getActiveWindowBounds(activeWindowBounds);
- if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
- Rect focusBounds = mTempRect;
- if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
- if (!focusBounds.contains(clickLocationX, clickLocationY)) {
- clickLocationX = focusBounds.centerX();
- clickLocationY = focusBounds.centerY();
+ if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
+ mAms.getActiveWindowBounds(activeWindowBounds);
+ if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
+ Rect focusBounds = mTempRect;
+ if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
+ if (!focusBounds.contains(clickLocationX, clickLocationY)) {
+ clickLocationX = focusBounds.centerX();
+ clickLocationY = focusBounds.centerY();
+ }
}
}
}
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java
index 488250824e1d..49d2ebd8e986 100644
--- a/services/java/com/android/server/pm/PackageManagerService.java
+++ b/services/java/com/android/server/pm/PackageManagerService.java
@@ -6165,7 +6165,22 @@ public class PackageManagerService extends IPackageManager.Stub {
private InstallArgs createInstallArgs(int flags, String fullCodePath, String fullResourcePath,
String nativeLibraryPath) {
- if (installOnSd(flags) || installForwardLocked(flags)) {
+ final boolean isInAsec;
+ if (installOnSd(flags)) {
+ /* Apps on SD card are always in ASEC containers. */
+ isInAsec = true;
+ } else if (installForwardLocked(flags)
+ && !fullCodePath.startsWith(mDrmAppPrivateInstallDir.getAbsolutePath())) {
+ /*
+ * Forward-locked apps are only in ASEC containers if they're the
+ * new style
+ */
+ isInAsec = true;
+ } else {
+ isInAsec = false;
+ }
+
+ if (isInAsec) {
return new AsecInstallArgs(fullCodePath, fullResourcePath, nativeLibraryPath,
installOnSd(flags), installForwardLocked(flags));
} else {
@@ -6548,8 +6563,9 @@ public class PackageManagerService extends IPackageManager.Stub {
setCachePath(subStr1);
}
- AsecInstallArgs(String cid) {
- super(null, null, isAsecExternal(cid) ? PackageManager.INSTALL_EXTERNAL : 0, null, null);
+ AsecInstallArgs(String cid, boolean isForwardLocked) {
+ super(null, null, (isAsecExternal(cid) ? PackageManager.INSTALL_EXTERNAL : 0)
+ | (isForwardLocked ? PackageManager.INSTALL_FORWARD_LOCK : 0), null, null);
this.cid = cid;
setCachePath(PackageHelper.getSdDir(cid));
}
@@ -6755,11 +6771,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
String getPackageName() {
- int idx = cid.lastIndexOf("-");
- if (idx == -1) {
- return cid;
- }
- return cid.substring(0, idx);
+ return getAsecPackageName(cid);
}
boolean doPostDeleteLI(boolean delete) {
@@ -6790,7 +6802,6 @@ public class PackageManagerService extends IPackageManager.Stub {
@Override
int doPostCopy(int uid) {
if (isFwdLocked()) {
- PackageHelper.fixSdPermissions(cid, uid, RES_FILE_NAME);
if (uid < Process.FIRST_APPLICATION_UID
|| !PackageHelper.fixSdPermissions(cid, uid, RES_FILE_NAME)) {
Slog.e(TAG, "Failed to finalize " + cid);
@@ -6803,6 +6814,14 @@ public class PackageManagerService extends IPackageManager.Stub {
}
};
+ static String getAsecPackageName(String packageCid) {
+ int idx = packageCid.lastIndexOf("-");
+ if (idx == -1) {
+ return packageCid;
+ }
+ return packageCid.substring(0, idx);
+ }
+
// Utility method used to create code paths based on package name and available index.
private static String getNextCodePath(String oldCodePath, String prefix, String suffix) {
String idxStr = "";
@@ -7864,7 +7883,7 @@ public class PackageManagerService extends IPackageManager.Stub {
}
p = ps.pkg;
}
- if (p != null && isExternal(p)) {
+ if (p != null && (isExternal(p) || isForwardLocked(p))) {
String secureContainerId = cidFromCodePath(p.applicationInfo.sourceDir);
if (secureContainerId != null) {
asecPath = PackageHelper.getSdFilesystem(secureContainerId);
@@ -7887,6 +7906,13 @@ public class PackageManagerService extends IPackageManager.Stub {
if (res < 0) {
return false;
}
+
+ // Fix-up for forward-locked applications in ASEC containers.
+ if (!isExternal(p)) {
+ pStats.codeSize += pStats.externalCodeSize;
+ pStats.externalCodeSize = 0L;
+ }
+
return true;
}
@@ -8724,10 +8750,9 @@ public class PackageManagerService extends IPackageManager.Stub {
// reader
synchronized (mPackages) {
for (String cid : list) {
- AsecInstallArgs args = new AsecInstallArgs(cid);
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Processing container " + cid);
- String pkgName = args.getPackageName();
+ String pkgName = getAsecPackageName(cid);
if (pkgName == null) {
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Container : " + cid + " stale");
@@ -8736,24 +8761,31 @@ public class PackageManagerService extends IPackageManager.Stub {
}
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Looking for pkg : " + pkgName);
- PackageSetting ps = mSettings.mPackages.get(pkgName);
+
+ final PackageSetting ps = mSettings.mPackages.get(pkgName);
+ if (ps == null) {
+ Log.i(TAG, "Deleting container with no matching settings " + cid);
+ removeCids.add(cid);
+ continue;
+ }
+
+ final AsecInstallArgs args = new AsecInstallArgs(cid, isForwardLocked(ps));
// The package status is changed only if the code path
// matches between settings and the container id.
- if (ps != null && ps.codePathString != null
- && ps.codePathString.equals(args.getCodePath())) {
- if (DEBUG_SD_INSTALL)
+ if (ps.codePathString != null && ps.codePathString.equals(args.getCodePath())) {
+ if (DEBUG_SD_INSTALL) {
Log.i(TAG, "Container : " + cid + " corresponds to pkg : " + pkgName
+ " at code path: " + ps.codePathString);
+ }
+
// We do have a valid package installed on sdcard
processCids.put(args, ps.codePathString);
- int uid = ps.appId;
+ final int uid = ps.appId;
if (uid != -1) {
uidList[num++] = uid;
}
} else {
- // Stale container on sdcard. Just delete
- if (DEBUG_SD_INSTALL)
- Log.i(TAG, "Container : " + cid + " stale");
+ Log.i(TAG, "Deleting stale container for " + cid);
removeCids.add(cid);
}
}
@@ -8837,6 +8869,9 @@ public class PackageManagerService extends IPackageManager.Stub {
if (args.isExternal()) {
parseFlags |= PackageParser.PARSE_ON_SDCARD;
}
+ if (args.isFwdLocked()) {
+ parseFlags |= PackageParser.PARSE_FORWARD_LOCK;
+ }
doGc = true;
synchronized (mInstallLock) {