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

Commit 8f4006fd authored by Romain Hunault's avatar Romain Hunault
Browse files

Merge branch 'v1-pie' into v1-pie-sprint_istanbul

parents 27f556ae a42122f8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -17,13 +17,13 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/menu_container"
    android:layout_width="match_parent"
    android:layout_width="@dimen/navigation_side_padding"
    android:layout_height="match_parent"
    android:importantForAccessibility="no"
    >
    <!-- Use width & height=match_parent for parent FrameLayout and buttons because they are placed
    inside a view that has a size controlled by weight. Ensure weight is large enough to support
    icon size. -->
    <!-- Use nav button width & height=match_parent for parent FrameLayout and buttons because they
    are placed inside a view that has a size controlled by weight. Ensure weight is large enough to
    support icon size. Use layout_width=navigation_side_padding like other navbar buttons. -->

    <com.android.systemui.statusbar.policy.KeyButtonView
        android:id="@+id/menu"
+8 −8
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
import static android.Manifest.permission.NETWORK_STACK;
import static android.content.pm.ApplicationInfo.FLAG_SYSTEM;
import static android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
import static android.content.pm.PackageManager.GET_PERMISSIONS;

import android.content.BroadcastReceiver;
@@ -42,6 +43,7 @@ import android.text.TextUtils;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;

import java.util.ArrayList;
import java.util.HashMap;
@@ -161,16 +163,14 @@ public class PermissionMonitor {
    }

    @VisibleForTesting
    boolean hasPermission(PackageInfo app, String permission) {
        if (app.requestedPermissions != null) {
            for (String p : app.requestedPermissions) {
                if (permission.equals(p)) {
                    return true;
                }
            }
        }
    boolean hasPermission(final PackageInfo app, final String permission) {
        if (app.requestedPermissions == null || app.requestedPermissionsFlags == null) {
            return false;
        }
        final int index = ArrayUtils.indexOf(app.requestedPermissions, permission);
        if (index < 0 || index >= app.requestedPermissionsFlags.length) return false;
        return (app.requestedPermissionsFlags[index] & REQUESTED_PERMISSION_GRANTED) != 0;
    }

    private boolean hasNetworkPermission(PackageInfo app) {
        return hasPermission(app, CHANGE_NETWORK_STATE);
+24 −20
Original line number Diff line number Diff line
@@ -18356,7 +18356,7 @@ public class PackageManagerService extends IPackageManager.Stub
                            continue;
                        }
                        List<VersionedPackage> libClientPackages = getPackagesUsingSharedLibraryLPr(
                                libEntry.info, 0, currUserId);
                                libEntry.info, MATCH_KNOWN_PACKAGES, currUserId);
                        if (!ArrayUtils.isEmpty(libClientPackages)) {
                            Slog.w(TAG, "Not removing package " + pkg.manifestPackageName
                                    + " hosting lib " + libEntry.info.getName() + " version "
@@ -18728,7 +18728,8 @@ public class PackageManagerService extends IPackageManager.Stub
     * Tries to delete system package.
     */
    private boolean deleteSystemPackageLIF(PackageParser.Package deletedPkg,
            PackageSetting deletedPs, int[] allUserHandles, int flags, PackageRemovedInfo outInfo,
            PackageSetting deletedPs, int[] allUserHandles, int flags,
            @Nullable PackageRemovedInfo outInfo,
            boolean writeSettings) {
        if (deletedPs.parentPackageName != null) {
            Slog.w(TAG, "Attempt to delete child system package " + deletedPkg.packageName);
@@ -18736,7 +18737,7 @@ public class PackageManagerService extends IPackageManager.Stub
        }
        final boolean applyUserRestrictions
                = (allUserHandles != null) && (outInfo.origUsers != null);
                = (allUserHandles != null) && outInfo != null && (outInfo.origUsers != null);
        final PackageSetting disabledPs;
        // Confirm if the system package has been updated
        // An updated system app can be deleted. This will also have to restore
@@ -18766,6 +18767,7 @@ public class PackageManagerService extends IPackageManager.Stub
            }
        }
        if (outInfo != null) {
            // Delete the updated package
            outInfo.isRemovedPackageSystemUpdate = true;
            if (outInfo.removedChildPackages != null) {
@@ -18783,6 +18785,7 @@ public class PackageManagerService extends IPackageManager.Stub
                    }
                }
            }
        }
        if (disabledPs.versionCode < deletedPs.versionCode) {
            // Delete data for downgrades
@@ -22710,9 +22713,9 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
            mSettings.writeKernelMappingLPr(ps);
        }
        final UserManager um = mContext.getSystemService(UserManager.class);
        final UserManagerService um = sUserManager;
        UserManagerInternal umInternal = getUserManagerInternal();
        for (UserInfo user : um.getUsers()) {
        for (UserInfo user : um.getUsers(false /* excludeDying */)) {
            final int flags;
            if (umInternal.isUserUnlockingOrUnlocked(user.id)) {
                flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
@@ -23373,8 +23376,9 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
                continue;
            }
            final String packageName = ps.pkg.packageName;
            // Skip over if system app
            if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0) {
            // Skip over if system app or static shared library
            if ((ps.pkgFlags & ApplicationInfo.FLAG_SYSTEM) != 0
                    || !TextUtils.isEmpty(ps.pkg.staticSharedLibName)) {
                continue;
            }
            if (DEBUG_CLEAN_APKS) {
+1 −1
Original line number Diff line number Diff line
@@ -1904,7 +1904,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (FactoryTest.isLongPressOnPowerOffEnabled()) {
            return LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM;
        }
        if (mTorchLongPressPowerEnabled && (!isScreenOn() || isDozeMode())) {
        if (mTorchLongPressPowerEnabled && (!isScreenOn() || isDozeMode() || mTorchEnabled)) {
            return LONG_PRESS_POWER_TORCH;
        }
        return mLongPressOnPowerBehavior;