Skip to content

Commit cf24906

Browse files
author
Android Build Coastguard Worker
committed
Snap for 12722466 from 7dd4415 to 25Q1-release
Change-Id: Iacd485a73500be1544d6e9d76f94ce991414fe44
2 parents 489671f + 7dd4415 commit cf24906

12 files changed

Lines changed: 256 additions & 199 deletions

File tree

include/android/performance_hint.h

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ __BEGIN_DECLS
7676
struct APerformanceHintManager;
7777
struct APerformanceHintSession;
7878
struct AWorkDuration;
79+
struct ANativeWindow;
80+
struct ASurfaceControl;
7981

8082
/**
8183
* {@link AWorkDuration} is an opaque type that represents the breakdown of the
@@ -353,6 +355,39 @@ int APerformanceHint_notifyWorkloadReset(
353355
APerformanceHintSession* _Nonnull session,
354356
bool cpu, bool gpu, const char* _Nonnull debugName) __INTRODUCED_IN(36);
355357

358+
/**
359+
* Associates a session with any {@link ASurfaceControl} or {@link ANativeWindow}
360+
* instances managed by this session.
361+
*
362+
* This method is primarily intended for sessions that manage the timing of an entire
363+
* graphics pipeline end-to-end, such as those using the
364+
* {@link ASessionCreationConfig_setGraphicsPipeline} API. However, any session directly
365+
* or indirectly managing a graphics pipeline should still associate themselves with
366+
* directly relevant ASurfaceControl or ANativeWindow instances for better optimization.
367+
*
368+
* To see any benefit from this method, the client must make sure they are updating the framerate
369+
* of attached surfaces using methods such as {@link ANativeWindow_setFrameRate}, or by updating
370+
* any associated ASurfaceControls with transactions that have {ASurfaceTransaction_setFrameRate}.
371+
*
372+
* @param session The {@link APerformanceHintSession} instance to update.
373+
* @param nativeWindows A pointer to a list of ANativeWindows associated with this session.
374+
* nullptr can be passed to indicate there are no associated ANativeWindows.
375+
* @param nativeWindowsSize The number of ANativeWindows in the list.
376+
* @param surfaceControls A pointer to a list of ASurfaceControls associated with this session.
377+
* nullptr can be passed to indicate there are no associated ASurfaceControls.
378+
* @param surfaceControlsSize The number of ASurfaceControls in the list.
379+
*
380+
* @return 0 on success.
381+
* EPIPE if communication has failed.
382+
* ENOTSUP if unsupported.
383+
* EINVAL if invalid or empty arguments passed.
384+
*/
385+
386+
int APerformanceHint_setNativeSurfaces(APerformanceHintSession* _Nonnull session,
387+
ANativeWindow* _Nonnull* _Nullable nativeWindows, int nativeWindowsSize,
388+
ASurfaceControl* _Nonnull* _Nullable surfaceControls, int surfaceControlsSize)
389+
__INTRODUCED_IN(36);
390+
356391
/**
357392
* Creates a new AWorkDuration. When the client finishes using {@link AWorkDuration}, it should
358393
* call {@link AWorkDuration_release()} to destroy {@link AWorkDuration} and release all resources
@@ -520,6 +555,63 @@ int ASessionCreationConfig_setPreferPowerEfficiency(
520555
int ASessionCreationConfig_setGraphicsPipeline(
521556
ASessionCreationConfig* _Nonnull config, bool enabled) __INTRODUCED_IN(36);
522557

558+
/**
559+
* Associates a session with any {@link ASurfaceControl} or {@link ANativeWindow}
560+
* instances managed by this session. See {@link APerformanceHint_setNativeSurfaces}
561+
* for more details.
562+
*
563+
* @param config The {@link ASessionCreationConfig}
564+
* created by calling {@link ASessionCreationConfig_create()}.
565+
* @param nativeWindows A pointer to a list of ANativeWindows associated with this session.
566+
* nullptr can be passed to indicate there are no associated ANativeWindows.
567+
* @param nativeWindowsSize The number of ANativeWindows in the list.
568+
* @param surfaceControls A pointer to a list of ASurfaceControls associated with this session.
569+
* nullptr can be passed to indicate there are no associated ASurfaceControls.
570+
* @param surfaceControlsSize The number of ASurfaceControls in the list.
571+
*
572+
* @return 0 on success.
573+
* ENOTSUP if unsupported.
574+
* EINVAL if invalid or empty arguments passed.
575+
*/
576+
int ASessionCreationConfig_setNativeSurfaces(
577+
ASessionCreationConfig* _Nonnull config,
578+
ANativeWindow* _Nonnull* _Nullable nativeWindows, int nativeWindowsSize,
579+
ASurfaceControl* _Nonnull* _Nullable surfaceControls, int surfaceControlsSize)
580+
__INTRODUCED_IN(36);
581+
582+
/**
583+
* Enable automatic timing mode for sessions using the GRAPHICS_PIPELINE API with an attached
584+
* surface. In this mode, sessions do not need to report actual durations and only need
585+
* to keep their thread list up-to-date, set a native surface, call
586+
* {@link ASessionCreationConfig_setGraphicsPipeline()} to signal that the session is in
587+
* "graphics pipeline" mode, and then set whether automatic timing is desired for the
588+
* CPU, GPU, or both, using this method.
589+
*
590+
* It is still be beneficial to set an accurate target time, as this may help determine
591+
* timing information for some workloads where there is less information available from
592+
* the framework, such as games. Additionally, reported CPU durations will be ignored
593+
* while automatic CPU timing is enabled, and similarly GPU durations will be ignored
594+
* when automatic GPU timing is enabled. When both are enabled, the entire
595+
* reportActualWorkDuration call will be ignored, and the session will be managed
596+
* completely automatically.
597+
*
598+
* This mode will not work unless the client makes sure they are updating the framerate
599+
* of attached surfaces with methods such as {@link ANativeWindow_setFrameRate}, or updating
600+
* any associated ASurfaceControls with transactions that have {ASurfaceTransaction_setFrameRate}.
601+
*
602+
* @param config The {@link ASessionCreationConfig}
603+
* created by calling {@link ASessionCreationConfig_create()}.
604+
* @param cpu Whether to enable automatic timing for the CPU for this session.
605+
* @param gpu Whether to enable automatic timing for the GPU for this session.
606+
*
607+
* @return 0 on success.
608+
* ENOTSUP if unsupported.
609+
*/
610+
int ASessionCreationConfig_setUseAutoTiming(
611+
ASessionCreationConfig* _Nonnull config,
612+
bool cpu, bool gpu)
613+
__INTRODUCED_IN(36);
614+
523615
__END_DECLS
524616

525617
#endif // ANDROID_NATIVE_PERFORMANCE_HINT_H

services/inputflinger/TEST_MAPPING

Lines changed: 18 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -35,109 +35,34 @@
3535
]
3636
},
3737
{
38-
"name": "CtsHardwareTestCases",
39-
"options": [
40-
{
41-
"include-filter": "android.hardware.input.cts.tests"
42-
},
43-
{
44-
"exclude-annotation": "androidx.test.filters.FlakyTest"
45-
}
46-
]
38+
"name": "CtsHardwareTestCases_cts_tests"
4739
},
4840
{
4941
"name": "CtsInputTestCases"
5042
},
5143
{
52-
"name": "CtsViewTestCases",
53-
"options": [
54-
{
55-
"include-filter": "android.view.cts.input"
56-
}
57-
]
44+
"name": "CtsViewTestCases_cts_input"
5845
},
5946
{
60-
"name": "CtsViewTestCases",
61-
"options": [
62-
{
63-
"include-filter": "android.view.cts.HoverTest"
64-
},
65-
{
66-
"include-filter": "android.view.cts.MotionEventTest"
67-
},
68-
{
69-
"include-filter": "android.view.cts.PointerCaptureTest"
70-
},
71-
{
72-
"include-filter": "android.view.cts.TooltipTest"
73-
},
74-
{
75-
"include-filter": "android.view.cts.TouchDelegateTest"
76-
},
77-
{
78-
"include-filter": "android.view.cts.VerifyInputEventTest"
79-
},
80-
{
81-
"include-filter": "android.view.cts.ViewTest"
82-
},
83-
{
84-
"include-filter": "android.view.cts.ViewUnbufferedTest"
85-
}
86-
]
47+
"name": "CtsViewTestCases_input_related"
8748
},
8849
{
89-
"name": "CtsWidgetTestCases",
90-
"options": [
91-
{
92-
"include-filter": "android.widget.cts.NumberPickerTest"
93-
},
94-
{
95-
"include-filter": "android.widget.cts.SeekBarTest"
96-
}
97-
]
50+
"name": "CtsWidgetTestCases_seekbar_and_numberpicker"
9851
},
9952
{
100-
"name": "FrameworksCoreTests",
101-
"options": [
102-
{
103-
"include-filter": "android.hardware.input"
104-
}
105-
]
53+
"name": "FrameworksCoreTests_hardware_input"
10654
},
10755
{
108-
"name": "FrameworksCoreTests",
109-
"options": [
110-
{
111-
"include-filter": "android.view.VerifiedKeyEventTest"
112-
},
113-
{
114-
"include-filter": "android.view.VerifiedMotionEventTest"
115-
}
116-
]
56+
"name": "FrameworksCoreTests_view_verified"
11757
},
11858
{
119-
"name": "CtsAppTestCases",
120-
"options": [
121-
{
122-
"include-filter": "android.app.cts.ToolbarActionBarTest"
123-
}
124-
]
59+
"name": "CtsAppTestCases_cts_toolbaractionbartest"
12560
},
12661
{
127-
"name": "FrameworksServicesTests",
128-
"options": [
129-
{
130-
"include-filter": "com.android.server.input"
131-
}
132-
]
62+
"name": "FrameworksServicesTests_android_server_input"
13363
},
13464
{
135-
"name": "CtsSecurityTestCases",
136-
"options": [
137-
{
138-
"include-filter": "android.security.cts.MotionEventTest"
139-
}
140-
]
65+
"name": "CtsSecurityTestCases_cts_motioneventtest"
14166
},
14267
{
14368
"name": "CtsSecurityBulletinHostTestCases",
@@ -156,12 +81,7 @@
15681
],
15782
"postsubmit": [
15883
{
159-
"name": "CtsWindowManagerDeviceWindow",
160-
"options": [
161-
{
162-
"include-filter": "android.server.wm.window.WindowInputTests"
163-
}
164-
]
84+
"name": "CtsWindowManagerDeviceWindow_window_windowinputtests"
16585
},
16686
{
16787
"name": "libinput_tests"
@@ -187,98 +107,31 @@
187107
]
188108
},
189109
{
190-
"name": "CtsHardwareTestCases",
191-
"options": [
192-
{
193-
"include-filter": "android.hardware.input.cts.tests"
194-
}
195-
]
110+
"name": "CtsHardwareTestCases_cts_tests"
196111
},
197112
{
198113
"name": "CtsInputTestCases"
199114
},
200115
{
201-
"name": "CtsViewTestCases",
202-
"options": [
203-
{
204-
"include-filter": "android.view.cts.input"
205-
}
206-
]
116+
"name": "CtsViewTestCases_cts_input"
207117
},
208118
{
209-
"name": "CtsViewTestCases",
210-
"options": [
211-
{
212-
"include-filter": "android.view.cts.HoverTest"
213-
},
214-
{
215-
"include-filter": "android.view.cts.MotionEventTest"
216-
},
217-
{
218-
"include-filter": "android.view.cts.PointerCaptureTest"
219-
},
220-
{
221-
"include-filter": "android.view.cts.TooltipTest"
222-
},
223-
{
224-
"include-filter": "android.view.cts.TouchDelegateTest"
225-
},
226-
{
227-
"include-filter": "android.view.cts.VerifyInputEventTest"
228-
},
229-
{
230-
"include-filter": "android.view.cts.ViewTest"
231-
},
232-
{
233-
"include-filter": "android.view.cts.ViewUnbufferedTest"
234-
}
235-
]
119+
"name": "CtsViewTestCases_input_related"
236120
},
237121
{
238-
"name": "CtsWidgetTestCases",
239-
"options": [
240-
{
241-
"include-filter": "android.widget.cts.NumberPickerTest"
242-
},
243-
{
244-
"include-filter": "android.widget.cts.SeekBarTest"
245-
}
246-
]
122+
"name": "CtsWidgetTestCases_seekbar_and_numberpicker"
247123
},
248124
{
249-
"name": "FrameworksCoreTests",
250-
"options": [
251-
{
252-
"include-filter": "android.view.VerifiedKeyEventTest"
253-
},
254-
{
255-
"include-filter": "android.view.VerifiedMotionEventTest"
256-
}
257-
]
125+
"name": "FrameworksCoreTests_view_verified"
258126
},
259127
{
260-
"name": "CtsAppTestCases",
261-
"options": [
262-
{
263-
"include-filter": "android.app.cts.ToolbarActionBarTest"
264-
}
265-
]
128+
"name": "CtsAppTestCases_cts_toolbaractionbartest"
266129
},
267130
{
268-
"name": "FrameworksServicesTests",
269-
"options": [
270-
{
271-
"include-filter": "com.android.server.input"
272-
}
273-
]
131+
"name": "FrameworksServicesTests_server_input"
274132
},
275133
{
276-
"name": "CtsSecurityTestCases",
277-
"options": [
278-
{
279-
"include-filter": "android.security.cts.MotionEventTest"
280-
}
281-
]
134+
"name": "CtsSecurityTestCases_cts_motioneventtest"
282135
},
283136
{
284137
"name": "CtsSecurityBulletinHostTestCases",

services/inputflinger/dispatcher/EventLogTags.logtags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# 6: Percent
3232
# Default value for data of type int/long is 2 (bytes).
3333
#
34-
# See system/core/logcat/event.logtags for the master copy of the tags.
34+
# See system/logging/logcat/event.logtags for the master copy of the tags.
3535

3636
# 62000 - 62199 reserved for inputflinger
3737

services/inputflinger/include/InputReaderBase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ struct InputReaderConfiguration {
245245
// True to use three-finger tap as a customizable shortcut; false to use it as a middle-click.
246246
bool touchpadThreeFingerTapShortcutEnabled;
247247

248+
// True to enable system gestures (three- and four-finger swipes) on touchpads.
249+
bool touchpadSystemGesturesEnabled;
250+
248251
// The set of currently disabled input devices.
249252
std::set<int32_t> disabledDevices;
250253

@@ -297,6 +300,7 @@ struct InputReaderConfiguration {
297300
shouldNotifyTouchpadHardwareState(false),
298301
touchpadRightClickZoneEnabled(false),
299302
touchpadThreeFingerTapShortcutEnabled(false),
303+
touchpadSystemGesturesEnabled(true),
300304
stylusButtonMotionEventsEnabled(true),
301305
stylusPointerIconEnabled(false),
302306
mouseReverseVerticalScrollingEnabled(false),

0 commit comments

Comments
 (0)