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

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

Merge cherrypicks of [2779825, 2780206, 2780207, 2780102, 2780103, 2779826,...

Merge cherrypicks of [2779825, 2780206, 2780207, 2780102, 2780103, 2779826, 2779827, 2779722, 2779723, 2779973, 2780208, 2780209, 2780210, 2780211, 2780212, 2780213, 2779703, 2779704, 2779705, 2779706, 2779707, 2779708, 2779709, 2780214, 2779828, 2779829, 2779454, 2779724] into oc-r3-release

Change-Id: I27cdc41924ec86e6840d678f2819de560c1b0870
parents 149289c7 2befed8b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -205,7 +205,8 @@ public final class BluetoothLeScanner {
        }
        synchronized (mLeScanClients) {
            if (callback != null && mLeScanClients.containsKey(callback)) {
                postCallbackError(callback, ScanCallback.SCAN_FAILED_ALREADY_STARTED);
                return postCallbackErrorOrReturn(callback,
                            ScanCallback.SCAN_FAILED_ALREADY_STARTED);
            }
            IBluetoothGatt gatt;
            try {
+2 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ public final class GateKeeperResponse implements Parcelable {
            if (mPayload != null) {
                dest.writeInt(mPayload.length);
                dest.writeByteArray(mPayload);
            } else {
                dest.writeInt(0);
            }
        }
    }
+27 −0
Original line number Diff line number Diff line
@@ -219,6 +219,33 @@ public class MediaDescription implements Parcelable {
        dest.writeParcelable(mMediaUri, flags);
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }

        if (!(o instanceof MediaDescription)){
            return false;
        }

        final MediaDescription d = (MediaDescription) o;

        if (!String.valueOf(mTitle).equals(String.valueOf(d.mTitle))) {
            return false;
        }

        if (!String.valueOf(mSubtitle).equals(String.valueOf(d.mSubtitle))) {
            return false;
        }

        if (!String.valueOf(mDescription).equals(String.valueOf(d.mDescription))) {
            return false;
        }

        return true;
    }

    @Override
    public String toString() {
        return mTitle + ", " + mSubtitle + ", " + mDescription;
+23 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Objects;

/**
 * Allows interaction with media controllers, volume keys, media buttons, and
@@ -1256,6 +1257,28 @@ public final class MediaSession {
                    "Description=" + mDescription +
                    ", Id=" + mId + " }";
        }

        @Override
        public boolean equals(Object o) {
            if (o == null) {
                return false;
            }

            if (!(o instanceof QueueItem)) {
                return false;
            }

            final QueueItem item = (QueueItem) o;
            if (mId != item.mId) {
                return false;
            }

            if (!Objects.equals(mDescription, item.mDescription)) {
                return false;
            }

            return true;
        }
    }

    private static final class Command {
+2 −19
Original line number Diff line number Diff line
@@ -397,24 +397,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
                && pm.resolveActivity(PHONE_INTENT, 0) != null;
    }

    private boolean isCameraDisabledByDpm() {
        final DevicePolicyManager dpm =
                (DevicePolicyManager) getContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
        if (dpm != null && mStatusBar != null) {
            try {
                final int userId = ActivityManager.getService().getCurrentUser().id;
                final int disabledFlags = dpm.getKeyguardDisabledFeatures(null, userId);
                final  boolean disabledBecauseKeyguardSecure =
                        (disabledFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0
                                && mStatusBar.isKeyguardSecure();
                return dpm.getCameraDisabled(null) || disabledBecauseKeyguardSecure;
            } catch (RemoteException e) {
                Log.e(TAG, "Can't get userId", e);
            }
        }
        return false;
    }

    private void watchForCameraPolicyChanges() {
        final IntentFilter filter = new IntentFilter();
        filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
@@ -865,7 +847,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
        @Override
        public IconState getIcon() {
            ResolveInfo resolved = resolveCameraIntent();
            mIconState.isVisible = !isCameraDisabledByDpm() && resolved != null
            boolean isCameraDisabled = (mStatusBar != null) && !mStatusBar.isCameraAllowedByAdmin();
            mIconState.isVisible = !isCameraDisabled && resolved != null
                    && getResources().getBoolean(R.bool.config_keyguardShowCameraAffordance)
                    && mUserSetupComplete;
            mIconState.drawable = mContext.getDrawable(R.drawable.ic_camera_alt_24dp);
Loading