diff options
Diffstat (limited to 'services/java/com/android/server')
5 files changed, 40 insertions, 82 deletions
diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java index 95d7623..499c15e 100644 --- a/services/java/com/android/server/AppWidgetServiceImpl.java +++ b/services/java/com/android/server/AppWidgetServiceImpl.java @@ -42,6 +42,7 @@ import android.os.Binder; import android.os.Bundle; import android.os.Environment; import android.os.IBinder; +import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; @@ -409,7 +410,7 @@ class AppWidgetServiceImpl { } public int allocateAppWidgetId(String packageName, int hostId) { - int callingUid = enforceCallingUid(packageName); + int callingUid = enforceSystemOrCallingUid(packageName); synchronized (mAppWidgetIds) { ensureStateLoadedLocked(); int appWidgetId = mNextAppWidgetId++; @@ -1358,10 +1359,10 @@ class AppWidgetServiceImpl { com.android.internal.R.styleable.AppWidgetProviderInfo_resizeMode, AppWidgetProviderInfo.RESIZE_NONE); info.widgetCategory = sa.getInt( - com.android.internal.R.styleable.AppWidgetProviderInfo_resizeMode, + com.android.internal.R.styleable.AppWidgetProviderInfo_widgetCategory, AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN); info.widgetFeatures = sa.getInt( - com.android.internal.R.styleable.AppWidgetProviderInfo_resizeMode, + com.android.internal.R.styleable.AppWidgetProviderInfo_widgetFeatures, AppWidgetProviderInfo.WIDGET_FEATURES_NONE); sa.recycle(); @@ -1391,6 +1392,15 @@ class AppWidgetServiceImpl { return pkgInfo.applicationInfo.uid; } + int enforceSystemOrCallingUid(String packageName) throws IllegalArgumentException { + int callingUid = Binder.getCallingUid(); + int uid = Process.myUid(); + if (UserHandle.getAppId(uid) == Process.SYSTEM_UID || uid == 0) { + return callingUid; + } + return enforceCallingUid(packageName); + } + int enforceCallingUid(String packageName) throws IllegalArgumentException { int callingUid = Binder.getCallingUid(); int packageUid; diff --git a/services/java/com/android/server/display/DisplayDeviceInfo.java b/services/java/com/android/server/display/DisplayDeviceInfo.java index 1420a50..f0cd0f5 100644 --- a/services/java/com/android/server/display/DisplayDeviceInfo.java +++ b/services/java/com/android/server/display/DisplayDeviceInfo.java @@ -180,7 +180,7 @@ final class DisplayDeviceInfo { msg.append(", FLAG_DEFAULT_DISPLAY"); } if ((flags & FLAG_SUPPORTS_ROTATION) != 0) { - msg.append(", FLAG_DEFAULT_DISPLAY"); + msg.append(", FLAG_SUPPORTS_ROTATION"); } if ((flags & FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT) != 0) { msg.append(", FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT"); diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index fe5889d..e208068 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -6334,7 +6334,8 @@ public class PackageManagerService extends IPackageManager.Stub { packageFile = mTempPackage; FileUtils.setPermissions(packageFile.getAbsolutePath(), - FileUtils.S_IRUSR | FileUtils.S_IWUSR | FileUtils.S_IROTH, + FileUtils.S_IRUSR | FileUtils.S_IWUSR | FileUtils.S_IRGRP + | FileUtils.S_IROTH, -1, -1); } else { packageFile = null; @@ -6515,12 +6516,12 @@ public class PackageManagerService extends IPackageManager.Stub { // will succeed. if (mArgs != null) { processPendingInstall(mArgs, mRet); - } - if (mTempPackage != null) { - if (!mTempPackage.delete()) { - Slog.w(TAG, "Couldn't delete temporary file: " - + mTempPackage.getAbsolutePath()); + if (mTempPackage != null) { + if (!mTempPackage.delete()) { + Slog.w(TAG, "Couldn't delete temporary file: " + + mTempPackage.getAbsolutePath()); + } } } } @@ -7942,17 +7943,23 @@ public class PackageManagerService extends IPackageManager.Stub { } private void deleteTempPackageFiles() { - FilenameFilter filter = new FilenameFilter() { + final FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.startsWith("vmdl") && name.endsWith(".tmp"); } }; - String tmpFilesList[] = mAppInstallDir.list(filter); - if(tmpFilesList == null) { + deleteTempPackageFilesInDirectory(mAppInstallDir, filter); + deleteTempPackageFilesInDirectory(mDrmAppPrivateInstallDir, filter); + } + + private static final void deleteTempPackageFilesInDirectory(File directory, + FilenameFilter filter) { + final String[] tmpFilesList = directory.list(filter); + if (tmpFilesList == null) { return; } - for(int i = 0; i < tmpFilesList.length; i++) { - File tmpFile = new File(mAppInstallDir, tmpFilesList[i]); + for (int i = 0; i < tmpFilesList.length; i++) { + final File tmpFile = new File(directory, tmpFilesList[i]); tmpFile.delete(); } } diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java index 72c6a51..cabe611 100644 --- a/services/java/com/android/server/wm/WindowAnimator.java +++ b/services/java/com/android/server/wm/WindowAnimator.java @@ -611,15 +611,6 @@ public class WindowAnimator { !mService.okToDisplay()); } - if (mService.mBlackFrame != null) { - if (mScreenRotationAnimation != null) { - mService.mBlackFrame.setMatrix( - mScreenRotationAnimation.getEnterTransformation().getMatrix()); - } else { - mService.mBlackFrame.clearMatrix(); - } - } - if (mService.mWatermark != null) { mService.mWatermark.drawIfNeeded(); } diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index dd98007..1a101ad 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -430,8 +430,6 @@ public class WindowManagerService extends IWindowManager.Stub Watermark mWatermark; StrictModeFlash mStrictModeFlash; - BlackFrame mBlackFrame; - final float[] mTmpFloats = new float[9]; boolean mDisplayReady; @@ -3442,25 +3440,27 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, "applyAnimation: atoken=" + atoken + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" - + " transit=" + transit + " Callers " + Debug.getCallers(3)); + + " transit=" + transit + " isEntrance=" + enter + + " Callers " + Debug.getCallers(3)); } else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) { a = createScaleUpAnimationLocked(transit, enter); initialized = true; if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, "applyAnimation: atoken=" + atoken + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" - + " transit=" + transit + " Callers " + Debug.getCallers(3)); + + " transit=" + transit + " isEntrance=" + enter + + " Callers " + Debug.getCallers(3)); } else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP || mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN) { boolean scaleUp = (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL_SCALE_UP); a = createThumbnailAnimationLocked(transit, enter, false, scaleUp); initialized = true; - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) { String animName = scaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN"; Slog.v(TAG, "applyAnimation: atoken=" + atoken + " anim=" + a + " nextAppTransition=" + animName - + " transit=" + transit + " Callers " + Debug.getCallers(3)); + + " transit=" + transit + " isEntrance=" + enter + + " Callers " + Debug.getCallers(3)); } } else { int animAttr = 0; @@ -3521,7 +3521,8 @@ public class WindowManagerService extends IWindowManager.Stub "applyAnimation: atoken=" + atoken + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) - + " transit=" + transit + " Callers " + Debug.getCallers(3)); + + " transit=" + transit + " isEntrance=" + enter + + " Callers " + Debug.getCallers(3)); } if (a != null) { if (DEBUG_ANIM) { @@ -6036,8 +6037,6 @@ public class WindowManagerService extends IWindowManager.Stub } } - rebuildBlackFrameLocked(); - final WindowList windows = displayContent.getWindowList(); for (int i = windows.size() - 1; i >= 0; i--) { WindowState w = windows.get(i); @@ -7854,49 +7853,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - private void rebuildBlackFrameLocked() { - if (mBlackFrame != null) { - mBlackFrame.kill(); - mBlackFrame = null; - } - // TODO(multidisplay): For now rotations are only main screen. - final DisplayContent displayContent = getDefaultDisplayContentLocked(); - final Display display = displayContent.getDisplay(); - if (displayContent.mBaseDisplayWidth < displayContent.mInitialDisplayWidth - || displayContent.mBaseDisplayHeight < displayContent.mInitialDisplayHeight) { - int initW, initH, baseW, baseH; - final boolean rotated = (mRotation == Surface.ROTATION_90 - || mRotation == Surface.ROTATION_270); - if (DEBUG_BOOT) { - Slog.i(TAG, "BLACK FRAME: rotated=" + rotated + " init=" - + displayContent.mInitialDisplayWidth + "x" - + displayContent.mInitialDisplayHeight + " base=" - + displayContent.mBaseDisplayWidth + "x" - + displayContent.mBaseDisplayHeight); - } - if (rotated) { - initW = displayContent.mInitialDisplayHeight; - initH = displayContent.mInitialDisplayWidth; - baseW = displayContent.mBaseDisplayHeight; - baseH = displayContent.mBaseDisplayWidth; - } else { - initW = displayContent.mInitialDisplayWidth; - initH = displayContent.mInitialDisplayHeight; - baseW = displayContent.mBaseDisplayWidth; - baseH = displayContent.mBaseDisplayHeight; - } - Rect outer = new Rect(0, 0, initW, initH); - Rect inner = new Rect(0, 0, baseW, baseH); - try { - mBlackFrame = new BlackFrame(mFxSession, outer, inner, MASK_LAYER, - display.getLayerStack()); - } catch (Surface.OutOfResourcesException e) { - } - } - } - private void readForcedDisplaySizeAndDensityLocked(final DisplayContent displayContent) { - boolean changed = false; final String sizeStr = Settings.Global.getString(mContext.getContentResolver(), Settings.Global.DISPLAY_SIZE_FORCED); if (sizeStr != null && sizeStr.length() > 0) { @@ -7909,7 +7866,6 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(displayContent.mDisplaySizeLock) { if (displayContent.mBaseDisplayWidth != width || displayContent.mBaseDisplayHeight != height) { - changed = true; Slog.i(TAG, "FORCED DISPLAY SIZE: " + width + "x" + height); displayContent.mBaseDisplayWidth = width; displayContent.mBaseDisplayHeight = height; @@ -7927,7 +7883,6 @@ public class WindowManagerService extends IWindowManager.Stub density = Integer.parseInt(densityStr); synchronized(displayContent.mDisplaySizeLock) { if (displayContent.mBaseDisplayDensity != density) { - changed = true; Slog.i(TAG, "FORCED DISPLAY DENSITY: " + density); displayContent.mBaseDisplayDensity = density; } @@ -7935,9 +7890,6 @@ public class WindowManagerService extends IWindowManager.Stub } catch (NumberFormatException ex) { } } - if (changed) { - rebuildBlackFrameLocked(); - } } private void setForcedDisplaySizeLocked(DisplayContent displayContent, int width, int height) { @@ -8011,8 +7963,6 @@ public class WindowManagerService extends IWindowManager.Stub mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } - rebuildBlackFrameLocked(); - performLayoutAndPlaceSurfacesLocked(); } |