Skip to content

Commit 052ac3d

Browse files
author
Android Build Coastguard Worker
committed
Snap for 9635940 from 42d96bb to tm-platform-release
Change-Id: I099cc4fc050d12337fe7dd98036ac74dbded951e
2 parents 29f0a94 + 42d96bb commit 052ac3d

3,330 files changed

Lines changed: 188111 additions & 79889 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Android.bp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ java_library {
151151
visibility: [
152152
// DO NOT ADD ANY MORE ENTRIES TO THIS LIST
153153
"//external/robolectric-shadows:__subpackages__",
154+
//This will eventually replace the item above, and serves the
155+
//same purpose.
156+
"//external/robolectric:__subpackages__",
154157
"//frameworks/layoutlib:__subpackages__",
155158
],
156159
}

PREUPLOAD.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ hidden_api_txt_exclude_hook = ${REPO_ROOT}/frameworks/base/tools/hiddenapi/exclu
2828

2929
ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check -i ${REPO_ROOT}/frameworks/base/packages/SystemUI/ktfmt_includes.txt ${PREUPLOAD_FILES}
3030

31-
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py -f ${PREUPLOAD_FILES}
31+
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --no-verify-format -f ${PREUPLOAD_FILES}
3232

3333
owners_hook = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} "OWNERS$"
3434

TEST_MAPPING

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@
1515
]
1616
}
1717
],
18+
"presubmit-pm": [
19+
{
20+
"name": "PackageManagerServiceServerTests",
21+
"options": [
22+
{
23+
"include-annotation": "android.platform.test.annotations.Presubmit"
24+
},
25+
{
26+
"exclude-annotation": "androidx.test.filters.FlakyTest"
27+
},
28+
{
29+
"exclude-annotation": "org.junit.Ignore"
30+
}
31+
]
32+
}
33+
],
1834
"presubmit": [
1935
{
2036
"name": "ManagedProvisioningTests",
@@ -167,6 +183,20 @@
167183
"exclude-annotation": "org.junit.Ignore"
168184
}
169185
]
186+
},
187+
{
188+
"name": "PackageManagerServiceServerTests",
189+
"options": [
190+
{
191+
"include-annotation": "android.platform.test.annotations.Presubmit"
192+
},
193+
{
194+
"exclude-annotation": "androidx.test.filters.FlakyTest"
195+
},
196+
{
197+
"exclude-annotation": "org.junit.Ignore"
198+
}
199+
]
170200
}
171201
]
172202
}

apex/jobscheduler/framework/java/android/app/JobSchedulerImpl.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
package android.app;
1818

19+
import android.annotation.NonNull;
20+
import android.annotation.RequiresPermission;
1921
import android.app.job.IJobScheduler;
22+
import android.app.job.IUserVisibleJobObserver;
2023
import android.app.job.JobInfo;
2124
import android.app.job.JobScheduler;
2225
import android.app.job.JobSnapshot;
@@ -119,4 +122,28 @@ public List<JobSnapshot> getAllJobSnapshots() {
119122
return null;
120123
}
121124
}
125+
126+
@RequiresPermission(allOf = {
127+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
128+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
129+
@Override
130+
public void registerUserVisibleJobObserver(@NonNull IUserVisibleJobObserver observer) {
131+
// TODO(255767350): implement
132+
}
133+
134+
@RequiresPermission(allOf = {
135+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
136+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
137+
@Override
138+
public void unregisterUserVisibleJobObserver(@NonNull IUserVisibleJobObserver observer) {
139+
// TODO(255767350): implement
140+
}
141+
142+
@RequiresPermission(allOf = {
143+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
144+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
145+
@Override
146+
public void stopUserVisibleJobsForUser(@NonNull String packageName, int userId) {
147+
// TODO(255767350): implement
148+
}
122149
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (C) 2022 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package android.app.job;
18+
19+
import android.app.job.UserVisibleJobSummary;
20+
21+
/**
22+
* IPC protocol to know about user-visible job activity.
23+
*
24+
* @hide
25+
*/
26+
oneway interface IUserVisibleJobObserver {
27+
/**
28+
* Notify the client of all changes to a user-visible jobs' state.
29+
* @param summary A token/summary that uniquely identifies and details a single running job
30+
* @param isRunning whether the job is currently running or not
31+
*/
32+
void onUserVisibleJobStateChanged(in UserVisibleJobSummary summary, boolean isRunning);
33+
}

apex/jobscheduler/framework/java/android/app/job/JobScheduler.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,32 @@ public abstract class JobScheduler {
237237
*/
238238
@SuppressWarnings("HiddenAbstractMethod")
239239
public abstract List<JobSnapshot> getAllJobSnapshots();
240-
}
240+
241+
/**
242+
* @hide
243+
*/
244+
@RequiresPermission(allOf = {
245+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
246+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
247+
@SuppressWarnings("HiddenAbstractMethod")
248+
public abstract void registerUserVisibleJobObserver(@NonNull IUserVisibleJobObserver observer);
249+
250+
/**
251+
* @hide
252+
*/
253+
@RequiresPermission(allOf = {
254+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
255+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
256+
@SuppressWarnings("HiddenAbstractMethod")
257+
public abstract void unregisterUserVisibleJobObserver(
258+
@NonNull IUserVisibleJobObserver observer);
259+
260+
/**
261+
* @hide
262+
*/
263+
@RequiresPermission(allOf = {
264+
android.Manifest.permission.MANAGE_ACTIVITY_TASKS,
265+
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL})
266+
@SuppressWarnings("HiddenAbstractMethod")
267+
public abstract void stopUserVisibleJobsForUser(@NonNull String packageName, int userId);
268+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright (C) 2022 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package android.app.job;
18+
19+
parcelable UserVisibleJobSummary;
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright (C) 2022 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package android.app.job;
18+
19+
import android.annotation.NonNull;
20+
import android.os.Parcel;
21+
import android.os.Parcelable;
22+
23+
/**
24+
* Summary of a scheduled job that the user is meant to be aware of.
25+
*
26+
* @hide
27+
*/
28+
public class UserVisibleJobSummary implements Parcelable {
29+
private final int mCallingUid;
30+
private final int mSourceUserId;
31+
@NonNull
32+
private final String mSourcePackageName;
33+
private final int mJobId;
34+
35+
public UserVisibleJobSummary(int callingUid, int sourceUserId,
36+
@NonNull String sourcePackageName, int jobId) {
37+
mCallingUid = callingUid;
38+
mSourceUserId = sourceUserId;
39+
mSourcePackageName = sourcePackageName;
40+
mJobId = jobId;
41+
}
42+
43+
protected UserVisibleJobSummary(Parcel in) {
44+
mCallingUid = in.readInt();
45+
mSourceUserId = in.readInt();
46+
mSourcePackageName = in.readString();
47+
mJobId = in.readInt();
48+
}
49+
50+
public int getCallingUid() {
51+
return mCallingUid;
52+
}
53+
54+
public int getJobId() {
55+
return mJobId;
56+
}
57+
58+
public int getSourceUserId() {
59+
return mSourceUserId;
60+
}
61+
62+
public String getSourcePackageName() {
63+
return mSourcePackageName;
64+
}
65+
66+
@Override
67+
public boolean equals(Object o) {
68+
if (this == o) return true;
69+
if (!(o instanceof UserVisibleJobSummary)) return false;
70+
UserVisibleJobSummary that = (UserVisibleJobSummary) o;
71+
return mCallingUid == that.mCallingUid
72+
&& mSourceUserId == that.mSourceUserId
73+
&& mSourcePackageName.equals(that.mSourcePackageName)
74+
&& mJobId == that.mJobId;
75+
}
76+
77+
@Override
78+
public int hashCode() {
79+
int result = 0;
80+
result = 31 * result + mCallingUid;
81+
result = 31 * result + mSourceUserId;
82+
result = 31 * result + mSourcePackageName.hashCode();
83+
result = 31 * result + mJobId;
84+
return result;
85+
}
86+
87+
@Override
88+
public String toString() {
89+
return "UserVisibleJobSummary{"
90+
+ "callingUid=" + mCallingUid
91+
+ ", sourceUserId=" + mSourceUserId
92+
+ ", sourcePackageName='" + mSourcePackageName + "'"
93+
+ ", jobId=" + mJobId
94+
+ "}";
95+
}
96+
97+
@Override
98+
public int describeContents() {
99+
return 0;
100+
}
101+
102+
@Override
103+
public void writeToParcel(Parcel dest, int flags) {
104+
dest.writeInt(mCallingUid);
105+
dest.writeInt(mSourceUserId);
106+
dest.writeString(mSourcePackageName);
107+
dest.writeInt(mJobId);
108+
}
109+
110+
public static final Creator<UserVisibleJobSummary> CREATOR =
111+
new Creator<UserVisibleJobSummary>() {
112+
@Override
113+
public UserVisibleJobSummary createFromParcel(Parcel in) {
114+
return new UserVisibleJobSummary(in);
115+
}
116+
117+
@Override
118+
public UserVisibleJobSummary[] newArray(int size) {
119+
return new UserVisibleJobSummary[size];
120+
}
121+
};
122+
}

0 commit comments

Comments
 (0)