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

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

Snap for 5495412 from 606f1c9f to qt-release

Change-Id: I9a7381da407316924e7a4ef6d9c275d1fce61a4c
parents 1bcea02c 606f1c9f
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -32,27 +32,6 @@ ifneq ($(ANDROID_BUILD_EMBEDDED),true)
# ============================================================
include $(CLEAR_VARS)

aidl_parcelables :=
define stubs-to-aidl-parcelables
  gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
  aidl_parcelables += $$(gen)
  $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables
	@echo Extract SDK parcelables: $$@
	rm -f $$@
	$(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
endef

$(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
  $(eval $(call stubs-to-aidl-parcelables,$(stubs))))

gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
.KATI_RESTAT: $(gen)
$(gen): $(aidl_parcelables)
	@echo Combining SDK parcelables: $@
	rm -f $@.tmp
	cat $^ | sort -u > $@.tmp
	$(call commit-change-for-toc,$@)

# This is used by ide.mk as the list of source files that are
# always included.
INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
+2 −2
Original line number Diff line number Diff line
@@ -1223,8 +1223,8 @@ package android {
    field public static final int shadowRadius = 16843108; // 0x1010164
    field public static final int shape = 16843162; // 0x101019a
    field public static final int shareInterpolator = 16843195; // 0x10101bb
    field public static final int sharedUserId = 16842763; // 0x101000b
    field public static final int sharedUserLabel = 16843361; // 0x1010261
    field @Deprecated public static final int sharedUserId = 16842763; // 0x101000b
    field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261
    field public static final int shell = 16844180; // 0x1010594
    field public static final int shortcutDisabledMessage = 16844075; // 0x101052b
    field public static final int shortcutId = 16844072; // 0x1010528
+1 −1
Original line number Diff line number Diff line
@@ -9479,7 +9479,7 @@ package android.view {
package android.view.accessibility {
  public final class AccessibilityManager {
    method public int getAccessibilityWindowId(android.os.IBinder);
    method public int getAccessibilityWindowId(@Nullable android.os.IBinder);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public void performAccessibilityShortcut();
  }
+100 −0
Original line number Diff line number Diff line
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#define DEBUG false
#include "Log.h"

#include <android-base/file.h>
#include <android/util/ProtoFileReader.h>
#include <android/util/ProtoOutputStream.h>
#include <android/util/protobuf.h>
#include <fcntl.h>
#include <gtest/gtest.h>
#include <signal.h>
#include <string.h>

#include "FdBuffer.h"
#include "incidentd_util.h"

using namespace android;
using namespace android::base;
using namespace android::os::incidentd;
using ::testing::Test;

const std::string kTestPath = GetExecutableDirectory();
const std::string kTestDataPath = kTestPath + "/testdata/";

status_t read(sp<ProtoFileReader> reader, size_t size) {
    uint8_t const* buf;
    while (size > 0 && (buf = reader->readBuffer()) != nullptr) {
        size_t amt = reader->currentToRead();
        if (size < amt) {
            amt = size;
        }
        reader->move(amt);
        size -= amt;
    }

    return NO_ERROR;
}

TEST(ProtoFileReaderTest, ParseOneLevel) {
    const std::string testFile = kTestDataPath + "protoFile.txt";
    size_t msg1Size = 10;
    size_t msg2Size = 5 * 1024;
    {
        // Create a proto file
        // TestProto {
        //    optional Section1 section1 = 1;
        //    optional Section2 section2 = 2;
        // }

        unique_fd fd(open(testFile.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR));
        ASSERT_NE(fd.get(), -1);
        ProtoOutputStream proto;
        string field1;
        field1.resize(msg1Size, 'h');
        string field2;
        field2.resize(msg2Size, 'a');
        proto.write(FIELD_TYPE_MESSAGE | 1, field1.data(), field1.length());
        proto.write(FIELD_TYPE_MESSAGE | 2, field2.data(), field2.length());
        proto.flush(fd);
    }

    int fd = open(testFile.c_str(), O_RDONLY | O_CLOEXEC);
    ASSERT_NE(fd, -1);

    status_t err;
    sp<ProtoFileReader> reader = new ProtoFileReader(fd);
    int i = 0;
    size_t msg_size[2];
    while (reader->hasNext()) {
        uint64_t fieldTag = reader->readRawVarint();
        uint32_t fieldId = read_field_id(fieldTag);
        uint8_t wireType = read_wire_type(fieldTag);
        ASSERT_EQ(WIRE_TYPE_LENGTH_DELIMITED, wireType);
        size_t sectionSize = reader->readRawVarint();
        if (i < 2) {
            msg_size[i] = sectionSize;
        }
        err = read(reader, sectionSize);
        ASSERT_EQ(NO_ERROR, err);
        i++;
    }

    ASSERT_EQ(2, i);

    ASSERT_EQ(msg1Size, msg_size[0]);
    ASSERT_EQ(msg2Size, msg_size[1]);
    close(fd);
}
+14 −1
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ import android.view.autofill.AutofillPopupWindow;
import android.view.autofill.IAutofillWindowPresenter;
import android.view.contentcapture.ContentCaptureContext;
import android.view.contentcapture.ContentCaptureManager;
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
import android.widget.AdapterView;
import android.widget.Toast;
import android.widget.Toolbar;
@@ -723,7 +724,7 @@ public class Activity extends ContextThemeWrapper
        Window.Callback, KeyEvent.Callback,
        OnCreateContextMenuListener, ComponentCallbacks2,
        Window.OnWindowDismissedCallback, WindowControllerCallback,
        AutofillManager.AutofillClient {
        AutofillManager.AutofillClient, ContentCaptureManager.ContentCaptureClient {
    private static final String TAG = "Activity";
    private static final boolean DEBUG_LIFECYCLE = false;

@@ -1125,6 +1126,12 @@ public class Activity extends ContextThemeWrapper
        return this;
    }

    /** @hide */
    @Override
    public final ContentCaptureClient getContentCaptureClient() {
        return this;
    }

    /**
     * Register an {@link Application.ActivityLifecycleCallbacks} instance that receives
     * lifecycle callbacks for only this Activity.
@@ -6511,6 +6518,12 @@ public class Activity extends ContextThemeWrapper
        return getComponentName();
    }

    /** @hide */
    @Override
    public final ComponentName contentCaptureClientGetComponentName() {
        return getComponentName();
    }

    /**
     * Retrieve a {@link SharedPreferences} object for accessing preferences
     * that are private to this activity.  This simply calls the underlying
Loading