Skip to content

Commit d274c33

Browse files
committed
Merge tag 'android-11.0.0_r32' into staging/lineage-18.1_merge-android-11.0.0_r32
Android 11.0.0 Release 32 (RQ2A.210305.006) * tag 'android-11.0.0_r32': Allow CBR when device owners is set up DO NOT MERGE Revert "Set fixed fps when ambient or display brightness is high" DO NOT MERGE Revert "Allow DeviceConfig to change display settings for high zone" Protect account chooser activities against overlay. DO NOT MERGE: Disable StrictMode VM Policy check. Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Copy the list before passing to deliverAlarms Import translations. DO NOT MERGE ANYWHERE MediaRouterService binds services when necessary DO NOT MERGE add android.permission.STATUS_BAR for cellbroadcastreceiver multiple users support for carrier wifi provisioning Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE DO NOT MERGE port power tap gesture logs to new standard Import translations. DO NOT MERGE ANYWHERE Add package name when initializing SoundPool. DO NOT MERGE Correctly reset cross-profile app-op Add mediametrics enum for MediaExtractor usage Import translations. DO NOT MERGE ANYWHERE Adding logging for the ML mBack gesture model. Import translations. DO NOT MERGE ANYWHERE Removes undesirable invokation of checkUriPermission Don't change the voice interactor setting if it's explicitly unset. Make low storage notification PendingIntent immutable Bluetooth: Check state correctly when client wants to bind Automatically dismiss SIM combination warnings and selection dialogs. Fix sharing shortcuts not showing for Work Profile. [GraphicsEnvironment] Avoid null access. Clear fixed rotation if rotated recents activity becomes top Expose MediaExtractor entry point to MediaMetrics Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Move phone ID to extra for action provision Combine uids for CpuTimePerUidFreq atom Update Visualizer implementation after changes in AudioEffect Extend Battery Defender strings chars limit add permission check for exported activity Send DROPBOX_ENTRY_ADDED to all users Add rotary highlight to switches Grant CHANGE_DEVICE_IDLE_TEMP_WHITELIST to call log provider. Fix issue with saving protos to disk during shutdown. Import translations. DO NOT MERGE ANYWHERE Update rotary highlight on bordered buttons Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Migrate media output switcher metrics - 1/n Use per-user Shell UID for adoptShellPermissionIdentity(). AudioService: increase audio mode timeout. [SettingsProvider] fix font size scale validator [SettingsProvider] fix font size scale validator Make AOD battery text field support BatteryDefender [SettingsProvider] fix font size scale validator [SettingsProvider] fix font size scale validator Revert "Ignore to show splash screen if the decorView is not opaque" Check isOnScreen for wallpaper target of recents animation Allow the System UID to unregister ConnDiags CBs. Filter conversation list by current users Fix pixel buds icon is empty in output switcher [DO NOT MERGE] Fixes CompanionDeviceManagerTest DO NOT MERGE Use round highlight for navigation buttons [DO NOT MERGE]Fix IndexOutOfBoundsException for TDA stack Do not allow non-system dialogs on UsbConfirmAct Import translations. DO NOT MERGE ANYWHERE Update link for Permissions samples in Javadoc Fix wrong target launches in Chooser. Import translations. DO NOT MERGE ANYWHERE Add back enforceReadPermission for getmetadata Import translations. DO NOT MERGE ANYWHERE Update CPA startActivity javadoc to refer to passing the result back Update SystemUI and SettingsLib battery defender strings Import translations. DO NOT MERGE ANYWHERE Apply animation for Media Ouput Switcher dialog Add dynamic item in output switcher if it is available Fix NPE when notification icon is empty Fix output switcher didn't show album art Add dynamic group operation in output switcher Enhancement for group operation in output switcher Add dismiss timing for Media Output Dialog Update OutputSwitcher from SettingsPanel to MediaOutputDialog in SystemUI Add constant for dismiss Settings panel Add animation when switching output device Add dismiss intent and method for MediaOutputDialog Add "Stop" button for remote device Add constant for dialog dismiss Rename MediaOutDialogReceiver to MediaOutputDialogReceiver Add getFeatures() for get device supporting features Add a receiver to launch Output Switcher dialog Add MediaOutputDialogFactory to create MediaOutputDialog Add Media Output Dialog for Output Switcher Add controller for Media operation Add MediaOutputAdapter for Media device list Define strings for output switcher dialog in SystemUI Add image utility methods Import translations. DO NOT MERGE ANYWHERE docs: Mention app query filters on Android 11 Add new carrier config option for enabling SIP PUBLISH of RCS caps Camera: Document behavior when cropRegion and zoomRation conflict Use current fullscreen opaque window as insets control target Make the visibility of rotated insets up-to-date Allow DeviceConfig to change display settings for high zone Set fixed fps when ambient or display brightness is high Add FakeSettingsProviderRule class DO NOT MERGE: Add constant for Output Switcher to start Bluetooth paring page Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Fix ConcurrentModification in onUidStateChanged Import translations. DO NOT MERGE ANYWHERE Add ART optimization dimension to reportFullyDrawn Import translations. DO NOT MERGE ANYWHERE Make sure we preserve preserveLegacyExternalStorage. Add Null check for mView.findFocus() in ViewRootImpl DO NOT MERGE: Enable ENABLE_DYNAMIC_PERMISSIONS depending on MediaProvider. Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Ensure insets state for dispatch is processed by policy Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE RESTRICT AUTOMERGE Ensure caller identity is restored in CP quick-path. RESTRICT AUTOMERGE Ensure caller identity is restored in CP quick-path. RESTRICT AUTOMERGE Ensure caller identity is restored in CP quick-path. Move all BluetoothCodecConfig and BluetoothCodecStatus APIs moved from the non-SDK API list to the blocklist in Android 11 back to the non-SDK API list. Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE DO NOT MERGE: Disable ENABLE_DYNAMIC_PERMISSIONS without helper method. Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Allow only preloaded voice recognition services to blame calling apps. Fix unique identifiers best practices links in device ID API docs Allow self blames to be trusted Add permissions to car shell Add READ_DREAM_STATE to the settings list Move handleCompleteDeferredRemoval to animator thread Add Battery Defender strings to SystemUI and SettingsLib Fix potential deadlock in shutdown in HistoricalRegistry Ensure caller identity is restored in CP quick-path. DO NOT MERGE: Associate notif cancels with notif posts Controls UI - RTL for input pin/password DO NOT MERGE Update bottom huns container to use HeadsUpContainerView Delete orphaned staging directories for staged session on reboot Clean up staged session data on validation failure Import translations. DO NOT MERGE ANYWHERE Run error callback when BiometricPrompt dismissed early Do let IME fit invisible insets Fix AccessibilityService#getWindows time out Add flag to get the name of the Model file from the flag in case we want to try out different models. In addition, we should not log touches in the middle of the screen for logging so moving the block at the very beginning. Add package_name to log for debugging the back gesture model. Add log entries for the results for the ML model for the back gesture. Delete orphaned staging directories for staged session on reboot Clean up staged session data on validation failure Fix up some camera API javadocs Import translations. DO NOT MERGE ANYWHERE [DO NOT MERGE] Transition to clear state after gesture cancelation. [RESTRICT AUTOMERGE] Fix Keyboard shown after force stopped app package Do not power off display on lockNow() on automotive builds. Use ML model for the Back Gesture in EdgeBackGestureHandler. Allow voice recognition service to blame other apps access. Ignore GrantCredentials call with unexpected calling uid. Ignore GrantCredentials call with unexpected calling uid. Protect GrantCredentialsPermissionActivity against overlay. Revert "Ignore GrantCredentials call with unexpected calling uid." Protect GrantCredentialsPermissionActivity against overlay. BroadcastQueue: temporarily unfreeze for parallel broadcasts Fix the focus not move to the place where the finger clicks Propagate callingPackage explicitly within CDM Don't set timeout when showing CDM UI Fix anr when installing package Only log first input reader length [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable [DO NOT MERGE] Make GlobalScreenshot PendingIntents immutable DO NOT MERGE Prevent isEnabled from mutating state FileBridge: fix fd ownership mismanagement. Ignore GrantCredentials call with unexpected calling uid. Add disconnect message constant Bug: b/171255813 Test: make Change-Id: Ia300b12ecf7d0c1d7d057b48a801b2928354315e iorap: Add a DEBUG guide on IORap debugging log. Check that Account Parcel has name and type. Ignore GrantCredentials call with unexpected calling uid. Fix non-dismissible resumption players. Grant access to the URI when forwarding intent from InstallStart to InstallInstalling Controls - Large ranges improperly calculated Ensure permissions are revoked on state changes Revoke permission on non-runtime -> runtime upgrade Revoke permission on non-runtime -> runtime upgrade Ensure permissions are revoked on state changes Revoke permission on non-runtime -> runtime upgrade Ensure permissions are revoked on state changes Revoke permission on non-runtime -> runtime upgrade Ensure permissions are revoked on state changes CPU time min threshold for CpuTimePerUidFreq docs: fix "buidler" typos in Typeface.Builder Reschedule the pre-reboot verification after boot completed. Prevent sessions from resuming once boot is completed Prevent extra sessions owned by staged install from living across restarts Prevent exceptions during staged install from crashing system server Prevent exceptions in pre-reboot verification from crashing system server Only use system gesture insets for exclusion rects with root ime view RESTRICT AUTOMERGE DO NOT MERGE: Only restore the positions of types which are controlled Do not allow uninstalling while an app is pinned CachedAppOptimizer: ensure binder is never frozen with app unfrozen Introduce INPUT_CONSUMER permission for InputConsumer Allow the network stack to read network stats history Add MediaMetrics support to MediaParser Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE DO NOT MERGE: Disable ENABLE_DYNAMIC_PERMISSIONS flag for now to avoid crashes. [DO NOT MERGE] Prevent extra sessions owned by staged install from living across restarts Prevent exceptions during staged install from crashing system server Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE DO NOT MERGE: Add conditions for Auto to isUserSetupComplete() Hide overlays over uninstall confirm dialog Hide overlays over uninstall confirm dialog RESTRICT AUTOMERGE Fix CDM package check RESTRICT AUTOMERGE Fix CDM package check RESTRICT AUTOMERGE Fix CDM package check RESTRICT AUTOMERGE Fix CDM package check Default dual tone alpha set to 0.3 Prevent exceptions in pre-reboot verification from crashing system server Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Remove updateIntentVerificationStatusAsUser from ResolverActivity Avoid MotionEvent no finish raise unnecessary ANR Finish fixed rotation of recents if it is invisible Ignore to show splash screen if the decorView is not opaque Reland "Distinguish warm/hot launch by whether the activity has attached process" Revert "Distinguish warm/hot launch by whether the activity has attached process" Distinguish warm/hot launch by whether the activity has attached process Import translations. DO NOT MERGE ANYWHERE Makes the multi-touch prevention only works for editable TextView. Release ICloseHandle instance after announcement listener is unregistered initialized carrier_certificate_string_array to an empty array instead of null, so that when a certificate is removed, it is also removed in SubscriptionInfoUpdater#updateSubscriptionByCarrierConfig Cache network capabilities. Import translations. DO NOT MERGE ANYWHERE Mark deleteMessageFromIcc() as @UnsupportedAppUsage. Handle possible null PlaybackState Update require attention in stats pull service Change default value for face metrics docs: Use correct profile for intent Allow permission to change application state Import translations. DO NOT MERGE ANYWHERE Update ranking for uninflated updated notifs Make framework-res dep in stubs explicit Ignore orientation from invisible non-activity window Doc: Fix typo the right way. Supersedes cl/318172931 remove sensitive pii from safetynet logging remove sensitive pii from safetynet logging remove sensitive pii from safetynet logging remove sensitive pii from safetynet logging remove sensitive pii from safetynet logging DO NOT MERGE: Revert "Don't let IME window fit status bar" Notifications starting paused shall still be subject to timeout. Disable player's "Dismiss" button when notification is not dismissible. [DO NOT MERGE ] Stop setting flag to enable two-finger passthrough swipes. [DO NOT MERGE] Fix Accidently trigger A11y button long pressed [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" Typo in the sand icon shape Rememeber the last dark mode before shutdown when in auto mode Remove accidentally added diff file Remove SQLlite log [DO NOT MERGE] MultiFingerSwipe: scale touch slop to number of fingers. [DO NOT MERGE] Use correct touch slop value for two-finger passthrough. [DO NOT MERGE] Fix sometime couldn't trigger A11y button with 3-finger [DO NOT MERGE] Fix hardly to perform 3-finger swipe from the bottom [DO NOT MERGE] Fix edge swipe logic. [DO NOT MERGE] Require both fingers to move before starting two-finger passthrough. [DO NOT MERGE] Start dragging where the fingers initially went down. [DO NOT MERGE] Address drag unreliability during touch exploration [DO NOT MERGE] Fix crash with multifinger touch exploration [DO NOT MERGE] Enable two-finger passthrough swipes. Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Import translations. DO NOT MERGE ANYWHERE Media player attempts to dismiss notifications when players removed. IdleMaint: run IdleMaint if battery is charging Update javadoc for setLaunchDisplayId DO NOT MERGE Revoke install permissions when the permission defining app is uninstalled. Revoke install permissions when the permission defining app is uninstalled. When logging ranking positions, use the number of displayed targets in calculating offset rather than the total number available. Flip ENABLE_DYNAMIC_PERMISSIONS, attempt #7. DO NOT MERGE Check fingerprint client against top activity in auth callback DO NOT MERGE Check fingerprint client against top activity in auth callback Ignore non test package events for AppStandbyControllerTests Camera: Track native metadata allocations Allow notfication vibrations in DND RESTRICT AUTOMERGE Implement sendBroadcastAsUserMultiplePermissions in BridgeContext. DO NOT MERGE Check fingerprint client against top activity in auth callback DO NOT MERGE Check fingerprint client against top activity in auth callback DO NOT MERGE Check fingerprint client against top activity in auth callback DO NOT MERGE Check fingerprint client against top activity in auth callback DO NOT MERGE Check fingerprint client against top activity in auth callback Notify AppOps when notifications are [un]blocked for an app. Validate user-supplied tree URIs in DocumentsProvider calls Fix storing the wrong value of mLockdown in setting Use shared libdrmframeworkcommon. [BACKPORT] Improve location checks in TelephonyRegistry [DO NOT MERGE][BACKPORT]Improve location checks in TelephonyRegistry Backport sendBroadcastAsUserMultiplePermissions to oc-dev [RESTRICT AUTOMERGE] Fix VrDisplayTest failure Backport sendBroadcastAsUserMultiplePermissions to oc-dev Make WallpaperMS bind wallpaper component PendingIntent immutable. Make WallpaperMS bind wallpaper component PendingIntent immutable. Make WallpaperMS bind wallpaper component PendingIntent immutable. Make WallpaperMS bind wallpaper component PendingIntent immutable. Make WallpaperMS bind wallpaper component PendingIntent immutable. Call DecorView.drawableChanged() in PhoneWindow.setBackgroungDrawable Fix the issue provider can be wrong when requesting slice permission Fix the issue provider can be wrong when requesting slice permission Fix the issue provider can be wrong when requesting slice permission Fix the issue provider can be wrong when requesting slice permission Do not re-initialize synthetic password Fix out of bound error of IncidentService Enforce permission checks in getting app exit reasons Validate user-supplied URIs in DocumentsProvider calls Revoke the uri permission when the file is deleted Revoke the uri permission when the file is deleted Revoke the uri permission when the file is deleted Revoke the uri permission when the file is deleted Revoke the uri permission when the file is deleted Protect bluetooth.device.action.ALIAS_CHANGED Conflicts: core/java/com/android/internal/app/ChooserActivity.java packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java services/core/java/com/android/server/notification/NotificationManagerService.java Change-Id: I898282ae459c97f9341dbfa18216045c072a98e5
2 parents d0b4d17 + b17db7a commit d274c33

646 files changed

Lines changed: 10042 additions & 2210 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.

StubLibraries.bp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ droidstubs {
305305
java_defaults {
306306
name: "android_defaults_stubs_current",
307307
libs: [ "stub-annotations" ],
308+
static_libs: [
309+
"framework-res-package-jar", // Export package of framework-res
310+
],
308311
errorprone: {
309312
javacflags: [
310313
"-XepDisableAllChecks",

apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import static com.android.server.job.JobSchedulerService.RESTRICTED_INDEX;
2424

25+
import android.annotation.Nullable;
2526
import android.app.job.JobInfo;
2627
import android.net.ConnectivityManager;
2728
import android.net.ConnectivityManager.NetworkCallback;
@@ -86,9 +87,12 @@ public final class ConnectivityController extends RestrictingController implemen
8687
@GuardedBy("mLock")
8788
private final SparseArray<ArraySet<JobStatus>> mRequestedWhitelistJobs = new SparseArray<>();
8889

89-
/** List of currently available networks. */
90+
/**
91+
* Set of currently available networks mapped to their latest network capabilities. Cache the
92+
* latest capabilities to avoid unnecessary calls into ConnectivityManager.
93+
*/
9094
@GuardedBy("mLock")
91-
private final ArraySet<Network> mAvailableNetworks = new ArraySet<>();
95+
private final ArrayMap<Network, NetworkCapabilities> mAvailableNetworks = new ArrayMap<>();
9296

9397
private static final int MSG_DATA_SAVER_TOGGLED = 0;
9498
private static final int MSG_UID_RULES_CHANGES = 1;
@@ -165,9 +169,8 @@ public void stopTrackingRestrictedJobLocked(JobStatus jobStatus) {
165169
public boolean isNetworkAvailable(JobStatus job) {
166170
synchronized (mLock) {
167171
for (int i = 0; i < mAvailableNetworks.size(); ++i) {
168-
final Network network = mAvailableNetworks.valueAt(i);
169-
final NetworkCapabilities capabilities = mConnManager.getNetworkCapabilities(
170-
network);
172+
final Network network = mAvailableNetworks.keyAt(i);
173+
final NetworkCapabilities capabilities = mAvailableNetworks.valueAt(i);
171174
final boolean satisfied = isSatisfied(job, network, capabilities, mConstants);
172175
if (DEBUG) {
173176
Slog.v(TAG, "isNetworkAvailable(" + job + ") with network " + network
@@ -427,9 +430,33 @@ boolean isSatisfied(JobStatus jobStatus, Network network,
427430
return false;
428431
}
429432

433+
@Nullable
434+
private NetworkCapabilities getNetworkCapabilities(@Nullable Network network) {
435+
if (network == null) {
436+
return null;
437+
}
438+
synchronized (mLock) {
439+
// There is technically a race here if the Network object is reused. This can happen
440+
// only if that Network disconnects and the auto-incrementing network ID in
441+
// ConnectivityService wraps. This should no longer be a concern if/when we only make
442+
// use of asynchronous calls.
443+
if (mAvailableNetworks.get(network) != null) {
444+
return mAvailableNetworks.get(network);
445+
}
446+
447+
// This should almost never happen because any time a new network connects, the
448+
// NetworkCallback would populate mAvailableNetworks. However, it's currently necessary
449+
// because we also call synchronous methods such as getActiveNetworkForUid.
450+
// TODO(134978280): remove after switching to callback-based APIs
451+
final NetworkCapabilities capabilities = mConnManager.getNetworkCapabilities(network);
452+
mAvailableNetworks.put(network, capabilities);
453+
return capabilities;
454+
}
455+
}
456+
430457
private boolean updateConstraintsSatisfied(JobStatus jobStatus) {
431458
final Network network = mConnManager.getActiveNetworkForUid(jobStatus.getSourceUid());
432-
final NetworkCapabilities capabilities = mConnManager.getNetworkCapabilities(network);
459+
final NetworkCapabilities capabilities = getNetworkCapabilities(network);
433460
return updateConstraintsSatisfied(jobStatus, network, capabilities);
434461
}
435462

@@ -470,38 +497,27 @@ private boolean updateConstraintsSatisfied(JobStatus jobStatus, Network network,
470497
*/
471498
private void updateTrackedJobs(int filterUid, Network filterNetwork) {
472499
synchronized (mLock) {
473-
// Since this is a really hot codepath, temporarily cache any
474-
// answers that we get from ConnectivityManager.
475-
final ArrayMap<Network, NetworkCapabilities> networkToCapabilities = new ArrayMap<>();
476-
477500
boolean changed = false;
478501
if (filterUid == -1) {
479502
for (int i = mTrackedJobs.size() - 1; i >= 0; i--) {
480-
changed |= updateTrackedJobsLocked(mTrackedJobs.valueAt(i),
481-
filterNetwork, networkToCapabilities);
503+
changed |= updateTrackedJobsLocked(mTrackedJobs.valueAt(i), filterNetwork);
482504
}
483505
} else {
484-
changed = updateTrackedJobsLocked(mTrackedJobs.get(filterUid),
485-
filterNetwork, networkToCapabilities);
506+
changed = updateTrackedJobsLocked(mTrackedJobs.get(filterUid), filterNetwork);
486507
}
487508
if (changed) {
488509
mStateChangedListener.onControllerStateChanged();
489510
}
490511
}
491512
}
492513

493-
private boolean updateTrackedJobsLocked(ArraySet<JobStatus> jobs, Network filterNetwork,
494-
ArrayMap<Network, NetworkCapabilities> networkToCapabilities) {
514+
private boolean updateTrackedJobsLocked(ArraySet<JobStatus> jobs, Network filterNetwork) {
495515
if (jobs == null || jobs.size() == 0) {
496516
return false;
497517
}
498518

499519
final Network network = mConnManager.getActiveNetworkForUid(jobs.valueAt(0).getSourceUid());
500-
NetworkCapabilities capabilities = networkToCapabilities.get(network);
501-
if (capabilities == null) {
502-
capabilities = mConnManager.getNetworkCapabilities(network);
503-
networkToCapabilities.put(network, capabilities);
504-
}
520+
final NetworkCapabilities capabilities = getNetworkCapabilities(network);
505521
final boolean networkMatch = (filterNetwork == null
506522
|| Objects.equals(filterNetwork, network));
507523

@@ -544,16 +560,19 @@ public void onNetworkActive() {
544560
@Override
545561
public void onAvailable(Network network) {
546562
if (DEBUG) Slog.v(TAG, "onAvailable: " + network);
547-
synchronized (mLock) {
548-
mAvailableNetworks.add(network);
549-
}
563+
// Documentation says not to call getNetworkCapabilities here but wait for
564+
// onCapabilitiesChanged instead. onCapabilitiesChanged should be called immediately
565+
// after this, so no need to update mAvailableNetworks here.
550566
}
551567

552568
@Override
553569
public void onCapabilitiesChanged(Network network, NetworkCapabilities capabilities) {
554570
if (DEBUG) {
555571
Slog.v(TAG, "onCapabilitiesChanged: " + network);
556572
}
573+
synchronized (mLock) {
574+
mAvailableNetworks.put(network, capabilities);
575+
}
557576
updateTrackedJobs(-1, network);
558577
}
559578

@@ -630,6 +649,8 @@ public void dumpControllerStateLocked(IndentingPrintWriter pw,
630649
pw.println("Available networks:");
631650
pw.increaseIndent();
632651
for (int i = 0; i < mAvailableNetworks.size(); i++) {
652+
pw.print(mAvailableNetworks.keyAt(i));
653+
pw.print(": ");
633654
pw.println(mAvailableNetworks.valueAt(i));
634655
}
635656
pw.decreaseIndent();
@@ -667,7 +688,7 @@ public void dumpControllerStateLocked(ProtoOutputStream proto, long fieldId,
667688
mRequestedWhitelistJobs.keyAt(i));
668689
}
669690
for (int i = 0; i < mAvailableNetworks.size(); i++) {
670-
Network network = mAvailableNetworks.valueAt(i);
691+
Network network = mAvailableNetworks.keyAt(i);
671692
if (network != null) {
672693
network.dumpDebug(proto,
673694
StateControllerProto.ConnectivityController.AVAILABLE_NETWORKS);

apex/media/framework/Android.bp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ java_library {
3535
libs: [
3636
"framework_media_annotation",
3737
],
38-
3938
static_libs: [
4039
"exoplayer2-extractor"
4140
],
@@ -110,10 +109,32 @@ java_sdk_library {
110109
],
111110
}
112111

113-
114112
java_library {
115113
name: "framework_media_annotation",
116114
srcs: [":framework-media-annotation-srcs"],
117115
installable: false,
118116
sdk_version: "core_current",
119117
}
118+
119+
cc_library_shared {
120+
name: "libmediaparser-jni",
121+
srcs: [
122+
"jni/android_media_MediaParserJNI.cpp",
123+
],
124+
shared_libs: [
125+
"libandroid",
126+
"liblog",
127+
"libmediametrics",
128+
],
129+
cflags: [
130+
"-Wall",
131+
"-Werror",
132+
"-Wno-unused-parameter",
133+
"-Wunreachable-code",
134+
"-Wunused",
135+
],
136+
apex_available: [
137+
"com.android.media",
138+
],
139+
min_sdk_version: "29",
140+
}

0 commit comments

Comments
 (0)