Merge "Fix issue #29871385: Need JobScheduler.scheduleAsPackage to be system API" into nyc-dev
diff --git a/docs/html/topic/instant-apps/faqs.jd b/docs/html/topic/instant-apps/faqs.jd
index bf37241..f69a4da 100644
--- a/docs/html/topic/instant-apps/faqs.jd
+++ b/docs/html/topic/instant-apps/faqs.jd
@@ -46,10 +46,7 @@
<strong>How do permissions work in Android Instant Apps?</strong>
<br/>
Android Instant Apps uses the runtime permissions model introduced in
- Android 6.0.
- If an app supports the permission model introduced in Android 6.0
- (API level 23), it does not require any additional work to become an Instant
- App that runs on older devices.
+ Android 6.0 (API level 23).
</p>
<p>
diff --git a/docs/html/topic/instant-apps/index.jd b/docs/html/topic/instant-apps/index.jd
index e2da9c5..8980982 100644
--- a/docs/html/topic/instant-apps/index.jd
+++ b/docs/html/topic/instant-apps/index.jd
@@ -81,7 +81,7 @@
Get people to your flagship Android experience from links that would
otherwise open your mobile web page — like
search, social media, messaging, and other deep links — without them
- needing to stop and install your app first.
+ needing to install your app first.
</p>
<div class="cols" style="margin-top:1em;">
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index f5592fa..7b8dc52 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -240,7 +240,9 @@
* constructors to set the state and initialize local properties.
*/
private VectorDrawable(@NonNull VectorDrawableState state, @Nullable Resources res) {
- mVectorState = state;
+ // Constant state sharing is disabled until we fix onStateChanged()
+ // affecting the shared bitmap.
+ mVectorState = new VectorDrawableState(state);
updateLocalState(res);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index b20f46f..7e1deec 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -184,7 +184,9 @@
mHeaderBar = (TaskViewHeader) inflater.inflate(R.layout.recents_task_view_header,
null, false);
reloadResources();
+ }
+ public void onBootCompleted() {
// When we start, preload the data associated with the previous recent tasks.
// We can use a new plan since the caches will be the same.
RecentsTaskLoader loader = Recents.getTaskLoader();
@@ -197,10 +199,6 @@
loader.loadTasks(mContext, plan, launchOpts);
}
- public void onBootCompleted() {
- // Do nothing
- }
-
public void onConfigurationChanged() {
reloadResources();
mDummyStackView.reloadOnConfigurationChange();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 94231c6..37a4948 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -314,8 +314,12 @@
if (includeFrontMostExcludedTask) {
flags |= ActivityManager.RECENT_WITH_EXCLUDED;
}
- List<ActivityManager.RecentTaskInfo> tasks = mAm.getRecentTasksForUser(numTasksToQuery,
- flags, userId);
+ List<ActivityManager.RecentTaskInfo> tasks = null;
+ try {
+ tasks = mAm.getRecentTasksForUser(numTasksToQuery, flags, userId);
+ } catch (Exception e) {
+ Log.e(TAG, "Failed to get recent tasks", e);
+ }
// Break early if we can't get a valid set of tasks
if (tasks == null) {
@@ -330,8 +334,9 @@
// NOTE: The order of these checks happens in the expected order of the traversal of the
// tasks
- // Remove the task if it is blacklisted
- if (sRecentsBlacklist.contains(t.realActivity.getClassName())) {
+ // Remove the task if it or it's package are blacklsited
+ if (sRecentsBlacklist.contains(t.realActivity.getClassName()) ||
+ sRecentsBlacklist.contains(t.realActivity.getPackageName())) {
iter.remove();
continue;
}
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
index cc556c7..081a3af 100644
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
@@ -1019,14 +1019,12 @@
}
}
+ /***
+ * @param opPackageName the name of the calling package
+ * @return authenticator id for the current user
+ */
public long getAuthenticatorId(String opPackageName) {
- if (canUseFingerprint(opPackageName, false /* foregroundOnly */,
- Binder.getCallingUid(), Binder.getCallingPid())) {
- return mCurrentAuthenticatorId;
- } else {
- Slog.w(TAG, "Client isn't current, returning authenticator_id=0");
- }
- return 0;
+ return mCurrentAuthenticatorId;
}
}
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index b907da6..e425e7d1 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -134,6 +134,9 @@
boolean mAppStopped;
int mPendingRelaunchCount;
+ private ArrayList<WindowSurfaceController.SurfaceControlWithBackground> mSurfaceViewBackgrounds =
+ new ArrayList<WindowSurfaceController.SurfaceControlWithBackground>();
+
ArrayDeque<Rect> mFrozenBounds = new ArrayDeque<>();
ArrayDeque<Configuration> mFrozenMergedConfig = new ArrayDeque<>();
@@ -720,6 +723,36 @@
service.mWindowPlacerLocked.performSurfacePlacement();
}
+ void addSurfaceViewBackground(WindowSurfaceController.SurfaceControlWithBackground background) {
+ mSurfaceViewBackgrounds.add(background);
+ }
+
+ void removeSurfaceViewBackground(WindowSurfaceController.SurfaceControlWithBackground background) {
+ mSurfaceViewBackgrounds.remove(background);
+ updateSurfaceViewBackgroundVisibilities();
+ }
+
+ // We use DimLayers behind SurfaceViews to prevent holes while resizing and creating.
+ // However, we need to ensure one SurfaceView doesn't cover another when they are both placed
+ // below the main app window (as traditionally a SurfaceView which is never drawn
+ // to is totally translucent). So we look at all our SurfaceView backgrounds and only enable
+ // the background for the SurfaceView with lowest Z order
+ void updateSurfaceViewBackgroundVisibilities() {
+ WindowSurfaceController.SurfaceControlWithBackground bottom = null;
+ int bottomLayer = Integer.MAX_VALUE;
+ for (int i = 0; i < mSurfaceViewBackgrounds.size(); i++) {
+ WindowSurfaceController.SurfaceControlWithBackground sc = mSurfaceViewBackgrounds.get(i);
+ if (sc.mVisible && sc.mLayer < bottomLayer) {
+ bottomLayer = sc.mLayer;
+ bottom = sc;
+ }
+ }
+ for (int i = 0; i < mSurfaceViewBackgrounds.size(); i++) {
+ WindowSurfaceController.SurfaceControlWithBackground sc = mSurfaceViewBackgrounds.get(i);
+ sc.updateBackgroundVisibility(sc != bottom);
+ }
+ }
+
@Override
void dump(PrintWriter pw, String prefix) {
super.dump(pw, prefix);
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index fd0bb99..570a6ec 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -84,9 +84,10 @@
// to a black-out layer placed one Z-layer below the surface.
// This prevents holes to whatever app/wallpaper is underneath.
if (animator.mWin.isChildWindow() &&
- animator.mWin.mSubLayer < 0) {
+ animator.mWin.mSubLayer < 0 &&
+ animator.mWin.mAppToken != null) {
mSurfaceControl = new SurfaceControlWithBackground(s,
- name, w, h, format, flags);
+ name, w, h, format, flags, animator.mWin.mAppToken);
} else if (DEBUG_SURFACE_TRACE) {
mSurfaceControl = new SurfaceTrace(
s, name, w, h, format, flags);
@@ -754,18 +755,25 @@
}
}
- private static class SurfaceControlWithBackground extends SurfaceControl {
+ class SurfaceControlWithBackground extends SurfaceControl {
private SurfaceControl mBackgroundControl;
private boolean mOpaque = true;
- private boolean mVisible = false;
+ private boolean mAppForcedInvisible = false;
+ private AppWindowToken mAppToken;
+ public boolean mVisible = false;
+ public int mLayer = -1;
public SurfaceControlWithBackground(SurfaceSession s,
- String name, int w, int h, int format, int flags)
+ String name, int w, int h, int format, int flags,
+ AppWindowToken token)
throws OutOfResourcesException {
super(s, name, w, h, format, flags);
mBackgroundControl = new SurfaceControl(s, name, w, h,
PixelFormat.OPAQUE, flags | SurfaceControl.FX_SURFACE_DIM);
mOpaque = (flags & SurfaceControl.OPAQUE) != 0;
+ mAppToken = token;
+
+ mAppToken.addSurfaceViewBackground(this);
}
@Override
@@ -778,6 +786,10 @@
public void setLayer(int zorder) {
super.setLayer(zorder);
mBackgroundControl.setLayer(zorder - 1);
+ if (mLayer != zorder) {
+ mLayer = zorder;
+ mAppToken.updateSurfaceViewBackgroundVisibilities();
+ }
}
@Override
@@ -814,7 +826,7 @@
public void setOpaque(boolean isOpaque) {
super.setOpaque(isOpaque);
mOpaque = isOpaque;
- updateBackgroundVisibility();
+ updateBackgroundVisibility(mAppForcedInvisible);
}
@Override
@@ -830,23 +842,28 @@
@Override
public void hide() {
- mVisible = false;
super.hide();
- updateBackgroundVisibility();
+ if (mVisible) {
+ mVisible = false;
+ mAppToken.updateSurfaceViewBackgroundVisibilities();
+ }
}
@Override
public void show() {
- mVisible = true;
super.show();
- updateBackgroundVisibility();
+ if (!mVisible) {
+ mVisible = true;
+ mAppToken.updateSurfaceViewBackgroundVisibilities();
+ }
}
@Override
public void destroy() {
super.destroy();
mBackgroundControl.destroy();
- }
+ mAppToken.removeSurfaceViewBackground(this);
+ }
@Override
public void release() {
@@ -866,8 +883,9 @@
mBackgroundControl.deferTransactionUntil(handle, frame);
}
- private void updateBackgroundVisibility() {
- if (mOpaque && mVisible) {
+ void updateBackgroundVisibility(boolean forcedInvisible) {
+ mAppForcedInvisible = forcedInvisible;
+ if (mOpaque && mVisible && !mAppForcedInvisible) {
mBackgroundControl.show();
} else {
mBackgroundControl.hide();