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

Commit a2ba4605 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8033408 from addb12da to sc-v2-release

Change-Id: I4e7e46c81e7c7d819a5de9d8cd53cf3329a1cbf9
parents 6fa54db6 addb12da
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5681,6 +5681,10 @@
    <!-- Allows input events to be monitored. Very dangerous!  @hide -->
    <permission android:name="android.permission.MONITOR_INPUT"
                android:protectionLevel="signature|recents" />
    <!-- Allows the use of FLAG_SLIPPERY, which permits touch events to slip from the current
         window to the window where the touch currently is on top of.  @hide -->
    <permission android:name="android.permission.ALLOW_SLIPPERY_TOUCHES"
                android:protectionLevel="signature|recents" />
    <!--  Allows the caller to change the associations between input devices and displays.
        Very dangerous! @hide -->
    <permission android:name="android.permission.ASSOCIATE_INPUT_DEVICE_TO_DISPLAY"
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@
    <uses-permission android:name="android.permission.SET_ORIENTATION" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <uses-permission android:name="android.permission.MONITOR_INPUT" />
    <uses-permission android:name="android.permission.ALLOW_SLIPPERY_TOUCHES" />
    <uses-permission android:name="android.permission.INPUT_CONSUMER" />

    <!-- DreamManager -->
+5 −4
Original line number Diff line number Diff line
@@ -53,21 +53,22 @@
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_width="@dimen/internet_dialog_progress_bar_width"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginBottom="@dimen/internet_dialog_network_layout_margin"
        android:orientation="vertical">

        <View
            android:id="@+id/divider"
            android:layout_gravity="center_vertical|center_horizontal"
            android:layout_width="340dp"
            android:layout_width="match_parent"
            android:layout_height="4dp"
            android:layout_gravity="center_vertical|center_horizontal"
            android:background="?androidprv:attr/colorSurfaceVariant"/>

        <ProgressBar
            android:id="@+id/wifi_searching_progress"
            android:layout_width="340dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:visibility="gone"
+2 −0
Original line number Diff line number Diff line
@@ -1254,6 +1254,8 @@

    <!-- Internet dialog related dimensions -->
    <dimen name="internet_dialog_corner_radius">24dp</dimen>
    <!-- Width of progress bar -->
    <dimen name="internet_dialog_progress_bar_width">152dp</dimen>
    <!-- End margin of network layout -->
    <dimen name="internet_dialog_network_layout_margin">16dp</dimen>
    <!-- Size of switch bar in internet dialog -->
+20 −5
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.server.connectivity;

import static android.Manifest.permission.BIND_VPN_SERVICE;
import static android.Manifest.permission.CONTROL_VPN;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_METERED;
import static android.net.RouteInfo.RTN_THROW;
import static android.net.RouteInfo.RTN_UNREACHABLE;
@@ -891,6 +893,7 @@ public class Vpn {
     * - oldPackage null, newPackage non-null: ConfirmDialog calling prepareVpn().
     * - oldPackage null, newPackage=LEGACY_VPN: Used internally to disconnect
     *   and revoke any current app VPN and re-prepare legacy vpn.
     * - oldPackage null, newPackage null: always returns true for backward compatibility.
     *
     * TODO: Rename the variables - or split this method into two - and end this confusion.
     * TODO: b/29032008 Migrate code from prepare(oldPackage=non-null, newPackage=LEGACY_VPN)
@@ -904,6 +907,18 @@ public class Vpn {
     */
    public synchronized boolean prepare(
            String oldPackage, String newPackage, @VpnManager.VpnType int vpnType) {
        // Except for Settings and VpnDialogs, the caller should be matched one of oldPackage or
        // newPackage. Otherwise, non VPN owner might get the VPN always-on status of the VPN owner.
        // See b/191382886.
        if (mContext.checkCallingOrSelfPermission(CONTROL_VPN) != PERMISSION_GRANTED) {
            if (oldPackage != null) {
                verifyCallingUidAndPackage(oldPackage);
            }
            if (newPackage != null) {
                verifyCallingUidAndPackage(newPackage);
            }
        }

        if (oldPackage != null) {
            // Stop an existing always-on VPN from being dethroned by other apps.
            if (mAlwaysOn && !isCurrentPreparedPackage(oldPackage)) {
@@ -1803,14 +1818,13 @@ public class Vpn {
    }

    private void enforceControlPermission() {
        mContext.enforceCallingPermission(Manifest.permission.CONTROL_VPN, "Unauthorized Caller");
        mContext.enforceCallingPermission(CONTROL_VPN, "Unauthorized Caller");
    }

    private void enforceControlPermissionOrInternalCaller() {
        // Require the caller to be either an application with CONTROL_VPN permission or a process
        // in the system server.
        mContext.enforceCallingOrSelfPermission(Manifest.permission.CONTROL_VPN,
                "Unauthorized Caller");
        mContext.enforceCallingOrSelfPermission(CONTROL_VPN, "Unauthorized Caller");
    }

    private void enforceSettingsPermission() {
@@ -3115,8 +3129,9 @@ public class Vpn {
    }

    private void verifyCallingUidAndPackage(String packageName) {
        if (getAppUid(packageName, mUserId) != Binder.getCallingUid()) {
            throw new SecurityException("Mismatched package and UID");
        final int callingUid = Binder.getCallingUid();
        if (getAppUid(packageName, mUserId) != callingUid) {
            throw new SecurityException(packageName + " does not belong to uid " + callingUid);
        }
    }

Loading