Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 021048db authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/cm-14.1' into v1-nougat

parents ee8e85b6 6183c32e
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -802,25 +802,6 @@ public class ResolverActivity extends Activity {
                        if (TextUtils.isEmpty(packageName)) {
                            pm.setDefaultBrowserPackageNameAsUser(ri.activityInfo.packageName, userId);
                        }
                    } else {
                        // Update Domain Verification status
                        ComponentName cn = intent.getComponent();
                        String packageName = cn.getPackageName();
                        String dataScheme = (data != null) ? data.getScheme() : null;

                        boolean isHttpOrHttps = (dataScheme != null) &&
                                (dataScheme.equals(IntentFilter.SCHEME_HTTP) ||
                                        dataScheme.equals(IntentFilter.SCHEME_HTTPS));

                        boolean isViewAction = (action != null) && action.equals(Intent.ACTION_VIEW);
                        boolean hasCategoryBrowsable = (categories != null) &&
                                categories.contains(Intent.CATEGORY_BROWSABLE);

                        if (isHttpOrHttps && isViewAction && hasCategoryBrowsable) {
                            pm.updateIntentVerificationStatusAsUser(packageName,
                                    PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS,
                                    userId);
                        }
                    }
                } else {
                    try {
+13 −1
Original line number Diff line number Diff line
@@ -395,6 +395,11 @@ public class ExternalStorageProvider extends DocumentsProvider {
        }
    }

    protected void onDocIdDeleted(String docId) {
        Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, docId);
        getContext().revokeUriPermission(uri, ~0);
    }

    @Override
    public Cursor queryRoots(String[] projection) throws FileNotFoundException {
        final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
@@ -472,6 +477,7 @@ public class ExternalStorageProvider extends DocumentsProvider {
            throw new IllegalStateException("Failed to rename to " + after);
        }
        final String afterDocId = getDocIdForFile(after);
        onDocIdDeleted(docId);
        if (!TextUtils.equals(docId, afterDocId)) {
            return afterDocId;
        } else {
@@ -492,6 +498,8 @@ public class ExternalStorageProvider extends DocumentsProvider {
            throw new IllegalStateException("Failed to delete " + file);
        }

        onDocIdDeleted(docId);

        if (visibleFile != null) {
            final ContentResolver resolver = getContext().getContentResolver();
            final Uri externalUri = MediaStore.Files.getContentUri("external");
@@ -526,7 +534,11 @@ public class ExternalStorageProvider extends DocumentsProvider {
        if (!before.renameTo(after)) {
            throw new IllegalStateException("Failed to move to " + after);
        }
        return getDocIdForFile(after);

        final String docId = getDocIdForFile(after);
        onDocIdDeleted(sourceDocumentId);

        return docId;
    }

    @Override
+57 −56
Original line number Diff line number Diff line
@@ -10972,10 +10972,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                final long origId = Binder.clearCallingIdentity();
                try {
                    checkTime(startTime, "getContentProviderImpl: incProviderCountLocked");
                // In this case the provider instance already exists, so we can
                // return it right away.
                    // Return the provider instance right away since it already exists.
                    conn = incProviderCountLocked(r, cpr, token, stable);
                    if (conn != null && (conn.stableCount+conn.unstableCount) == 1) {
                        if (cpr.proc != null && r.setAdj <= ProcessList.PERCEPTIBLE_APP_ADJ) {
@@ -10988,7 +10988,6 @@ public final class ActivityManagerService extends ActivityManagerNative
                            checkTime(startTime, "getContentProviderImpl: after updateLruProcess");
                        }
                    }
                    checkTime(startTime, "getContentProviderImpl: before updateOomAdj");
                    final int verifiedAdj = cpr.proc.verifiedAdj;
                    boolean success = updateOomAdjLocked(cpr.proc);
@@ -10997,7 +10996,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                    // it, we will check whether the process still exists.  Note that this doesn't
                    // completely get rid of races with LMK killing the process, but should make
                    // them much smaller.
                if (success && verifiedAdj != cpr.proc.setAdj && !isProcessAliveLocked(cpr.proc)) {
                    if (success && verifiedAdj != cpr.proc.setAdj
                            && !isProcessAliveLocked(cpr.proc)) {
                        success = false;
                    }
                    maybeUpdateProviderUsageStatsLocked(r, cpr.info.packageName, name);
@@ -11007,7 +11007,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    // pending on the process even though we managed to update its
                    // adj level.  Not sure what to do about this, but at least
                    // the race is now smaller.
                if (!success || cpr.proc.killedByAm) {
                    if (!success) {
                        // Uh oh...  it looks like the provider's process
                        // has been killed on us.  We need to wait for a new
                        // process to be started, and make sure its death
@@ -11028,9 +11028,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                    } else {
                        cpr.proc.verifiedAdj = cpr.proc.setAdj;
                    }
                } finally {
                    Binder.restoreCallingIdentity(origId);
                }
            }
            if (!providerRunning) {
                try {
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ public class AppTransition implements Dump {
    private static final int MAX_CLIP_REVEAL_TRANSITION_DURATION = 420;
    private static final int THUMBNAIL_APP_TRANSITION_DURATION = 336;
    private static final long APP_TRANSITION_TIMEOUT_MS = 5000;
    static final int MAX_APP_TRANSITION_DURATION = 3 * 1000; // 3 secs.

    private final Context mContext;
    private final WindowManagerService mService;
+11 −1
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED;
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static android.view.WindowManagerPolicy.TRANSIT_EXIT;
import static android.view.WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
import static com.android.server.wm.AppTransition.MAX_APP_TRANSITION_DURATION;
import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_END;
import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_START;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
@@ -3333,7 +3334,16 @@ public class WindowManagerService extends IWindowManager.Stub
                    mCurConfiguration.orientation, frame, displayFrame, insets, surfaceInsets,
                    isVoiceInteraction, freeform, atoken.mTask.mTaskId);
            if (a != null) {
                if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + atoken);
                if (a != null) {
                    // Setup the maximum app transition duration to prevent malicious app may set a long
                    // animation duration or infinite repeat counts for the app transition through
                    // ActivityOption#makeCustomAnimation or WindowManager#overridePendingTransition.
                    a.restrictDuration(MAX_APP_TRANSITION_DURATION);
                }
                if (DEBUG_ANIM) {
                    logWithStack(TAG, "Loaded animation " + a + " for " + atoken
                            + ", duration: " + ((a != null) ? a.getDuration() : 0));
                }
                final int containingWidth = frame.width();
                final int containingHeight = frame.height();
                atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight,