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

Commit bde102fb authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Merge cherrypicks of [4997814, 4997815, 4997816, 4996950, 4996344, 4997836,...

Merge cherrypicks of [4997814, 4997815, 4997816, 4996950, 4996344, 4997836, 4997837, 4997838, 4998071, 4998091, 4998092, 4998093] into oc-m7-release

Change-Id: Ia72b0b0a4e2dfb3176853b3e1feb38e1eefddfa0
parents 0b434bf5 117ca495
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -806,11 +806,19 @@ public final class Parcel {
            return;
        }
        Set<Map.Entry<String,Object>> entries = val.entrySet();
        writeInt(entries.size());
        int size = entries.size();
        writeInt(size);

        for (Map.Entry<String,Object> e : entries) {
            writeValue(e.getKey());
            writeValue(e.getValue());
            size--;
        }

        if (size != 0) {
            throw new BadParcelableException("Map size does not match number of entries!");
        }

    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -199,6 +199,9 @@
    <!-- to change themes - light or dark -->
    <uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES" />

    <!-- permission necessary to hide non-system overlay windows from covering up the SystemUI -->
    <uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />

    <application
        android:name=".SystemUIApplication"
        android:persistent="true"
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.media;

import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
@@ -36,6 +38,7 @@ import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.StyleSpan;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
@@ -146,7 +149,9 @@ public class MediaProjectionPermissionActivity extends Activity
        mDialog.getButton(DialogInterface.BUTTON_POSITIVE).setFilterTouchesWhenObscured(true);

        ((CheckBox) mDialog.findViewById(R.id.remember)).setOnCheckedChangeListener(this);
        mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        final Window w = mDialog.getWindow();
        w.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        w.addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        mDialog.show();
    }
+4 −1
Original line number Diff line number Diff line
@@ -284,6 +284,7 @@ import com.android.server.Watchdog;
import com.android.server.net.NetworkPolicyManagerInternal;
import com.android.server.pm.Installer.InstallerException;
import com.android.server.pm.PermissionsState.PermissionState;
import com.android.server.pm.PackageSetting;
import com.android.server.pm.Settings.DatabaseVersion;
import com.android.server.pm.Settings.VersionInfo;
import com.android.server.pm.dex.DexManager;
@@ -5617,8 +5618,10 @@ public class PackageManagerService extends IPackageManager.Stub
    private static void enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission(
            PackageParser.Package pkg, BasePermission bp) {
        final PackageSetting pkgSetting = (PackageSetting) pkg.mExtras;
        final PermissionsState permsState = pkgSetting.getPermissionsState();
        int index = pkg.requestedPermissions.indexOf(bp.name);
        if (index == -1) {
        if (!permsState.hasRequestedPermission(bp.name) && index == -1) {
            throw new SecurityException("Package " + pkg.packageName
                    + " has not requested permission " + bp.name);
        }
+8 −0
Original line number Diff line number Diff line
@@ -290,6 +290,14 @@ public final class PermissionsState {
        return false;
    }

    /**
     * Returns whether the state has any known request for the given permission name,
     * whether or not it has been granted.
     */
    public boolean hasRequestedPermission(String name) {
        return mPermissions != null && (mPermissions.get(name) != null);
    }

    /**
     * Gets all permissions for a given device user id regardless if they
     * are install time or runtime permissions.
Loading