Loading cmds/installd/InstalldNativeService.cpp +1 −3 Original line number Original line Diff line number Diff line Loading @@ -722,9 +722,7 @@ binder::Status InstalldNativeService::createAppDataLocked( } } } } // TODO(b/220095381): Due to boot time regression, we have omitted call to if (flags & FLAG_STORAGE_SDK) { // createSdkSandboxDataDirectory from here temporarily (unless it's for testing) if (uuid_ != nullptr && strcmp(uuid_, "TEST") == 0) { auto status = createSdkSandboxDataDirectory(uuid, packageName, userId, appId, previousAppId, auto status = createSdkSandboxDataDirectory(uuid, packageName, userId, appId, previousAppId, seInfo, flags); seInfo, flags); if (!status.isOk()) { if (!status.isOk()) { Loading cmds/installd/binder/android/os/IInstalld.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,7 @@ interface IInstalld { const int FLAG_STORAGE_DE = 0x1; const int FLAG_STORAGE_DE = 0x1; const int FLAG_STORAGE_CE = 0x2; const int FLAG_STORAGE_CE = 0x2; const int FLAG_STORAGE_EXTERNAL = 0x4; const int FLAG_STORAGE_EXTERNAL = 0x4; const int FLAG_STORAGE_SDK = 0x8; const int FLAG_CLEAR_CACHE_ONLY = 0x10; const int FLAG_CLEAR_CACHE_ONLY = 0x10; const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; Loading cmds/installd/tests/installd_service_test.cpp +21 −7 Original line number Original line Diff line number Diff line Loading @@ -79,6 +79,7 @@ static constexpr const char* kTestPath = "/data/local/tmp/user/0"; static constexpr const uid_t kSystemUid = 1000; static constexpr const uid_t kSystemUid = 1000; static constexpr const int32_t kTestUserId = 0; static constexpr const int32_t kTestUserId = 0; static constexpr const uid_t kTestAppId = 19999; static constexpr const uid_t kTestAppId = 19999; static constexpr const int FLAG_STORAGE_SDK = InstalldNativeService::FLAG_STORAGE_SDK; const gid_t kTestAppUid = multiuser_get_uid(kTestUserId, kTestAppId); const gid_t kTestAppUid = multiuser_get_uid(kTestUserId, kTestAppId); const uid_t kTestSdkSandboxUid = multiuser_get_sdk_sandbox_uid(kTestUserId, kTestAppId); const uid_t kTestSdkSandboxUid = multiuser_get_sdk_sandbox_uid(kTestUserId, kTestAppId); Loading Loading @@ -971,7 +972,7 @@ public: args.userId = kTestUserId; args.userId = kTestUserId; args.appId = kTestAppId; args.appId = kTestAppId; args.seInfo = "default"; args.seInfo = "default"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE | FLAG_STORAGE_SDK; return args; return args; } } Loading Loading @@ -1006,11 +1007,11 @@ private: } } }; }; TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLevelData) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading @@ -1030,11 +1031,24 @@ TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData) { S_IFDIR | S_ISGID | 0771); S_IFDIR | S_ISGID | 0771); } } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutDeFlag) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutSdkFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_FALSE(exists("/data/local/tmp/misc_ce/0/sdksandbox/com.foo")); ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutDeFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading @@ -1046,11 +1060,11 @@ TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutDeFla ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); } } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutCeFlag) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutCeFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_DE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading libs/gui/WindowInfo.cpp +3 −7 Original line number Original line Diff line number Diff line Loading @@ -51,11 +51,11 @@ bool WindowInfo::supportsSplitTouch() const { } } bool WindowInfo::isSpy() const { bool WindowInfo::isSpy() const { return inputFeatures.test(Feature::SPY); return inputConfig.test(InputConfig::SPY); } } bool WindowInfo::interceptsStylus() const { bool WindowInfo::interceptsStylus() const { return inputFeatures.test(Feature::INTERCEPTS_STYLUS); return inputConfig.test(InputConfig::INTERCEPTS_STYLUS); } } bool WindowInfo::overlaps(const WindowInfo* other) const { bool WindowInfo::overlaps(const WindowInfo* other) const { Loading @@ -73,8 +73,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.touchableRegion.hasSameRects(touchableRegion) && info.touchableRegion.hasSameRects(touchableRegion) && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.ownerUid == ownerUid && info.packageName == packageName && info.inputFeatures == inputFeatures && info.inputConfig == inputConfig && info.inputConfig == inputConfig && info.displayId == displayId && info.displayId == displayId && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.applicationInfo == applicationInfo && info.layoutParamsType == layoutParamsType && info.applicationInfo == applicationInfo && info.layoutParamsType == layoutParamsType && info.layoutParamsFlags == layoutParamsFlags; info.layoutParamsFlags == layoutParamsFlags; Loading @@ -92,7 +91,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(1); parcel->writeInt32(1); // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. static_assert(sizeof(inputFeatures) == 4u); static_assert(sizeof(inputConfig) == 4u); static_assert(sizeof(inputConfig) == 4u); // clang-format off // clang-format off Loading Loading @@ -120,7 +118,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(ownerPid) ?: parcel->writeInt32(ownerPid) ?: parcel->writeInt32(ownerUid) ?: parcel->writeInt32(ownerUid) ?: parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeInt32(inputFeatures.get()) ?: parcel->writeInt32(inputConfig.get()) ?: parcel->writeInt32(inputConfig.get()) ?: parcel->writeInt32(displayId) ?: parcel->writeInt32(displayId) ?: applicationInfo.writeToParcel(parcel) ?: applicationInfo.writeToParcel(parcel) ?: Loading Loading @@ -178,7 +175,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt); touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt); inputFeatures = Flags<Feature>(parcel->readInt32()); inputConfig = Flags<InputConfig>(parcel->readInt32()); inputConfig = Flags<InputConfig>(parcel->readInt32()); // clang-format off // clang-format off status = parcel->readInt32(&displayId) ?: status = parcel->readInt32(&displayId) ?: Loading libs/gui/include/gui/WindowInfo.h +32 −37 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ #pragma once #pragma once #include <android/gui/TouchOcclusionMode.h> #include <android/gui/TouchOcclusionMode.h> #include <android/os/IInputConstants.h> #include <android/os/InputConfig.h> #include <binder/Parcel.h> #include <binder/Parcel.h> #include <binder/Parcelable.h> #include <binder/Parcelable.h> #include <ftl/Flags.h> #include <ftl/Flags.h> Loading Loading @@ -132,49 +132,45 @@ struct WindowInfo : public Parcelable { ftl_last = FIRST_SYSTEM_WINDOW + 15 ftl_last = FIRST_SYSTEM_WINDOW + 15 }; }; // This is a conversion of os::IInputConstants::InputFeature to an enum backed by an unsigned // Flags used to determine configuration of this input window. // This is a conversion of os::InputConfig to an enum backed by an unsigned // type. This indicates that they are flags, so it can be used with ftl/enum.h. // type. This indicates that they are flags, so it can be used with ftl/enum.h. enum class Feature : uint32_t { enum class InputConfig : uint32_t { // clang-format off // clang-format off DEFAULT = static_cast<uint32_t>(os::InputConfig::DEFAULT), NO_INPUT_CHANNEL = NO_INPUT_CHANNEL = static_cast<uint32_t>(os::IInputConstants::InputFeature::NO_INPUT_CHANNEL), static_cast<uint32_t>(os::InputConfig::NO_INPUT_CHANNEL), NOT_VISIBLE = static_cast<uint32_t>(os::InputConfig::NOT_VISIBLE), NOT_FOCUSABLE = static_cast<uint32_t>(os::InputConfig::NOT_FOCUSABLE), NOT_TOUCHABLE = static_cast<uint32_t>(os::InputConfig::NOT_TOUCHABLE), PREVENT_SPLITTING = static_cast<uint32_t>(os::InputConfig::PREVENT_SPLITTING), DUPLICATE_TOUCH_TO_WALLPAPER = static_cast<uint32_t>(os::InputConfig::DUPLICATE_TOUCH_TO_WALLPAPER), IS_WALLPAPER = static_cast<uint32_t>(os::InputConfig::IS_WALLPAPER), PAUSE_DISPATCHING = static_cast<uint32_t>(os::InputConfig::PAUSE_DISPATCHING), TRUSTED_OVERLAY = static_cast<uint32_t>(os::InputConfig::TRUSTED_OVERLAY), WATCH_OUTSIDE_TOUCH = static_cast<uint32_t>(os::InputConfig::WATCH_OUTSIDE_TOUCH), SLIPPERY = static_cast<uint32_t>(os::InputConfig::SLIPPERY), DISABLE_USER_ACTIVITY = DISABLE_USER_ACTIVITY = static_cast<uint32_t>(os::IInputConstants::InputFeature::DISABLE_USER_ACTIVITY), static_cast<uint32_t>(os::InputConfig::DISABLE_USER_ACTIVITY), DROP_INPUT = DROP_INPUT = static_cast<uint32_t>(os::IInputConstants::InputFeature::DROP_INPUT), static_cast<uint32_t>(os::InputConfig::DROP_INPUT), DROP_INPUT_IF_OBSCURED = DROP_INPUT_IF_OBSCURED = static_cast<uint32_t>(os::IInputConstants::InputFeature::DROP_INPUT_IF_OBSCURED), static_cast<uint32_t>(os::InputConfig::DROP_INPUT_IF_OBSCURED), SPY = SPY = static_cast<uint32_t>(os::IInputConstants::InputFeature::SPY), static_cast<uint32_t>(os::InputConfig::SPY), INTERCEPTS_STYLUS = INTERCEPTS_STYLUS = static_cast<uint32_t>(os::IInputConstants::InputFeature::INTERCEPTS_STYLUS), static_cast<uint32_t>(os::InputConfig::INTERCEPTS_STYLUS), // clang-format on }; // Flags used to determine configuration of this input window. // Input windows can be configured with two sets of flags: InputFeature (WindowInfo::Feature // defined above), and InputConfig. When adding a new configuration for an input window: // - If you are adding a new flag that's visible and accessible to apps, it should be added // as an InputFeature. // - If you are adding an internal behaviour that is used within the system or shell and is // not exposed to apps, it should be added as an InputConfig. enum class InputConfig : uint32_t { // clang-format off NONE = 0, NOT_VISIBLE = 1 << 0, NOT_FOCUSABLE = 1 << 1, NOT_TOUCHABLE = 1 << 2, PREVENT_SPLITTING = 1 << 3, DUPLICATE_TOUCH_TO_WALLPAPER = 1 << 4, IS_WALLPAPER = 1 << 5, PAUSE_DISPATCHING = 1 << 6, // This flag is set when the window is of a trusted type that is allowed to silently // overlay other windows for the purpose of implementing the secure views feature. // Trusted overlays, such as IME windows, can partly obscure other windows without causing // motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. TRUSTED_OVERLAY = 1 << 7, WATCH_OUTSIDE_TOUCH = 1 << 8, SLIPPERY = 1 << 9, // clang-format on // clang-format on }; }; Loading Loading @@ -228,7 +224,6 @@ struct WindowInfo : public Parcelable { int32_t ownerPid = -1; int32_t ownerPid = -1; int32_t ownerUid = -1; int32_t ownerUid = -1; std::string packageName; std::string packageName; Flags<Feature> inputFeatures; Flags<InputConfig> inputConfig; Flags<InputConfig> inputConfig; int32_t displayId = ADISPLAY_ID_NONE; int32_t displayId = ADISPLAY_ID_NONE; InputApplicationInfo applicationInfo; InputApplicationInfo applicationInfo; Loading Loading
cmds/installd/InstalldNativeService.cpp +1 −3 Original line number Original line Diff line number Diff line Loading @@ -722,9 +722,7 @@ binder::Status InstalldNativeService::createAppDataLocked( } } } } // TODO(b/220095381): Due to boot time regression, we have omitted call to if (flags & FLAG_STORAGE_SDK) { // createSdkSandboxDataDirectory from here temporarily (unless it's for testing) if (uuid_ != nullptr && strcmp(uuid_, "TEST") == 0) { auto status = createSdkSandboxDataDirectory(uuid, packageName, userId, appId, previousAppId, auto status = createSdkSandboxDataDirectory(uuid, packageName, userId, appId, previousAppId, seInfo, flags); seInfo, flags); if (!status.isOk()) { if (!status.isOk()) { Loading
cmds/installd/binder/android/os/IInstalld.aidl +1 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,7 @@ interface IInstalld { const int FLAG_STORAGE_DE = 0x1; const int FLAG_STORAGE_DE = 0x1; const int FLAG_STORAGE_CE = 0x2; const int FLAG_STORAGE_CE = 0x2; const int FLAG_STORAGE_EXTERNAL = 0x4; const int FLAG_STORAGE_EXTERNAL = 0x4; const int FLAG_STORAGE_SDK = 0x8; const int FLAG_CLEAR_CACHE_ONLY = 0x10; const int FLAG_CLEAR_CACHE_ONLY = 0x10; const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; const int FLAG_CLEAR_CODE_CACHE_ONLY = 0x20; Loading
cmds/installd/tests/installd_service_test.cpp +21 −7 Original line number Original line Diff line number Diff line Loading @@ -79,6 +79,7 @@ static constexpr const char* kTestPath = "/data/local/tmp/user/0"; static constexpr const uid_t kSystemUid = 1000; static constexpr const uid_t kSystemUid = 1000; static constexpr const int32_t kTestUserId = 0; static constexpr const int32_t kTestUserId = 0; static constexpr const uid_t kTestAppId = 19999; static constexpr const uid_t kTestAppId = 19999; static constexpr const int FLAG_STORAGE_SDK = InstalldNativeService::FLAG_STORAGE_SDK; const gid_t kTestAppUid = multiuser_get_uid(kTestUserId, kTestAppId); const gid_t kTestAppUid = multiuser_get_uid(kTestUserId, kTestAppId); const uid_t kTestSdkSandboxUid = multiuser_get_sdk_sandbox_uid(kTestUserId, kTestAppId); const uid_t kTestSdkSandboxUid = multiuser_get_sdk_sandbox_uid(kTestUserId, kTestAppId); Loading Loading @@ -971,7 +972,7 @@ public: args.userId = kTestUserId; args.userId = kTestUserId; args.appId = kTestAppId; args.appId = kTestAppId; args.seInfo = "default"; args.seInfo = "default"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE | FLAG_STORAGE_SDK; return args; return args; } } Loading Loading @@ -1006,11 +1007,11 @@ private: } } }; }; TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLevelData) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading @@ -1030,11 +1031,24 @@ TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData) { S_IFDIR | S_ISGID | 0771); S_IFDIR | S_ISGID | 0771); } } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutDeFlag) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutSdkFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_DE; // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_FALSE(exists("/data/local/tmp/misc_ce/0/sdksandbox/com.foo")); ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutDeFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_CE; args.flags = FLAG_STORAGE_CE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading @@ -1046,11 +1060,11 @@ TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutDeFla ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); ASSERT_FALSE(exists("/data/local/tmp/misc_de/0/sdksandbox/com.foo")); } } TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSupplementalAppData_WithoutCeFlag) { TEST_F(SdkSandboxDataTest, CreateAppData_CreatesSdkAppLeveleData_WithoutCeFlag) { android::os::CreateAppDataResult result; android::os::CreateAppDataResult result; android::os::CreateAppDataArgs args = createAppDataArgs(); android::os::CreateAppDataArgs args = createAppDataArgs(); args.packageName = "com.foo"; args.packageName = "com.foo"; args.flags = FLAG_STORAGE_DE; args.flags = FLAG_STORAGE_DE | FLAG_STORAGE_SDK; // Create the app user data. // Create the app user data. ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); ASSERT_BINDER_SUCCESS(service->createAppData(args, &result)); Loading
libs/gui/WindowInfo.cpp +3 −7 Original line number Original line Diff line number Diff line Loading @@ -51,11 +51,11 @@ bool WindowInfo::supportsSplitTouch() const { } } bool WindowInfo::isSpy() const { bool WindowInfo::isSpy() const { return inputFeatures.test(Feature::SPY); return inputConfig.test(InputConfig::SPY); } } bool WindowInfo::interceptsStylus() const { bool WindowInfo::interceptsStylus() const { return inputFeatures.test(Feature::INTERCEPTS_STYLUS); return inputConfig.test(InputConfig::INTERCEPTS_STYLUS); } } bool WindowInfo::overlaps(const WindowInfo* other) const { bool WindowInfo::overlaps(const WindowInfo* other) const { Loading @@ -73,8 +73,7 @@ bool WindowInfo::operator==(const WindowInfo& info) const { info.touchableRegion.hasSameRects(touchableRegion) && info.touchableRegion.hasSameRects(touchableRegion) && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.touchOcclusionMode == touchOcclusionMode && info.ownerPid == ownerPid && info.ownerUid == ownerUid && info.packageName == packageName && info.ownerUid == ownerUid && info.packageName == packageName && info.inputFeatures == inputFeatures && info.inputConfig == inputConfig && info.inputConfig == inputConfig && info.displayId == displayId && info.displayId == displayId && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.replaceTouchableRegionWithCrop == replaceTouchableRegionWithCrop && info.applicationInfo == applicationInfo && info.layoutParamsType == layoutParamsType && info.applicationInfo == applicationInfo && info.layoutParamsType == layoutParamsType && info.layoutParamsFlags == layoutParamsFlags; info.layoutParamsFlags == layoutParamsFlags; Loading @@ -92,7 +91,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(1); parcel->writeInt32(1); // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. // Ensure that the size of the flags that we use is 32 bits for writing into the parcel. static_assert(sizeof(inputFeatures) == 4u); static_assert(sizeof(inputConfig) == 4u); static_assert(sizeof(inputConfig) == 4u); // clang-format off // clang-format off Loading Loading @@ -120,7 +118,6 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const { parcel->writeInt32(ownerPid) ?: parcel->writeInt32(ownerPid) ?: parcel->writeInt32(ownerUid) ?: parcel->writeInt32(ownerUid) ?: parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeUtf8AsUtf16(packageName) ?: parcel->writeInt32(inputFeatures.get()) ?: parcel->writeInt32(inputConfig.get()) ?: parcel->writeInt32(inputConfig.get()) ?: parcel->writeInt32(displayId) ?: parcel->writeInt32(displayId) ?: applicationInfo.writeToParcel(parcel) ?: applicationInfo.writeToParcel(parcel) ?: Loading Loading @@ -178,7 +175,6 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) { touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt); touchOcclusionMode = static_cast<TouchOcclusionMode>(touchOcclusionModeInt); inputFeatures = Flags<Feature>(parcel->readInt32()); inputConfig = Flags<InputConfig>(parcel->readInt32()); inputConfig = Flags<InputConfig>(parcel->readInt32()); // clang-format off // clang-format off status = parcel->readInt32(&displayId) ?: status = parcel->readInt32(&displayId) ?: Loading
libs/gui/include/gui/WindowInfo.h +32 −37 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ #pragma once #pragma once #include <android/gui/TouchOcclusionMode.h> #include <android/gui/TouchOcclusionMode.h> #include <android/os/IInputConstants.h> #include <android/os/InputConfig.h> #include <binder/Parcel.h> #include <binder/Parcel.h> #include <binder/Parcelable.h> #include <binder/Parcelable.h> #include <ftl/Flags.h> #include <ftl/Flags.h> Loading Loading @@ -132,49 +132,45 @@ struct WindowInfo : public Parcelable { ftl_last = FIRST_SYSTEM_WINDOW + 15 ftl_last = FIRST_SYSTEM_WINDOW + 15 }; }; // This is a conversion of os::IInputConstants::InputFeature to an enum backed by an unsigned // Flags used to determine configuration of this input window. // This is a conversion of os::InputConfig to an enum backed by an unsigned // type. This indicates that they are flags, so it can be used with ftl/enum.h. // type. This indicates that they are flags, so it can be used with ftl/enum.h. enum class Feature : uint32_t { enum class InputConfig : uint32_t { // clang-format off // clang-format off DEFAULT = static_cast<uint32_t>(os::InputConfig::DEFAULT), NO_INPUT_CHANNEL = NO_INPUT_CHANNEL = static_cast<uint32_t>(os::IInputConstants::InputFeature::NO_INPUT_CHANNEL), static_cast<uint32_t>(os::InputConfig::NO_INPUT_CHANNEL), NOT_VISIBLE = static_cast<uint32_t>(os::InputConfig::NOT_VISIBLE), NOT_FOCUSABLE = static_cast<uint32_t>(os::InputConfig::NOT_FOCUSABLE), NOT_TOUCHABLE = static_cast<uint32_t>(os::InputConfig::NOT_TOUCHABLE), PREVENT_SPLITTING = static_cast<uint32_t>(os::InputConfig::PREVENT_SPLITTING), DUPLICATE_TOUCH_TO_WALLPAPER = static_cast<uint32_t>(os::InputConfig::DUPLICATE_TOUCH_TO_WALLPAPER), IS_WALLPAPER = static_cast<uint32_t>(os::InputConfig::IS_WALLPAPER), PAUSE_DISPATCHING = static_cast<uint32_t>(os::InputConfig::PAUSE_DISPATCHING), TRUSTED_OVERLAY = static_cast<uint32_t>(os::InputConfig::TRUSTED_OVERLAY), WATCH_OUTSIDE_TOUCH = static_cast<uint32_t>(os::InputConfig::WATCH_OUTSIDE_TOUCH), SLIPPERY = static_cast<uint32_t>(os::InputConfig::SLIPPERY), DISABLE_USER_ACTIVITY = DISABLE_USER_ACTIVITY = static_cast<uint32_t>(os::IInputConstants::InputFeature::DISABLE_USER_ACTIVITY), static_cast<uint32_t>(os::InputConfig::DISABLE_USER_ACTIVITY), DROP_INPUT = DROP_INPUT = static_cast<uint32_t>(os::IInputConstants::InputFeature::DROP_INPUT), static_cast<uint32_t>(os::InputConfig::DROP_INPUT), DROP_INPUT_IF_OBSCURED = DROP_INPUT_IF_OBSCURED = static_cast<uint32_t>(os::IInputConstants::InputFeature::DROP_INPUT_IF_OBSCURED), static_cast<uint32_t>(os::InputConfig::DROP_INPUT_IF_OBSCURED), SPY = SPY = static_cast<uint32_t>(os::IInputConstants::InputFeature::SPY), static_cast<uint32_t>(os::InputConfig::SPY), INTERCEPTS_STYLUS = INTERCEPTS_STYLUS = static_cast<uint32_t>(os::IInputConstants::InputFeature::INTERCEPTS_STYLUS), static_cast<uint32_t>(os::InputConfig::INTERCEPTS_STYLUS), // clang-format on }; // Flags used to determine configuration of this input window. // Input windows can be configured with two sets of flags: InputFeature (WindowInfo::Feature // defined above), and InputConfig. When adding a new configuration for an input window: // - If you are adding a new flag that's visible and accessible to apps, it should be added // as an InputFeature. // - If you are adding an internal behaviour that is used within the system or shell and is // not exposed to apps, it should be added as an InputConfig. enum class InputConfig : uint32_t { // clang-format off NONE = 0, NOT_VISIBLE = 1 << 0, NOT_FOCUSABLE = 1 << 1, NOT_TOUCHABLE = 1 << 2, PREVENT_SPLITTING = 1 << 3, DUPLICATE_TOUCH_TO_WALLPAPER = 1 << 4, IS_WALLPAPER = 1 << 5, PAUSE_DISPATCHING = 1 << 6, // This flag is set when the window is of a trusted type that is allowed to silently // overlay other windows for the purpose of implementing the secure views feature. // Trusted overlays, such as IME windows, can partly obscure other windows without causing // motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED. TRUSTED_OVERLAY = 1 << 7, WATCH_OUTSIDE_TOUCH = 1 << 8, SLIPPERY = 1 << 9, // clang-format on // clang-format on }; }; Loading Loading @@ -228,7 +224,6 @@ struct WindowInfo : public Parcelable { int32_t ownerPid = -1; int32_t ownerPid = -1; int32_t ownerUid = -1; int32_t ownerUid = -1; std::string packageName; std::string packageName; Flags<Feature> inputFeatures; Flags<InputConfig> inputConfig; Flags<InputConfig> inputConfig; int32_t displayId = ADISPLAY_ID_NONE; int32_t displayId = ADISPLAY_ID_NONE; InputApplicationInfo applicationInfo; InputApplicationInfo applicationInfo; Loading