File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
javatests/androidx/test/core/content/pm Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
** API Changes**
14
14
15
+ * Added ApplicationInfoBuilder.setFlags(int)
16
+
15
17
** Breaking API Changes**
16
18
17
19
** Known Issues**
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ package androidx.test.core.content.pm {
33
33
public final class ApplicationInfoBuilder {
34
34
method public android.content.pm.ApplicationInfo! build();
35
35
method public static androidx.test.core.content.pm.ApplicationInfoBuilder! newBuilder();
36
+ method public androidx.test.core.content.pm.ApplicationInfoBuilder! setFlags(int);
36
37
method public androidx.test.core.content.pm.ApplicationInfoBuilder! setName(String?);
37
38
method public androidx.test.core.content.pm.ApplicationInfoBuilder! setPackageName(String!);
38
39
}
Original file line number Diff line number Diff line change 24
24
public final class ApplicationInfoBuilder {
25
25
@ Nullable private String name ;
26
26
@ Nullable private String packageName ;
27
+ private int flags = 0 ;
27
28
28
29
private ApplicationInfoBuilder () {}
29
30
@@ -58,11 +59,22 @@ public ApplicationInfoBuilder setName(@Nullable String name) {
58
59
return this ;
59
60
}
60
61
62
+ /**
63
+ * Sets the flags.
64
+ *
65
+ * @see ApplicationInfo#flags
66
+ */
67
+ public ApplicationInfoBuilder setFlags (int flags ) {
68
+ this .flags = flags ;
69
+ return this ;
70
+ }
71
+
61
72
/** Returns a {@link ApplicationInfo} with the provided data. */
62
73
public ApplicationInfo build () {
63
74
checkNotNull (packageName , "Mandatory field 'packageName' missing." );
64
75
65
76
ApplicationInfo applicationInfo = new ApplicationInfo ();
77
+ applicationInfo .flags = flags ;
66
78
applicationInfo .name = name ;
67
79
applicationInfo .packageName = packageName ;
68
80
Original file line number Diff line number Diff line change @@ -31,12 +31,18 @@ public final class ApplicationInfoBuilderTest {
31
31
public void buildAllFields () {
32
32
String name = "TestName" ;
33
33
String packageName = "test.package.name" ;
34
+ int flags = 0x00000001 ;
34
35
35
36
ApplicationInfo applicationInfo =
36
- ApplicationInfoBuilder .newBuilder ().setName (name ).setPackageName (packageName ).build ();
37
+ ApplicationInfoBuilder .newBuilder ()
38
+ .setFlags (flags )
39
+ .setName (name )
40
+ .setPackageName (packageName )
41
+ .build ();
37
42
38
43
assertThat (applicationInfo .name ).isEqualTo (name );
39
44
assertThat (applicationInfo .packageName ).isEqualTo (packageName );
45
+ assertThat (applicationInfo .flags ).isEqualTo (flags );
40
46
}
41
47
42
48
@ Test
You can’t perform that action at this time.
0 commit comments