Skip to content

Commit

Permalink
Merge tag 'android-11.0.0_r7' of https://android.googlesource.com/pla…
Browse files Browse the repository at this point in the history
…tform/frameworks/base into 11

Android 11.0.0 Release 7 (RD1A.200810.020)
  • Loading branch information
sagarrokade006 committed Nov 3, 2020
1 parent 25a7a9c commit 7abfcd6
Show file tree
Hide file tree
Showing 1,269 changed files with 21,699 additions and 1,654 deletions.
40 changes: 40 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,3 +1225,43 @@ build = [
"StubLibraries.bp",
"ApiDocs.bp",
]

java_library {
name: "framework-telephony",
srcs: [
//":framework-telephony-sources",
//":framework-telephony-shared-srcs",
],
// TODO: change to framework-system-stub to build against system APIs.
libs: [
"framework-minus-apex",
"unsupportedappusage",
],
static_libs: [
"libphonenumber-platform",
"app-compat-annotations",
],
sdk_version: "core_platform",
aidl: {
export_include_dirs: ["telephony/java"],
include_dirs: [
"frameworks/native/aidl/binder",
"frameworks/native/aidl/gui",
]
},
jarjar_rules: ":framework-telephony-jarjar-rules",
dxflags: [
"--core-library",
"--multi-dex",
],
// This is to break the dependency from boot jars.
dex_preopt: {
enabled: false,
},
installable: true,
}

filegroup {
name: "framework-telephony-jarjar-rules",
srcs: ["telephony/framework-telephony-jarjar-rules.txt"],
}
1 change: 1 addition & 0 deletions cmds/uiautomator/library/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ java_library_static {
"android.test.runner",
"junit",
],
java_version: "1.8",
}

java_library_static {
Expand Down
10 changes: 10 additions & 0 deletions core/java/android/companion/BluetoothDeviceFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ public int hashCode() {
return Objects.hash(mNamePattern, mAddress, mServiceUuids, mServiceUuidMasks);
}

@Override
public String toString() {
return "BluetoothDeviceFilter{"
+ "mNamePattern=" + mNamePattern
+ ", mAddress='" + mAddress + '\''
+ ", mServiceUuids=" + mServiceUuids
+ ", mServiceUuidMasks=" + mServiceUuidMasks
+ '}';
}

@Override
public int describeContents() {
return 0;
Expand Down
3 changes: 3 additions & 0 deletions core/java/android/content/pm/PermissionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ public static int fixProtectionLevel(int level) {
if ((level & PermissionInfo.PROTECTION_FLAG_APP_PREDICTOR) != 0) {
protLevel += "|appPredictor";
}
if ((level & PermissionInfo.PROTECTION_FLAG_COMPANION) != 0) {
protLevel += "|companion";
}
if ((level & PermissionInfo.PROTECTION_FLAG_RETAIL_DEMO) != 0) {
protLevel += "|retailDemo";
}
Expand Down
4 changes: 3 additions & 1 deletion core/java/android/hardware/camera2/CameraDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ public abstract void createCustomCaptureSession(
*<p>BACKWARD_COMPATIBLE devices capable of streaming concurrently with other devices as described by
* {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds} have the
* following guaranteed streams (when streaming concurrently with other devices)</p>
* <p> Note: The sizes mentioned for these concurrent streams are the maximum sizes guaranteed
* to be supported. Sizes smaller than these, obtained by {@link StreamConfigurationMap#getOutputSizes} for a particular format, are supported as well. </p>
*
* <table>
* <tr><th colspan="5">Concurrent stream guaranteed configurations</th></tr>
Expand All @@ -696,7 +698,7 @@ public abstract void createCustomCaptureSession(
* </table><br>
* </p>
*
* <p> Devices which are not backwards-compatible, support a mandatory single stream of size sVGA with image format {@code DEPTH16} during concurrent operation.
* <p> Devices which are not backwards-compatible, support a mandatory single stream of size sVGA with image format {@code DEPTH16} during concurrent operation. </p>
*
* <p> For guaranteed concurrent stream configurations:</p>
* <p> sVGA refers to the camera device's maximum resolution for that format from {@link StreamConfigurationMap#getOutputSizes} or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ public abstract boolean setDisplayedContentSamplingEnabled(
public abstract DisplayedContentSample getDisplayedContentSample(
int displayId, long maxFrames, long timestamp);

/**
* Temporarily ignore proximity-sensor-based display behavior until there is a change
* to the proximity sensor state. This allows the display to turn back on even if something
* is obstructing the proximity sensor.
*/
public abstract void ignoreProximitySensorUntilChanged();

/**
* Describes the requested power state of the display.
*
Expand Down
4 changes: 4 additions & 0 deletions core/java/android/net/NetworkTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ public static final int[] getAllCollapsedRatTypes() {
for (final int ratType : ratTypes) {
collapsedRatTypes.add(NetworkTemplate.getCollapsedRatType(ratType));
}
// Add NETWORK_TYPE_5G_NSA to the returned list since 5G NSA is a virtual RAT type and
// it is not in TelephonyManager#NETWORK_TYPE_* constants.
// See {@link NetworkTemplate#NETWORK_TYPE_5G_NSA}.
collapsedRatTypes.add(NetworkTemplate.getCollapsedRatType(NETWORK_TYPE_5G_NSA));
// Ensure that unknown type is returned.
collapsedRatTypes.add(TelephonyManager.NETWORK_TYPE_UNKNOWN);
return toIntArray(collapsedRatTypes);
Expand Down
5 changes: 5 additions & 0 deletions core/java/android/os/PowerManagerInternal.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package android.os;

import android.view.Display;
import android.view.KeyEvent;

import java.util.function.Consumer;

Expand Down Expand Up @@ -335,4 +336,8 @@ public interface LowPowerModeListener {
public abstract void setFeature(int featureId, int data);

public abstract int getFeature(int featureId);

/** Allows power button to intercept a power key button press. */
public abstract boolean interceptPowerKeyDown(KeyEvent event);

}
11 changes: 0 additions & 11 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11422,17 +11422,6 @@ public static final class Global extends NameValueTable {
*/
public static final String MODE_RINGER = "mode_ringer";

/**
* Specifies whether Enhanced Connectivity is enabled or not. This setting allows the
* Connectivity Thermal Power Manager to actively help the device to save power in 5G
* scenarios
* Type: int 1 is enabled, 0 is disabled
*
* @hide
*/
public static final String ENHANCED_CONNECTIVITY_ENABLED =
"enhanced_connectivity_enable";

/**
* Overlay display devices setting.
* The associated value is a specially formatted string that describes the
Expand Down
3 changes: 1 addition & 2 deletions core/java/android/provider/Telephony.java
Original file line number Diff line number Diff line change
Expand Up @@ -3946,8 +3946,7 @@ private Carriers() {}

/**
* The APN set id. When the user manually selects an APN or the framework sets an APN as
* preferred, all APNs with the same set id as the selected APN should be prioritized over
* APNs in other sets.
* preferred, the device can only use APNs with the same set id as the selected APN.
* <p>Type: INTEGER</p>
* @hide
*/
Expand Down
1 change: 1 addition & 0 deletions core/java/android/service/wallpaper/IWallpaperEngine.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ oneway interface IWallpaperEngine {
@UnsupportedAppUsage
void destroy();
void setZoomOut(float scale);
void scalePreview(in Rect positionInWindow);
}
63 changes: 58 additions & 5 deletions core/java/android/service/wallpaper/WallpaperService.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

package android.service.wallpaper;

import static android.graphics.Matrix.MSCALE_X;
import static android.graphics.Matrix.MSCALE_Y;
import static android.graphics.Matrix.MSKEW_X;
import static android.graphics.Matrix.MSKEW_Y;

import android.annotation.FloatRange;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
Expand All @@ -31,6 +36,7 @@
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
Expand Down Expand Up @@ -123,7 +129,8 @@ public abstract class WallpaperService extends Service {
private static final int MSG_WINDOW_MOVED = 10035;
private static final int MSG_TOUCH_EVENT = 10040;
private static final int MSG_REQUEST_WALLPAPER_COLORS = 10050;
private static final int MSG_SCALE = 10100;
private static final int MSG_ZOOM = 10100;
private static final int MSG_SCALE_PREVIEW = 10110;

private static final int NOTIFY_COLORS_RATE_LIMIT_MS = 1000;

Expand Down Expand Up @@ -178,6 +185,7 @@ public class Engine {
WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS;
int mCurWindowFlags = mWindowFlags;
int mCurWindowPrivateFlags = mWindowPrivateFlags;
Rect mPreviewSurfacePosition;
final Rect mVisibleInsets = new Rect();
final Rect mWinFrame = new Rect();
final Rect mContentInsets = new Rect();
Expand All @@ -194,6 +202,8 @@ public class Engine {
final InsetsSourceControl[] mTempControls = new InsetsSourceControl[0];
final MergedConfiguration mMergedConfiguration = new MergedConfiguration();
private final Point mSurfaceSize = new Point();
private final Matrix mTmpMatrix = new Matrix();
private final float[] mTmpValues = new float[9];

final WindowManager.LayoutParams mLayout
= new WindowManager.LayoutParams();
Expand Down Expand Up @@ -366,7 +376,7 @@ public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep,
Message msg = mCaller.obtainMessage(MSG_WALLPAPER_OFFSETS);
mCaller.sendMessage(msg);
}
Message msg = mCaller.obtainMessageI(MSG_SCALE, Float.floatToIntBits(zoom));
Message msg = mCaller.obtainMessageI(MSG_ZOOM, Float.floatToIntBits(zoom));
mCaller.sendMessage(msg);
}
}
Expand Down Expand Up @@ -747,6 +757,8 @@ protected void dump(String prefix, FileDescriptor fd, PrintWriter out, String[]
out.println(mMergedConfiguration.getMergedConfiguration());
out.print(prefix); out.print("mLayout="); out.println(mLayout);
out.print(prefix); out.print("mZoom="); out.println(mZoom);
out.print(prefix); out.print("mPreviewSurfacePosition=");
out.println(mPreviewSurfacePosition);
synchronized (mLock) {
out.print(prefix); out.print("mPendingXOffset="); out.print(mPendingXOffset);
out.print(" mPendingXOffset="); out.println(mPendingXOffset);
Expand Down Expand Up @@ -908,7 +920,6 @@ void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNee
mInsetsState, mTempControls, mSurfaceSize, mTmpSurfaceControl);
if (mSurfaceControl.isValid()) {
mSurfaceHolder.mSurface.copyFrom(mSurfaceControl);
mSurfaceControl.release();
}

if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
Expand Down Expand Up @@ -1063,6 +1074,7 @@ void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNee
if (redrawNeeded) {
mSession.finishDrawing(mWindow, null /* postDrawTransaction */);
}
reposition();
mIWallpaperEngine.reportShown();
}
} catch (RemoteException ex) {
Expand All @@ -1073,6 +1085,39 @@ void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNee
}
}

private void scalePreview(Rect position) {
if (isPreview() && mPreviewSurfacePosition == null && position != null
|| mPreviewSurfacePosition != null
&& !mPreviewSurfacePosition.equals(position)) {
mPreviewSurfacePosition = position;
if (mSurfaceControl.isValid()) {
reposition();
} else {
updateSurface(false, false, false);
}
}
}

private void reposition() {
if (mPreviewSurfacePosition == null) {
return;
}
if (DEBUG) {
Log.i(TAG, "reposition: rect: " + mPreviewSurfacePosition);
}

mTmpMatrix.setTranslate(mPreviewSurfacePosition.left, mPreviewSurfacePosition.top);
mTmpMatrix.postScale(((float) mPreviewSurfacePosition.width()) / mCurWidth,
((float) mPreviewSurfacePosition.height()) / mCurHeight);
mTmpMatrix.getValues(mTmpValues);
SurfaceControl.Transaction t = new SurfaceControl.Transaction();
t.setPosition(mSurfaceControl, mPreviewSurfacePosition.left,
mPreviewSurfacePosition.top);
t.setMatrix(mSurfaceControl, mTmpValues[MSCALE_X], mTmpValues[MSKEW_Y],
mTmpValues[MSKEW_X], mTmpValues[MSCALE_Y]);
t.apply();
}

void attach(IWallpaperEngineWrapper wrapper) {
if (DEBUG) Log.v(TAG, "attach: " + this + " wrapper=" + wrapper);
if (mDestroyed) {
Expand Down Expand Up @@ -1415,7 +1460,7 @@ public void dispatchWallpaperCommand(String action, int x, int y,
}

public void setZoomOut(float scale) {
Message msg = mCaller.obtainMessageI(MSG_SCALE, Float.floatToIntBits(scale));
Message msg = mCaller.obtainMessageI(MSG_ZOOM, Float.floatToIntBits(scale));
mCaller.sendMessage(msg);
}

Expand Down Expand Up @@ -1445,6 +1490,11 @@ public void detach() {
mDetached.set(true);
}

public void scalePreview(Rect position) {
Message msg = mCaller.obtainMessageO(MSG_SCALE_PREVIEW, position);
mCaller.sendMessage(msg);
}

private void doDetachEngine() {
mActiveEngines.remove(mEngine);
mEngine.detach();
Expand Down Expand Up @@ -1491,9 +1541,12 @@ public void executeMessage(Message message) {
case MSG_UPDATE_SURFACE:
mEngine.updateSurface(true, false, true/*false*/);
break;
case MSG_SCALE:
case MSG_ZOOM:
mEngine.setZoom(Float.intBitsToFloat(message.arg1));
break;
case MSG_SCALE_PREVIEW:
mEngine.scalePreview((Rect) message.obj);
break;
case MSG_VISIBILITY_CHANGED:
if (DEBUG) Log.v(TAG, "Visibility change in " + mEngine
+ ": " + message.arg1);
Expand Down
25 changes: 16 additions & 9 deletions core/java/android/view/InsetsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,20 @@ public boolean onStateChanged(InsetsState state) {
return false;
}
if (DEBUG) Log.d(TAG, "onStateChanged: " + state);
updateState(state);

boolean localStateChanged = !mState.equals(mLastDispatchedState,
true /* excludingCaptionInsets */, true /* excludeInvisibleIme */);
mLastDispatchedState.set(state, true /* copySources */);

final InsetsState lastState = new InsetsState(mState, true /* copySources */);
updateState(state);
applyLocalVisibilityOverride();
if (localStateChanged) {
if (DEBUG) Log.d(TAG, "onStateChanged, notifyInsetsChanged, send state to WM: " + mState);

if (!mState.equals(lastState, true /* excludingCaptionInsets */,
true /* excludeInvisibleIme */)) {
if (DEBUG) Log.d(TAG, "onStateChanged, notifyInsetsChanged");
mHost.notifyInsetsChanged();
}
if (!mState.equals(mLastDispatchedState, true /* excludingCaptionInsets */,
true /* excludeInvisibleIme */)) {
if (DEBUG) Log.d(TAG, "onStateChanged, send state to WM: " + mState);
updateRequestedState();
}
return true;
Expand Down Expand Up @@ -1134,22 +1138,25 @@ private void cancelAnimation(InsetsAnimationControlRunner control, boolean invok
if (invokeCallback) {
control.cancel();
}
boolean stateChanged = false;
for (int i = mRunningAnimations.size() - 1; i >= 0; i--) {
RunningAnimation runningAnimation = mRunningAnimations.get(i);
if (runningAnimation.runner == control) {
mRunningAnimations.remove(i);
ArraySet<Integer> types = toInternalType(control.getTypes());
for (int j = types.size() - 1; j >= 0; j--) {
if (getSourceConsumer(types.valueAt(j)).notifyAnimationFinished()) {
mHost.notifyInsetsChanged();
}
stateChanged |= getSourceConsumer(types.valueAt(j)).notifyAnimationFinished();
}
if (invokeCallback && runningAnimation.startDispatched) {
dispatchAnimationEnd(runningAnimation.runner.getAnimation());
}
break;
}
}
if (stateChanged) {
mHost.notifyInsetsChanged();
updateRequestedState();
}
}

private void applyLocalVisibilityOverride() {
Expand Down
2 changes: 2 additions & 0 deletions core/java/android/view/InsetsState.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
*/
public class InsetsState implements Parcelable {

public static final InsetsState EMPTY = new InsetsState();

/**
* Internal representation of inset source types. This is different from the public API in
* {@link WindowInsets.Type} as one type from the public API might indicate multiple windows
Expand Down
Loading

0 comments on commit 7abfcd6

Please sign in to comment.