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

Commit b3b3d4ec authored by Xin Li's avatar Xin Li Committed by Android (Google) Code Review
Browse files

Merge "Revert "Snap for 6793014 from bbbccc3c...""

parents 2d0adaf8 082aec6c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "CtsOsTestCases",
      "options": [
        {
          "include-filter": "android.os.cts.CompanionDeviceManagerTest"
        }
      ]
    }
  ]
}
+3 −3
Original line number Diff line number Diff line
@@ -43,11 +43,11 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FastXmlSerializer;

import libcore.io.IoUtils;

import com.google.android.collect.Lists;
import com.google.android.collect.Maps;

import libcore.io.IoUtils;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
@@ -793,7 +793,7 @@ public abstract class RegisteredServicesCache<V> {

    @VisibleForTesting
    protected List<UserInfo> getUsers() {
        return UserManager.get(mContext).getUsers(true);
        return UserManager.get(mContext).getAliveUsers();
    }

    @VisibleForTesting
+7 −5
Original line number Diff line number Diff line
@@ -1293,7 +1293,7 @@ public class UserManager {
     * in {@link UserManager} & {@link DevicePolicyManager}.
     * Note: This is slightly different from the real set of user restrictions listed in {@link
     * com.android.server.pm.UserRestrictionsUtils#USER_RESTRICTIONS}. For example
     * {@link #KEY_RESTRICTIONS_PENDING} is not a real user restriction, but is a a legitimate
     * {@link #KEY_RESTRICTIONS_PENDING} is not a real user restriction, but is a legitimate
     * value that can be passed into {@link #hasUserRestriction(String)}.
     * @hide
     */
@@ -3252,7 +3252,8 @@ public class UserManager {
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public @NonNull List<UserHandle> getUserHandles(boolean excludeDying) {
        List<UserInfo> users = getUsers(excludeDying);
        List<UserInfo> users = getUsers(/* excludePartial= */ true, excludeDying,
                /* excludePreCreated= */ true);
        List<UserHandle> result = new ArrayList<>(users.size());
        for (UserInfo user : users) {
            result.add(user.getUserHandle());
@@ -3270,7 +3271,8 @@ public class UserManager {
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public long[] getSerialNumbersOfUsers(boolean excludeDying) {
        List<UserInfo> users = getUsers(excludeDying);
        List<UserInfo> users = getUsers(/* excludePartial= */ true, excludeDying,
                /* excludePreCreated= */ true);
        long[] result = new long[users.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = users.get(i).serialNumber;
@@ -3336,7 +3338,7 @@ public class UserManager {
    public boolean canAddMoreUsers() {
        // TODO(b/142482943): UMS has different logic, excluding Demo and Profile from counting. Why
        //                    not here? The logic is inconsistent. See UMS.canAddMoreManagedProfiles
        final List<UserInfo> users = getUsers(true);
        final List<UserInfo> users = getAliveUsers();
        final int totalUserCount = users.size();
        int aliveUserCount = 0;
        for (int i = 0; i < totalUserCount; i++) {
@@ -4144,7 +4146,7 @@ public class UserManager {

    /** Returns whether there are any users (other than the current user) to which to switch. */
    private boolean areThereUsersToWhichToSwitch() {
        final List<UserInfo> users = getUsers(true);
        final List<UserInfo> users = getAliveUsers();
        if (users == null) {
            return false;
        }
+1 −1
Original line number Diff line number Diff line
@@ -870,7 +870,7 @@ public class CallLog {

                // Otherwise, insert to all other users that are running and unlocked.

                final List<UserInfo> users = userManager.getUsers(true);
                final List<UserInfo> users = userManager.getAliveUsers();

                final int count = users.size();
                for (int i = 0; i < count; i++) {
+40 −36
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include "android_media_AudioTrack.h"

#include <nativehelper/JNIHelp.h>
#include <nativehelper/ScopedUtfChars.h>
#include "core_jni_helpers.h"

#include <utils/Log.h>
@@ -251,7 +252,7 @@ static jint android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject we
                                           jint audioFormat, jint buffSizeInBytes, jint memoryMode,
                                           jintArray jSession, jlong nativeAudioTrack,
                                           jboolean offload, jint encapsulationMode,
                                           jobject tunerConfiguration) {
                                           jobject tunerConfiguration, jstring opPackageName) {
    ALOGV("sampleRates=%p, channel mask=%x, index mask=%x, audioFormat(Java)=%d, buffSize=%d,"
          " nativeAudioTrack=0x%" PRIX64 ", offload=%d encapsulationMode=%d tuner=%p",
          jSampleRate, channelPositionMask, channelIndexMask, audioFormat, buffSizeInBytes,
@@ -337,7 +338,8 @@ static jint android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject we
        }

        // create the native AudioTrack object
        lpTrack = new AudioTrack();
        ScopedUtfChars opPackageNameStr(env, opPackageName);
        lpTrack = new AudioTrack(opPackageNameStr.c_str());

        // read the AudioAttributes values
        auto paa = JNIAudioAttributeHelper::makeUnique();
@@ -371,23 +373,24 @@ static jint android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject we
        status_t status = NO_ERROR;
        switch (memoryMode) {
        case MODE_STREAM:
            status = lpTrack->set(
                    AUDIO_STREAM_DEFAULT,// stream type, but more info conveyed in paa (last argument)
            status = lpTrack->set(AUDIO_STREAM_DEFAULT, // stream type, but more info conveyed
                                                        // in paa (last argument)
                                  sampleRateInHertz,
                                  format, // word length, PCM
                    nativeChannelMask,
                    offload ? 0 : frameCount,
                    offload ? AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD : AUDIO_OUTPUT_FLAG_NONE,
                    audioCallback, &(lpJniStorage->mCallbackData),//callback, callback data (user)
                    0,// notificationFrames == 0 since not using EVENT_MORE_DATA to feed the AudioTrack
                                  nativeChannelMask, offload ? 0 : frameCount,
                                  offload ? AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD
                                          : AUDIO_OUTPUT_FLAG_NONE,
                                  audioCallback,
                                  &(lpJniStorage->mCallbackData), // callback, callback data (user)
                                  0,    // notificationFrames == 0 since not using EVENT_MORE_DATA
                                        // to feed the AudioTrack
                                  0,    // shared mem
                                  true, // thread can call Java
                                  sessionId, // audio session ID
                    offload ? AudioTrack::TRANSFER_SYNC_NOTIF_CALLBACK : AudioTrack::TRANSFER_SYNC,
                    offload ? &offloadInfo : NULL,
                    -1, -1,                       // default uid, pid values
                                  offload ? AudioTrack::TRANSFER_SYNC_NOTIF_CALLBACK
                                          : AudioTrack::TRANSFER_SYNC,
                                  offload ? &offloadInfo : NULL, -1, -1, // default uid, pid values
                                  paa.get());

            break;

        case MODE_STATIC:
@@ -398,15 +401,15 @@ static jint android_media_AudioTrack_setup(JNIEnv *env, jobject thiz, jobject we
                goto native_init_failure;
            }

            status = lpTrack->set(
                    AUDIO_STREAM_DEFAULT,// stream type, but more info conveyed in paa (last argument)
            status = lpTrack->set(AUDIO_STREAM_DEFAULT, // stream type, but more info conveyed
                                                        // in paa (last argument)
                                  sampleRateInHertz,
                                  format, // word length, PCM
                    nativeChannelMask,
                    frameCount,
                    AUDIO_OUTPUT_FLAG_NONE,
                    audioCallback, &(lpJniStorage->mCallbackData),//callback, callback data (user));
                    0,// notificationFrames == 0 since not using EVENT_MORE_DATA to feed the AudioTrack
                                  nativeChannelMask, frameCount, AUDIO_OUTPUT_FLAG_NONE,
                                  audioCallback,
                                  &(lpJniStorage->mCallbackData), // callback, callback data (user)
                                  0, // notificationFrames == 0 since not using EVENT_MORE_DATA
                                     // to feed the AudioTrack
                                  lpJniStorage->mMemBase, // shared mem
                                  true,                   // thread can call Java
                                  sessionId,              // audio session ID
@@ -1428,7 +1431,8 @@ static const JNINativeMethod gMethods[] = {
        {"native_stop", "()V", (void *)android_media_AudioTrack_stop},
        {"native_pause", "()V", (void *)android_media_AudioTrack_pause},
        {"native_flush", "()V", (void *)android_media_AudioTrack_flush},
        {"native_setup", "(Ljava/lang/Object;Ljava/lang/Object;[IIIIII[IJZILjava/lang/Object;)I",
        {"native_setup",
         "(Ljava/lang/Object;Ljava/lang/Object;[IIIIII[IJZILjava/lang/Object;Ljava/lang/String;)I",
         (void *)android_media_AudioTrack_setup},
        {"native_finalize", "()V", (void *)android_media_AudioTrack_finalize},
        {"native_release", "()V", (void *)android_media_AudioTrack_release},
Loading