Merge "Add getFlags and getSessionToken to MediaController" into lmp-dev
diff --git a/Android.mk b/Android.mk
index 30cb9c6..4376ed6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -215,7 +215,6 @@
core/java/android/print/IWriteResultCallback.aidl \
core/java/android/printservice/IPrintService.aidl \
core/java/android/printservice/IPrintServiceClient.aidl \
- core/java/android/service/dreams/IDozeHardware.aidl \
core/java/android/service/dreams/IDreamManager.aidl \
core/java/android/service/dreams/IDreamService.aidl \
core/java/android/service/persistentdata/IPersistentDataBlockService.aidl \
diff --git a/api/current.txt b/api/current.txt
index 292123e..5b9ea82 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -564,9 +564,9 @@
field public static final int fastScrollTextColor = 16843609; // 0x1010359
field public static final int fastScrollThumbDrawable = 16843574; // 0x1010336
field public static final int fastScrollTrackDrawable = 16843577; // 0x1010339
- field public static final int fill = 16843807; // 0x101041f
field public static final int fillAfter = 16843197; // 0x10101bd
field public static final int fillBefore = 16843196; // 0x10101bc
+ field public static final int fillColor = 16843807; // 0x101041f
field public static final int fillEnabled = 16843343; // 0x101024f
field public static final int fillOpacity = 16843806; // 0x101041e
field public static final int fillViewport = 16843130; // 0x101017a
@@ -1161,7 +1161,7 @@
field public static final int streamType = 16843273; // 0x1010209
field public static final int stretchColumns = 16843081; // 0x1010149
field public static final int stretchMode = 16843030; // 0x1010116
- field public static final int stroke = 16843809; // 0x1010421
+ field public static final int strokeColor = 16843809; // 0x1010421
field public static final int strokeLineCap = 16843815; // 0x1010427
field public static final int strokeLineJoin = 16843816; // 0x1010428
field public static final int strokeOpacity = 16843810; // 0x1010422
@@ -1388,6 +1388,7 @@
field public static final int windowAllowExitTransitionOverlap = 16843837; // 0x101043d
field public static final int windowAnimationStyle = 16842926; // 0x10100ae
field public static final int windowBackground = 16842836; // 0x1010054
+ field public static final int windowClipToOutline = 16843953; // 0x10104b1
field public static final int windowCloseOnTouchOutside = 16843611; // 0x101035b
field public static final int windowContentOverlay = 16842841; // 0x1010059
field public static final int windowContentTransitionManager = 16843795; // 0x1010413
@@ -5415,6 +5416,7 @@
field public static final java.lang.String EXTRA_DEVICE_ADMIN = "android.app.extra.DEVICE_ADMIN";
field public static final java.lang.String EXTRA_PROVISIONING_DEFAULT_MANAGED_PROFILE_NAME = "android.app.extra.defaultManagedProfileName";
field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM = "android.app.extra.deviceAdminPackageChecksum";
+ field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER = "android.app.extra.deviceAdminPackageDownloadCookieHeader";
field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION = "android.app.extra.deviceAdminPackageDownloadLocation";
field public static final java.lang.String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME = "android.app.extra.deviceAdminPackageName";
field public static final java.lang.String EXTRA_PROVISIONING_EMAIL_ADDRESS = "android.app.extra.ManagedProfileEmailAddress";
@@ -14371,6 +14373,11 @@
field public static final int QUALITY_720P = 5; // 0x5
field public static final int QUALITY_CIF = 3; // 0x3
field public static final int QUALITY_HIGH = 1; // 0x1
+ field public static final int QUALITY_HIGH_SPEED_1080P = 2004; // 0x7d4
+ field public static final int QUALITY_HIGH_SPEED_480P = 2002; // 0x7d2
+ field public static final int QUALITY_HIGH_SPEED_720P = 2003; // 0x7d3
+ field public static final int QUALITY_HIGH_SPEED_HIGH = 2001; // 0x7d1
+ field public static final int QUALITY_HIGH_SPEED_LOW = 2000; // 0x7d0
field public static final int QUALITY_LOW = 0; // 0x0
field public static final int QUALITY_QCIF = 2; // 0x2
field public static final int QUALITY_QVGA = 7; // 0x7
@@ -17010,12 +17017,12 @@
public abstract class TvInputService.Session implements android.view.KeyEvent.Callback {
ctor public TvInputService.Session();
- method public void dispatchChannelRetuned(android.net.Uri);
- method public void dispatchContentAllowed();
- method public void dispatchContentBlocked(android.media.tv.TvContentRating);
- method public void dispatchTrackInfoChanged(java.util.List<android.media.tv.TvTrackInfo>);
- method public void dispatchVideoAvailable();
- method public void dispatchVideoUnavailable(int);
+ method public void notifyChannelRetuned(android.net.Uri);
+ method public void notifyContentAllowed();
+ method public void notifyContentBlocked(android.media.tv.TvContentRating);
+ method public void notifyTrackInfoChanged(java.util.List<android.media.tv.TvTrackInfo>);
+ method public void notifyVideoAvailable();
+ method public void notifyVideoUnavailable(int);
method public android.view.View onCreateOverlayView();
method public boolean onGenericMotionEvent(android.view.MotionEvent);
method public boolean onKeyDown(int, android.view.KeyEvent);
@@ -17023,7 +17030,6 @@
method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
method public boolean onKeyUp(int, android.view.KeyEvent);
method public abstract void onRelease();
- method public void onRequestUnblockContent(android.media.tv.TvContentRating);
method public boolean onSelectTrack(android.media.tv.TvTrackInfo);
method public abstract void onSetCaptionEnabled(boolean);
method public abstract void onSetStreamVolume(float);
@@ -17032,6 +17038,7 @@
method public boolean onTouchEvent(android.view.MotionEvent);
method public boolean onTrackballEvent(android.view.MotionEvent);
method public abstract boolean onTune(android.net.Uri);
+ method public void onUnblockContent(android.media.tv.TvContentRating);
method public boolean onUnselectTrack(android.media.tv.TvTrackInfo);
method public void setOverlayViewEnabled(boolean);
}
@@ -17433,6 +17440,7 @@
public class Network implements android.os.Parcelable {
method public int describeContents();
method public java.net.InetAddress[] getAllByName(java.lang.String) throws java.net.UnknownHostException;
+ method public java.net.URL getBoundURL(java.net.URL) throws java.net.MalformedURLException;
method public java.net.InetAddress getByName(java.lang.String) throws java.net.UnknownHostException;
method public javax.net.SocketFactory getSocketFactory();
method public void writeToParcel(android.os.Parcel, int);
@@ -25536,11 +25544,13 @@
field public static final java.lang.String ACTION_SOUND_SETTINGS = "android.settings.SOUND_SETTINGS";
field public static final java.lang.String ACTION_SYNC_SETTINGS = "android.settings.SYNC_SETTINGS";
field public static final java.lang.String ACTION_USER_DICTIONARY_SETTINGS = "android.settings.USER_DICTIONARY_SETTINGS";
+ field public static final java.lang.String ACTION_VOICE_CONTROL_AIRPLANE_MODE = "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS";
field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS";
field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS";
field public static final java.lang.String AUTHORITY = "settings";
field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types";
+ field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
field public static final java.lang.String EXTRA_AUTHORITIES = "authorities";
field public static final java.lang.String EXTRA_INPUT_METHOD_ID = "input_method_id";
}
@@ -28605,7 +28615,7 @@
method public final android.telecomm.Connection getParentConnection();
method public final int getState();
method public final android.telecomm.StatusHints getStatusHints();
- method public final android.telecomm.VideoCallProvider getVideoCallProvider();
+ method public final android.telecomm.ConnectionService.VideoCallProvider getVideoCallProvider();
method public final int getVideoState();
method public final boolean isConferenceConnection();
method public final boolean isRequestingRingback();
@@ -28642,7 +28652,7 @@
method public final void setRinging();
method public final void setSignal(android.os.Bundle);
method public final void setStatusHints(android.telecomm.StatusHints);
- method public final void setVideoCallProvider(android.telecomm.VideoCallProvider);
+ method public final void setVideoCallProvider(android.telecomm.ConnectionService.VideoCallProvider);
method public final void setVideoState(int);
method public final void startActivityFromInCall(android.app.PendingIntent);
method public static java.lang.String stateToString(int);
@@ -28694,6 +28704,26 @@
method public abstract void onSuccess(android.telecomm.ConnectionRequest, CONNECTION);
}
+ public static abstract class ConnectionService.VideoCallProvider {
+ ctor public ConnectionService.VideoCallProvider();
+ method public void changeCallDataUsage(int);
+ method public void changeCameraCapabilities(android.telecomm.CallCameraCapabilities);
+ method public void changePeerDimensions(int, int);
+ method public void handleCallSessionEvent(int);
+ method public abstract void onRequestCallDataUsage();
+ method public abstract void onRequestCameraCapabilities();
+ method public abstract void onSendSessionModifyRequest(android.telecomm.VideoCallProfile);
+ method public abstract void onSendSessionModifyResponse(android.telecomm.VideoCallProfile);
+ method public abstract void onSetCamera(java.lang.String);
+ method public abstract void onSetDeviceOrientation(int);
+ method public abstract void onSetDisplaySurface(android.view.Surface);
+ method public abstract void onSetPauseImage(java.lang.String);
+ method public abstract void onSetPreviewSurface(android.view.Surface);
+ method public abstract void onSetZoom(float);
+ method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile);
+ method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
+ }
+
public class GatewayInfo implements android.os.Parcelable {
method public int describeContents();
method public android.net.Uri getGatewayHandle();
@@ -28926,26 +28956,6 @@
field public static final int VIDEO_STATE_TX_ENABLED = 1; // 0x1
}
- public abstract class VideoCallProvider {
- ctor public VideoCallProvider();
- method public void changeCallDataUsage(int);
- method public void changeCameraCapabilities(android.telecomm.CallCameraCapabilities);
- method public void changePeerDimensions(int, int);
- method public void handleCallSessionEvent(int);
- method public abstract void onRequestCallDataUsage();
- method public abstract void onRequestCameraCapabilities();
- method public abstract void onSendSessionModifyRequest(android.telecomm.VideoCallProfile);
- method public abstract void onSendSessionModifyResponse(android.telecomm.VideoCallProfile);
- method public abstract void onSetCamera(java.lang.String);
- method public abstract void onSetDeviceOrientation(int);
- method public abstract void onSetDisplaySurface(android.view.Surface);
- method public abstract void onSetPauseImage(java.lang.String);
- method public abstract void onSetPreviewSurface(android.view.Surface);
- method public abstract void onSetZoom(float);
- method public void receiveSessionModifyRequest(android.telecomm.VideoCallProfile);
- method public void receiveSessionModifyResponse(int, android.telecomm.VideoCallProfile, android.telecomm.VideoCallProfile);
- }
-
}
package android.telephony {
@@ -39769,8 +39779,8 @@
method public void setLogo(android.graphics.drawable.Drawable);
method public void setLogoDescription(int);
method public void setLogoDescription(java.lang.CharSequence);
- method public void setNavigationContentDescription(java.lang.CharSequence);
method public void setNavigationContentDescription(int);
+ method public void setNavigationContentDescription(java.lang.CharSequence);
method public void setNavigationIcon(int);
method public void setNavigationIcon(android.graphics.drawable.Drawable);
method public void setNavigationOnClickListener(android.view.View.OnClickListener);
diff --git a/core/java/android/accounts/CantAddAccountActivity.java b/core/java/android/accounts/CantAddAccountActivity.java
index 4ac2beb..f7f232e 100644
--- a/core/java/android/accounts/CantAddAccountActivity.java
+++ b/core/java/android/accounts/CantAddAccountActivity.java
@@ -19,7 +19,6 @@
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
-import android.widget.TextView;
import com.android.internal.R;
@@ -29,25 +28,11 @@
*/
public class CantAddAccountActivity extends Activity {
public static final String EXTRA_ERROR_CODE = "android.accounts.extra.ERROR_CODE";
- public static final int MISSING = -1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_not_authorized);
-
- int errorCode = getIntent().getIntExtra(EXTRA_ERROR_CODE, MISSING);
- if (errorCode != MISSING) {
- TextView errorText = (TextView) findViewById(R.id.description);
- switch (errorCode) {
- case AccountManager.ERROR_CODE_USER_RESTRICTED:
- errorText.setText(R.string.app_no_restricted_accounts);
- break;
- default:
- // TODO: Get better message. See: http://b/14642886
- errorText.setText(R.string.error_message_title);
- }
- }
}
public void onCancelButtonClicked(View view) {
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 68d4cf1..f18507e 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -1583,7 +1583,8 @@
public void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, int targetUserId,
int flags) {
try {
- mPM.addCrossProfileIntentFilter(filter, sourceUserId, targetUserId, flags);
+ mPM.addCrossProfileIntentFilter(filter, mContext.getOpPackageName(),
+ mContext.getUserId(), sourceUserId, targetUserId, flags);
} catch (RemoteException e) {
// Should never happen!
}
@@ -1607,7 +1608,8 @@
@Override
public void clearCrossProfileIntentFilters(int sourceUserId) {
try {
- mPM.clearCrossProfileIntentFilters(sourceUserId);
+ mPM.clearCrossProfileIntentFilters(sourceUserId, mContext.getOpPackageName(),
+ mContext.getUserId());
} catch (RemoteException e) {
// Should never happen!
}
@@ -1621,11 +1623,11 @@
return new BitmapDrawable(getUserManager().getUserIcon(itemInfo.showUserIcon));
}
Drawable dr = getDrawable(itemInfo.packageName, itemInfo.icon, appInfo);
- if (dr != null) {
- dr = getUserManager().getBadgedDrawableForUser(dr,
- new UserHandle(mContext.getUserId()));
+ if (dr == null) {
+ dr = getDefaultActivityIcon();
}
- return dr;
+ return getUserManager().getBadgedDrawableForUser(dr,
+ new UserHandle(mContext.getUserId()));
}
private static class LegacyPackageInstallObserver extends PackageInstallObserver {
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 1f2f18a..76cf29a 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -273,6 +273,16 @@
= "android.app.extra.deviceAdminPackageDownloadLocation";
/**
+ * A String extra holding a http cookie header which should be used in the http request to the
+ * url specified in {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION}.
+ *
+ * <p>Use in an Nfc record with {@link #PROVISIONING_NFC_MIME_TYPE} that starts device owner
+ * provisioning via an Nfc bump.
+ */
+ public static final String EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER
+ = "android.app.extra.deviceAdminPackageDownloadCookieHeader";
+
+ /**
* A String extra holding the SHA-1 checksum of the file at download location specified in
* {@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION}. If this doesn't match
* the file at the download location an error will be shown to the user and the user will be
@@ -302,6 +312,7 @@
* <ul>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME}</li>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION}</li>
+ * <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_COOKIE_HEADER}, optional</li>
* <li>{@link #EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM}</li>
* <li>{@link #EXTRA_PROVISIONING_LOCAL_TIME} (convert to String), optional</li>
* <li>{@link #EXTRA_PROVISIONING_TIME_ZONE}, optional</li>
@@ -2391,8 +2402,9 @@
}
/**
- * Called by a profile owner to remove the cross-profile intent filters from the managed profile
- * and from the parent.
+ * Called by a profile owner to remove the cross-profile intent filters that go from the
+ * managed profile to the parent, or from the parent to the managed profile.
+ * Only removes those that have been set by the profile owner.
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
*/
public void clearCrossProfileIntentFilters(ComponentName admin) {
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index 27f2011..1fe43ec 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -491,6 +491,7 @@
mService.readDescriptor(mClientIf, address,
srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
descrInstId, descrUuid, AUTHENTICATION_MITM);
+ return;
} catch (RemoteException e) {
Log.e(TAG,"",e);
}
@@ -544,6 +545,7 @@
srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
descrInstId, descrUuid, characteristic.getWriteType(),
AUTHENTICATION_MITM, descriptor.getValue());
+ return;
} catch (RemoteException e) {
Log.e(TAG,"",e);
}
diff --git a/core/java/android/bluetooth/le/ScanFilter.java b/core/java/android/bluetooth/le/ScanFilter.java
index 0ae11b0..2ce18b0 100644
--- a/core/java/android/bluetooth/le/ScanFilter.java
+++ b/core/java/android/bluetooth/le/ScanFilter.java
@@ -107,7 +107,7 @@
dest.writeParcelable(mServiceUuidMask, flags);
}
}
- dest.writeInt(mServiceDataUuid == null? 0 : 1);
+ dest.writeInt(mServiceDataUuid == null ? 0 : 1);
if (mServiceDataUuid != null) {
dest.writeParcelable(mServiceDataUuid, flags);
dest.writeInt(mServiceData == null ? 0 : mServiceData.length);
@@ -235,6 +235,14 @@
}
/**
+ * @hide
+ */
+ @Nullable
+ public ParcelUuid getServiceDataUuid() {
+ return mServiceDataUuid;
+ }
+
+ /**
* Returns the manufacturer id. -1 if the manufacturer filter is not set.
*/
public int getManufacturerId() {
@@ -287,15 +295,21 @@
}
// Service data match
- if (mServiceData != null &&
- !matchesPartialData(mServiceData, mServiceDataMask, scanRecord.getServiceData())) {
- return false;
+ if (mServiceData != null) {
+ if (!Objects.equals(mServiceDataUuid, scanRecord.getServiceDataUuid()) ||
+ !matchesPartialData(mServiceData, mServiceDataMask,
+ scanRecord.getServiceData())) {
+ return false;
+ }
}
// Manufacturer data match.
- if (mManufacturerData != null && !matchesPartialData(mManufacturerData,
- mManufacturerDataMask, scanRecord.getManufacturerSpecificData())) {
- return false;
+ if (mManufacturerData != null) {
+ if (mManufacturerId != scanRecord.getManufacturerId() ||
+ !matchesPartialData(mManufacturerData,
+ mManufacturerDataMask, scanRecord.getManufacturerSpecificData())) {
+ return false;
+ }
}
// All filters match.
return true;
@@ -353,7 +367,8 @@
public String toString() {
return "BluetoothLeScanFilter [mDeviceName=" + mDeviceName + ", mDeviceAddress="
+ mDeviceAddress
- + ", mUuid=" + mServiceUuid + ", mUuidMask=" + mServiceUuidMask + ", mServiceData="
+ + ", mUuid=" + mServiceUuid + ", mUuidMask=" + mServiceUuidMask
+ + ", mServiceDataUuid=" + Objects.toString(mServiceDataUuid) + ", mServiceData="
+ Arrays.toString(mServiceData) + ", mServiceDataMask="
+ Arrays.toString(mServiceDataMask) + ", mManufacturerId=" + mManufacturerId
+ ", mManufacturerData=" + Arrays.toString(mManufacturerData)
@@ -363,7 +378,7 @@
@Override
public int hashCode() {
return Objects.hash(mDeviceName, mDeviceAddress, mManufacturerId, mManufacturerData,
- mManufacturerDataMask, mServiceData, mServiceDataMask,
+ mManufacturerDataMask, mServiceDataUuid, mServiceData, mServiceDataMask,
mServiceUuid, mServiceUuidMask);
}
@@ -381,6 +396,7 @@
mManufacturerId == other.mManufacturerId &&
Objects.deepEquals(mManufacturerData, other.mManufacturerData) &&
Objects.deepEquals(mManufacturerDataMask, other.mManufacturerDataMask) &&
+ Objects.deepEquals(mServiceDataUuid, other.mServiceDataUuid) &&
Objects.deepEquals(mServiceData, other.mServiceData) &&
Objects.deepEquals(mServiceDataMask, other.mServiceDataMask) &&
Objects.equals(mServiceUuid, other.mServiceUuid) &&
@@ -498,6 +514,7 @@
"size mismatch for service data and service data mask");
}
}
+ mServiceDataUuid = serviceDataUuid;
mServiceData = serviceData;
mServiceDataMask = serviceDataMask;
return this;
diff --git a/core/java/android/bluetooth/le/ScanRecord.java b/core/java/android/bluetooth/le/ScanRecord.java
index dd03308..e564c7d 100644
--- a/core/java/android/bluetooth/le/ScanRecord.java
+++ b/core/java/android/bluetooth/le/ScanRecord.java
@@ -225,20 +225,21 @@
txPowerLevel = scanRecord[currentPos];
break;
case DATA_TYPE_SERVICE_DATA:
- serviceData = extractBytes(scanRecord, currentPos, dataLength);
- // The first two bytes of the service data are service data UUID.
+ // The first two bytes of the service data are service data UUID in little
+ // endian. The rest bytes are service data.
int serviceUuidLength = BluetoothUuid.UUID_BYTES_16_BIT;
byte[] serviceDataUuidBytes = extractBytes(scanRecord, currentPos,
serviceUuidLength);
serviceDataUuid = BluetoothUuid.parseUuidFrom(serviceDataUuidBytes);
+ serviceData = extractBytes(scanRecord, currentPos + 2, dataLength - 2);
break;
case DATA_TYPE_MANUFACTURER_SPECIFIC_DATA:
- manufacturerSpecificData = extractBytes(scanRecord, currentPos,
- dataLength);
// The first two bytes of the manufacturer specific data are
// manufacturer ids in little endian.
- manufacturerId = ((manufacturerSpecificData[1] & 0xFF) << 8) +
- (manufacturerSpecificData[0] & 0xFF);
+ manufacturerId = ((scanRecord[currentPos + 1] & 0xFF) << 8) +
+ (scanRecord[currentPos] & 0xFF);
+ manufacturerSpecificData = extractBytes(scanRecord, currentPos + 2,
+ dataLength - 2);
break;
default:
// Just ignore, we don't handle such data type.
diff --git a/core/java/android/bluetooth/le/ScanResult.java b/core/java/android/bluetooth/le/ScanResult.java
index 9aee200..a0bdaff 100644
--- a/core/java/android/bluetooth/le/ScanResult.java
+++ b/core/java/android/bluetooth/le/ScanResult.java
@@ -69,7 +69,7 @@
dest.writeInt(0);
}
if (mScanRecord != null) {
- dest.writeInt(mScanRecord.getBytes().length);
+ dest.writeInt(1);
dest.writeByteArray(mScanRecord.getBytes());
} else {
dest.writeInt(0);
@@ -145,7 +145,7 @@
@Override
public String toString() {
return "ScanResult{" + "mDevice=" + mDevice + ", mScanRecord="
- + mScanRecord.toString() + ", mRssi=" + mRssi + ", mTimestampNanos="
+ + Objects.toString(mScanRecord) + ", mRssi=" + mRssi + ", mTimestampNanos="
+ mTimestampNanos + '}';
}
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 3f9f53b..f224f40 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1422,12 +1422,12 @@
* challenge.<p/>
* This intent is handled by the system at a high priority and applications cannot intercept
* it.<p/>
- * You can use {@link KeyguardManager#isKeyguardSecure()} to determine if the user will be
+ * You can use {@link android.app.KeyguardManager#isKeyguardSecure()} to determine if the user will be
* prompted.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
- public static final String ACTION_CONFIRM_DEVICE_CREDENTIAL
- = "android.intent.action.CONFIRM_DEVICE_CREDENTIAL";
+ public static final String ACTION_CONFIRM_DEVICE_CREDENTIAL = "android.intent.action.CONFIRM_DEVICE_CREDENTIAL";
+
/**
* Specify whether the package should be uninstalled for all users.
@@ -3182,8 +3182,8 @@
public static final String EXTRA_TITLE = "android.intent.extra.TITLE";
/**
- * A CharSequence description to show to the user on the lock screen UI asking for
- * their credentials when used with {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}.
+ * A CharSequence description to provide to the user when used with
+ * {@link #ACTION_CONFIRM_DEVICE_CREDENTIAL}.
*/
public static final String EXTRA_DETAILS = "android.intent.extra.DETAILS";
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 72c85ee..7196372 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -244,13 +244,13 @@
void clearPackagePersistentPreferredActivities(String packageName, int userId);
- void addCrossProfileIntentFilter(in IntentFilter intentFilter, int sourceUserId, int targetUserId,
- int flags);
+ void addCrossProfileIntentFilter(in IntentFilter intentFilter, String ownerPackage,
+ int ownerUserId, int sourceUserId, int targetUserId, int flags);
void addCrossProfileIntentsForPackage(in String packageName, int sourceUserId,
int targetUserId);
- void clearCrossProfileIntentFilters(int sourceUserId);
+ void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage, int ownerUserId);
/**
* Report the set of 'Home' activity candidates, plus (if any) which of them
diff --git a/core/java/android/content/pm/PackageItemInfo.java b/core/java/android/content/pm/PackageItemInfo.java
index 9f79a89..4b5bdda 100644
--- a/core/java/android/content/pm/PackageItemInfo.java
+++ b/core/java/android/content/pm/PackageItemInfo.java
@@ -152,15 +152,9 @@
* such as the default activity icon.
*/
public Drawable loadIcon(PackageManager pm) {
- if (icon != 0 || showUserIcon != UserHandle.USER_NULL) {
- Drawable dr = pm.loadItemIcon(this, getApplicationInfo());
- if (dr != null) {
- return dr;
- }
- }
- return loadDefaultIcon(pm);
+ return pm.loadItemIcon(this, getApplicationInfo());
}
-
+
/**
* Retrieve the current graphical banner associated with this item. This
* will call back on the given PackageManager to load the banner from
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 62611efa..c5dcd8e 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -205,13 +205,6 @@
public static final int NO_CROSS_PROFILE = 0x00020000;
/**
- * Flag for {@link addCrossProfileIntentFilter}: if the cross-profile intent has been set by the
- * profile owner.
- * @hide
- */
- public static final int SET_BY_PROFILE_OWNER= 0x00000001;
-
- /**
* Flag for {@link addCrossProfileIntentFilter}: if this flag is set:
* when resolving an intent that matches the {@link CrossProfileIntentFilter}, the current
* profile will be skipped.
@@ -3744,9 +3737,10 @@
* Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the
* user with id sourceUserId can also be be resolved by activities in the user with id
* targetUserId if they match the specified intent filter.
- * @param filter the {@link IntentFilter} the intent has to match
- * @param removable if set to false, {@link clearCrossProfileIntentFilters} will not remove this
- * {@link CrossProfileIntentFilter}
+ * @param filter The {@link IntentFilter} the intent has to match
+ * @param sourceUserId The source user id.
+ * @param targetUserId The target user id.
+ * @param flags The only possible value is {@link SKIP_CURRENT_PROFILE}
* @hide
*/
public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId,
@@ -3754,8 +3748,8 @@
/**
* Clearing {@link CrossProfileIntentFilter}s which have the specified user as their
- * source, and have been set by the profile owner
- * @param sourceUserId
+ * source, and have been set by the app calling this method.
+ * @param sourceUserId The source user id.
* @hide
*/
public abstract void clearCrossProfileIntentFilters(int sourceUserId);
diff --git a/core/java/android/net/Network.java b/core/java/android/net/Network.java
index 9a22d78..97238f1 100644
--- a/core/java/android/net/Network.java
+++ b/core/java/android/net/Network.java
@@ -23,11 +23,16 @@
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
+import java.net.MalformedURLException;
import java.net.Socket;
import java.net.SocketException;
import java.net.UnknownHostException;
+import java.net.URL;
import javax.net.SocketFactory;
+import com.android.okhttp.HostResolver;
+import com.android.okhttp.OkHttpClient;
+
/**
* Identifies a {@code Network}. This is supplied to applications via
* {@link ConnectivityManager.NetworkCallback} in response to the active
@@ -44,7 +49,11 @@
*/
public final int netId;
+ // Objects used to perform per-network operations such as getSocketFactory
+ // and getBoundURL, and a lock to protect access to them.
private NetworkBoundSocketFactory mNetworkBoundSocketFactory = null;
+ private OkHttpClient mOkHttpClient = null;
+ private Object mLock = new Object();
/**
* @hide
@@ -166,12 +175,38 @@
* {@code Network}.
*/
public SocketFactory getSocketFactory() {
- if (mNetworkBoundSocketFactory == null) {
- mNetworkBoundSocketFactory = new NetworkBoundSocketFactory(netId);
+ synchronized (mLock) {
+ if (mNetworkBoundSocketFactory == null) {
+ mNetworkBoundSocketFactory = new NetworkBoundSocketFactory(netId);
+ }
}
return mNetworkBoundSocketFactory;
}
+ /**
+ * Returns a {@link URL} based on the given URL but bound to this {@code Network}.
+ * Note that if this {@code Network} ever disconnects, this factory and any URL object it
+ * produced in the past or future will cease to work.
+ *
+ * @return a {@link URL} bound to this {@code Network}.
+ */
+ public URL getBoundURL(URL url) throws MalformedURLException {
+ synchronized (mLock) {
+ if (mOkHttpClient == null) {
+ HostResolver hostResolver = new HostResolver() {
+ @Override
+ public InetAddress[] getAllByName(String host) throws UnknownHostException {
+ return Network.this.getAllByName(host);
+ }
+ };
+ mOkHttpClient = new OkHttpClient()
+ .setSocketFactory(getSocketFactory())
+ .setHostResolver(hostResolver);
+ }
+ }
+ return new URL(url, "", mOkHttpClient.createURLStreamHandler(url.getProtocol()));
+ }
+
// implement the Parcelable interface
public int describeContents() {
return 0;
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 95cb9f3..59cd97c 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -246,6 +246,7 @@
private static native void nativeRestoreAllowFds(long nativePtr, boolean lastValue);
private static native void nativeWriteByteArray(long nativePtr, byte[] b, int offset, int len);
+ private static native void nativeWriteBlob(long nativePtr, byte[] b, int offset, int len);
private static native void nativeWriteInt(long nativePtr, int val);
private static native void nativeWriteLong(long nativePtr, long val);
private static native void nativeWriteFloat(long nativePtr, float val);
@@ -255,6 +256,7 @@
private static native void nativeWriteFileDescriptor(long nativePtr, FileDescriptor val);
private static native byte[] nativeCreateByteArray(long nativePtr);
+ private static native byte[] nativeReadBlob(long nativePtr);
private static native int nativeReadInt(long nativePtr);
private static native long nativeReadLong(long nativePtr);
private static native float nativeReadFloat(long nativePtr);
@@ -479,6 +481,16 @@
}
/**
+ * Write a blob of data into the parcel at the current {@link #dataPosition},
+ * growing {@link #dataCapacity} if needed.
+ * @param b Bytes to place into the parcel.
+ * {@hide}
+ */
+ public final void writeBlob(byte[] b) {
+ nativeWriteBlob(mNativePtr, b, 0, (b != null) ? b.length : 0);
+ }
+
+ /**
* Write an integer value into the parcel at the current dataPosition(),
* growing dataCapacity() if needed.
*/
@@ -1700,6 +1712,14 @@
}
/**
+ * Read a blob of data from the parcel and return it as a byte array.
+ * {@hide}
+ */
+ public final byte[] readBlob() {
+ return nativeReadBlob(mNativePtr);
+ }
+
+ /**
* Read and return a String[] object from the parcel.
* {@hide}
*/
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 6a77805..fe201cd 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -131,6 +131,31 @@
"android.settings.AIRPLANE_MODE_SETTINGS";
/**
+ * Activity Action: Modify Airplane mode settings using the users voice.
+ * <p>
+ * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
+ * <p>
+ * This intent MUST be started using
+ * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
+ * startVoiceActivity}.
+ * <p>
+ * To tell which state airplane mode should be set to, add the
+ * {@link #EXTRA_AIRPLANE_MODE_ENABLED} extra to this Intent with the state specified.
+ * If there is no extra in this Intent, no changes will be made.
+ * <p>
+ * The activity should verify that
+ * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction} returns true before
+ * modifying the setting.
+ * <p>
+ * Input: Nothing.
+ * <p>
+ * Output: Nothing.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_VOICE_CONTROL_AIRPLANE_MODE =
+ "android.settings.VOICE_CONTROL_AIRPLANE_MODE";
+
+ /**
* Activity Action: Show settings for accessibility modules.
* <p>
* In some cases, a matching Activity may not exist, so ensure you
@@ -207,7 +232,6 @@
/**
* Activity Action: Show settings to allow configuration of Wi-Fi.
-
* <p>
* In some cases, a matching Activity may not exist, so ensure you
* safeguard against this.
@@ -780,6 +804,33 @@
public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
/**
+ * Activity Action: Modify zen mode settings.
+ * <p>
+ * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
+ * <p>
+ * This intent MUST be started using
+ * {@link android.service.voice.VoiceInteractionSession#startVoiceActivity
+ * startVoiceActivity}.
+ * <p>
+ * To tell which state zen mode should be set to, add the
+ * {@link #EXTRA_ZEN_MODE_INTERRUPTION_STATE} extra to this Intent with the state specified.
+ * If there is no extra in this Intent, no changes will be made.
+ * <p>
+ * The Activity should verify that
+ * {@link android.app.Activity#isVoiceInteraction isVoiceInteraction}.
+ * returns true before modifying the setting.
+ * <p>
+ * Input: Nothing.
+ * <p>
+ * Output: Nothing.
+ *
+ * @hide
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_VOICE_CONTROL_ZEN_MODE =
+ "android.settings.VOICE_CONTROL_ZEN_MODE";
+
+ /**
* Activity Action: Show the regulatory information screen for the device.
* <p>
* In some cases, a matching Activity may not exist, so ensure you safeguard
@@ -891,6 +942,27 @@
public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
+ /**
+ * Activity Extra: Enable or disable Airplane Mode.
+ * <p>
+ * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_AIRPLANE_MODE}
+ * intent as a boolean.
+ */
+ public static final String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled";
+
+ /**
+ * Activity Extra: Modify the zen mode interruption state.
+ * <p>
+ * This can be passed as an extra field to the {@link #ACTION_VOICE_CONTROL_ZEN_MODE}
+ * intent as an integer. The value should be one of
+ * {@link android.provider.Settings.Global#ZEN_MODE_OFF},
+ * {@link android.provider.Settings.Global#ZEN_MODE_IMPORTANT_INTERRUPTIONS},
+ * {@link android.provider.Settings.Global#ZEN_MODE_NO_INTERRUPTIONS}.
+ *
+ * @hide
+ */
+ public static final String EXTRA_ZEN_MODE_INTERRUPTION_STATE = "zen_mode_interruption_state";
+
private static final String JID_RESOURCE_PREFIX = "android";
public static final String AUTHORITY = "settings";
@@ -4846,6 +4918,14 @@
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/global");
/**
+ * Whether users are allowed to add more users or guest from lockscreen.
+ * <p>
+ * Type: int
+ * @hide
+ */
+ public static final String ADD_USERS_WHEN_LOCKED = "add_users_when_locked";
+
+ /**
* Setting whether the global gesture for enabling accessibility is enabled.
* If this gesture is enabled the user will be able to perfrom it to enable
* the accessibility state without visiting the settings app.
diff --git a/core/java/android/service/dreams/DozeHardware.java b/core/java/android/service/dreams/DozeHardware.java
deleted file mode 100644
index b5e7f43..0000000
--- a/core/java/android/service/dreams/DozeHardware.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.service.dreams;
-
-import android.os.RemoteException;
-import android.util.Log;
-
-/**
- * Provides access to low-level hardware features that a dream may use to provide
- * a richer user experience while dozing.
- * <p>
- * This class contains functions that should be called by the dream to configure
- * hardware before starting to doze and allowing the application processor to suspend.
- * For example, the dream may provide the hardware with enough information to render
- * some content on its own without any further assistance from the application processor.
- * </p><p>
- * This object is obtained by calling {@link DreamService#getDozeHardware()}.
- * </p>
- *
- * @hide experimental
- */
-public final class DozeHardware {
- private static final String TAG = "DozeHardware";
-
- public static final String MSG_ENABLE_MCU = "enable_mcu";
-
- public static final byte[] VALUE_ON = "on".getBytes();
- public static final byte[] VALUE_OFF = "off".getBytes();
-
- private final IDozeHardware mHardware;
-
- DozeHardware(IDozeHardware hardware) {
- mHardware = hardware;
- }
-
- /**
- * Sets whether to enable the microcontroller.
- *
- * @param enable If true, enables the MCU otherwise disables it.
- */
- public void setEnableMcu(boolean enable) {
- sendMessage(MSG_ENABLE_MCU, enable ? VALUE_ON : VALUE_OFF);
- }
-
- /**
- * Sends a message to the doze hardware module.
- *
- * @param msg The name of the message to send.
- * @param arg An optional argument data blob, may be null.
- * @return A result data blob, may be null.
- */
- public byte[] sendMessage(String msg, byte[] arg) {
- if (msg == null) {
- throw new IllegalArgumentException("msg must not be null");
- }
-
- try {
- return mHardware.sendMessage(msg, arg);
- } catch (RemoteException ex) {
- Log.e(TAG, "Failed to send message to doze hardware module.", ex);
- return null;
- }
- }
-}
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index 5cf8aa6..7e04ae8 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -183,7 +183,6 @@
private boolean mCanDoze;
private boolean mDozing;
private boolean mWindowless;
- private DozeHardware mDozeHardware;
private int mDozeScreenState = Display.STATE_UNKNOWN;
private int mDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT;
@@ -658,29 +657,6 @@
}
/**
- * Gets an object that may be used to access low-level hardware features that a
- * dream may use to provide a richer user experience while dozing.
- *
- * @return An instance of {@link DozeHardware} or null if this device does not offer
- * hardware support for dozing.
- *
- * @hide For use by system UI components only.
- */
- public DozeHardware getDozeHardware() {
- if (mCanDoze && mDozeHardware == null && mWindowToken != null) {
- try {
- IDozeHardware hardware = mSandman.getDozeHardware(mWindowToken);
- if (hardware != null) {
- mDozeHardware = new DozeHardware(hardware);
- }
- } catch (RemoteException ex) {
- // system server died
- }
- }
- return mDozeHardware;
- }
-
- /**
* Gets the screen state to use while dozing.
*
* @return The screen state to use while dozing, such as {@link Display#STATE_ON},
@@ -1084,7 +1060,6 @@
else if (canDoze()) pw.print(" candoze");
pw.println();
if (canDoze()) {
- pw.println(" doze hardware: " + mDozeHardware);
pw.println(" doze screen state: " + Display.stateToString(mDozeScreenState));
pw.println(" doze screen brightness: " + mDozeScreenBrightness);
}
diff --git a/core/java/android/service/dreams/IDozeHardware.aidl b/core/java/android/service/dreams/IDozeHardware.aidl
deleted file mode 100644
index f5a657b..0000000
--- a/core/java/android/service/dreams/IDozeHardware.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.service.dreams;
-
-/**
- * @hide
- */
-interface IDozeHardware {
- byte[] sendMessage(String msg, in byte[] arg);
-}
diff --git a/core/java/android/service/dreams/IDreamManager.aidl b/core/java/android/service/dreams/IDreamManager.aidl
index 648426c..be3f3b3 100644
--- a/core/java/android/service/dreams/IDreamManager.aidl
+++ b/core/java/android/service/dreams/IDreamManager.aidl
@@ -20,7 +20,6 @@
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.os.IBinder;
-import android.service.dreams.IDozeHardware;
/** @hide */
interface IDreamManager {
@@ -34,5 +33,4 @@
void finishSelf(in IBinder token, boolean immediate);
void startDozing(in IBinder token, int screenState, int screenBrightness);
void stopDozing(in IBinder token);
- IDozeHardware getDozeHardware(in IBinder token);
}
diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
index d685cc5..d077a17 100644
--- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java
+++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
@@ -133,10 +133,10 @@
private final Handler mHandler;
/**
- * The sound model for the keyphrase, derived from the model management service
- * (IVoiceInteractionManagerService). May be null if the keyphrase isn't enrolled yet.
+ * Indicates if there is a sound model enrolled for the keyphrase,
+ * derived from the model management service (IVoiceInteractionManagerService).
*/
- private KeyphraseSoundModel mEnrolledSoundModel;
+ private boolean mIsEnrolledForDetection;
private int mAvailability = STATE_NOT_READY;
/**
@@ -257,7 +257,7 @@
int code = STATUS_ERROR;
try {
code = mModelManagementService.startRecognition(mVoiceInteractionService,
- mKeyphraseMetadata.id, mEnrolledSoundModel, mInternalCallback,
+ mKeyphraseMetadata.id, mInternalCallback,
new RecognitionConfig(
captureTriggerAudio, recognitionExtra, null /* additional data */));
} catch (RemoteException e) {
@@ -417,14 +417,13 @@
@Override
public Void doInBackground(Void... params) {
int availability = internalGetInitialAvailability();
- KeyphraseSoundModel soundModel = null;
+ boolean enrolled = false;
// Fetch the sound model if the availability is one of the supported ones.
if (availability == STATE_NOT_READY
|| availability == STATE_KEYPHRASE_UNENROLLED
|| availability == STATE_KEYPHRASE_ENROLLED) {
- soundModel =
- internalGetKeyphraseSoundModel(mKeyphraseMetadata.id);
- if (soundModel == null) {
+ enrolled = internalGetIsEnrolled(mKeyphraseMetadata.id);
+ if (!enrolled) {
availability = STATE_KEYPHRASE_UNENROLLED;
} else {
availability = STATE_KEYPHRASE_ENROLLED;
@@ -436,8 +435,8 @@
Slog.d(TAG, "Hotword availability changed from " + mAvailability
+ " -> " + availability);
}
+ mIsEnrolledForDetection = enrolled;
mAvailability = availability;
- mEnrolledSoundModel = soundModel;
notifyStateChangedLocked();
}
return null;
@@ -475,31 +474,14 @@
/**
* @return The corresponding {@link KeyphraseSoundModel} or null if none is found.
*/
- private KeyphraseSoundModel internalGetKeyphraseSoundModel(int keyphraseId) {
- List<KeyphraseSoundModel> soundModels;
+ private boolean internalGetIsEnrolled(int keyphraseId) {
try {
- soundModels = mModelManagementService
- .listRegisteredKeyphraseSoundModels(mVoiceInteractionService);
- if (soundModels == null || soundModels.isEmpty()) {
- Slog.i(TAG, "No available sound models for keyphrase ID: " + keyphraseId);
- return null;
- }
- for (int i = 0; i < soundModels.size(); i++) {
- KeyphraseSoundModel soundModel = soundModels.get(i);
- if (soundModel.keyphrases == null || soundModel.keyphrases.length == 0) {
- continue;
- }
- for (int j = 0; i < soundModel.keyphrases.length; j++) {
- Keyphrase keyphrase = soundModel.keyphrases[j];
- if (keyphrase.id == keyphraseId) {
- return soundModel;
- }
- }
- }
+ return mModelManagementService.isEnrolledForKeyphrase(
+ mVoiceInteractionService, keyphraseId);
} catch (RemoteException e) {
Slog.w(TAG, "RemoteException in listRegisteredKeyphraseSoundModels!");
}
- return null;
+ return false;
}
}
}
diff --git a/core/java/android/util/PathParser.java b/core/java/android/util/PathParser.java
index c36421d..6820f77 100644
--- a/core/java/android/util/PathParser.java
+++ b/core/java/android/util/PathParser.java
@@ -74,6 +74,9 @@
* @return a deep copy of the <code>source</code>.
*/
public static PathDataNode[] deepCopyNodes(PathDataNode[] source) {
+ if (source == null) {
+ return null;
+ }
PathDataNode[] copy = new PathParser.PathDataNode[source.length];
for (int i = 0; i < source.length; i ++) {
copy[i] = new PathDataNode(source[i]);
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java
index 8aba8af..2d54acb 100644
--- a/core/java/android/view/RenderNode.java
+++ b/core/java/android/view/RenderNode.java
@@ -597,6 +597,9 @@
* @see #getScaleX()
*/
public boolean setScaleX(float scaleX) {
+ if (scaleX > 1000000) {
+ throw new IllegalArgumentException("Invalid scale: " + scaleX);
+ }
return nSetScaleX(mNativeRenderNode, scaleX);
}
@@ -618,6 +621,9 @@
* @see #getScaleY()
*/
public boolean setScaleY(float scaleY) {
+ if (scaleY > 1000000) {
+ throw new IllegalArgumentException("Invalid scale: " + scaleY);
+ }
return nSetScaleY(mNativeRenderNode, scaleY);
}
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c4c3242..27f493a 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3327,7 +3327,7 @@
child.mRenderNode.setClipToBounds(clipChildren);
}
}
- invalidate();
+ invalidate(true);
}
}
@@ -3342,7 +3342,7 @@
public void setClipToPadding(boolean clipToPadding) {
if (hasBooleanFlag(FLAG_CLIP_TO_PADDING) != clipToPadding) {
setBooleanFlag(FLAG_CLIP_TO_PADDING, clipToPadding);
- invalidate();
+ invalidate(true);
}
}
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 2c7b3eb..0401fb7 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -16,6 +16,9 @@
package android.webkit;
+import android.app.AppGlobals;
+import android.content.Context;
+import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Process;
import android.os.RemoteException;
@@ -100,9 +103,14 @@
private static Class<WebViewFactoryProvider> getFactoryClass() throws ClassNotFoundException {
try {
- return (Class<WebViewFactoryProvider>) Class.forName(CHROMIUM_WEBVIEW_FACTORY);
- } catch (ClassNotFoundException e) {
- Log.e(LOGTAG, "Chromium WebView does not exist");
+ Context webViewContext = AppGlobals.getInitialApplication().createPackageContext(
+ getWebViewPackageName(),
+ Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
+ ClassLoader clazzLoader = webViewContext.getClassLoader();
+ return (Class<WebViewFactoryProvider>) Class.forName(CHROMIUM_WEBVIEW_FACTORY, true,
+ clazzLoader);
+ } catch (PackageManager.NameNotFoundException e) {
+ Log.e(LOGTAG, "Chromium WebView package does not exist");
return (Class<WebViewFactoryProvider>) Class.forName(NULL_WEBVIEW_FACTORY);
}
}
diff --git a/core/java/com/android/internal/app/IAppOpsService.aidl b/core/java/com/android/internal/app/IAppOpsService.aidl
index 9ff2cf4..a52dd48 100644
--- a/core/java/com/android/internal/app/IAppOpsService.aidl
+++ b/core/java/com/android/internal/app/IAppOpsService.aidl
@@ -40,8 +40,6 @@
int checkAudioOperation(int code, int usage, int uid, String packageName);
void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages);
- void setDeviceOwner(String packageName);
- void setProfileOwner(String packageName, int userHandle);
void setUserRestrictions(in Bundle restrictions, int userHandle);
void removeUser(int userHandle);
diff --git a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
index 7d5abd2..22ec4be 100644
--- a/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
+++ b/core/java/com/android/internal/app/IVoiceInteractionManagerService.aidl
@@ -33,19 +33,24 @@
void finish(IBinder token);
/**
- * Lists the registered Sound models for keyphrase detection.
+ * Lists the registered Sound model for keyphrase detection.
* May be null if no matching sound models exist.
- *
- * @param service The current voice interaction service.
*/
- List<SoundTrigger.KeyphraseSoundModel> listRegisteredKeyphraseSoundModels(
- in IVoiceInteractionService service);
+ SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId);
/**
* Updates the given keyphrase sound model. Adds the model if it doesn't exist currently.
*/
int updateKeyphraseSoundModel(in SoundTrigger.KeyphraseSoundModel model);
+ /**
+ * Deletes the given keyphrase sound model.
+ */
+ int deleteKeyphraseSoundModel(int keyphraseId);
/**
+ * Indicates if there's a keyphrase sound model available for the given keyphrase ID.
+ */
+ boolean isEnrolledForKeyphrase(IVoiceInteractionService service, int keyphraseId);
+ /**
* Gets the properties of the DSP hardware on this device, null if not present.
*/
SoundTrigger.ModuleProperties getDspModuleProperties(in IVoiceInteractionService service);
@@ -53,7 +58,7 @@
* Starts a recognition for the given keyphrase.
*/
int startRecognition(in IVoiceInteractionService service, int keyphraseId,
- in SoundTrigger.KeyphraseSoundModel soundModel, in IRecognitionStatusCallback callback,
+ in IRecognitionStatusCallback callback,
in SoundTrigger.RecognitionConfig recognitionConfig);
/**
* Stops a recognition for the given keyphrase.
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 84bd443..969c0db 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -34,6 +34,7 @@
boolean showImeSwitcher);
void setHardKeyboardStatus(boolean available, boolean enabled);
void setWindowState(int window, int state);
+ void buzzBeepBlinked();
void showRecentApps(boolean triggeredFromAltTab);
void hideRecentApps(boolean triggeredFromAltTab);
diff --git a/core/java/com/android/internal/util/Protocol.java b/core/java/com/android/internal/util/Protocol.java
index af966b1..d9ebc25 100644
--- a/core/java/com/android/internal/util/Protocol.java
+++ b/core/java/com/android/internal/util/Protocol.java
@@ -48,6 +48,8 @@
public static final int BASE_WIFI_CONTROLLER = 0x00026000;
public static final int BASE_WIFI_SCANNER = 0x00027000;
public static final int BASE_WIFI_SCANNER_SERVICE = 0x00027100;
+ public static final int BASE_WIFI_RTT_MANAGER = 0x00027200;
+ public static final int BASE_WIFI_RTT_SERVICE = 0x00027300;
public static final int BASE_WIFI_PASSPOINT_MANAGER = 0x00028000;
public static final int BASE_WIFI_PASSPOINT_SERVICE = 0x00028100;
public static final int BASE_DHCP = 0x00030000;
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index 3a3328f..eaadfb2 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -1173,8 +1173,8 @@
calibrationTransform1[ctr++] = entry1.data.r[i].denominator;
}
- BAIL_IF_INVALID(writer->addEntry(TAG_CAMERACALIBRATION1, entry1.count, calibrationTransform1,
- TIFF_IFD_0), env, TAG_CAMERACALIBRATION1, writer);
+ BAIL_IF_INVALID(writer->addEntry(TAG_CAMERACALIBRATION1, entry1.count,
+ calibrationTransform1, TIFF_IFD_0), env, TAG_CAMERACALIBRATION1, writer);
if (!singleIlluminant) {
camera_metadata_entry entry2 =
@@ -1188,8 +1188,8 @@
calibrationTransform2[ctr++] = entry2.data.r[i].denominator;
}
- BAIL_IF_INVALID(writer->addEntry(TAG_CAMERACALIBRATION2, entry2.count, calibrationTransform1,
- TIFF_IFD_0), env, TAG_CAMERACALIBRATION2, writer);
+ BAIL_IF_INVALID(writer->addEntry(TAG_CAMERACALIBRATION2, entry2.count,
+ calibrationTransform1, TIFF_IFD_0), env, TAG_CAMERACALIBRATION2, writer);
}
}
@@ -1294,6 +1294,21 @@
}
{
+ // Setup sensor noise model
+ camera_metadata_entry entry =
+ results.find(ANDROID_SENSOR_NOISE_PROFILE);
+
+ if (entry.count > 0) {
+ BAIL_IF_INVALID(writer->addEntry(TAG_NOISEPROFILE, entry.count,
+ entry.data.d, TIFF_IFD_0), env,
+ TAG_NOISEPROFILE, writer);
+ } else {
+ ALOGW("%s: No noise profile found in result metadata. Image quality may be reduced.",
+ __FUNCTION__);
+ }
+ }
+
+ {
// Setup opcode List 2
camera_metadata_entry entry1 =
characteristics.find(ANDROID_LENS_INFO_SHADING_MAP_SIZE);
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp
index 7e2448e..e0431a7 100644
--- a/core/jni/android_media_AudioTrack.cpp
+++ b/core/jni/android_media_AudioTrack.cpp
@@ -290,7 +290,7 @@
case MODE_STREAM:
status = lpTrack->set(
- AUDIO_STREAM_DEFAULT,// stream type
+ AUDIO_STREAM_DEFAULT,// stream type, but more info conveyed in paa (last argument)
sampleRateInHertz,
format,// word length, PCM
nativeChannelMask,
@@ -301,7 +301,7 @@
0,// shared mem
true,// thread can call Java
sessionId,// audio session ID
- AudioTrack::TRANSFER_DEFAULT, // default transfer mode
+ AudioTrack::TRANSFER_SYNC,
NULL, // default offloadInfo
-1, -1, // default uid, pid values
paa);
@@ -316,7 +316,7 @@
}
status = lpTrack->set(
- AUDIO_STREAM_DEFAULT,// stream type
+ AUDIO_STREAM_DEFAULT,// stream type, but more info conveyed in paa (last argument)
sampleRateInHertz,
format,// word length, PCM
nativeChannelMask,
@@ -327,7 +327,7 @@
lpJniStorage->mMemBase,// shared mem
true,// thread can call Java
sessionId,// audio session ID
- AudioTrack::TRANSFER_DEFAULT, // default transfer mode
+ AudioTrack::TRANSFER_SHARED,
NULL, // default offloadInfo
-1, -1, // default uid, pid values
paa);
diff --git a/core/jni/android_os_Parcel.cpp b/core/jni/android_os_Parcel.cpp
index 50f6c73..3ba481e 100644
--- a/core/jni/android_os_Parcel.cpp
+++ b/core/jni/android_os_Parcel.cpp
@@ -187,6 +187,37 @@
}
}
+static void android_os_Parcel_writeBlob(JNIEnv* env, jclass clazz, jlong nativePtr, jobject data,
+ jint offset, jint length) {
+ Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
+ if (parcel == NULL) {
+ return;
+ }
+
+ const status_t err = parcel->writeInt32(length);
+ if (err != NO_ERROR) {
+ signalExceptionForError(env, clazz, err);
+ return;
+ }
+
+ android::Parcel::WritableBlob blob;
+ android::status_t err2 = parcel->writeBlob(length, &blob);
+ if (err2 != NO_ERROR) {
+ signalExceptionForError(env, clazz, err2);
+ return;
+ }
+
+ jbyte* ar = (jbyte*)env->GetPrimitiveArrayCritical((jarray)data, 0);
+ if (ar == NULL) {
+ memset(blob.data(), 0, length);
+ } else {
+ memcpy(blob.data(), ar + offset, length);
+ env->ReleasePrimitiveArrayCritical((jarray)data, ar, 0);
+ }
+
+ blob.release();
+}
+
static void android_os_Parcel_writeInt(JNIEnv* env, jclass clazz, jlong nativePtr, jint val) {
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
const status_t err = parcel->writeInt32(val);
@@ -297,6 +328,36 @@
return ret;
}
+static jbyteArray android_os_Parcel_readBlob(JNIEnv* env, jclass clazz, jlong nativePtr)
+{
+ jbyteArray ret = NULL;
+
+ Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
+ if (parcel != NULL) {
+ int32_t len = parcel->readInt32();
+ if (len >= 0) {
+ android::Parcel::ReadableBlob blob;
+ android::status_t err = parcel->readBlob(len, &blob);
+ if (err != NO_ERROR) {
+ signalExceptionForError(env, clazz, err);
+ return NULL;
+ }
+
+ ret = env->NewByteArray(len);
+ if (ret != NULL) {
+ jbyte* a2 = (jbyte*)env->GetPrimitiveArrayCritical(ret, 0);
+ if (a2) {
+ memcpy(a2, blob.data(), len);
+ env->ReleasePrimitiveArrayCritical(ret, a2, 0);
+ }
+ }
+ blob.release();
+ }
+ }
+
+ return ret;
+}
+
static jint android_os_Parcel_readInt(JNIEnv* env, jclass clazz, jlong nativePtr)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
@@ -634,6 +695,7 @@
{"nativeRestoreAllowFds", "(JZ)V", (void*)android_os_Parcel_restoreAllowFds},
{"nativeWriteByteArray", "(J[BII)V", (void*)android_os_Parcel_writeNative},
+ {"nativeWriteBlob", "(J[BII)V", (void*)android_os_Parcel_writeBlob},
{"nativeWriteInt", "(JI)V", (void*)android_os_Parcel_writeInt},
{"nativeWriteLong", "(JJ)V", (void*)android_os_Parcel_writeLong},
{"nativeWriteFloat", "(JF)V", (void*)android_os_Parcel_writeFloat},
@@ -643,6 +705,7 @@
{"nativeWriteFileDescriptor", "(JLjava/io/FileDescriptor;)V", (void*)android_os_Parcel_writeFileDescriptor},
{"nativeCreateByteArray", "(J)[B", (void*)android_os_Parcel_createByteArray},
+ {"nativeReadBlob", "(J)[B", (void*)android_os_Parcel_readBlob},
{"nativeReadInt", "(J)I", (void*)android_os_Parcel_readInt},
{"nativeReadLong", "(J)J", (void*)android_os_Parcel_readLong},
{"nativeReadFloat", "(J)F", (void*)android_os_Parcel_readFloat},
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 2043214..6a7501d 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3023,6 +3023,11 @@
android:permission="android.permission.BIND_JOB_SERVICE" >
</service>
+ <service android:name="com.android.server.backup.FullBackupJob"
+ android:exported="true"
+ android:permission="android.permission.BIND_JOB_SERVICE" >
+ </service>
+
<service
android:name="com.android.server.pm.BackgroundDexOptService"
android:exported="true"
diff --git a/core/res/res/drawable-nodpi/platlogo.xml b/core/res/res/drawable-nodpi/platlogo.xml
index d1e2df3..fb52830 100644
--- a/core/res/res/drawable-nodpi/platlogo.xml
+++ b/core/res/res/drawable-nodpi/platlogo.xml
@@ -13,27 +13,28 @@
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size android:width="400dp" android:height="400dp"/>
-
- <viewport android:viewportHeight="25" android:viewportWidth="25" />
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="400dp"
+ android:height="400dp"
+ android:viewportHeight="25"
+ android:viewportWidth="25" >
<path
android:name="torso"
android:pathData="m2,2 l21,0 l0,21 l-21,0 z"
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
/>
<path
android:name="|"
android:pathData="m4,4 l8,0 l0,17 l-8,0 z"
- android:fill="#FF0000FF"
+ android:fillColor="#FF0000FF"
/>
<path
android:name="_"
android:pathData="m5,14 l16,0 l0,6 l-16,0 z"
- android:fill="#FFFF0000"
+ android:fillColor="#FFFF0000"
/>
</vector>
diff --git a/core/res/res/drawable-nodpi/stat_sys_adb.xml b/core/res/res/drawable-nodpi/stat_sys_adb.xml
index 6b3be4a..1fee2df 100644
--- a/core/res/res/drawable-nodpi/stat_sys_adb.xml
+++ b/core/res/res/drawable-nodpi/stat_sys_adb.xml
@@ -13,10 +13,11 @@
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size android:width="25dp" android:height="25dp"/>
-
- <viewport android:viewportHeight="25" android:viewportWidth="25" />
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="25dp"
+ android:height="25dp"
+ android:viewportHeight="25"
+ android:viewportWidth="25" >
<path
android:name="L-card"
@@ -34,7 +35,7 @@
M15,2 l3,0 l0,5 l5,0 l0,3 l-8,0
z"
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
/>
diff --git a/core/res/res/drawable/ic_audio_ring_notif.xml b/core/res/res/drawable/ic_audio_ring_notif.xml
index b52db5c..60a98ab 100644
--- a/core/res/res/drawable/ic_audio_ring_notif.xml
+++ b/core/res/res/drawable/ic_audio_ring_notif.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#8A000000"
+ android:fillColor="#8A000000"
android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,16.0l0.0,-5.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7c-2.9,0.7 -5.0,3.2 -5.0,6.3L5.0,16.0l-2.0,2.0l0.0,1.0l17.0,0.0l0.0,-1.0L18.0,16.0z"/>
</vector>
diff --git a/core/res/res/drawable/ic_audio_ring_notif_mute.xml b/core/res/res/drawable/ic_audio_ring_notif_mute.xml
index 8d7d6cb..17dfa7e 100644
--- a/core/res/res/drawable/ic_audio_ring_notif_mute.xml
+++ b/core/res/res/drawable/ic_audio_ring_notif_mute.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#8A000000"
+ android:fillColor="#8A000000"
android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,10.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7C9.5,4.3 9.0,4.5 8.6,4.7l9.4,9.4L18.0,10.5zM17.7,19.0l2.0,2.0l1.3,-1.3L4.3,3.0L3.0,4.3l2.9,2.9C5.3,8.2 5.0,9.3 5.0,10.5L5.0,16.0l-2.0,2.0l0.0,1.0L17.7,19.0z" />
</vector>
diff --git a/core/res/res/drawable/ic_audio_ring_notif_vibrate.xml b/core/res/res/drawable/ic_audio_ring_notif_vibrate.xml
index 2f1d940..2ed33ea 100644
--- a/core/res/res/drawable/ic_audio_ring_notif_vibrate.xml
+++ b/core/res/res/drawable/ic_audio_ring_notif_vibrate.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#8A000000"
+ android:fillColor="#8A000000"
android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/>
</vector>
diff --git a/core/res/res/drawable/ic_corp_badge.xml b/core/res/res/drawable/ic_corp_badge.xml
index 16c101b..e185fc4 100644
--- a/core/res/res/drawable/ic_corp_badge.xml
+++ b/core/res/res/drawable/ic_corp_badge.xml
@@ -13,31 +13,28 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20.0dp"
- android:height="20.0dp"/>
-
- <viewport
+ android:height="20.0dp"
android:viewportWidth="20.0"
- android:viewportHeight="20.0"/>
+ android:viewportHeight="20.0">
<path
android:pathData="M10.0,10.0m-10.0,0.0a10.0,10.0 0.0,1.0 1.0,20.0 0.0a10.0,10.0 0.0,1.0 1.0,-20.0 0.0"
- android:fill="#FF5722"/>
+ android:fillColor="#FF5722"/>
<path
android:pathData="M11.139,12.149l-0.001,0.0L8.996,12.149l0.0,-0.571L4.738,11.578l-0.002,2.198c0.0,0.589 0.477,1.066 1.066,1.066l8.535,0.0c0.589,0.0 1.066,-0.477 1.066,-1.066l0.0,-2.198l-4.264,0.0L11.139,12.149z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
<path
android:pathData="M8.996,10.006l2.143,0.0l0.0,0.52l4.442,0.0L15.580999,7.909c0.0,-0.589 -0.477,-1.066 -1.066,-1.066l-1.877,0.0L7.544,6.843L5.606,6.843c-0.589,0.0 -1.061,0.477 -1.061,1.066l-0.003,2.617l4.453,0.0L8.996,10.006L8.996,10.006z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
<path
android:pathData="M3.367,3.456 h13.016 v13.016 h-13.016z"
- android:fill="#00000000"/>
+ android:fillColor="#00000000"/>
<path
android:pathData="M7.368,5.263l5.263,0.0l0.0,1.053l-5.263,0.0z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
<path
android:pathData="M8.996,12.149l2.1419992,0.0 0.0010004044,0.0 0.0,-0.5699997 -2.1429996,0.0z"
- android:fill="#00000000"/>
+ android:fillColor="#00000000"/>
</vector>
diff --git a/core/res/res/drawable/ic_corp_icon_badge.xml b/core/res/res/drawable/ic_corp_icon_badge.xml
index c8e49e1..d20c431 100644
--- a/core/res/res/drawable/ic_corp_icon_badge.xml
+++ b/core/res/res/drawable/ic_corp_icon_badge.xml
@@ -13,42 +13,39 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.0dp"
- android:height="64.0dp"/>
-
- <viewport
+ android:height="64.0dp"
android:viewportWidth="64.0"
- android:viewportHeight="64.0"/>
+ android:viewportHeight="64.0">
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M49.062,50.0m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0"
android:fillOpacity="0.2"/>
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M49.0,49.5m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0"
android:fillOpacity="0.2"/>
<path
android:pathData="M49.0,49.0m-14.0,0.0a14.0,14.0 0.0,1.0 1.0,28.0 0.0a14.0,14.0 0.0,1.0 1.0,-28.0 0.0"
- android:fill="#FF5722"/>
+ android:fillColor="#FF5722"/>
<path
android:pathData="M50.594,52.009l-3.0,0.0L47.594,51.0l-5.961,0.0l-0.003,3.289c0.0,0.826 0.668,1.494 1.494,1.494l11.948,0.0c0.826,0.0 1.494,-0.668 1.494,-1.494L56.566006,51.0l-5.972,0.0C50.594,51.0 50.594,52.009 50.594,52.009z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
<path
android:pathData="M47.594,49.009l3.0,0.0L50.594,50.0l6.22,0.0l0.0,-3.925c0.0,-0.826 -0.668,-1.494 -1.494,-1.494l-2.627,0.0l-7.131,-0.001l-2.713,0.0c-0.826,0.0 -1.486,0.668 -1.486,1.494L41.359,50.0l6.235,0.0L47.594,49.009z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
<path
android:pathData="M39.714,39.838 h18.221 v18.221 h-18.221z"
- android:fill="#00000000"/>
+ android:fillColor="#00000000"/>
<path
android:pathData="M47.594,49.009 h3.0 v0.991 h-3.0z"
- android:fill="#00000000"/>
+ android:fillColor="#00000000"/>
<path
android:pathData="M47.594,51.0 h3.0 v1.009 h-3.0z"
- android:fill="#00000000"/>
+ android:fillColor="#00000000"/>
<path
android:pathData="M46.0,43.0l6.0,0.0l0.0,1.0l-6.0,0.0z"
- android:fill="#FFFFFF"/>
+ android:fillColor="#FFFFFF"/>
</vector>
diff --git a/core/res/res/drawable/ic_lock_bugreport.xml b/core/res/res/drawable/ic_lock_bugreport.xml
index b93a09a..8540eee 100644
--- a/core/res/res/drawable/ic_lock_bugreport.xml
+++ b/core/res/res/drawable/ic_lock_bugreport.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="?attr/colorControlNormal"
+ android:fillColor="?attr/colorControlNormal"
android:pathData="M20.0,8.0l-2.8,0.0c-0.5,-0.8 -1.1,-1.5 -1.8,-2.0L17.0,4.4L15.6,3.0l-2.2,2.2C13.0,5.1 12.5,5.0 12.0,5.0s-1.0,0.1 -1.4,0.2L8.4,3.0L7.0,4.4L8.6,6.0C7.9,6.5 7.3,7.2 6.8,8.0L4.0,8.0l0.0,2.0l2.1,0.0C6.0,10.3 6.0,10.7 6.0,11.0l0.0,1.0L4.0,12.0l0.0,2.0l2.0,0.0l0.0,1.0c0.0,0.3 0.0,0.7 0.1,1.0L4.0,16.0l0.0,2.0l2.8,0.0c1.0,1.8 3.0,3.0 5.2,3.0s4.2,-1.2 5.2,-3.0L20.0,18.0l0.0,-2.0l-2.1,0.0c0.1,-0.3 0.1,-0.7 0.1,-1.0l0.0,-1.0l2.0,0.0l0.0,-2.0l-2.0,0.0l0.0,-1.0c0.0,-0.3 0.0,-0.7 -0.1,-1.0L20.0,10.0L20.0,8.0zM14.0,16.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,16.0zM14.0,12.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,12.0z"/>
</vector>
diff --git a/core/res/res/drawable/stat_notify_disabled_data.xml b/core/res/res/drawable/stat_notify_disabled_data.xml
index d287a75..2f6ffaf 100644
--- a/core/res/res/drawable/stat_notify_disabled_data.xml
+++ b/core/res/res/drawable/stat_notify_disabled_data.xml
@@ -13,25 +13,22 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M40.709,4.5l-6.604,7.337 0.0,16.601 6.604,6.604z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M32.305,13.838l-6.0629997,6.7370005 6.0629997,6.0629997z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M15.498,40.5l0.0,-7.9869995 -7.205,7.9869995z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M10.265,9.72l-2.5460005,2.545 9.971001,9.971 3.7139988,3.7140007 -4.105999,4.5619984 0.0,9.988001 6.6019993,0.0 0.0,-12.054001 1.8029995,1.8030014 0.0,10.250999 6.602001,0.0 0.0,-3.6479988 1.7999992,1.7999992 1.8479996,1.8479996 4.670002,4.669998 2.5459976,-2.5459976z"/>
</vector>
diff --git a/core/res/res/drawable/vector_drawable_progress_bar_large.xml b/core/res/res/drawable/vector_drawable_progress_bar_large.xml
index 6e0840c..3bf3cd7 100644
--- a/core/res/res/drawable/vector_drawable_progress_bar_large.xml
+++ b/core/res/res/drawable/vector_drawable_progress_bar_large.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="76dp"
- android:width="76dp" />
-
- <viewport
+ android:width="76dp"
android:viewportHeight="48"
- android:viewportWidth="48" />
+ android:viewportWidth="48" >
<group
android:name="root"
@@ -29,9 +25,9 @@
android:translateY="24.0" >
<path
android:name="progressBar"
- android:fill="#00000000"
+ android:fillColor="#00000000"
android:pathData="M0, 0 m 0, -19 a 19,19 0 1,1 0,38 a 19,19 0 1,1 0,-38"
- android:stroke="?attr/colorControlActivated"
+ android:strokeColor="?attr/colorControlActivated"
android:strokeLineCap="round"
android:strokeLineJoin="miter"
android:strokeWidth="4"
diff --git a/core/res/res/drawable/vector_drawable_progress_bar_medium.xml b/core/res/res/drawable/vector_drawable_progress_bar_medium.xml
index 7f1231c..62f9225 100644
--- a/core/res/res/drawable/vector_drawable_progress_bar_medium.xml
+++ b/core/res/res/drawable/vector_drawable_progress_bar_medium.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="48dp"
- android:width="48dp" />
-
- <viewport
+ android:width="48dp"
android:viewportHeight="48"
- android:viewportWidth="48" />
+ android:viewportWidth="48" >
<group
android:name="root"
@@ -29,9 +25,9 @@
android:translateY="24.0" >
<path
android:name="progressBar"
- android:fill="#00000000"
+ android:fillColor="#00000000"
android:pathData="M0, 0 m 0, -19 a 19,19 0 1,1 0,38 a 19,19 0 1,1 0,-38"
- android:stroke="?attr/colorControlActivated"
+ android:strokeColor="?attr/colorControlActivated"
android:strokeLineCap="round"
android:strokeLineJoin="miter"
android:strokeWidth="4"
diff --git a/core/res/res/drawable/vector_drawable_progress_bar_small.xml b/core/res/res/drawable/vector_drawable_progress_bar_small.xml
index 58ca101..1352cfc 100644
--- a/core/res/res/drawable/vector_drawable_progress_bar_small.xml
+++ b/core/res/res/drawable/vector_drawable_progress_bar_small.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="16dp"
- android:width="16dp" />
-
- <viewport
+ android:width="16dp"
android:viewportHeight="48"
- android:viewportWidth="48" />
+ android:viewportWidth="48" >
<group
android:name="root"
@@ -29,9 +25,9 @@
android:translateY="24.0" >
<path
android:name="progressBar"
- android:fill="#00000000"
+ android:fillColor="#00000000"
android:pathData="M0, 0 m 0, -19 a 19,19 0 1,1 0,38 a 19,19 0 1,1 0,-38"
- android:stroke="?attr/colorControlActivated"
+ android:strokeColor="?attr/colorControlActivated"
android:strokeLineCap="round"
android:strokeLineJoin="miter"
android:strokeWidth="4"
diff --git a/core/res/res/layout/app_not_authorized.xml b/core/res/res/layout/app_not_authorized.xml
index bd40eeb..2188511 100644
--- a/core/res/res/layout/app_not_authorized.xml
+++ b/core/res/res/layout/app_not_authorized.xml
@@ -32,7 +32,7 @@
android:paddingBottom="16dip"
android:paddingStart="16dip"
android:paddingEnd="16dip"
- android:text="@string/app_no_restricted_accounts"
+ android:text="@string/error_message_change_not_allowed"
/>
<!-- Horizontal divider line -->
diff --git a/core/res/res/layout/app_permission_item.xml b/core/res/res/layout/app_permission_item.xml
index e2ffffb..1eff3dc 100644
--- a/core/res/res/layout/app_permission_item.xml
+++ b/core/res/res/layout/app_permission_item.xml
@@ -27,8 +27,8 @@
<ImageView
android:id="@+id/perm_icon"
- android:layout_width="32dp"
- android:layout_height="32dp"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:scaleType="fitCenter" />
diff --git a/core/res/res/layout/app_permission_item_money.xml b/core/res/res/layout/app_permission_item_money.xml
index 3fa4653..7e1aca1 100644
--- a/core/res/res/layout/app_permission_item_money.xml
+++ b/core/res/res/layout/app_permission_item_money.xml
@@ -27,8 +27,8 @@
<ImageView
android:id="@+id/perm_icon"
- android:layout_width="32dp"
- android:layout_height="32dp"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:scaleType="fitCenter" />
diff --git a/core/res/res/layout/app_permission_item_old.xml b/core/res/res/layout/app_permission_item_old.xml
index ce0cd42..de6fc4f 100644
--- a/core/res/res/layout/app_permission_item_old.xml
+++ b/core/res/res/layout/app_permission_item_old.xml
@@ -26,8 +26,8 @@
<ImageView
android:id="@+id/perm_icon"
- android:layout_width="30dip"
- android:layout_height="30dip"
+ android:layout_width="24dip"
+ android:layout_height="24dip"
android:layout_alignParentStart="true"
android:scaleType="fitCenter" />
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index fedea4e..184198b 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1847,6 +1847,9 @@
<!-- Elevation to use for the window. -->
<attr name="windowElevation" format="dimension" />
+
+ <!-- Whether to clip window content to the outline of the window background. -->
+ <attr name="windowClipToOutline" format="boolean" />
</declare-styleable>
<!-- The set of attributes that describe a AlertDialog's theme. -->
@@ -5116,24 +5119,16 @@
<!-- Indicates if the drawable needs to be mirrored when its layout direction is
RTL (right-to-left). -->
<attr name="autoMirrored" />
- </declare-styleable>
-
- <!-- Define the virtual size of the drawing surface paths will draw to. -->
- <declare-styleable name="VectorDrawableViewport">
+ <!-- The intrinsic width of the Vector Drawable. -->
+ <attr name="width" />
+ <!-- The intrinsic height of the Vector Drawable. -->
+ <attr name="height" />
<!-- The width of the canvas the drawing is on. -->
<attr name="viewportWidth" format="float"/>
<!-- The height of the canvas the drawing is on. -->
<attr name="viewportHeight" format="float"/>
</declare-styleable>
- <!-- Define the size of the drawable -->
- <declare-styleable name="VectorDrawableSize">
- <!-- Width of the Vector Drawable. -->
- <attr name="width" />
- <!-- Height of the Vector Drawable. -->
- <attr name="height" />
- </declare-styleable>
-
<!-- Defines the group used in VectorDrawables. -->
<declare-styleable name="VectorDrawableGroup">
<!-- The Name of this group -->
@@ -5165,9 +5160,9 @@
<!-- The opacity of a path stroke -->
<attr name="strokeOpacity" format="float" />
<!-- The color to stroke the path if not defined implies no stroke-->
- <attr name="stroke" format="color" />
+ <attr name="strokeColor" format="color" />
<!-- The color to fill the path if not defined implies no fill-->
- <attr name="fill" format="color" />
+ <attr name="fillColor" format="color" />
<!-- The level of opacity of the filled area of the path -->
<attr name="fillOpacity" format="float" />
<!-- The specification of the operations that define the path -->
@@ -5178,7 +5173,7 @@
<attr name="trimPathEnd" format="float" />
<!-- Shift trim region (allows visible region to include the start and end) from 0 to 1 -->
<attr name="trimPathOffset" format="float" />
- <!-- Path will set the current clip path -->
+ <!-- TODO: Remove this. Path will set the current clip path -->
<attr name="clipToPath" format="boolean" />
<!-- sets the linecap for a stroked path -->
<attr name="strokeLineCap" format="enum">
@@ -5196,6 +5191,14 @@
<attr name="strokeMiterLimit" format="float"/>
</declare-styleable>
+ <!-- Defines the clip path used in VectorDrawables. -->
+ <declare-styleable name="VectorDrawableClipPath">
+ <!-- The Name of this path -->
+ <attr name="name" />
+ <!-- The specification of the operations that define the path -->
+ <attr name="pathData"/>
+ </declare-styleable>
+
<!-- ========================== -->
<!-- AnimatedVectorDrawable class -->
<!-- ========================== -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a6e85e9..0a87d0d 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2119,9 +2119,9 @@
<public type="attr" name="viewportWidth" />
<public type="attr" name="viewportHeight" />
<public type="attr" name="fillOpacity" />
- <public type="attr" name="fill" />
+ <public type="attr" name="fillColor" />
<public type="attr" name="pathData" />
- <public type="attr" name="stroke" />
+ <public type="attr" name="strokeColor" />
<public type="attr" name="strokeOpacity" />
<public type="attr" name="strokeWidth" />
<public type="attr" name="trimPathStart" />
@@ -2268,6 +2268,7 @@
<public type="attr" name="checkMarkTintMode" />
<public type="attr" name="popupTheme" />
<public type="attr" name="toolbarStyle" />
+ <public type="attr" name="windowClipToOutline" />
<public-padding type="dimen" name="l_resource_pad" end="0x01050010" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 056c1a6..c6ee89f 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4513,8 +4513,8 @@
<string name="owner_name" msgid="3879126011135546571">Owner</string>
<!-- Error message title [CHAR LIMIT=35] -->
<string name="error_message_title">Error</string>
- <!-- Message informing user that app is not permitted to access accounts. [CHAR LIMIT=none] -->
- <string name="app_no_restricted_accounts">This app doesn\'t support accounts for restricted profiles</string>
+ <!-- Message informing user that the change was disallowed by an administrator. [CHAR LIMIT=none] -->
+ <string name="error_message_change_not_allowed">This change isn\'t allowed by your administrator</string>
<!-- Message informing user that the requested activity could not be found [CHAR LIMIT=none] -->
<string name="app_not_found">No application found to handle this action</string>
<string name="revoke">Revoke</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index e9b9889..30209e9 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -877,7 +877,7 @@
<java-symbol type="string" name="config_customResolverActivity" />
<java-symbol type="string" name="config_appsAuthorizedForSharedAccounts" />
<java-symbol type="string" name="error_message_title" />
- <java-symbol type="string" name="app_no_restricted_accounts" />
+ <java-symbol type="string" name="error_message_change_not_allowed" />
<java-symbol type="string" name="action_bar_home_description_format" />
<java-symbol type="string" name="action_bar_home_subtitle_description_format" />
<java-symbol type="string" name="wireless_display_route_description" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 0d4a2bf..aea72c1 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -169,6 +169,7 @@
<!-- Window attributes -->
<item name="windowBackground">@drawable/screen_background_selector_dark</item>
+ <item name="windowClipToOutline">false</item>
<item name="windowFrame">@null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
@@ -473,6 +474,8 @@
<p>This is designed for API level 10 and lower.</p>-->
<style name="Theme.Light">
<item name="windowBackground">@drawable/screen_background_selector_light</item>
+ <item name="windowClipToOutline">false</item>
+
<item name="colorBackground">@color/background_light</item>
<item name="colorForeground">@color/bright_foreground_light</item>
<item name="colorForegroundInverse">@color/bright_foreground_light_inverse</item>
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 741ffe6..f2233e0 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -146,6 +146,7 @@
<!-- Window attributes -->
<item name="windowBackground">@color/background_material_dark</item>
+ <item name="windowClipToOutline">true</item>
<item name="windowFrame">@null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
@@ -512,6 +513,7 @@
<!-- Window attributes -->
<item name="windowBackground">@color/background_material_light</item>
+ <item name="windowClipToOutline">true</item>
<item name="windowFrame">@null</item>
<item name="windowNoTitle">false</item>
<item name="windowFullscreen">false</item>
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java b/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java
index e259bcc..ccdd90a 100644
--- a/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java
+++ b/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java
@@ -27,8 +27,7 @@
/**
* Unit test cases for {@link ScanRecord}.
* <p>
- * To run this test, use adb shell am instrument -e class
- * 'android.bluetooth.ScanRecordTest' -w
+ * To run this test, use adb shell am instrument -e class 'android.bluetooth.ScanRecordTest' -w
* 'com.android.bluetooth.tests/android.bluetooth.BluetoothTestRunner'
*/
public class ScanRecordTest extends TestCase {
@@ -54,13 +53,13 @@
assertEquals("Ped", data.getDeviceName());
assertEquals(-20, data.getTxPowerLevel());
- assertEquals(224, data.getManufacturerId());
+ assertEquals(0x00e0, data.getManufacturerId());
assertArrayEquals(new byte[] {
- (byte) 0xe0, 0x00, 0x02, 0x15 }, data.getManufacturerSpecificData());
+ 0x02, 0x15 }, data.getManufacturerSpecificData());
assertEquals(uuid2, data.getServiceDataUuid());
assertArrayEquals(new byte[] {
- 0x0b, 0x11, 0x50, 0x64 }, data.getServiceData());
+ 0x50, 0x64 }, data.getServiceData());
}
// Assert two byte arrays are equal.
diff --git a/data/fonts/Android.mk b/data/fonts/Android.mk
index 9f6b64c..80fb1fd 100644
--- a/data/fonts/Android.mk
+++ b/data/fonts/Android.mk
@@ -47,14 +47,8 @@
DroidSans-Bold.ttf
################################
-# On space-constrained devices, we include a subset of fonts:
-ifeq ($(SMALLER_FONT_FOOTPRINT),true)
-
-droidsans_fallback_src := DroidSansFallback.ttf
-
-else # !SMALLER_FONT_FOOTPRINT
-
-droidsans_fallback_src := DroidSansFallbackFull.ttf
+# Do not include Motoya on space-constrained devices
+ifneq ($(SMALLER_FONT_FOOTPRINT),true)
include $(CLEAR_VARS)
LOCAL_MODULE := MTLmr3m.ttf
@@ -65,24 +59,44 @@
include $(BUILD_PREBUILT)
extra_font_files += MTLmr3m.ttf
-endif # SMALLER_FONT_FOOTPRINT
+endif # !SMALLER_FONT_FOOTPRINT
################################
+# Use DroidSansMono to hang extra_font_files on
+include $(CLEAR_VARS)
+LOCAL_MODULE := DroidSansMono.ttf
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
+LOCAL_REQUIRED_MODULES := $(extra_font_files)
+include $(BUILD_PREBUILT)
+extra_font_files :=
+
+################################
+# Include DroidSansFallback only on non-EXTENDED_FONT_FOOTPRINT builds
+ifneq ($(EXTENDED_FONT_FOOTPRINT),true)
+
+# Include a subset of DroidSansFallback on SMALLER_FONT_FOOTPRINT build
+ifeq ($(SMALLER_FONT_FOOTPRINT),true)
+droidsans_fallback_src := DroidSansFallback.ttf
+else # !SMALLER_FONT_FOOTPRINT
+droidsans_fallback_src := DroidSansFallbackFull.ttf
+endif # SMALLER_FONT_FOOTPRINT
+
include $(CLEAR_VARS)
LOCAL_MODULE := DroidSansFallback.ttf
LOCAL_SRC_FILES := $(droidsans_fallback_src)
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)/fonts
-LOCAL_REQUIRED_MODULES := $(extra_font_files)
include $(BUILD_PREBUILT)
-
-font_symlink_src :=
-font_symlink :=
droidsans_fallback_src :=
-extra_font_files :=
+
+endif # !EXTENDED_FONT_FOOTPRINT
+
################################
-# Build the rest font files as prebuilt.
+# Build the rest of font files as prebuilt.
# $(1): The source file name in LOCAL_PATH.
# It also serves as the module name and the dest file name.
@@ -101,7 +115,6 @@
Roboto-Bold.ttf \
Roboto-Italic.ttf \
Roboto-BoldItalic.ttf \
- DroidSansMono.ttf \
Clockopia.ttf \
AndroidClock.ttf \
AndroidClock_Highlight.ttf \
diff --git a/data/fonts/DroidKufi-Bold.ttf b/data/fonts/DroidKufi-Bold.ttf
deleted file mode 100644
index 650919e..0000000
--- a/data/fonts/DroidKufi-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/data/fonts/DroidKufi-Regular.ttf b/data/fonts/DroidKufi-Regular.ttf
deleted file mode 100644
index af85975..0000000
--- a/data/fonts/DroidKufi-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/data/fonts/DroidSans-Bold.ttf b/data/fonts/DroidSans-Bold.ttf
deleted file mode 100644
index d065b64..0000000
--- a/data/fonts/DroidSans-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/data/fonts/DroidSans.ttf b/data/fonts/DroidSans.ttf
deleted file mode 100644
index ad1efca..0000000
--- a/data/fonts/DroidSans.ttf
+++ /dev/null
Binary files differ
diff --git a/data/fonts/DroidSansFallbackFull.ttf b/data/fonts/DroidSansFallbackFull.ttf
index 135723c..1dfcc33 100644
--- a/data/fonts/DroidSansFallbackFull.ttf
+++ b/data/fonts/DroidSansFallbackFull.ttf
Binary files differ
diff --git a/data/fonts/DroidSansJapanese.ttf b/data/fonts/DroidSansJapanese.ttf
deleted file mode 100644
index 412fa3d..0000000
--- a/data/fonts/DroidSansJapanese.ttf
+++ /dev/null
Binary files differ
diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
index 11c2571..54683aa 100644
--- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
@@ -49,13 +49,11 @@
* </p>
* <li>Here is a simple VectorDrawable in this vectordrawable.xml file.
* <pre>
- * <vector xmlns:android="http://schemas.android.com/apk/res/android" >
- * <size
- * android:height="64dp"
- * android:width="64dp" />
- * <viewport
- * android:viewportHeight="600"
- * android:viewportWidth="600" />
+ * <vector xmlns:android="http://schemas.android.com/apk/res/android"
+ * android:height="64dp"
+ * android:width="64dp"
+ * android:viewportHeight="600"
+ * android:viewportWidth="600" >
* <group
* android:name="rotationGroup"
* android:pivotX="300.0"
@@ -63,7 +61,7 @@
* android:rotation="45.0" >
* <path
* android:name="v"
- * android:fill="#000000"
+ * android:fillColor="#000000"
* android:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" />
* </group>
* </vector>
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index f32fa1f..f41b11a 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -54,76 +54,130 @@
* <p/>
* The vector drawable has the following elements:
* <p/>
- * <dl>
* <dt><code><vector></code></dt>
- * <dd>Used to defined a vector drawable</dd>
- * <dt><code><size></code></dt>
- * <dd>Used to defined the intrinsic Width Height size of the drawable using
- * <code>android:width</code> and <code>android:height</code></dd>
- * <dt><code><viewport></code></dt>
- * <dd>Used to defined the size of the virtual canvas the paths are drawn on.
- * The size is defined using the attributes <code>android:viewportHeight</code>
- * <code>android:viewportWidth</code></dd>
+ * <dl>
+ * <dd>Used to defined a vector drawable
+ * <dl>
+ * <dt><code>android:width</code></dt>
+ * <dd>Used to defined the intrinsic width of the drawable.
+ * This support all the dimension units, normally specified with dp.</dd>
+ * <dt><code>android:height</code></dt>
+ * <dd>Used to defined the intrinsic height the drawable.
+ * This support all the dimension units, normally specified with dp.</dd>
+ * <dt><code>android:viewportWidth</code></dt>
+ * <dd>Used to defined the width of the viewport space. Viewport is basically
+ * the virtual canvas where the paths are drawn on.</dd>
+ * <dt><code>android:viewportHeight</code></dt>
+ * <dd>Used to defined the height of the viewport space. Viewport is basically
+ * the virtual canvas where the paths are drawn on.</dd>
+ * <dt><code>android:tint</code></dt>
+ * <dd>The color to apply to the drawable as a tint. By default, no tint is applied.</dd>
+ * <dt><code>android:tintMode</code></dt>
+ * <dd>The Porter-Duff blending mode for the tint color. The default value is src_in.</dd>
+ * <dt><code>android:autoMirrored</code></dt>
+ * <dd>Indicates if the drawable needs to be mirrored when its layout direction is
+ * RTL (right-to-left).</dd>
+ * </dl></dd>
+ * </dl>
+ *
+ * <dl>
* <dt><code><group></code></dt>
* <dd>Defines a group of paths or subgroups, plus transformation information.
* The transformations are defined in the same coordinates as the viewport.
- * And the transformations are applied in the order of scale, rotate then translate. </dd>
- * <dt><code>android:rotation</code>
- * <dd>The degrees of rotation of the group.</dd></dt>
- * <dt><code>android:pivotX</code>
- * <dd>The X coordinate of the pivot for the scale and rotation of the group</dd></dt>
- * <dt><code>android:pivotY</code>
- * <dd>The Y coordinate of the pivot for the scale and rotation of the group</dd></dt>
- * <dt><code>android:scaleX</code>
- * <dd>The amount of scale on the X Coordinate</dd></dt>
- * <dt><code>android:scaleY</code>
- * <dd>The amount of scale on the Y coordinate</dd></dt>
- * <dt><code>android:translateX</code>
- * <dd>The amount of translation on the X coordinate</dd></dt>
- * <dt><code>android:translateY</code>
- * <dd>The amount of translation on the Y coordinate</dd></dt>
+ * And the transformations are applied in the order of scale, rotate then translate.
+ * <dl>
+ * <dt><code>android:rotation</code></dt>
+ * <dd>The degrees of rotation of the group.</dd>
+ * <dt><code>android:pivotX</code></dt>
+ * <dd>The X coordinate of the pivot for the scale and rotation of the group.
+ * This is defined in the viewport space.</dd>
+ * <dt><code>android:pivotY</code></dt>
+ * <dd>The Y coordinate of the pivot for the scale and rotation of the group.
+ * This is defined in the viewport space.</dd>
+ * <dt><code>android:scaleX</code></dt>
+ * <dd>The amount of scale on the X Coordinate.</dd>
+ * <dt><code>android:scaleY</code></dt>
+ * <dd>The amount of scale on the Y coordinate.</dd>
+ * <dt><code>android:translateX</code></dt>
+ * <dd>The amount of translation on the X coordinate.
+ * This is defined in the viewport space.</dd>
+ * <dt><code>android:translateY</code></dt>
+ * <dd>The amount of translation on the Y coordinate.
+ * This is defined in the viewport space.</dd>
+ * </dl></dd>
+ * </dl>
+ *
+ * <dl>
* <dt><code><path></code></dt>
* <dd>Defines paths to be drawn.
* <dl>
- * <dt><code>android:name</code>
- * <dd>Defines the name of the path.</dd></dt>
- * <dt><code>android:pathData</code>
+ * <dt><code>android:name</code></dt>
+ * <dd>Defines the name of the path.</dd>
+ * <dt><code>android:pathData</code></dt>
* <dd>Defines path string. This is using exactly same format as "d" attribute
- * in the SVG's path data</dd></dt>
- * <dt><code>android:fill</code>
- * <dd>Defines the color to fill the path (none if not present).</dd></dt>
- * <dt><code>android:stroke</code>
+ * in the SVG's path data. This is defined in the viewport space.</dd>
+ * <dt><code>android:fillColor</code></dt>
+ * <dd>Defines the color to fill the path (none if not present).</dd>
+ * <dt><code>android:strokeColor</code></dt>
* <dd>Defines the color to draw the path outline (none if not present).</dd>
- * </dt>
- * <dt><code>android:strokeWidth</code>
- * <dd>The width a path stroke</dd></dt>
- * <dt><code>android:strokeOpacity</code>
- * <dd>The opacity of a path stroke</dd></dt>
- * <dt><code>android:fillOpacity</code>
- * <dd>The opacity to fill the path with</dd></dt>
- * <dt><code>android:trimPathStart</code>
- * <dd>The fraction of the path to trim from the start from 0 to 1</dd></dt>
- * <dt><code>android:trimPathEnd</code>
- * <dd>The fraction of the path to trim from the end from 0 to 1</dd></dt>
- * <dt><code>android:trimPathOffset</code>
- * <dd>Shift trim region (allows showed region to include the start and end)
- * from 0 to 1</dd></dt>
- * <dt><code>android:clipToPath</code>
- * <dd>Path will set the clip path</dd></dt>
- * <dt><code>android:strokeLineCap</code>
- * <dd>Sets the linecap for a stroked path: butt, round, square</dd></dt>
- * <dt><code>android:strokeLineJoin</code>
- * <dd>Sets the lineJoin for a stroked path: miter,round,bevel</dd></dt>
- * <dt><code>android:strokeMiterLimit</code>
- * <dd>Sets the Miter limit for a stroked path</dd></dt>
+ * <dt><code>android:strokeWidth</code></dt>
+ * <dd>The width a path stroke.</dd>
+ * <dt><code>android:strokeOpacity</code></dt>
+ * <dd>The opacity of a path stroke.</dd>
+ * <dt><code>android:fillOpacity</code></dt>
+ * <dd>The opacity to fill the path with.</dd>
+ * <dt><code>android:trimPathStart</code></dt>
+ * <dd>The fraction of the path to trim from the start, in the range from 0 to 1.</dd>
+ * <dt><code>android:trimPathEnd</code></dt>
+ * <dd>The fraction of the path to trim from the end, in the range from 0 to 1.</dd>
+ * <dt><code>android:trimPathOffset</code></dt>
+ * <dd>Shift trim region (allows showed region to include the start and end), in the range
+ * from 0 to 1.</dd>
+ * <dt><code>android:strokeLineCap</code></dt>
+ * <dd>Sets the linecap for a stroked path: butt, round, square.</dd>
+ * <dt><code>android:strokeLineJoin</code></dt>
+ * <dd>Sets the lineJoin for a stroked path: miter,round,bevel.</dd>
+ * <dt><code>android:strokeMiterLimit</code></dt>
+ * <dd>Sets the Miter limit for a stroked path.</dd>
+ * </dl></dd>
* </dl>
- * </dd>
+ *
+ * <dl>
+ * <dt><code><clip-path></code></dt>
+ * <dd>Defines path to be the current clip.
+ * <dl>
+ * <dt><code>android:name</code></dt>
+ * <dd>Defines the name of the clip path.</dd>
+ * <dt><code>android:pathData</code></dt>
+ * <dd>Defines clip path string. This is using exactly same format as "d" attribute
+ * in the SVG's path data.</dd>
+ * </dl></dd>
+ * </dl>
+ * <li>Here is a simple VectorDrawable in this vectordrawable.xml file.
+ * <pre>
+ * <vector xmlns:android="http://schemas.android.com/apk/res/android"
+ * android:height="64dp"
+ * android:width="64dp"
+ * android:viewportHeight="600"
+ * android:viewportWidth="600" >
+ * <group
+ * android:name="rotationGroup"
+ * android:pivotX="300.0"
+ * android:pivotY="300.0"
+ * android:rotation="45.0" >
+ * <path
+ * android:name="v"
+ * android:fillColor="#000000"
+ * android:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" />
+ * </group>
+ * </vector>
+ * </pre></li>
*/
+
public class VectorDrawable extends Drawable {
private static final String LOGTAG = VectorDrawable.class.getSimpleName();
- private static final String SHAPE_SIZE = "size";
- private static final String SHAPE_VIEWPORT = "viewport";
+ private static final String SHAPE_CLIP_PATH = "clip-path";
private static final String SHAPE_GROUP = "group";
private static final String SHAPE_PATH = "path";
private static final String SHAPE_VECTOR = "vector";
@@ -337,20 +391,24 @@
@Override
public void inflate(Resources res, XmlPullParser parser, AttributeSet attrs, Theme theme)
throws XmlPullParserException, IOException {
- final TypedArray a = obtainAttributes(res, theme, attrs, R.styleable.VectorDrawable);
+ final VectorDrawableState state = mVectorState;
+ final VPathRenderer pathRenderer = new VPathRenderer();
+ state.mVPathRenderer = pathRenderer;
+
+ TypedArray a = obtainAttributes(res, theme, attrs, R.styleable.VectorDrawable);
updateStateFromTypedArray(a);
a.recycle();
- final VectorDrawableState state = mVectorState;
- mVectorState.mCacheDirty = true;
+ state.mCacheDirty = true;
inflateInternal(res, parser, attrs, theme);
mTintFilter = updateTintFilter(mTintFilter, state.mTint, state.mTintMode);
state.mVPathRenderer.setColorFilter(mTintFilter);
}
- private void updateStateFromTypedArray(TypedArray a) {
+ private void updateStateFromTypedArray(TypedArray a) throws XmlPullParserException {
final VectorDrawableState state = mVectorState;
+ final VPathRenderer pathRenderer = state.mVPathRenderer;
// Account for any configuration changes.
state.mChangingConfigurations |= a.getChangingConfigurations();
@@ -370,16 +428,38 @@
state.mAutoMirrored = a.getBoolean(
R.styleable.VectorDrawable_autoMirrored, state.mAutoMirrored);
+
+ pathRenderer.mViewportWidth = a.getFloat(
+ R.styleable.VectorDrawable_viewportWidth, pathRenderer.mViewportWidth);
+ pathRenderer.mViewportHeight = a.getFloat(
+ R.styleable.VectorDrawable_viewportHeight, pathRenderer.mViewportHeight);
+
+ if (pathRenderer.mViewportWidth <= 0) {
+ throw new XmlPullParserException(a.getPositionDescription() +
+ "<viewport> tag requires viewportWidth > 0");
+ } else if (pathRenderer.mViewportHeight <= 0) {
+ throw new XmlPullParserException(a.getPositionDescription() +
+ "<viewport> tag requires viewportHeight > 0");
+ }
+
+ pathRenderer.mBaseWidth = a.getDimension(
+ R.styleable.VectorDrawable_width, pathRenderer.mBaseWidth);
+ pathRenderer.mBaseHeight = a.getDimension(
+ R.styleable.VectorDrawable_height, pathRenderer.mBaseHeight);
+
+ if (pathRenderer.mBaseWidth <= 0) {
+ throw new XmlPullParserException(a.getPositionDescription() +
+ "<size> tag requires width > 0");
+ } else if (pathRenderer.mBaseHeight <= 0) {
+ throw new XmlPullParserException(a.getPositionDescription() +
+ "<size> tag requires height > 0");
+ }
}
private void inflateInternal(Resources res, XmlPullParser parser, AttributeSet attrs,
Theme theme) throws XmlPullParserException, IOException {
final VectorDrawableState state = mVectorState;
- final VPathRenderer pathRenderer = new VPathRenderer();
- state.mVPathRenderer = pathRenderer;
-
- boolean noSizeTag = true;
- boolean noViewportTag = true;
+ final VPathRenderer pathRenderer = state.mVPathRenderer;
boolean noPathTag = true;
// Use a stack to help to build the group tree.
@@ -394,7 +474,7 @@
final VGroup currentGroup = groupStack.peek();
if (SHAPE_PATH.equals(tagName)) {
- final VPath path = new VPath();
+ final VFullPath path = new VFullPath();
path.inflate(res, attrs, theme);
currentGroup.mChildren.add(path);
if (path.getPathName() != null) {
@@ -402,14 +482,14 @@
}
noPathTag = false;
state.mChangingConfigurations |= path.mChangingConfigurations;
- } else if (SHAPE_SIZE.equals(tagName)) {
- pathRenderer.parseSize(res, attrs);
- noSizeTag = false;
- state.mChangingConfigurations |= pathRenderer.mChangingConfigurations;
- } else if (SHAPE_VIEWPORT.equals(tagName)) {
- pathRenderer.parseViewport(res, attrs);
- noViewportTag = false;
- state.mChangingConfigurations |= pathRenderer.mChangingConfigurations;
+ } else if (SHAPE_CLIP_PATH.equals(tagName)) {
+ final VClipPath path = new VClipPath();
+ path.inflate(res, attrs, theme);
+ currentGroup.mChildren.add(path);
+ if (path.getPathName() != null) {
+ pathRenderer.mVGTargetsMap.put(path.getPathName(), path);
+ }
+ state.mChangingConfigurations |= path.mChangingConfigurations;
} else if (SHAPE_GROUP.equals(tagName)) {
VGroup newChildGroup = new VGroup();
newChildGroup.inflate(res, attrs, theme);
@@ -435,26 +515,13 @@
printGroupTree(pathRenderer.mRootGroup, 0);
}
- if (noSizeTag || noViewportTag || noPathTag) {
+ if (noPathTag) {
final StringBuffer tag = new StringBuffer();
- if (noSizeTag) {
- tag.append(SHAPE_SIZE);
+ if (tag.length() > 0) {
+ tag.append(" or ");
}
-
- if (noViewportTag) {
- if (tag.length() > 0) {
- tag.append(" & ");
- }
- tag.append(SHAPE_SIZE);
- }
-
- if (noPathTag) {
- if (tag.length() > 0) {
- tag.append(" or ");
- }
- tag.append(SHAPE_PATH);
- }
+ tag.append(SHAPE_PATH);
throw new XmlPullParserException("no " + tag + " defined");
}
@@ -611,10 +678,10 @@
// Variables below need to be copied (deep copy if applicable) for mutation.
private int mChangingConfigurations;
private final VGroup mRootGroup;
- private float mBaseWidth = 0;
- private float mBaseHeight = 0;
- private float mViewportWidth = 0;
- private float mViewportHeight = 0;
+ float mBaseWidth = 0;
+ float mBaseHeight = 0;
+ float mViewportWidth = 0;
+ float mViewportHeight = 0;
private int mRootAlpha = 0xFF;
final ArrayMap<String, Object> mVGTargetsMap = new ArrayMap<String, Object>();
@@ -736,7 +803,8 @@
public void draw(Canvas canvas, int w, int h) {
// Travese the tree in pre-order to draw.
- drawGroupTree(mRootGroup, IDENTITY_MATRIX, ((float) mRootAlpha) / 0xFF, canvas, w, h);
+ drawGroupTree(mRootGroup, IDENTITY_MATRIX, ((float) mRootAlpha) / 0xFF,
+ canvas, w, h);
}
private void drawPath(VGroup vGroup, VPath vPath, float stackedAlpha,
@@ -751,47 +819,48 @@
vPath.toPath(mPath);
final Path path = mPath;
- if (vPath.mTrimPathStart != 0.0f || vPath.mTrimPathEnd != 1.0f) {
- float start = (vPath.mTrimPathStart + vPath.mTrimPathOffset) % 1.0f;
- float end = (vPath.mTrimPathEnd + vPath.mTrimPathOffset) % 1.0f;
-
- if (mPathMeasure == null) {
- mPathMeasure = new PathMeasure();
- }
- mPathMeasure.setPath(mPath, false);
-
- float len = mPathMeasure.getLength();
- start = start * len;
- end = end * len;
- path.reset();
- if (start > end) {
- mPathMeasure.getSegment(start, len, path, true);
- mPathMeasure.getSegment(0f, end, path, true);
- } else {
- mPathMeasure.getSegment(start, end, path, true);
- }
- path.rLineTo(0, 0); // fix bug in measure
- }
-
mRenderPath.reset();
- mRenderPath.addPath(path, mFinalPathMatrix);
-
- if (vPath.mClip) {
+ if (vPath.isClipPath()) {
+ mRenderPath.addPath(path, mFinalPathMatrix);
canvas.clipPath(mRenderPath, Region.Op.REPLACE);
} else {
- if (vPath.mFillColor != 0) {
+ VFullPath fullPath = (VFullPath) vPath;
+ if (fullPath.mTrimPathStart != 0.0f || fullPath.mTrimPathEnd != 1.0f) {
+ float start = (fullPath.mTrimPathStart + fullPath.mTrimPathOffset) % 1.0f;
+ float end = (fullPath.mTrimPathEnd + fullPath.mTrimPathOffset) % 1.0f;
+
+ if (mPathMeasure == null) {
+ mPathMeasure = new PathMeasure();
+ }
+ mPathMeasure.setPath(mPath, false);
+
+ float len = mPathMeasure.getLength();
+ start = start * len;
+ end = end * len;
+ path.reset();
+ if (start > end) {
+ mPathMeasure.getSegment(start, len, path, true);
+ mPathMeasure.getSegment(0f, end, path, true);
+ } else {
+ mPathMeasure.getSegment(start, end, path, true);
+ }
+ path.rLineTo(0, 0); // fix bug in measure
+ }
+ mRenderPath.addPath(path, mFinalPathMatrix);
+
+ if (fullPath.mFillColor != 0) {
if (mFillPaint == null) {
mFillPaint = new Paint();
mFillPaint.setColorFilter(mColorFilter);
mFillPaint.setStyle(Paint.Style.FILL);
mFillPaint.setAntiAlias(true);
}
- mFillPaint.setColor(applyAlpha(vPath.mFillColor, stackedAlpha));
+ mFillPaint.setColor(applyAlpha(fullPath.mFillColor, stackedAlpha));
canvas.drawPath(mRenderPath, mFillPaint);
}
- if (vPath.mStrokeColor != 0) {
+ if (fullPath.mStrokeColor != 0) {
if (mStrokePaint == null) {
mStrokePaint = new Paint();
mStrokePaint.setColorFilter(mColorFilter);
@@ -800,70 +869,25 @@
}
final Paint strokePaint = mStrokePaint;
- if (vPath.mStrokeLineJoin != null) {
- strokePaint.setStrokeJoin(vPath.mStrokeLineJoin);
+ if (fullPath.mStrokeLineJoin != null) {
+ strokePaint.setStrokeJoin(fullPath.mStrokeLineJoin);
}
- if (vPath.mStrokeLineCap != null) {
- strokePaint.setStrokeCap(vPath.mStrokeLineCap);
+ if (fullPath.mStrokeLineCap != null) {
+ strokePaint.setStrokeCap(fullPath.mStrokeLineCap);
}
- strokePaint.setStrokeMiter(vPath.mStrokeMiterlimit * minScale);
+ strokePaint.setStrokeMiter(fullPath.mStrokeMiterlimit * minScale);
- strokePaint.setColor(applyAlpha(vPath.mStrokeColor, stackedAlpha));
- strokePaint.setStrokeWidth(vPath.mStrokeWidth * minScale);
+ strokePaint.setColor(applyAlpha(fullPath.mStrokeColor, stackedAlpha));
+ strokePaint.setStrokeWidth(fullPath.mStrokeWidth * minScale);
canvas.drawPath(mRenderPath, strokePaint);
}
}
}
-
- private void parseViewport(Resources r, AttributeSet attrs)
- throws XmlPullParserException {
- final TypedArray a = r.obtainAttributes(attrs, R.styleable.VectorDrawableViewport);
-
- // Account for any configuration changes.
- mChangingConfigurations |= a.getChangingConfigurations();
-
- mViewportWidth = a.getFloat(
- R.styleable.VectorDrawableViewport_viewportWidth, mViewportWidth);
- mViewportHeight = a.getFloat(
- R.styleable.VectorDrawableViewport_viewportHeight, mViewportHeight);
-
- if (mViewportWidth <= 0) {
- throw new XmlPullParserException(a.getPositionDescription() +
- "<viewport> tag requires viewportWidth > 0");
- } else if (mViewportHeight <= 0) {
- throw new XmlPullParserException(a.getPositionDescription() +
- "<viewport> tag requires viewportHeight > 0");
- }
-
- a.recycle();
- }
-
- private void parseSize(Resources r, AttributeSet attrs)
- throws XmlPullParserException {
- final TypedArray a = r.obtainAttributes(attrs, R.styleable.VectorDrawableSize);
-
- // Account for any configuration changes.
- mChangingConfigurations |= a.getChangingConfigurations();
-
- mBaseWidth = a.getDimension(R.styleable.VectorDrawableSize_width, mBaseWidth);
- mBaseHeight = a.getDimension(R.styleable.VectorDrawableSize_height, mBaseHeight);
-
- if (mBaseWidth <= 0) {
- throw new XmlPullParserException(a.getPositionDescription() +
- "<size> tag requires width > 0");
- } else if (mBaseHeight <= 0) {
- throw new XmlPullParserException(a.getPositionDescription() +
- "<size> tag requires height > 0");
- }
-
- a.recycle();
- }
-
}
- static class VGroup {
+ private static class VGroup {
// mStackedMatrix is only used temporarily when drawing, it combines all
// the parents' local matrices with the current one.
private final Matrix mStackedMatrix = new Matrix();
@@ -912,9 +936,15 @@
if (copyChild instanceof VGroup) {
VGroup copyGroup = (VGroup) copyChild;
mChildren.add(new VGroup(copyGroup, targetsMap));
- } else if (copyChild instanceof VPath) {
- VPath copyPath = (VPath) copyChild;
- VPath newPath = new VPath(copyPath);
+ } else {
+ VPath newPath = null;
+ if (copyChild instanceof VFullPath) {
+ newPath = new VFullPath((VFullPath) copyChild);
+ } else if (copyChild instanceof VClipPath) {
+ newPath = new VClipPath((VClipPath) copyChild);
+ } else {
+ throw new IllegalStateException("Unknown object in the tree!");
+ }
mChildren.add(newPath);
if (newPath.mPathName != null) {
targetsMap.put(newPath.mPathName, newPath);
@@ -926,94 +956,6 @@
public VGroup() {
}
- /* Getter and Setter */
- public float getRotation() {
- return mRotate;
- }
-
- public void setRotation(float rotation) {
- if (rotation != mRotate) {
- mRotate = rotation;
- updateLocalMatrix();
- }
- }
-
- public float getPivotX() {
- return mPivotX;
- }
-
- public void setPivotX(float pivotX) {
- if (pivotX != mPivotX) {
- mPivotX = pivotX;
- updateLocalMatrix();
- }
- }
-
- public float getPivotY() {
- return mPivotY;
- }
-
- public void setPivotY(float pivotY) {
- if (pivotY != mPivotY) {
- mPivotY = pivotY;
- updateLocalMatrix();
- }
- }
-
- public float getScaleX() {
- return mScaleX;
- }
-
- public void setScaleX(float scaleX) {
- if (scaleX != mScaleX) {
- mScaleX = scaleX;
- updateLocalMatrix();
- }
- }
-
- public float getScaleY() {
- return mScaleY;
- }
-
- public void setScaleY(float scaleY) {
- if (scaleY != mScaleY) {
- mScaleY = scaleY;
- updateLocalMatrix();
- }
- }
-
- public float getTranslateX() {
- return mTranslateX;
- }
-
- public void setTranslateX(float translateX) {
- if (translateX != mTranslateX) {
- mTranslateX = translateX;
- updateLocalMatrix();
- }
- }
-
- public float getTranslateY() {
- return mTranslateY;
- }
-
- public void setTranslateY(float translateY) {
- if (translateY != mTranslateY) {
- mTranslateY = translateY;
- updateLocalMatrix();
- }
- }
-
- public float getAlpha() {
- return mGroupAlpha;
- }
-
- public void setAlpha(float groupAlpha) {
- if (groupAlpha != mGroupAlpha) {
- mGroupAlpha = groupAlpha;
- }
- }
-
public String getGroupName() {
return mGroupName;
}
@@ -1062,7 +1004,8 @@
return;
}
- final TypedArray a = t.resolveAttributes(mThemeAttrs, R.styleable.VectorDrawablePath);
+ final TypedArray a = t.resolveAttributes(mThemeAttrs,
+ R.styleable.VectorDrawableGroup);
updateStateFromTypedArray(a);
a.recycle();
}
@@ -1076,9 +1019,207 @@
mLocalMatrix.postRotate(mRotate, 0, 0);
mLocalMatrix.postTranslate(mTranslateX + mPivotX, mTranslateY + mPivotY);
}
+
+ /* Setters and Getters, used by animator from AnimatedVectorDrawable. */
+ @SuppressWarnings("unused")
+ public float getRotation() {
+ return mRotate;
+ }
+
+ @SuppressWarnings("unused")
+ public void setRotation(float rotation) {
+ if (rotation != mRotate) {
+ mRotate = rotation;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getPivotX() {
+ return mPivotX;
+ }
+
+ @SuppressWarnings("unused")
+ public void setPivotX(float pivotX) {
+ if (pivotX != mPivotX) {
+ mPivotX = pivotX;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getPivotY() {
+ return mPivotY;
+ }
+
+ @SuppressWarnings("unused")
+ public void setPivotY(float pivotY) {
+ if (pivotY != mPivotY) {
+ mPivotY = pivotY;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getScaleX() {
+ return mScaleX;
+ }
+
+ @SuppressWarnings("unused")
+ public void setScaleX(float scaleX) {
+ if (scaleX != mScaleX) {
+ mScaleX = scaleX;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getScaleY() {
+ return mScaleY;
+ }
+
+ @SuppressWarnings("unused")
+ public void setScaleY(float scaleY) {
+ if (scaleY != mScaleY) {
+ mScaleY = scaleY;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getTranslateX() {
+ return mTranslateX;
+ }
+
+ @SuppressWarnings("unused")
+ public void setTranslateX(float translateX) {
+ if (translateX != mTranslateX) {
+ mTranslateX = translateX;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getTranslateY() {
+ return mTranslateY;
+ }
+
+ @SuppressWarnings("unused")
+ public void setTranslateY(float translateY) {
+ if (translateY != mTranslateY) {
+ mTranslateY = translateY;
+ updateLocalMatrix();
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public float getAlpha() {
+ return mGroupAlpha;
+ }
+
+ @SuppressWarnings("unused")
+ public void setAlpha(float groupAlpha) {
+ if (groupAlpha != mGroupAlpha) {
+ mGroupAlpha = groupAlpha;
+ }
+ }
}
+ /**
+ * Common Path information for clip path and normal path.
+ */
private static class VPath {
+ protected PathParser.PathDataNode[] mNodes = null;
+ String mPathName;
+ int mChangingConfigurations;
+
+ public VPath() {
+ // Empty constructor.
+ }
+
+ public VPath(VPath copy) {
+ mPathName = copy.mPathName;
+ mChangingConfigurations = copy.mChangingConfigurations;
+ mNodes = PathParser.deepCopyNodes(copy.mNodes);
+ }
+
+ public void toPath(Path path) {
+ path.reset();
+ if (mNodes != null) {
+ PathParser.PathDataNode.nodesToPath(mNodes, path);
+ }
+ }
+
+ public String getPathName() {
+ return mPathName;
+ }
+
+ public boolean canApplyTheme() {
+ return false;
+ }
+
+ public void applyTheme(Theme t) {
+ }
+
+ public boolean isClipPath() {
+ return false;
+ }
+
+ /* Setters and Getters, used by animator from AnimatedVectorDrawable. */
+ @SuppressWarnings("unused")
+ public PathParser.PathDataNode[] getPathData() {
+ return mNodes;
+ }
+
+ @SuppressWarnings("unused")
+ public void setPathData(PathParser.PathDataNode[] nodes) {
+ if (!PathParser.canMorph(mNodes, nodes)) {
+ // This should not happen in the middle of animation.
+ mNodes = PathParser.deepCopyNodes(nodes);
+ } else {
+ PathParser.updateNodes(mNodes, nodes);
+ }
+ }
+ }
+
+ /**
+ * Clip path, which only has name and pathData.
+ */
+ private static class VClipPath extends VPath{
+ public VClipPath() {
+ // Empty constructor.
+ }
+
+ public VClipPath(VClipPath copy) {
+ super(copy);
+ }
+
+ public void inflate(Resources r, AttributeSet attrs, Theme theme) {
+ final TypedArray a = obtainAttributes(r, theme, attrs,
+ R.styleable.VectorDrawableClipPath);
+ updateStateFromTypedArray(a);
+ a.recycle();
+ }
+
+ private void updateStateFromTypedArray(TypedArray a) {
+ // Account for any configuration changes.
+ mChangingConfigurations |= a.getChangingConfigurations();
+
+ mPathName = a.getString(R.styleable.VectorDrawableClipPath_name);
+ mNodes = PathParser.createNodesFromPathData(a.getString(
+ R.styleable.VectorDrawableClipPath_pathData));
+ }
+
+ @Override
+ public boolean isClipPath() {
+ return true;
+ }
+ }
+
+ /**
+ * Normal path, which contains all the fill / paint information.
+ */
+ private static class VFullPath extends VPath {
/////////////////////////////////////////////////////
// Variables below need to be copied (deep copy if applicable) for mutation.
private int[] mThemeAttrs;
@@ -1093,20 +1234,16 @@
float mTrimPathEnd = 1;
float mTrimPathOffset = 0;
- boolean mClip = false;
Paint.Cap mStrokeLineCap = Paint.Cap.BUTT;
Paint.Join mStrokeLineJoin = Paint.Join.MITER;
float mStrokeMiterlimit = 4;
- private PathParser.PathDataNode[] mNodes = null;
- String mPathName;
- private int mChangingConfigurations;
-
- public VPath() {
+ public VFullPath() {
// Empty constructor.
}
- public VPath(VPath copy) {
+ public VFullPath(VFullPath copy) {
+ super(copy);
mThemeAttrs = copy.mThemeAttrs;
mStrokeColor = copy.mStrokeColor;
@@ -1119,25 +1256,9 @@
mTrimPathEnd = copy.mTrimPathEnd;
mTrimPathOffset = copy.mTrimPathOffset;
- mClip = copy.mClip;
mStrokeLineCap = copy.mStrokeLineCap;
mStrokeLineJoin = copy.mStrokeLineJoin;
mStrokeMiterlimit = copy.mStrokeMiterlimit;
-
- mNodes = PathParser.deepCopyNodes(copy.mNodes);
- mPathName = copy.mPathName;
- mChangingConfigurations = copy.mChangingConfigurations;
- }
-
- public void toPath(Path path) {
- path.reset();
- if (mNodes != null) {
- PathParser.PathDataNode.nodesToPath(mNodes, path);
- }
- }
-
- public String getPathName() {
- return mPathName;
}
private Paint.Cap getStrokeLineCap(int id, Paint.Cap defValue) {
@@ -1166,22 +1287,78 @@
}
}
- /* Setters and Getters, mostly used by animator from AnimatedVectorDrawable. */
- @SuppressWarnings("unused")
- public PathParser.PathDataNode[] getPathData() {
- return mNodes;
+ @Override
+ public boolean canApplyTheme() {
+ return mThemeAttrs != null;
}
- @SuppressWarnings("unused")
- public void setPathData(PathParser.PathDataNode[] nodes) {
- if (!PathParser.canMorph(mNodes, nodes)) {
- // This should not happen in the middle of animation.
- mNodes = PathParser.deepCopyNodes(nodes);
- } else {
- PathParser.updateNodes(mNodes, nodes);
+ public void inflate(Resources r, AttributeSet attrs, Theme theme) {
+ final TypedArray a = obtainAttributes(r, theme, attrs,
+ R.styleable.VectorDrawablePath);
+ updateStateFromTypedArray(a);
+ a.recycle();
+ }
+
+ private void updateStateFromTypedArray(TypedArray a) {
+ // Account for any configuration changes.
+ mChangingConfigurations |= a.getChangingConfigurations();
+
+ // Extract the theme attributes, if any.
+ mThemeAttrs = a.extractThemeAttrs();
+
+ mPathName = a.getString(R.styleable.VectorDrawablePath_name);
+ mNodes = PathParser.createNodesFromPathData(a.getString(
+ R.styleable.VectorDrawablePath_pathData));
+
+ mFillColor = a.getColor(R.styleable.VectorDrawablePath_fillColor,
+ mFillColor);
+ mFillOpacity = a.getFloat(R.styleable.VectorDrawablePath_fillOpacity,
+ mFillOpacity);
+ mStrokeLineCap = getStrokeLineCap(a.getInt(
+ R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap);
+ mStrokeLineJoin = getStrokeLineJoin(a.getInt(
+ R.styleable.VectorDrawablePath_strokeLineJoin, -1), mStrokeLineJoin);
+ mStrokeMiterlimit = a.getFloat(
+ R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit);
+ mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_strokeColor,
+ mStrokeColor);
+ mStrokeOpacity = a.getFloat(R.styleable.VectorDrawablePath_strokeOpacity,
+ mStrokeOpacity);
+ mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth,
+ mStrokeWidth);
+ mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd,
+ mTrimPathEnd);
+ mTrimPathOffset = a.getFloat(
+ R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset);
+ mTrimPathStart = a.getFloat(
+ R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart);
+
+ updateColorAlphas();
+ }
+
+ @Override
+ public void applyTheme(Theme t) {
+ if (mThemeAttrs == null) {
+ return;
+ }
+
+ final TypedArray a = t.resolveAttributes(mThemeAttrs,
+ R.styleable.VectorDrawablePath);
+ updateStateFromTypedArray(a);
+ a.recycle();
+ }
+
+ private void updateColorAlphas() {
+ if (!Float.isNaN(mFillOpacity)) {
+ mFillColor = applyAlpha(mFillColor, mFillOpacity);
+ }
+
+ if (!Float.isNaN(mStrokeOpacity)) {
+ mStrokeColor = applyAlpha(mStrokeColor, mStrokeOpacity);
}
}
+ /* Setters and Getters, used by animator from AnimatedVectorDrawable. */
@SuppressWarnings("unused")
int getStroke() {
return mStrokeColor;
@@ -1261,69 +1438,5 @@
void setTrimPathOffset(float trimPathOffset) {
mTrimPathOffset = trimPathOffset;
}
-
- public boolean canApplyTheme() {
- return mThemeAttrs != null;
- }
-
- public void inflate(Resources r, AttributeSet attrs, Theme theme) {
- final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.VectorDrawablePath);
- updateStateFromTypedArray(a);
- a.recycle();
- }
-
- private void updateStateFromTypedArray(TypedArray a) {
- // Account for any configuration changes.
- mChangingConfigurations |= a.getChangingConfigurations();
-
- // Extract the theme attributes, if any.
- mThemeAttrs = a.extractThemeAttrs();
-
- mClip = a.getBoolean(R.styleable.VectorDrawablePath_clipToPath, mClip);
-
- mPathName = a.getString(R.styleable.VectorDrawablePath_name);
- mNodes = PathParser.createNodesFromPathData(a.getString(
- R.styleable.VectorDrawablePath_pathData));
-
- mFillColor = a.getColor(R.styleable.VectorDrawablePath_fill, mFillColor);
- mFillOpacity = a.getFloat(R.styleable.VectorDrawablePath_fillOpacity, mFillOpacity);
- mStrokeLineCap = getStrokeLineCap(a.getInt(
- R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap);
- mStrokeLineJoin = getStrokeLineJoin(a.getInt(
- R.styleable.VectorDrawablePath_strokeLineJoin, -1), mStrokeLineJoin);
- mStrokeMiterlimit = a.getFloat(
- R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit);
- mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_stroke, mStrokeColor);
- mStrokeOpacity = a.getFloat(
- R.styleable.VectorDrawablePath_strokeOpacity, mStrokeOpacity);
- mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth, mStrokeWidth);
- mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd, mTrimPathEnd);
- mTrimPathOffset = a.getFloat(
- R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset);
- mTrimPathStart = a.getFloat(
- R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart);
-
- updateColorAlphas();
- }
-
- public void applyTheme(Theme t) {
- if (mThemeAttrs == null) {
- return;
- }
-
- final TypedArray a = t.resolveAttributes(mThemeAttrs, R.styleable.VectorDrawablePath);
- updateStateFromTypedArray(a);
- a.recycle();
- }
-
- private void updateColorAlphas() {
- if (!Float.isNaN(mFillOpacity)) {
- mFillColor = applyAlpha(mFillColor, mFillOpacity);
- }
-
- if (!Float.isNaN(mStrokeOpacity)) {
- mStrokeColor = applyAlpha(mStrokeColor, mStrokeOpacity);
- }
- }
}
}
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 64df6c8..41f89c2 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1934,7 +1934,9 @@
return deferredList.flush(*this, dirty) | status;
}
- return DrawGlInfo::kStatusDone;
+ // Even if there is no drawing command(Ex: invisible),
+ // it still needs startFrame to clear buffer and start tiling.
+ return startFrame();
}
void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, const SkPaint* paint) {
diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java
index f9e49c1..8883d28 100644
--- a/media/java/android/media/CamcorderProfile.java
+++ b/media/java/android/media/CamcorderProfile.java
@@ -149,6 +149,39 @@
private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_2160P;
/**
+ * High speed ( >= 100fps) quality level corresponding to the lowest available resolution.
+ */
+ public static final int QUALITY_HIGH_SPEED_LOW = 2000;
+
+ /**
+ * High speed ( >= 100fps) quality level corresponding to the highest available resolution.
+ */
+ public static final int QUALITY_HIGH_SPEED_HIGH = 2001;
+
+ /**
+ * High speed ( >= 100fps) quality level corresponding to the 480p (720 x 480) resolution.
+ *
+ * Note that the horizontal resolution for 480p can also be other
+ * values, such as 640 or 704, instead of 720.
+ */
+ public static final int QUALITY_HIGH_SPEED_480P = 2002;
+
+ /**
+ * High speed ( >= 100fps) quality level corresponding to the 720p (1280 x 720) resolution.
+ */
+ public static final int QUALITY_HIGH_SPEED_720P = 2003;
+
+ /**
+ * High speed ( >= 100fps) quality level corresponding to the 1080p (1920 x 1080 or 1920x1088)
+ * resolution.
+ */
+ public static final int QUALITY_HIGH_SPEED_1080P = 2004;
+
+ // Start and end of high speed quality list
+ private static final int QUALITY_HIGH_SPEED_LIST_START = QUALITY_HIGH_SPEED_LOW;
+ private static final int QUALITY_HIGH_SPEED_LIST_END = QUALITY_HIGH_SPEED_1080P;
+
+ /**
* Default recording duration in seconds before the session is terminated.
* This is useful for applications like MMS has limited file size requirement.
*/
@@ -240,13 +273,17 @@
* {@link #hasProfile(int, int)}.
* QUALITY_LOW refers to the lowest quality available, while QUALITY_HIGH refers to
* the highest quality available.
- * QUALITY_LOW/QUALITY_HIGH have to match one of qcif, cif, 480p, 720p, or 1080p.
- * E.g. if the device supports 480p, 720p, and 1080p, then low is 480p and high is
- * 1080p.
+ * QUALITY_LOW/QUALITY_HIGH have to match one of qcif, cif, 480p, 720p, 1080p or 2160p.
+ * E.g. if the device supports 480p, 720p, 1080p and 2160p, then low is 480p and high is
+ * 2160p.
*
* The same is true for time lapse quality levels, i.e. QUALITY_TIME_LAPSE_LOW,
* QUALITY_TIME_LAPSE_HIGH are guaranteed to be supported and have to match one of
- * qcif, cif, 480p, 720p, or 1080p.
+ * qcif, cif, 480p, 720p, 1080p, or 2160p.
+ *
+ * For high speed quality levels, they may or may not be supported. If a subset of the levels
+ * are supported, QUALITY_HIGH_SPEED_LOW and QUALITY_HIGH_SPEED_HIGH are guaranteed to be
+ * supported and have to match one of 480p, 720p, or 1080p.
*
* A camcorder recording session with higher quality level usually has higher output
* bit rate, better video and/or audio recording quality, larger video frame
@@ -262,6 +299,7 @@
* @see #QUALITY_480P
* @see #QUALITY_720P
* @see #QUALITY_1080P
+ * @see #QUALITY_2160P
* @see #QUALITY_TIME_LAPSE_LOW
* @see #QUALITY_TIME_LAPSE_HIGH
* @see #QUALITY_TIME_LAPSE_QCIF
@@ -269,12 +307,20 @@
* @see #QUALITY_TIME_LAPSE_480P
* @see #QUALITY_TIME_LAPSE_720P
* @see #QUALITY_TIME_LAPSE_1080P
- */
+ * @see #QUALITY_TIME_LAPSE_2160P
+ * @see #QUALITY_HIGH_SPEED_LOW
+ * @see #QUALITY_HIGH_SPEED_HIGH
+ * @see #QUALITY_HIGH_SPEED_480P
+ * @see #QUALITY_HIGH_SPEED_720P
+ * @see #QUALITY_HIGH_SPEED_1080P
+ */
public static CamcorderProfile get(int cameraId, int quality) {
if (!((quality >= QUALITY_LIST_START &&
quality <= QUALITY_LIST_END) ||
(quality >= QUALITY_TIME_LAPSE_LIST_START &&
- quality <= QUALITY_TIME_LAPSE_LIST_END))) {
+ quality <= QUALITY_TIME_LAPSE_LIST_END) ||
+ (quality >= QUALITY_HIGH_SPEED_LIST_START &&
+ quality <= QUALITY_HIGH_SPEED_LIST_END))) {
String errMessage = "Unsupported quality level: " + quality;
throw new IllegalArgumentException(errMessage);
}
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index f84c383..275d9b2 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -16,7 +16,10 @@
package android.media;
+import android.graphics.ImageFormat;
+import android.graphics.Rect;
import android.media.Image;
+import android.media.Image.Plane;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.media.MediaCrypto;
@@ -29,6 +32,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.nio.ReadOnlyBufferException;
import java.util.Arrays;
import java.util.Map;
@@ -1537,4 +1541,175 @@
}
private long mNativeContext;
+
+ /** @hide */
+ public static class MediaImage extends Image {
+ private final boolean mIsReadOnly;
+ private boolean mIsValid;
+ private final int mWidth;
+ private final int mHeight;
+ private final int mFormat;
+ private long mTimestamp;
+ private final Plane[] mPlanes;
+ private final ByteBuffer mBuffer;
+ private final ByteBuffer mInfo;
+ private final int mXOffset;
+ private final int mYOffset;
+
+ private final static int TYPE_YUV = 1;
+
+ public int getFormat() {
+ checkValid();
+ return mFormat;
+ }
+
+ public int getHeight() {
+ checkValid();
+ return mHeight;
+ }
+
+ public int getWidth() {
+ checkValid();
+ return mWidth;
+ }
+
+ public long getTimestamp() {
+ checkValid();
+ return mTimestamp;
+ }
+
+ public Plane[] getPlanes() {
+ checkValid();
+ return Arrays.copyOf(mPlanes, mPlanes.length);
+ }
+
+ public void close() {
+ if (mIsValid) {
+ java.nio.NioUtils.freeDirectBuffer(mBuffer);
+ mIsValid = false;
+ }
+ }
+
+ /**
+ * Set the crop rectangle associated with this frame.
+ * <p>
+ * The crop rectangle specifies the region of valid pixels in the image,
+ * using coordinates in the largest-resolution plane.
+ */
+ public void setCropRect(Rect cropRect) {
+ if (mIsReadOnly) {
+ throw new ReadOnlyBufferException();
+ }
+ super.setCropRect(cropRect);
+ }
+
+ private void checkValid() {
+ if (!mIsValid) {
+ throw new IllegalStateException("Image is already released");
+ }
+ }
+
+ private int readInt(ByteBuffer buffer, boolean asLong) {
+ if (asLong) {
+ return (int)buffer.getLong();
+ } else {
+ return buffer.getInt();
+ }
+ }
+
+ public MediaImage(
+ ByteBuffer buffer, ByteBuffer info, boolean readOnly,
+ long timestamp, int xOffset, int yOffset, Rect cropRect) {
+ mFormat = ImageFormat.YUV_420_888;
+ mTimestamp = timestamp;
+ mIsValid = true;
+ mIsReadOnly = buffer.isReadOnly();
+ mBuffer = buffer.duplicate();
+ if (cropRect != null) {
+ cropRect.offset(-xOffset, -yOffset);
+ }
+ mCropRect = cropRect;
+
+ // save offsets and info
+ mXOffset = xOffset;
+ mYOffset = yOffset;
+ mInfo = info;
+
+ // read media-info. the size of media info can be 80 or 156 depending on
+ // whether it was created on a 32- or 64-bit process. See MediaImage
+ if (info.remaining() == 80 || info.remaining() == 156) {
+ boolean sizeIsLong = info.remaining() == 156;
+ int type = info.getInt();
+ if (type != TYPE_YUV) {
+ throw new UnsupportedOperationException("unsupported type: " + type);
+ }
+ int numPlanes = readInt(info, sizeIsLong);
+ if (numPlanes != 3) {
+ throw new RuntimeException("unexpected number of planes: " + numPlanes);
+ }
+ mWidth = readInt(info, sizeIsLong);
+ mHeight = readInt(info, sizeIsLong);
+ if (mWidth < 1 || mHeight < 1) {
+ throw new UnsupportedOperationException(
+ "unsupported size: " + mWidth + "x" + mHeight);
+ }
+ int bitDepth = readInt(info, sizeIsLong);
+ if (bitDepth != 8) {
+ throw new UnsupportedOperationException("unsupported bit depth: " + bitDepth);
+ }
+ mPlanes = new MediaPlane[numPlanes];
+ for (int ix = 0; ix < numPlanes; ix++) {
+ int planeOffset = readInt(info, sizeIsLong);
+ int colInc = readInt(info, sizeIsLong);
+ int rowInc = readInt(info, sizeIsLong);
+ int horiz = readInt(info, sizeIsLong);
+ int vert = readInt(info, sizeIsLong);
+ if (horiz != vert || horiz != (ix == 0 ? 1 : 2)) {
+ throw new UnsupportedOperationException("unexpected subsampling: "
+ + horiz + "x" + vert + " on plane " + ix);
+ }
+
+ buffer.clear();
+ buffer.position(mBuffer.position() + planeOffset
+ + (xOffset / horiz) * colInc + (yOffset / vert) * rowInc);
+ buffer.limit(buffer.position() + Utils.divUp(bitDepth, 8)
+ + (mHeight / vert - 1) * rowInc + (mWidth / horiz - 1) * colInc);
+ mPlanes[ix] = new MediaPlane(buffer.slice(), rowInc, colInc);
+ }
+ } else {
+ throw new UnsupportedOperationException(
+ "unsupported info length: " + info.remaining());
+ }
+ }
+
+ private class MediaPlane extends Plane {
+ public MediaPlane(ByteBuffer buffer, int rowInc, int colInc) {
+ mData = buffer;
+ mRowInc = rowInc;
+ mColInc = colInc;
+ }
+
+ @Override
+ public int getRowStride() {
+ checkValid();
+ return mRowInc;
+ }
+
+ @Override
+ public int getPixelStride() {
+ checkValid();
+ return mColInc;
+ }
+
+ @Override
+ public ByteBuffer getBuffer() {
+ checkValid();
+ return mData;
+ }
+
+ private final int mRowInc;
+ private final int mColInc;
+ private final ByteBuffer mData;
+ }
+ }
}
diff --git a/media/java/android/media/tv/ITvInputSessionWrapper.java b/media/java/android/media/tv/ITvInputSessionWrapper.java
index 35a68a4..9fb552c 100644
--- a/media/java/android/media/tv/ITvInputSessionWrapper.java
+++ b/media/java/android/media/tv/ITvInputSessionWrapper.java
@@ -147,7 +147,7 @@
return;
}
case DO_REQUEST_UNBLOCK_CONTENT: {
- mTvInputSessionImpl.requestUnblockContent((String) msg.obj);
+ mTvInputSessionImpl.unblockContent((String) msg.obj);
return;
}
default: {
diff --git a/media/java/android/media/tv/TvInputPassthroughWrapperService.java b/media/java/android/media/tv/TvInputPassthroughWrapperService.java
index e99044d..08c802f6 100644
--- a/media/java/android/media/tv/TvInputPassthroughWrapperService.java
+++ b/media/java/android/media/tv/TvInputPassthroughWrapperService.java
@@ -170,7 +170,7 @@
public void onSessionEvent(TvInputManager.Session session, String eventType,
Bundle eventArgs) {
if (mSession == session) {
- dispatchSessionEvent(eventType, eventArgs);
+ notifySessionEvent(eventType, eventArgs);
}
}
};
@@ -188,13 +188,13 @@
/**
* Called when the underlying pass-through TV input session calls
- * {@link #dispatchVideoAvailable()}.
+ * {@link #notifyVideoAvailable()}.
*/
public abstract void onPassthroughVideoAvailable();
/**
* Called when the underlying pass-through TV input session calls
- * {@link #dispatchVideoUnavailable(int)}.
+ * {@link #notifyVideoUnavailable(int)}.
*
* @param reason The reason why the pass-through TV input stopped the playback.
*/
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index d5111f4..6b0a633 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -282,7 +282,7 @@
* @param eventArgs Optional arguments of the event.
* @hide
*/
- public void dispatchSessionEvent(final String eventType, final Bundle eventArgs) {
+ public void notifySessionEvent(final String eventType, final Bundle eventArgs) {
if (eventType == null) {
throw new IllegalArgumentException("eventType should not be null.");
}
@@ -290,7 +290,7 @@
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchSessionEvent(" + eventType + ")");
+ if (DEBUG) Log.d(TAG, "notifySessionEvent(" + eventType + ")");
mSessionCallback.onSessionEvent(eventType, eventArgs);
} catch (RemoteException e) {
Log.w(TAG, "error in sending event (event=" + eventType + ")");
@@ -304,15 +304,15 @@
*
* @param channelUri The URI of a channel.
*/
- public void dispatchChannelRetuned(final Uri channelUri) {
+ public void notifyChannelRetuned(final Uri channelUri) {
mHandler.post(new Runnable() {
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchChannelRetuned");
+ if (DEBUG) Log.d(TAG, "notifyChannelRetuned");
mSessionCallback.onChannelRetuned(channelUri);
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchChannelRetuned");
+ Log.w(TAG, "error in notifyChannelRetuned");
}
}
});
@@ -324,7 +324,7 @@
*
* @param tracks A list which includes track information.
*/
- public void dispatchTrackInfoChanged(final List<TvTrackInfo> tracks) {
+ public void notifyTrackInfoChanged(final List<TvTrackInfo> tracks) {
if (!TvTrackInfo.checkSanity(tracks)) {
throw new IllegalArgumentException(
"Two or more selected tracks for a track type.");
@@ -333,10 +333,10 @@
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchTrackInfoChanged");
+ if (DEBUG) Log.d(TAG, "notifyTrackInfoChanged");
mSessionCallback.onTrackInfoChanged(tracks);
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchTrackInfoChanged");
+ Log.w(TAG, "error in notifyTrackInfoChanged");
}
}
});
@@ -346,15 +346,15 @@
* Informs the application that video is available and the playback of the TV stream has
* been started.
*/
- public void dispatchVideoAvailable() {
+ public void notifyVideoAvailable() {
mHandler.post(new Runnable() {
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchVideoAvailable");
+ if (DEBUG) Log.d(TAG, "notifyVideoAvailable");
mSessionCallback.onVideoAvailable();
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchVideoAvailable");
+ Log.w(TAG, "error in notifyVideoAvailable");
}
}
});
@@ -372,7 +372,7 @@
* <li>{@link TvInputManager#VIDEO_UNAVAILABLE_REASON_BUFFERING}
* </ul>
*/
- public void dispatchVideoUnavailable(final int reason) {
+ public void notifyVideoUnavailable(final int reason) {
if (reason < TvInputManager.VIDEO_UNAVAILABLE_REASON_START
|| reason > TvInputManager.VIDEO_UNAVAILABLE_REASON_END) {
throw new IllegalArgumentException("Unknown reason: " + reason);
@@ -381,10 +381,10 @@
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchVideoUnavailable");
+ if (DEBUG) Log.d(TAG, "notifyVideoUnavailable");
mSessionCallback.onVideoUnavailable(reason);
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchVideoUnavailable");
+ Log.w(TAG, "error in notifyVideoUnavailable");
}
}
});
@@ -411,18 +411,18 @@
* reevaluate the current program with the new parental control settings.
* </p>
*
- * @see #dispatchContentBlocked
+ * @see #notifyContentBlocked
* @see TvParentalControlManager
*/
- public void dispatchContentAllowed() {
+ public void notifyContentAllowed() {
mHandler.post(new Runnable() {
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchContentAllowed");
+ if (DEBUG) Log.d(TAG, "notifyContentAllowed");
mSessionCallback.onContentAllowed();
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchContentAllowed");
+ Log.w(TAG, "error in notifyContentAllowed");
}
}
});
@@ -451,18 +451,18 @@
* </p>
*
* @param rating The content rating for the current TV program.
- * @see #dispatchContentAllowed
+ * @see #notifyContentAllowed
* @see TvParentalControlManager
*/
- public void dispatchContentBlocked(final TvContentRating rating) {
+ public void notifyContentBlocked(final TvContentRating rating) {
mHandler.post(new Runnable() {
@Override
public void run() {
try {
- if (DEBUG) Log.d(TAG, "dispatchContentBlocked");
+ if (DEBUG) Log.d(TAG, "notifyContentBlocked");
mSessionCallback.onContentBlocked(rating.flattenToString());
} catch (RemoteException e) {
- Log.w(TAG, "error in dispatchContentBlocked");
+ Log.w(TAG, "error in notifyContentBlocked");
}
}
});
@@ -529,8 +529,8 @@
public abstract void onSetStreamVolume(float volume);
/**
- * Tunes to a given channel. When the video is available, {@link #dispatchVideoAvailable()}
- * should be called. Also, {@link #dispatchVideoUnavailable(int)} should be called when the
+ * Tunes to a given channel. When the video is available, {@link #notifyVideoAvailable()}
+ * should be called. Also, {@link #notifyVideoUnavailable(int)} should be called when the
* TV input cannot continue playing the given channel.
*
* @param channelUri The URI of the channel.
@@ -562,7 +562,7 @@
*
* @param unblockedRating An unblocked content rating
*/
- public void onRequestUnblockContent(TvContentRating unblockedRating) {
+ public void onUnblockContent(TvContentRating unblockedRating) {
}
/**
@@ -571,12 +571,12 @@
* If it is called multiple times on the same type of track (ie. Video, Audio, Text), the
* track selected previously should be unselected in the implementation of this method.
* Also, if the select operation was successful, the implementation should call
- * {@link #dispatchTrackInfoChanged(List)} to report the updated track information.
+ * {@link #notifyTrackInfoChanged(List)} to report the updated track information.
* </p>
*
* @param track The track to be selected.
* @return {@code true} if the select operation was successful, {@code false} otherwise.
- * @see #dispatchTrackInfoChanged
+ * @see #notifyTrackInfoChanged
* @see TvTrackInfo#KEY_IS_SELECTED
*/
public boolean onSelectTrack(TvTrackInfo track) {
@@ -587,12 +587,12 @@
* Unselects a given track.
* <p>
* If the unselect operation was successful, the implementation should call
- * {@link #dispatchTrackInfoChanged(List)} to report the updated track information.
+ * {@link #notifyTrackInfoChanged(List)} to report the updated track information.
* </p>
*
* @param track The track to be unselected.
* @return {@code true} if the unselect operation was successful, {@code false} otherwise.
- * @see #dispatchTrackInfoChanged
+ * @see #notifyTrackInfoChanged
* @see TvTrackInfo#KEY_IS_SELECTED
*/
public boolean onUnselectTrack(TvTrackInfo track) {
@@ -821,10 +821,10 @@
}
/**
- * Calls {@link #onRequestUnblockContent}.
+ * Calls {@link #onUnblockContent}.
*/
- void requestUnblockContent(String unblockedRating) {
- onRequestUnblockContent(TvContentRating.unflattenFromString(unblockedRating));
+ void unblockContent(String unblockedRating) {
+ onUnblockContent(TvContentRating.unflattenFromString(unblockedRating));
// TODO: Handle failure.
}
diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java
index 5fe9955..a5eef0a 100644
--- a/media/java/android/media/tv/TvView.java
+++ b/media/java/android/media/tv/TvView.java
@@ -258,7 +258,7 @@
* </p>
*
* @param unblockedRating A TvContentRating to unblock.
- * @see TvInputService.Session#dispatchContentBlocked(TvContentRating)
+ * @see TvInputService.Session#notifyContentBlocked(TvContentRating)
* @hide
*/
@SystemApi
@@ -484,8 +484,8 @@
}
@Override
- public void setVisibility(int visibility) {
- super.setVisibility(visibility);
+ protected void onVisibilityChanged(View changedView, int visibility) {
+ super.onVisibilityChanged(changedView, visibility);
mSurfaceView.setVisibility(visibility);
if (visibility == View.VISIBLE) {
createSessionOverlayView();
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 04ff098..d033f76 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -90,6 +90,8 @@
mClass = (jclass)env->NewGlobalRef(clazz);
mObject = env->NewWeakGlobalRef(thiz);
+ cacheJavaObjects(env);
+
mLooper = new ALooper;
mLooper->setName("MediaCodec_looper");
@@ -105,6 +107,45 @@
}
}
+void JMediaCodec::cacheJavaObjects(JNIEnv *env) {
+ jclass clazz = (jclass)env->FindClass("java/nio/ByteBuffer");
+ mByteBufferClass = (jclass)env->NewGlobalRef(clazz);
+ CHECK(mByteBufferClass != NULL);
+
+ ScopedLocalRef<jclass> byteOrderClass(
+ env, env->FindClass("java/nio/ByteOrder"));
+ CHECK(byteOrderClass.get() != NULL);
+
+ jmethodID nativeOrderID = env->GetStaticMethodID(
+ byteOrderClass.get(), "nativeOrder", "()Ljava/nio/ByteOrder;");
+ CHECK(nativeOrderID != NULL);
+
+ jobject nativeByteOrderObj =
+ env->CallStaticObjectMethod(byteOrderClass.get(), nativeOrderID);
+ mNativeByteOrderObj = env->NewGlobalRef(nativeByteOrderObj);
+ CHECK(mNativeByteOrderObj != NULL);
+ env->DeleteLocalRef(nativeByteOrderObj);
+ nativeByteOrderObj = NULL;
+
+ mByteBufferOrderMethodID = env->GetMethodID(
+ mByteBufferClass,
+ "order",
+ "(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;");
+ CHECK(mByteBufferOrderMethodID != NULL);
+
+ mByteBufferAsReadOnlyBufferMethodID = env->GetMethodID(
+ mByteBufferClass, "asReadOnlyBuffer", "()Ljava/nio/ByteBuffer;");
+ CHECK(mByteBufferAsReadOnlyBufferMethodID != NULL);
+
+ mByteBufferPositionMethodID = env->GetMethodID(
+ mByteBufferClass, "position", "(I)Ljava/nio/Buffer;");
+ CHECK(mByteBufferPositionMethodID != NULL);
+
+ mByteBufferLimitMethodID = env->GetMethodID(
+ mByteBufferClass, "limit", "(I)Ljava/nio/Buffer;");
+ CHECK(mByteBufferLimitMethodID != NULL);
+}
+
status_t JMediaCodec::initCheck() const {
return mCodec != NULL ? OK : NO_INIT;
}
@@ -148,6 +189,19 @@
mObject = NULL;
env->DeleteGlobalRef(mClass);
mClass = NULL;
+ deleteJavaObjects(env);
+}
+
+void JMediaCodec::deleteJavaObjects(JNIEnv *env) {
+ env->DeleteGlobalRef(mByteBufferClass);
+ mByteBufferClass = NULL;
+ env->DeleteGlobalRef(mNativeByteOrderObj);
+ mNativeByteOrderObj = NULL;
+
+ mByteBufferOrderMethodID = NULL;
+ mByteBufferAsReadOnlyBufferMethodID = NULL;
+ mByteBufferPositionMethodID = NULL;
+ mByteBufferLimitMethodID = NULL;
}
status_t JMediaCodec::setCallback(jobject cb) {
@@ -298,80 +352,69 @@
return err;
}
- ScopedLocalRef<jclass> byteBufferClass(
- env, env->FindClass("java/nio/ByteBuffer"));
-
- CHECK(byteBufferClass.get() != NULL);
-
- jmethodID orderID = env->GetMethodID(
- byteBufferClass.get(),
- "order",
- "(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;");
-
- CHECK(orderID != NULL);
-
- jmethodID asReadOnlyBufferID = env->GetMethodID(
- byteBufferClass.get(), "asReadOnlyBuffer", "()Ljava/nio/ByteBuffer;");
-
- CHECK(asReadOnlyBufferID != NULL);
-
- ScopedLocalRef<jclass> byteOrderClass(
- env, env->FindClass("java/nio/ByteOrder"));
-
- CHECK(byteOrderClass.get() != NULL);
-
- jmethodID nativeOrderID = env->GetStaticMethodID(
- byteOrderClass.get(), "nativeOrder", "()Ljava/nio/ByteOrder;");
- CHECK(nativeOrderID != NULL);
-
- jobject nativeByteOrderObj =
- env->CallStaticObjectMethod(byteOrderClass.get(), nativeOrderID);
- CHECK(nativeByteOrderObj != NULL);
-
*bufArray = (jobjectArray)env->NewObjectArray(
- buffers.size(), byteBufferClass.get(), NULL);
+ buffers.size(), mByteBufferClass, NULL);
if (*bufArray == NULL) {
- env->DeleteLocalRef(nativeByteOrderObj);
return NO_MEMORY;
}
for (size_t i = 0; i < buffers.size(); ++i) {
const sp<ABuffer> &buffer = buffers.itemAt(i);
- // if this is an ABuffer that doesn't actually hold any accessible memory,
- // use a null ByteBuffer
- if (buffer->base() == NULL) {
- continue;
+ jobject byteBuffer = NULL;
+ err = createByteBufferFromABuffer(
+ env, !input /* readOnly */, true /* clearBuffer */, buffer, &byteBuffer);
+ if (err != OK) {
+ return err;
}
- jobject byteBuffer =
- env->NewDirectByteBuffer(
- buffer->base(),
- buffer->capacity());
- if (!input && byteBuffer != NULL) {
- jobject readOnlyBuffer = env->CallObjectMethod(
- byteBuffer, asReadOnlyBufferID);
+ if (byteBuffer != NULL) {
+ env->SetObjectArrayElement(
+ *bufArray, i, byteBuffer);
+
env->DeleteLocalRef(byteBuffer);
- byteBuffer = readOnlyBuffer;
+ byteBuffer = NULL;
}
- if (byteBuffer == NULL) {
- env->DeleteLocalRef(nativeByteOrderObj);
- return NO_MEMORY;
- }
- jobject me = env->CallObjectMethod(
- byteBuffer, orderID, nativeByteOrderObj);
- env->DeleteLocalRef(me);
- me = NULL;
-
- env->SetObjectArrayElement(
- *bufArray, i, byteBuffer);
-
- env->DeleteLocalRef(byteBuffer);
- byteBuffer = NULL;
}
- env->DeleteLocalRef(nativeByteOrderObj);
- nativeByteOrderObj = NULL;
+ return OK;
+}
+// static
+status_t JMediaCodec::createByteBufferFromABuffer(
+ JNIEnv *env, bool readOnly, bool clearBuffer, const sp<ABuffer> &buffer,
+ jobject *buf) const {
+ // if this is an ABuffer that doesn't actually hold any accessible memory,
+ // use a null ByteBuffer
+ *buf = NULL;
+ if (buffer->base() == NULL) {
+ return OK;
+ }
+
+ jobject byteBuffer =
+ env->NewDirectByteBuffer(buffer->base(), buffer->capacity());
+ if (readOnly && byteBuffer != NULL) {
+ jobject readOnlyBuffer = env->CallObjectMethod(
+ byteBuffer, mByteBufferAsReadOnlyBufferMethodID);
+ env->DeleteLocalRef(byteBuffer);
+ byteBuffer = readOnlyBuffer;
+ }
+ if (byteBuffer == NULL) {
+ return NO_MEMORY;
+ }
+ jobject me = env->CallObjectMethod(
+ byteBuffer, mByteBufferOrderMethodID, mNativeByteOrderObj);
+ env->DeleteLocalRef(me);
+ me = env->CallObjectMethod(
+ byteBuffer, mByteBufferLimitMethodID,
+ clearBuffer ? buffer->capacity() : (buffer->offset() + buffer->size()));
+ env->DeleteLocalRef(me);
+ me = env->CallObjectMethod(
+ byteBuffer, mByteBufferPositionMethodID,
+ clearBuffer ? 0 : buffer->offset());
+ env->DeleteLocalRef(me);
+ me = NULL;
+
+ *buf = byteBuffer;
return OK;
}
@@ -388,85 +431,8 @@
return err;
}
- ScopedLocalRef<jclass> byteBufferClass(
- env, env->FindClass("java/nio/ByteBuffer"));
-
- CHECK(byteBufferClass.get() != NULL);
-
- jmethodID orderID = env->GetMethodID(
- byteBufferClass.get(),
- "order",
- "(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;");
-
- CHECK(orderID != NULL);
-
- jmethodID asReadOnlyBufferID = env->GetMethodID(
- byteBufferClass.get(), "asReadOnlyBuffer", "()Ljava/nio/ByteBuffer;");
-
- CHECK(asReadOnlyBufferID != NULL);
-
- jmethodID positionID = env->GetMethodID(
- byteBufferClass.get(), "position", "(I)Ljava/nio/Buffer;");
-
- CHECK(positionID != NULL);
-
- jmethodID limitID = env->GetMethodID(
- byteBufferClass.get(), "limit", "(I)Ljava/nio/Buffer;");
-
- CHECK(limitID != NULL);
-
- ScopedLocalRef<jclass> byteOrderClass(
- env, env->FindClass("java/nio/ByteOrder"));
-
- CHECK(byteOrderClass.get() != NULL);
-
- jmethodID nativeOrderID = env->GetStaticMethodID(
- byteOrderClass.get(), "nativeOrder", "()Ljava/nio/ByteOrder;");
- CHECK(nativeOrderID != NULL);
-
- jobject nativeByteOrderObj =
- env->CallStaticObjectMethod(byteOrderClass.get(), nativeOrderID);
- CHECK(nativeByteOrderObj != NULL);
-
- // if this is an ABuffer that doesn't actually hold any accessible memory,
- // use a null ByteBuffer
- if (buffer->base() == NULL) {
- *buf = NULL;
- return OK;
- }
-
- jobject byteBuffer =
- env->NewDirectByteBuffer(
- buffer->base(),
- buffer->capacity());
- if (!input && byteBuffer != NULL) {
- jobject readOnlyBuffer = env->CallObjectMethod(
- byteBuffer, asReadOnlyBufferID);
- env->DeleteLocalRef(byteBuffer);
- byteBuffer = readOnlyBuffer;
- }
- if (byteBuffer == NULL) {
- env->DeleteLocalRef(nativeByteOrderObj);
- return NO_MEMORY;
- }
- jobject me = env->CallObjectMethod(
- byteBuffer, orderID, nativeByteOrderObj);
- env->DeleteLocalRef(me);
- me = env->CallObjectMethod(
- byteBuffer, limitID,
- input ? buffer->capacity() : (buffer->offset() + buffer->size()));
- env->DeleteLocalRef(me);
- me = env->CallObjectMethod(
- byteBuffer, positionID,
- input ? 0 : buffer->offset());
- env->DeleteLocalRef(me);
- me = NULL;
-
- env->DeleteLocalRef(nativeByteOrderObj);
- nativeByteOrderObj = NULL;
-
- *buf = byteBuffer;
- return OK;
+ return createByteBufferFromABuffer(
+ env, !input /* readOnly */, input /* clearBuffer */, buffer, buf);
}
status_t JMediaCodec::getImage(
@@ -490,15 +456,80 @@
}
// check if buffer is an image
- AString imageData;
- if (!buffer->meta()->findString("image-data", &imageData)) {
+ sp<ABuffer> imageData;
+ if (!buffer->meta()->findBuffer("image-data", &imageData)) {
return OK;
}
+ int64_t timestamp = 0;
+ if (!input && buffer->meta()->findInt64("timeUs", ×tamp)) {
+ timestamp *= 1000; // adjust to ns
+ }
+
+ jobject byteBuffer = NULL;
+ err = createByteBufferFromABuffer(
+ env, !input /* readOnly */, input /* clearBuffer */, buffer, &byteBuffer);
+ if (err != OK) {
+ return OK;
+ }
+
+ jobject infoBuffer = NULL;
+ err = createByteBufferFromABuffer(
+ env, true /* readOnly */, true /* clearBuffer */, imageData, &infoBuffer);
+ if (err != OK) {
+ env->DeleteLocalRef(byteBuffer);
+ byteBuffer = NULL;
+ return OK;
+ }
+
+ jobject cropRect = NULL;
+ int32_t left, top, right, bottom;
+ if (buffer->meta()->findRect("crop-rect", &left, &top, &right, &bottom)) {
+ ScopedLocalRef<jclass> rectClazz(
+ env, env->FindClass("android/graphics/Rect"));
+ CHECK(rectClazz.get() != NULL);
+
+ jmethodID rectConstructID = env->GetMethodID(
+ rectClazz.get(), "<init>", "(IIII)V");
+
+ cropRect = env->NewObject(
+ rectClazz.get(), rectConstructID, left, top, right + 1, bottom + 1);
+ }
+
+ ScopedLocalRef<jclass> imageClazz(
+ env, env->FindClass("android/media/MediaCodec$MediaImage"));
+ CHECK(imageClazz.get() != NULL);
+
+ jmethodID imageConstructID = env->GetMethodID(imageClazz.get(), "<init>",
+ "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;ZJIILandroid/graphics/Rect;)V");
+
+ *buf = env->NewObject(imageClazz.get(), imageConstructID,
+ byteBuffer, infoBuffer,
+ (jboolean)!input /* readOnly */,
+ (jlong)timestamp,
+ (jint)0 /* xOffset */, (jint)0 /* yOffset */, cropRect);
+
+ // if MediaImage creation fails, return null
+ if (env->ExceptionCheck()) {
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+ *buf = NULL;
+ }
+
+ if (cropRect != NULL) {
+ env->DeleteLocalRef(cropRect);
+ cropRect = NULL;
+ }
+
+ env->DeleteLocalRef(byteBuffer);
+ byteBuffer = NULL;
+
+ env->DeleteLocalRef(infoBuffer);
+ infoBuffer = NULL;
+
return OK;
}
-
status_t JMediaCodec::getName(JNIEnv *env, jstring *nameStr) const {
AString name;
diff --git a/media/jni/android_media_MediaCodec.h b/media/jni/android_media_MediaCodec.h
index dbccb0f..f84a16a 100644
--- a/media/jni/android_media_MediaCodec.h
+++ b/media/jni/android_media_MediaCodec.h
@@ -26,6 +26,7 @@
namespace android {
+struct ABuffer;
struct ALooper;
struct AMessage;
struct AString;
@@ -121,11 +122,26 @@
jweak mObject;
sp<Surface> mSurfaceTextureClient;
+ // java objects cached
+ jclass mByteBufferClass;
+ jobject mNativeByteOrderObj;
+ jmethodID mByteBufferOrderMethodID;
+ jmethodID mByteBufferPositionMethodID;
+ jmethodID mByteBufferLimitMethodID;
+ jmethodID mByteBufferAsReadOnlyBufferMethodID;
+
sp<ALooper> mLooper;
sp<MediaCodec> mCodec;
sp<AMessage> mCallbackNotification;
+ status_t createByteBufferFromABuffer(
+ JNIEnv *env, bool readOnly, bool clearBuffer, const sp<ABuffer> &buffer,
+ jobject *buf) const;
+
+ void cacheJavaObjects(JNIEnv *env);
+ void deleteJavaObjects(JNIEnv *env);
+
DISALLOW_EVIL_CONSTRUCTORS(JMediaCodec);
};
diff --git a/media/jni/android_media_MediaProfiles.cpp b/media/jni/android_media_MediaProfiles.cpp
index 1e5c700..007fc14 100644
--- a/media/jni/android_media_MediaProfiles.cpp
+++ b/media/jni/android_media_MediaProfiles.cpp
@@ -166,7 +166,9 @@
return ((quality >= CAMCORDER_QUALITY_LIST_START &&
quality <= CAMCORDER_QUALITY_LIST_END) ||
(quality >= CAMCORDER_QUALITY_TIME_LAPSE_LIST_START &&
- quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END));
+ quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END) ||
+ (quality >= CAMCORDER_QUALITY_HIGH_SPEED_LIST_START &&
+ quality <= CAMCORDER_QUALITY_HIGH_SPEED_LIST_END));
}
static jobject
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow_am.png
index 7c4c1a6..54d76c1 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_breadcrumb_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png
index 649985d..1330240 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_accept.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png
index 791bf6d..6369d18 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_cancel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png
index 6c32af1..063009d 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_cab_select_item.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png
deleted file mode 100644
index 5bc4e05..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_dark.png
new file mode 100644
index 0000000..bea0eec
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_light.png
new file mode 100644
index 0000000..c4c264e
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_alert_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png
deleted file mode 100644
index ffb076c..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_dark.png
new file mode 100644
index 0000000..f7e59a5
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_light.png
new file mode 100644
index 0000000..ae50d74
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_dialog_info_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png
index 179db33..e462727 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_album.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png
index 8704a78..8ac89b6 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_apk.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_am.png
deleted file mode 100644
index 465838d..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_dark_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_dark_am.png
new file mode 100644
index 0000000..3cbff21
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_light_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_light_am.png
new file mode 100644
index 0000000..7c8b540
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_audio_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png
index 434a6e6..8644171 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_certificate.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png
index 940d185..0a3a9a6 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_codes.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png
index 35cdc1f..d37d9bf 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_compressed.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact_am.png
index 8f3b82c..7ad6c37 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_contact_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event_am.png
index a3df893..bb7e584 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_event_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_excel.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_excel.png
new file mode 100644
index 0000000..0f5159b
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_excel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png
index 92225ba..b3e7192 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_font.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic_am.png
index 55b9b7d..a799a83d 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_generic_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png
deleted file mode 100644
index 72b611d..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_dark.png
new file mode 100644
index 0000000..10c0b99
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_light.png
new file mode 100644
index 0000000..c857519
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_image_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png
index e08b0e6..b168481 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_pdf.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_powerpoint.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_powerpoint.png
new file mode 100644
index 0000000..4af36b7
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_powerpoint.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png
index 0c55e8c..9167c7d 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_presentation.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet_am.png
index 880564e..7abe436 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_spreadsheet_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text_am.png
index cb60165..737cca7 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_text_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_am.png
deleted file mode 100644
index 9a942d2..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_dark_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_dark_am.png
new file mode 100644
index 0000000..ff8d3aa
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_light_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_light_am.png
new file mode 100644
index 0000000..d422eb7
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_video_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_doc_word.png b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_word.png
new file mode 100644
index 0000000..3860241
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_doc_word.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_folder.png b/packages/DocumentsUI/res/drawable-hdpi/ic_folder.png
new file mode 100644
index 0000000..3c88982
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png
deleted file mode 100644
index 7c3d69d..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_background.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png
deleted file mode 100644
index 8b90094..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png
deleted file mode 100644
index 1e41d7a..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_card_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png
index a6e56ea..e9cfdb1 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png
deleted file mode 100644
index b896c55..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_grid_gradient_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_hamburger.png b/packages/DocumentsUI/res/drawable-hdpi/ic_hamburger.png
new file mode 100644
index 0000000..4527667
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_hamburger.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png
index c907bf6..f4f9df2 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_copy.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png
index 1fe7af7..396ce59 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_delete.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect_am.png
index 8a88407..ddf9f9a 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_disconnect_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder_am.png
index 638c812..ab4d176 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_new_folder_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png
index 2a007d2..6b01137 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_overflow.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename_am.png
index 2756327..4eeafad 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_rename_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png
index b00328b..dca23e6 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_search.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png
index 03e0cc7..d52840f 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_settings.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png
index cf7d2f4..8ff9ea5 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_share.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby_am.png
index 0d4cdc1..3563e97 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_sortby_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo_am.png
index 20dce0f..2d61dc7 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_undo_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png
index 3f3b536..3035ac4 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_grid.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png
index 79bffc9..d1f26a6 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_menu_view_list.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_open_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_open_am.png
index 595c4b9..b0a5f73 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_open_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_open_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_popout_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_popout_am.png
index 3700512..9497fb0b 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_popout_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_popout_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png
deleted file mode 100644
index 52f1c70..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_dark.png
new file mode 100644
index 0000000..96d23be
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_light.png
new file mode 100644
index 0000000..032fb17
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_download_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_am.png
deleted file mode 100644
index 915e118..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_dark_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_dark_am.png
new file mode 100644
index 0000000..e2001f7
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_light_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_light_am.png
new file mode 100644
index 0000000..f2cec4f
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_folder_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png
deleted file mode 100644
index 303b7f9..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_dark.png
new file mode 100644
index 0000000..6954b42
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_light.png
new file mode 100644
index 0000000..3ede991
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_recent_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png
deleted file mode 100644
index 2375e17..0000000
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_dark.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_dark.png
new file mode 100644
index 0000000..b43fddd
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_light.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_light.png
new file mode 100644
index 0000000..f0a8402
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_sdcard_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png
index 5c0c87b..665ee0b 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_root_usb.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow_am.png b/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow_am.png
index 99060cd..6be1f5b 100644
--- a/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-hdpi/ic_subdirectory_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow_am.png
index 09e77afb..821667e4 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_breadcrumb_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png
index f42be13..4e954c4 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_accept.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png
index b47e306..6ec1234 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_cancel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png
index 903a041..73e1081 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_cab_select_item.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png
deleted file mode 100644
index 4835d5f..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_dark.png
new file mode 100644
index 0000000..dbe4cb7
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_light.png
new file mode 100644
index 0000000..e9ae097
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_alert_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png
deleted file mode 100644
index 2d29442..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_dark.png
new file mode 100644
index 0000000..f8f9eaf
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_light.png
new file mode 100644
index 0000000..f8635fe
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_dialog_info_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png
index 318dd5b..0d3d5d7 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_album.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png
index 932995e..f9597f0 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_apk.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_am.png
deleted file mode 100644
index cb94d99..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_dark_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_dark_am.png
new file mode 100644
index 0000000..deba408
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_light_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_light_am.png
new file mode 100644
index 0000000..88f0127
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_audio_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png
index 240d7f4..b1323da 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_certificate.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png
index 6c6aad6..ff99fd7 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_codes.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png
index 8fc7bea..4af71f3 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_compressed.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact_am.png
index 290ad3a..e137ca0 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_contact_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event_am.png
index e5eda72..db55b74 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_event_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_excel.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_excel.png
new file mode 100644
index 0000000..3adff71
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_excel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png
index 00bd478..0a4a841 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_font.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic_am.png
index a1bd14e..1dce216 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_generic_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png
deleted file mode 100644
index b81b1e5..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_dark.png
new file mode 100644
index 0000000..f061b0c
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_light.png
new file mode 100644
index 0000000..fa3d2ea
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_image_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png
index 3381c42..b558d08 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_pdf.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_powerpoint.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_powerpoint.png
new file mode 100644
index 0000000..efc0b13
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_powerpoint.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png
index 68cc971..655d866 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_presentation.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet_am.png
index 2934e5a..a2f9116 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_spreadsheet_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text_am.png
index 95565b3..4aa3a0e 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_text_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_am.png
deleted file mode 100644
index 3a5b798..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_dark_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_dark_am.png
new file mode 100644
index 0000000..1b6f00f
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_light_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_light_am.png
new file mode 100644
index 0000000..24dad11
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_video_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_doc_word.png b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_word.png
new file mode 100644
index 0000000..7f26252
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_doc_word.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_folder.png b/packages/DocumentsUI/res/drawable-mdpi/ic_folder.png
new file mode 100644
index 0000000..17cb056
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png
deleted file mode 100644
index 567a06b..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_background.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png
deleted file mode 100644
index 1525572..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png
deleted file mode 100644
index 16c9296..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_card_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png
index 6e63b8c..5534c74e 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png
deleted file mode 100644
index 1120864..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_grid_gradient_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_hamburger.png b/packages/DocumentsUI/res/drawable-mdpi/ic_hamburger.png
new file mode 100644
index 0000000..440c0f6
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_hamburger.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png
index fbf5c88..fbd5c21 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_copy.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png
index ecb4bf2..1939ed7 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_delete.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect_am.png
index 96b01b9..bb06624 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_disconnect_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder_am.png
index ee95809..86b9256 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_new_folder_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png
index 7a63828..c7f60c4 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_overflow.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename_am.png
index 9ab2f78..dc9bbc9 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_rename_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png
index 2d0ab8a..1f45b99 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_search.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png
index cf5575a..db6321d 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_settings.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png
index 368fbd6..f370056 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_share.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby_am.png
index 2768b1c..86e1cf9 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_sortby_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo_am.png
index d56db42..ed0ee5d 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_undo_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png
index 0a0c8f1..6af4222 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_grid.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png
index 8a724ac..20197f4 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_menu_view_list.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_open_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_open_am.png
index adfacc1..dab578b 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_open_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_open_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_popout_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_popout_am.png
index b17de2d..12e873d 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_popout_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_popout_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png
deleted file mode 100644
index 4f903df..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_dark.png
new file mode 100644
index 0000000..d3f3e08
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_light.png
new file mode 100644
index 0000000..23663d7
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_download_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_am.png
deleted file mode 100644
index 4352d08..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_dark_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_dark_am.png
new file mode 100644
index 0000000..8d9de3d
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_light_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_light_am.png
new file mode 100644
index 0000000..35505fe
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_folder_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png
deleted file mode 100644
index bf9b1b6..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_dark.png
new file mode 100644
index 0000000..67789a3
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_light.png
new file mode 100644
index 0000000..6f8d9a5
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_recent_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png
deleted file mode 100644
index 6adc2a3..0000000
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_dark.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_dark.png
new file mode 100644
index 0000000..3b945e1
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_light.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_light.png
new file mode 100644
index 0000000..7032d5f
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_sdcard_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png
index d318dba..a4f474b 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_root_usb.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow_am.png b/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow_am.png
index a7a2b12..c8c9f1a 100644
--- a/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-mdpi/ic_subdirectory_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow_am.png
index 33c8f27..74fdc2b 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_breadcrumb_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png
index ef9641d..6f8f34f 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_accept.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png
index 9c3d008..d360431 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_cancel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png
index 4cf4f3f..21319d8 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_cab_select_item.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png
deleted file mode 100644
index 17f9f9e..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_dark.png
new file mode 100644
index 0000000..eeef696
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_light.png
new file mode 100644
index 0000000..0b52ce4a
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_alert_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png
deleted file mode 100644
index 2f9cc58..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_dark.png
new file mode 100644
index 0000000..7006326
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_light.png
new file mode 100644
index 0000000..28b69c6
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_dialog_info_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png
index e67aa8d..8952222 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_album.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png
index d0e2594..bc833b4 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_apk.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_am.png
deleted file mode 100644
index 2e66f03..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_dark_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_dark_am.png
new file mode 100644
index 0000000..c782d0f
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_light_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_light_am.png
new file mode 100644
index 0000000..fbc1e24
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_audio_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png
index 64e0d42..de17d0b 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_certificate.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png
index a4f70ba..d396745 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_codes.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png
index 4897221c..1627d8e 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_compressed.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact_am.png
index 4cec994..a6f91b5 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_contact_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event_am.png
index 5e46b71e..cff0ab6 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_event_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_excel.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_excel.png
new file mode 100644
index 0000000..884dd58
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_excel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png
index 977cfd2..9f70fb8 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_font.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic_am.png
index e05c4b4..7fb5ef6 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_generic_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png
deleted file mode 100644
index 98d3f79..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_dark.png
new file mode 100644
index 0000000..49e4d0a
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_light.png
new file mode 100644
index 0000000..09609e3
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_image_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png
index ff2ff14..cdb8471 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_pdf.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_powerpoint.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_powerpoint.png
new file mode 100644
index 0000000..f319929
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_powerpoint.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png
index 2917377..ee8f63c 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_presentation.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet_am.png
index 87c6538..faa648d4 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_spreadsheet_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text_am.png
index 97c4500..872a67b 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_text_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_am.png
deleted file mode 100644
index 1a8e632..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_dark_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_dark_am.png
new file mode 100644
index 0000000..aaa951b
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_light_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_light_am.png
new file mode 100644
index 0000000..1342087
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_video_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_word.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_word.png
new file mode 100644
index 0000000..8c883ad
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_doc_word.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_folder.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_folder.png
new file mode 100644
index 0000000..0d3f869
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png
deleted file mode 100644
index 8f7f4ab..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_background.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png
deleted file mode 100644
index b82ae20..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png
deleted file mode 100644
index edd6266..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_card_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png
index c3af9ec..a1c9789 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png
deleted file mode 100644
index 60ce8d5..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_grid_gradient_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_hamburger.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_hamburger.png
new file mode 100644
index 0000000..f7a1779
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_hamburger.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png
index c650185..295576c 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_copy.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png
index 0771ed2..19c19ba 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_delete.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect_am.png
index 91c31e3..22cbd7b 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_disconnect_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder_am.png
index f06b298..bbdee7e 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_new_folder_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png
index c3a7eaa..7a050c9 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_overflow.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename_am.png
index 17e09b3..8ccca63 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_rename_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png
index 0ab604f..4c87e59 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_search.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png
index 5054fc8..d0929cf 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_settings.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png
index d3d386e..e55b347 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_share.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby_am.png
index f24ca1a..28b7d5c 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_sortby_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo_am.png
index 82c1a30..1121c43 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_undo_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png
index 0258312..47b5333 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_grid.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png
index ccace9d..62ab8fb 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_menu_view_list.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_open_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_open_am.png
index a56940a..f969418 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_open_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_open_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_popout_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_popout_am.png
index f6a0af4..204b04d 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_popout_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_popout_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png
deleted file mode 100644
index 6c6447e..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_dark.png
new file mode 100644
index 0000000..2460761
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_light.png
new file mode 100644
index 0000000..1de0247
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_download_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_am.png
deleted file mode 100644
index c916e0b..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_dark_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_dark_am.png
new file mode 100644
index 0000000..f9788b1
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_light_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_light_am.png
new file mode 100644
index 0000000..ff307cd
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_folder_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png
deleted file mode 100644
index 714f2ee..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_dark.png
new file mode 100644
index 0000000..be89734
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_light.png
new file mode 100644
index 0000000..90d1e15
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_recent_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png
deleted file mode 100644
index 6016c08..0000000
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_dark.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_dark.png
new file mode 100644
index 0000000..f788f23
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_light.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_light.png
new file mode 100644
index 0000000..bc2acbe
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_sdcard_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png
index b05b9a4..6ccfb76 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_root_usb.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow_am.png b/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow_am.png
index 1da8196..94a757a 100644
--- a/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-xhdpi/ic_subdirectory_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_breadcrumb_arrow_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_breadcrumb_arrow_am.png
index 06681e3..21272f4 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_breadcrumb_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_breadcrumb_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_accept.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_accept.png
index ac88818..6824bce 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_accept.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_accept.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_cancel.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_cancel.png
index 88356c7..81d7816 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_cancel.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_cancel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_select_item.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_select_item.png
index 75658db..99c3dbb 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_select_item.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_cab_select_item.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png
deleted file mode 100644
index 8bee0dc..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_dark.png
new file mode 100644
index 0000000..a91cd76
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_light.png
new file mode 100644
index 0000000..73e440a
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_alert_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png
deleted file mode 100644
index ad6c59b..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_dark.png
new file mode 100644
index 0000000..aff4bc4
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_light.png
new file mode 100644
index 0000000..7e0fa62
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_dialog_info_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png
index 4c56bd0c..e7151cf 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_album.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png
index 5f64229..5c10593 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_apk.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_am.png
deleted file mode 100644
index 48ab9c7..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_dark_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_dark_am.png
new file mode 100644
index 0000000..e96ed99
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_light_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_light_am.png
new file mode 100644
index 0000000..cac2aaf
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_audio_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_certificate.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_certificate.png
index 68e619e..1ee0875 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_certificate.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_certificate.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png
index 945119a..8d3dabf 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_codes.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_compressed.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_compressed.png
index bf49d78..c3e21ae 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_compressed.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_compressed.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact_am.png
index 5263365..e809fe65 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_contact_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_event_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_event_am.png
index 77a0fae..5ed0373 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_event_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_event_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_excel.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_excel.png
new file mode 100644
index 0000000..1a373f3
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_excel.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_font.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_font.png
index 30d2c4c..b4308b4 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_font.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_font.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic_am.png
index c098866..b5ba48b 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_generic_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png
deleted file mode 100644
index 06d8d9c..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_dark.png
new file mode 100644
index 0000000..63e4255
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_light.png
new file mode 100644
index 0000000..6237ded
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_image_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png
index a3b146b..2c0a81e 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_pdf.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_powerpoint.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_powerpoint.png
new file mode 100644
index 0000000..2fba5ed
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_powerpoint.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_presentation.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_presentation.png
index c09d6ab..3e391ce 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_presentation.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_presentation.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_spreadsheet_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_spreadsheet_am.png
index 2170e66..372abc9 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_spreadsheet_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_spreadsheet_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text_am.png
index bc4ce79..e535ca3 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_text_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_am.png
deleted file mode 100644
index 42d8ec1..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_dark_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_dark_am.png
new file mode 100644
index 0000000..48b4a72
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_light_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_light_am.png
new file mode 100644
index 0000000..15d6c50
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_video_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_word.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_word.png
new file mode 100644
index 0000000..9ccf41e
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_doc_word.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_folder.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_folder.png
new file mode 100644
index 0000000..9bedcd9
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_background.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_background.9.png
deleted file mode 100644
index 7bbaf9d..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_background.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png
deleted file mode 100644
index 901af80..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png
deleted file mode 100644
index e21e350..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_card_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_folder.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_folder.png
index 86a74cd..10cdd51 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_folder.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_folder.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_gradient_bg.9.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_gradient_bg.9.png
deleted file mode 100644
index 988c8563..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_grid_gradient_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_hamburger.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_hamburger.png
new file mode 100644
index 0000000..355f61f
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_hamburger.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png
index f23e23c..7f483e1 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_copy.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png
index f67c72e..c19988f9 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_delete.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_disconnect_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_disconnect_am.png
index 676d0f7..d10bec8 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_disconnect_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_disconnect_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder_am.png
index b17ba1d0..4013b7c 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_new_folder_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_overflow.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_overflow.png
index 58f1381..036127c 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_overflow.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_overflow.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename_am.png
index eed0eaf..0fef9d0 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_rename_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png
index 40fb392..af79507 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_search.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png
index b988ab5..db2ef7b 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_settings.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png
index 6ace932..e6befad 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_share.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby_am.png
index 8f19afa..89bf79f 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_sortby_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo_am.png
index e4c9f8a..7acc684e 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_undo_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png
index 9e27d63..0bee75a 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_grid.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png
index e4c679a..da13073 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_menu_view_list.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_open_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_open_am.png
index b467962..7196ee5 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_open_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_open_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_popout_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_popout_am.png
index 5f5a86f..6fa2216 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_popout_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_popout_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png
deleted file mode 100644
index 3b8afc9..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_dark.png
new file mode 100644
index 0000000..067aa655
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_light.png
new file mode 100644
index 0000000..40437a8
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_download_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_am.png
deleted file mode 100644
index 077c851..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_am.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_dark_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_dark_am.png
new file mode 100644
index 0000000..069d951
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_dark_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_light_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_light_am.png
new file mode 100644
index 0000000..1725025
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_folder_light_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png
deleted file mode 100644
index a3215f2..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_dark.png
new file mode 100644
index 0000000..d149239
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_light.png
new file mode 100644
index 0000000..9a06663
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_recent_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png
deleted file mode 100644
index 873a553..0000000
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard.png
+++ /dev/null
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_dark.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_dark.png
new file mode 100644
index 0000000..429f3c5
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_dark.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_light.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_light.png
new file mode 100644
index 0000000..bcfe7fd
--- /dev/null
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_sdcard_light.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png
index d213e7c..c31b4dc 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_root_usb.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow_am.png b/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow_am.png
index db53a01..d852b8ec 100644
--- a/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow_am.png
+++ b/packages/DocumentsUI/res/drawable-xxhdpi/ic_subdirectory_arrow_am.png
Binary files differ
diff --git a/packages/DocumentsUI/res/drawable/item_doc_grid.xml b/packages/DocumentsUI/res/drawable/grid_protect_background.xml
similarity index 75%
rename from packages/DocumentsUI/res/drawable/item_doc_grid.xml
rename to packages/DocumentsUI/res/drawable/grid_protect_background.xml
index 3f036f7..2e7aadd 100644
--- a/packages/DocumentsUI/res/drawable/item_doc_grid.xml
+++ b/packages/DocumentsUI/res/drawable/grid_protect_background.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 The Android Open Source Project
+<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,5 +15,10 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_grid_card_background" />
+ <item android:state_enabled="false">
+ <color android:color="#88000000" />
+ </item>
+ <item>
+ <color android:color="#88252525" />
+ </item>
</selector>
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_doc_audio_dark.xml
similarity index 93%
copy from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
copy to packages/DocumentsUI/res/drawable/ic_doc_audio_dark.xml
index c6ccea6..768d409 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_doc_audio_dark.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_doc_audio_dark_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_doc_audio_light.xml
similarity index 93%
copy from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
copy to packages/DocumentsUI/res/drawable/ic_doc_audio_light.xml
index c6ccea6..bdb6983 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_doc_audio_light.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_doc_audio_light_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_video.xml b/packages/DocumentsUI/res/drawable/ic_doc_video.xml
deleted file mode 100644
index e196262..0000000
--- a/packages/DocumentsUI/res/drawable/ic_doc_video.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright 2013, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_video_am"
- android:autoMirrored="true">
-</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_doc_video_dark.xml
similarity index 93%
rename from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
rename to packages/DocumentsUI/res/drawable/ic_doc_video_dark.xml
index c6ccea6..4fb82bb 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_doc_video_dark.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_doc_video_dark_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_doc_video_light.xml
similarity index 93%
copy from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
copy to packages/DocumentsUI/res/drawable/ic_doc_video_light.xml
index c6ccea6..290c3f1a 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_doc_video_light.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_doc_video_light_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_root_folder.xml b/packages/DocumentsUI/res/drawable/ic_root_folder.xml
deleted file mode 100644
index a3c8f61..0000000
--- a/packages/DocumentsUI/res/drawable/ic_root_folder.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright 2013, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_root_folder_am"
- android:autoMirrored="true">
-</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_root_folder_dark.xml
similarity index 93%
copy from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
copy to packages/DocumentsUI/res/drawable/ic_root_folder_dark.xml
index c6ccea6..8e29d1d 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_root_folder_dark.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_root_folder_dark_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml b/packages/DocumentsUI/res/drawable/ic_root_folder_light.xml
similarity index 92%
copy from packages/DocumentsUI/res/drawable/ic_doc_audio.xml
copy to packages/DocumentsUI/res/drawable/ic_root_folder_light.xml
index c6ccea6..a750f1f 100644
--- a/packages/DocumentsUI/res/drawable/ic_doc_audio.xml
+++ b/packages/DocumentsUI/res/drawable/ic_root_folder_light.xml
@@ -18,6 +18,6 @@
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/ic_doc_audio_am"
+ android:src="@drawable/ic_root_folder_light_am"
android:autoMirrored="true">
</bitmap>
\ No newline at end of file
diff --git a/packages/DocumentsUI/res/drawable/item_doc_grid.xml b/packages/DocumentsUI/res/drawable/item_activated.xml
similarity index 71%
copy from packages/DocumentsUI/res/drawable/item_doc_grid.xml
copy to packages/DocumentsUI/res/drawable/item_activated.xml
index 3f036f7..6ffefdb 100644
--- a/packages/DocumentsUI/res/drawable/item_doc_grid.xml
+++ b/packages/DocumentsUI/res/drawable/item_activated.xml
@@ -15,5 +15,7 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_grid_card_background" />
+ <item android:state_focused="true" android:state_activated="true" android:drawable="@color/accent_item_activated" />
+ <item android:state_focused="false" android:state_activated="true" android:drawable="@color/accent_item_activated" />
+ <item android:drawable="@android:color/transparent" />
</selector>
diff --git a/packages/DocumentsUI/res/drawable/item_background.xml b/packages/DocumentsUI/res/drawable/item_background.xml
deleted file mode 100644
index ec9be6d..0000000
--- a/packages/DocumentsUI/res/drawable/item_background.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item android:state_window_focused="false" android:drawable="@android:color/transparent" />
-
- <item android:state_focused="true" android:state_activated="true" android:drawable="@drawable/ic_grid_card_focused" />
- <item android:state_focused="false" android:state_activated="true" android:drawable="@drawable/ic_grid_card_focused" />
-
- <item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/ic_grid_card_pressed" />
- <item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/ic_grid_card_pressed" />
- <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/ic_grid_card_pressed" />
- <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/ic_grid_card_pressed" />
- <item android:state_focused="true" android:drawable="@drawable/ic_grid_card_pressed" />
-
- <item android:drawable="@android:color/transparent" />
-
-</selector>
diff --git a/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml b/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml
index adbb9da..5f1e432 100644
--- a/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml
+++ b/packages/DocumentsUI/res/layout-sw720dp-land/item_doc_list.xml
@@ -14,103 +14,111 @@
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/item_background"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false">
+ android:foreground="@drawable/item_activated">
- <FrameLayout
- android:id="@android:id/icon"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_marginStart="12dp"
- android:layout_marginEnd="20dp">
-
- <ImageView
- android:id="@+id/icon_mime"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
-
- <ImageView
- android:id="@+id/icon_thumb"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:contentDescription="@null" />
-
- </FrameLayout>
-
- <!-- This is the one special case where we want baseline alignment! -->
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal">
+ android:minHeight="@dimen/list_item_height"
+ android:paddingStart="@dimen/list_item_padding"
+ android:paddingEnd="@dimen/list_item_padding"
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <TextView
- android:id="@android:id/title"
+ <FrameLayout
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/icon_size"
+ android:layout_height="@dimen/icon_size"
+ android:layout_marginStart="0dp"
+ android:layout_marginEnd="16dp">
+
+ <ImageView
+ android:id="@+id/icon_mime"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+ <ImageView
+ android:id="@+id/icon_thumb"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@null" />
+
+ </FrameLayout>
+
+ <!-- This is the one special case where we want baseline alignment! -->
+ <LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_weight="0.5"
- android:layout_marginEnd="12dp"
- android:singleLine="true"
- android:ellipsize="middle"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Medium" />
+ android:layout_weight="1"
+ android:orientation="horizontal">
- <ImageView
- android:id="@android:id/icon1"
- android:layout_width="@dimen/root_icon_size"
- android:layout_height="@dimen/root_icon_size"
- android:layout_marginEnd="8dp"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.5"
+ android:layout_marginEnd="12dp"
+ android:singleLine="true"
+ android:ellipsize="middle"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimary" />
- <TextView
- android:id="@android:id/summary"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.25"
- android:layout_marginEnd="12dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ <ImageView
+ android:id="@android:id/icon1"
+ android:layout_width="@dimen/root_icon_size"
+ android:layout_height="@dimen/root_icon_size"
+ android:layout_marginEnd="8dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
- <TextView
- android:id="@+id/size"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.125"
- android:layout_marginEnd="12dp"
- android:minWidth="70dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewEnd"
- style="@style/TextAppearance.Small" />
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.25"
+ android:layout_marginEnd="12dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
- <TextView
- android:id="@+id/date"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.125"
- android:layout_marginEnd="12dp"
- android:minWidth="70dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewEnd"
- style="@style/TextAppearance.Small" />
+ <TextView
+ android:id="@+id/size"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.125"
+ android:layout_marginEnd="12dp"
+ android:minWidth="70dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewEnd"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.125"
+ android:layout_marginEnd="12dp"
+ android:minWidth="70dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewEnd"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ </LinearLayout>
</LinearLayout>
-</LinearLayout>
+</FrameLayout>
diff --git a/packages/DocumentsUI/res/layout/fragment_directory.xml b/packages/DocumentsUI/res/layout/fragment_directory.xml
index 77cdc3b..09b50c0 100644
--- a/packages/DocumentsUI/res/layout/fragment_directory.xml
+++ b/packages/DocumentsUI/res/layout/fragment_directory.xml
@@ -31,8 +31,7 @@
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:listSelector="@android:color/transparent" />
+ android:layout_height="match_parent" />
<GridView
android:id="@+id/grid"
@@ -40,11 +39,13 @@
android:layout_height="match_parent"
android:paddingStart="@dimen/grid_padding_horiz"
android:paddingEnd="@dimen/grid_padding_horiz"
- android:paddingTop="@dimen/grid_padding"
- android:paddingBottom="@dimen/grid_padding"
+ android:paddingTop="@dimen/grid_padding_vert"
+ android:paddingBottom="@dimen/grid_padding_vert"
+ android:horizontalSpacing="@dimen/grid_item_padding"
+ android:verticalSpacing="@dimen/grid_item_padding"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
- android:listSelector="@android:color/transparent"
+ android:drawSelectorOnTop="true"
android:visibility="gone" />
</com.android.documentsui.DirectoryView>
diff --git a/packages/DocumentsUI/res/layout/item_doc_grid.xml b/packages/DocumentsUI/res/layout/item_doc_grid.xml
index 3aef1cd..0fc606d 100644
--- a/packages/DocumentsUI/res/layout/item_doc_grid.xml
+++ b/packages/DocumentsUI/res/layout/item_doc_grid.xml
@@ -16,110 +16,111 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="@dimen/grid_height"
- android:background="@drawable/item_doc_grid"
- android:foreground="@drawable/item_background">
+ android:layout_height="@dimen/grid_item_height"
+ android:orientation="vertical"
+ android:background="@color/grid_item_background"
+ android:foreground="@drawable/item_activated">
+
+ <ImageView
+ android:id="@+id/icon_thumb"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@null" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingBottom="6dp"
android:orientation="vertical">
- <FrameLayout
+ <ImageView
+ android:id="@+id/icon_mime"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:layout_marginBottom="6dp"
- android:background="#fff"
- android:foreground="@drawable/ic_grid_gradient_bg"
- android:foregroundGravity="fill">
-
- <ImageView
- android:id="@+id/icon_mime"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
-
- <ImageView
- android:id="@+id/icon_thumb"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:contentDescription="@null" />
-
- </FrameLayout>
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
<LinearLayout
- android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false"
+ android:background="@drawable/grid_protect_background"
+ android:orientation="vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
- <TextView
- android:id="@android:id/title"
- android:layout_width="0dp"
+ <LinearLayout
+ android:id="@+id/line1"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:singleLine="true"
- android:ellipsize="middle"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Medium" />
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <ImageView
- android:id="@android:id/icon1"
- android:layout_width="@dimen/root_icon_size"
- android:layout_height="@dimen/root_icon_size"
- android:layout_marginStart="8dp"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:ellipsize="middle"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimaryInverse" />
- </LinearLayout>
+ <ImageView
+ android:id="@android:id/icon1"
+ android:layout_width="@dimen/root_icon_size"
+ android:layout_height="@dimen/root_icon_size"
+ android:layout_marginStart="8dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
- <LinearLayout
- android:id="@+id/line2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+ </LinearLayout>
- <TextView
- android:id="@+id/date"
- android:layout_width="0dp"
+ <LinearLayout
+ android:id="@+id/line2"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="0.5"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <TextView
- android:id="@+id/size"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.5"
- android:layout_marginStart="8dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.5"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Caption"
+ android:textColor="?android:attr/textColorPrimaryInverse" />
- <ImageView
- android:id="@android:id/icon2"
- android:layout_width="@dimen/root_icon_size"
- android:layout_height="@dimen/root_icon_size"
- android:layout_marginStart="8dp"
- android:scaleType="centerInside"
- android:contentDescription="@null"
- android:visibility="gone" />
+ <TextView
+ android:id="@+id/size"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="0.5"
+ android:layout_marginStart="8dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Caption"
+ android:textColor="?android:attr/textColorPrimaryInverse" />
+
+ <ImageView
+ android:id="@android:id/icon2"
+ android:layout_width="@dimen/root_icon_size"
+ android:layout_height="@dimen/root_icon_size"
+ android:layout_marginStart="8dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null"
+ android:visibility="gone" />
+
+ </LinearLayout>
</LinearLayout>
diff --git a/packages/DocumentsUI/res/layout/item_doc_list.xml b/packages/DocumentsUI/res/layout/item_doc_list.xml
index e3a0ddd..50ed2d6 100644
--- a/packages/DocumentsUI/res/layout/item_doc_list.xml
+++ b/packages/DocumentsUI/res/layout/item_doc_list.xml
@@ -14,114 +14,121 @@
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/item_background"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false">
-
- <FrameLayout
- android:id="@android:id/icon"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_marginStart="12dp"
- android:layout_marginEnd="20dp">
-
- <ImageView
- android:id="@+id/icon_mime"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
-
- <ImageView
- android:id="@+id/icon_thumb"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:contentDescription="@null" />
-
- </FrameLayout>
+ android:foreground="@drawable/item_activated">
<LinearLayout
- android:layout_width="0dp"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical">
+ android:minHeight="@dimen/list_item_height"
+ android:paddingStart="@dimen/list_item_padding"
+ android:paddingEnd="@dimen/list_item_padding"
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:baselineAligned="false">
-
- <TextView
- android:id="@android:id/title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:singleLine="true"
- android:ellipsize="middle"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Medium" />
+ <FrameLayout
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/icon_size"
+ android:layout_height="@dimen/icon_size"
+ android:layout_marginEnd="16dp">
<ImageView
- android:id="@android:id/icon1"
- android:layout_width="@dimen/root_icon_size"
- android:layout_height="@dimen/root_icon_size"
- android:layout_marginStart="8dp"
+ android:id="@+id/icon_mime"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
android:scaleType="centerInside"
android:contentDescription="@null" />
- </LinearLayout>
+ <ImageView
+ android:id="@+id/icon_thumb"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ android:contentDescription="@null" />
+
+ </FrameLayout>
<LinearLayout
- android:id="@+id/line2"
- android:layout_width="match_parent"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:orientation="horizontal"
- android:baselineAligned="false">
+ android:layout_weight="1"
+ android:orientation="vertical">
- <TextView
- android:id="@+id/date"
- android:layout_width="90dp"
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ android:orientation="horizontal"
+ android:baselineAligned="false">
- <TextView
- android:id="@+id/size"
- android:layout_width="90dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:ellipsize="middle"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimary" />
- <TextView
- android:id="@android:id/summary"
- android:layout_width="0dp"
+ <ImageView
+ android:id="@android:id/icon1"
+ android:layout_width="@dimen/root_icon_size"
+ android:layout_height="@dimen/root_icon_size"
+ android:layout_marginStart="8dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/line2"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginStart="8dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAlignment="viewStart"
- style="@style/TextAppearance.Small" />
+ android:gravity="center_vertical"
+ android:orientation="horizontal"
+ android:baselineAligned="false">
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="90dp"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <TextView
+ android:id="@+id/size"
+ android:layout_width="90dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginStart="8dp"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
-</LinearLayout>
+</FrameLayout>
diff --git a/packages/DocumentsUI/res/layout/item_loading_grid.xml b/packages/DocumentsUI/res/layout/item_loading_grid.xml
index 0bf6137..005a111 100644
--- a/packages/DocumentsUI/res/layout/item_loading_grid.xml
+++ b/packages/DocumentsUI/res/layout/item_loading_grid.xml
@@ -17,11 +17,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/grid_height"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
android:orientation="horizontal">
<ProgressBar
diff --git a/packages/DocumentsUI/res/layout/item_loading_list.xml b/packages/DocumentsUI/res/layout/item_loading_list.xml
index cdcd01d..6f214ed 100644
--- a/packages/DocumentsUI/res/layout/item_loading_list.xml
+++ b/packages/DocumentsUI/res/layout/item_loading_list.xml
@@ -17,11 +17,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingTop="8dp"
- android:paddingBottom="8dp">
+ android:minHeight="@dimen/list_item_height">
<ProgressBar
android:layout_width="wrap_content"
diff --git a/packages/DocumentsUI/res/layout/item_message_grid.xml b/packages/DocumentsUI/res/layout/item_message_grid.xml
index b3bdd28..385563d 100644
--- a/packages/DocumentsUI/res/layout/item_message_grid.xml
+++ b/packages/DocumentsUI/res/layout/item_message_grid.xml
@@ -17,11 +17,10 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/grid_height"
- android:paddingTop="?android:attr/listPreferredItemPaddingStart"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
- android:paddingBottom="?android:attr/listPreferredItemPaddingEnd"
- android:foreground="@drawable/item_background">
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp">
<LinearLayout
android:layout_width="match_parent"
@@ -42,9 +41,10 @@
android:gravity="center"
android:maxLines="4"
android:ellipsize="end"
- android:paddingTop="6dp"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textAlignment="viewStart" />
+ android:paddingTop="8dp"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>
diff --git a/packages/DocumentsUI/res/layout/item_message_list.xml b/packages/DocumentsUI/res/layout/item_message_list.xml
index 2bcbc2d..44c8baf 100644
--- a/packages/DocumentsUI/res/layout/item_message_list.xml
+++ b/packages/DocumentsUI/res/layout/item_message_list.xml
@@ -17,23 +17,28 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/item_background"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:minHeight="@dimen/list_item_height"
+ android:paddingStart="@dimen/list_item_padding"
+ android:paddingEnd="@dimen/list_item_padding"
android:paddingTop="8dp"
android:paddingBottom="8dp"
+ android:gravity="center_vertical"
android:orientation="horizontal"
android:baselineAligned="false">
- <ImageView
- android:id="@android:id/icon"
- android:layout_width="@android:dimen/app_icon_size"
- android:layout_height="@android:dimen/app_icon_size"
- android:layout_marginEnd="8dp"
- android:layout_gravity="center_vertical"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
+ <FrameLayout
+ android:layout_width="@dimen/icon_size"
+ android:layout_height="@dimen/icon_size"
+ android:layout_marginEnd="16dp">
+
+ <ImageView
+ android:id="@android:id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
+
+ </FrameLayout>
<TextView
android:id="@android:id/title"
@@ -43,6 +48,7 @@
android:maxLines="2"
android:ellipsize="end"
android:textAlignment="viewStart"
- android:textAppearance="?android:attr/textAppearanceSmall" />
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>
diff --git a/packages/DocumentsUI/res/drawable/item_doc_grid.xml b/packages/DocumentsUI/res/values-ldrtl/dimens.xml
similarity index 74%
copy from packages/DocumentsUI/res/drawable/item_doc_grid.xml
copy to packages/DocumentsUI/res/values-ldrtl/dimens.xml
index 3f036f7..22f8131 100644
--- a/packages/DocumentsUI/res/drawable/item_doc_grid.xml
+++ b/packages/DocumentsUI/res/values-ldrtl/dimens.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 The Android Open Source Project
+<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,6 +14,6 @@
limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@drawable/ic_grid_card_background" />
-</selector>
+<resources>
+ <bool name="list_divider_inset_left">false</bool>
+</resources>
diff --git a/packages/DocumentsUI/res/values-sw720dp-land/dimens.xml b/packages/DocumentsUI/res/values-sw720dp-land/dimens.xml
index 961608c..c9dee8d 100644
--- a/packages/DocumentsUI/res/values-sw720dp-land/dimens.xml
+++ b/packages/DocumentsUI/res/values-sw720dp-land/dimens.xml
@@ -16,4 +16,10 @@
<resources>
<bool name="always_show_summary">true</bool>
+
+ <dimen name="list_item_height">64dp</dimen>
+ <dimen name="list_item_padding">24dp</dimen>
+
+ <dimen name="list_divider_inset">80dp</dimen>
+
</resources>
diff --git a/packages/DocumentsUI/res/values-sw720dp/dimens.xml b/packages/DocumentsUI/res/values-sw720dp/dimens.xml
index 3a75dfa..75afe01 100644
--- a/packages/DocumentsUI/res/values-sw720dp/dimens.xml
+++ b/packages/DocumentsUI/res/values-sw720dp/dimens.xml
@@ -20,5 +20,9 @@
<item type="dimen" name="dialog_width">85%</item>
<item type="dimen" name="dialog_height">90%</item>
- <dimen name="grid_padding_horiz">20dp</dimen>
+ <dimen name="grid_padding_horiz">24dp</dimen>
+ <dimen name="grid_padding_vert">8dp</dimen>
+
+ <dimen name="grid_item_padding">8dp</dimen>
+
</resources>
diff --git a/packages/DocumentsUI/res/values/colors.xml b/packages/DocumentsUI/res/values/colors.xml
index adeff77..e3d7f2d 100644
--- a/packages/DocumentsUI/res/values/colors.xml
+++ b/packages/DocumentsUI/res/values/colors.xml
@@ -18,4 +18,9 @@
<color name="chip">#ddd</color>
<color name="item_root_pressed">#33cccccc</color>
<color name="item_root_focused">#66cccccc</color>
+
+ <color name="grid_item_background">#ffe1e1e0</color>
+
+ <color name="accent_item_activated">#88009587</color>
+
</resources>
diff --git a/packages/DocumentsUI/res/values/dimens.xml b/packages/DocumentsUI/res/values/dimens.xml
index 924a8d6..83a0bf4 100644
--- a/packages/DocumentsUI/res/values/dimens.xml
+++ b/packages/DocumentsUI/res/values/dimens.xml
@@ -15,14 +15,26 @@
-->
<resources>
- <dimen name="icon_size">32dp</dimen>
+ <dimen name="icon_size">40dp</dimen>
<dimen name="root_icon_size">24dp</dimen>
- <dimen name="grid_width">160dp</dimen>
- <dimen name="grid_height">170dp</dimen>
- <dimen name="grid_padding">4dp</dimen>
+ <dimen name="grid_width">160dp</dimen>
+ <dimen name="grid_height">176dp</dimen>
+
+ <dimen name="grid_item_width">160dp</dimen>
+ <dimen name="grid_item_height">176dp</dimen>
+ <dimen name="grid_item_padding">4dp</dimen>
+
<dimen name="grid_padding_horiz">4dp</dimen>
+ <dimen name="grid_padding_vert">4dp</dimen>
+
+ <dimen name="list_item_height">72dp</dimen>
+ <dimen name="list_item_padding">16dp</dimen>
+
+ <dimen name="list_divider_inset">72dp</dimen>
+ <bool name="list_divider_inset_left">true</bool>
<bool name="show_as_dialog">false</bool>
<bool name="always_show_summary">false</bool>
+
</resources>
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryContainerView.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryContainerView.java
index 77595b6..00b3c87 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryContainerView.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryContainerView.java
@@ -29,12 +29,18 @@
public DirectoryContainerView(Context context) {
super(context);
- setClipChildren(false);
}
public DirectoryContainerView(Context context, AttributeSet attrs) {
super(context, attrs);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
setClipChildren(false);
+ setClipToOutline(false);
+ setClipToPadding(false);
}
@Override
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
index 9069a55..e013cc3 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
@@ -38,6 +38,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.Loader;
+import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Point;
@@ -187,6 +188,7 @@
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final Context context = inflater.getContext();
+ final Resources res = context.getResources();
final View view = inflater.inflate(R.layout.fragment_directory, container, false);
mEmptyView = view.findViewById(android.R.id.empty);
@@ -196,6 +198,16 @@
mListView.setMultiChoiceModeListener(mMultiListener);
mListView.setRecyclerListener(mRecycleListener);
+ // Indent our list divider to align with text
+ final Drawable divider = mListView.getDivider();
+ final boolean insetLeft = res.getBoolean(R.bool.list_divider_inset_left);
+ final int insetSize = res.getDimensionPixelSize(R.dimen.list_divider_inset);
+ if (insetLeft) {
+ mListView.setDivider(new InsetDrawable(divider, insetSize, 0, 0, 0));
+ } else {
+ mListView.setDivider(new InsetDrawable(divider, 0, 0, insetSize, 0));
+ }
+
mGridView = (GridView) view.findViewById(R.id.grid);
mGridView.setOnItemClickListener(mItemListener);
mGridView.setMultiChoiceModeListener(mMultiListener);
@@ -693,11 +705,11 @@
if (extras != null) {
final String info = extras.getString(DocumentsContract.EXTRA_INFO);
if (info != null) {
- mFooters.add(new MessageFooter(2, R.drawable.ic_dialog_info, info));
+ mFooters.add(new MessageFooter(2, R.drawable.ic_dialog_info_dark, info));
}
final String error = extras.getString(DocumentsContract.EXTRA_ERROR);
if (error != null) {
- mFooters.add(new MessageFooter(3, R.drawable.ic_dialog_alert, error));
+ mFooters.add(new MessageFooter(3, R.drawable.ic_dialog_alert_dark, error));
}
if (extras.getBoolean(DocumentsContract.EXTRA_LOADING, false)) {
mFooters.add(new LoadingFooter());
@@ -706,7 +718,7 @@
if (result != null && result.exception != null) {
mFooters.add(new MessageFooter(
- 3, R.drawable.ic_dialog_alert, getString(R.string.query_error)));
+ 3, R.drawable.ic_dialog_alert_dark, getString(R.string.query_error)));
}
if (isEmpty()) {
@@ -748,21 +760,6 @@
convertView = inflater.inflate(R.layout.item_doc_list, parent, false);
} else if (state.derivedMode == MODE_GRID) {
convertView = inflater.inflate(R.layout.item_doc_grid, parent, false);
-
- // Apply padding to grid items
- final FrameLayout grid = (FrameLayout) convertView;
- final int gridPadding = getResources()
- .getDimensionPixelSize(R.dimen.grid_padding);
-
- // Tricksy hobbitses! We need to fully clear the drawable so
- // the view doesn't clobber the new InsetDrawable callback
- // when setting back later.
- final Drawable fg = grid.getForeground();
- final Drawable bg = grid.getBackground();
- grid.setForeground(null);
- grid.setBackground(null);
- grid.setForeground(new InsetDrawable(fg, gridPadding));
- grid.setBackground(new InsetDrawable(bg, gridPadding));
} else {
throw new IllegalStateException();
}
@@ -882,7 +879,8 @@
// hint to remind user they're a directory.
if (Document.MIME_TYPE_DIR.equals(docMimeType) && state.derivedMode == MODE_GRID
&& showThumbnail) {
- iconDrawable = context.getResources().getDrawable(R.drawable.ic_root_folder);
+ iconDrawable = context.getResources().getDrawable(
+ R.drawable.ic_root_folder_dark);
}
if (summary != null) {
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java
index b552e5a..c163c46 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryView.java
@@ -40,8 +40,13 @@
public void setBackground(Drawable background) {
final Rect rect = new Rect();
background.getPadding(rect);
- final InsetDrawable inset = new InsetDrawable(background, -rect.left, 0, -rect.right, 0);
- super.setBackground(inset);
+
+ final boolean insetLeft = getResources().getBoolean(R.bool.list_divider_inset_left);
+ if (insetLeft) {
+ super.setBackground(new InsetDrawable(background, -rect.left, 0, -rect.right, 0));
+ } else {
+ super.setBackground(new InsetDrawable(background, -rect.right, 0, -rect.left, 0));
+ }
}
@Override
diff --git a/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java b/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
index 71fd100..eaa74eb 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/IconUtils.java
@@ -45,7 +45,7 @@
add("application/vnd.android.package-archive", icon);
// Audio
- icon = R.drawable.ic_doc_audio;
+ icon = R.drawable.ic_doc_audio_dark;
add("application/ogg", icon);
add("application/x-flac", icon);
@@ -132,7 +132,7 @@
add("application/x-font-ttf", icon);
// Image
- icon = R.drawable.ic_doc_image;
+ icon = R.drawable.ic_doc_image_dark;
add("application/vnd.oasis.opendocument.graphics", icon);
add("application/vnd.oasis.opendocument.graphics-template", icon);
add("application/vnd.oasis.opendocument.image", icon);
@@ -186,7 +186,7 @@
add("application/x-kword", icon);
// Video
- icon = R.drawable.ic_doc_video;
+ icon = R.drawable.ic_doc_video_dark;
add("application/x-quicktimeplayer", icon);
add("application/x-shockwave-flash", icon);
}
@@ -220,7 +220,7 @@
if (mode == DocumentsActivity.State.MODE_GRID) {
return res.getDrawable(R.drawable.ic_grid_folder);
} else {
- return res.getDrawable(R.drawable.ic_root_folder);
+ return res.getDrawable(R.drawable.ic_root_folder_dark);
}
}
@@ -232,7 +232,7 @@
if (Document.MIME_TYPE_DIR.equals(mimeType)) {
// TODO: return a mipmap, since this is used for grid
- return res.getDrawable(R.drawable.ic_root_folder);
+ return res.getDrawable(R.drawable.ic_root_folder_dark);
}
// Look for exact match first
@@ -249,13 +249,13 @@
// Otherwise look for partial match
final String typeOnly = mimeType.split("/")[0];
if ("audio".equals(typeOnly)) {
- return res.getDrawable(R.drawable.ic_doc_audio);
+ return res.getDrawable(R.drawable.ic_doc_audio_dark);
} else if ("image".equals(typeOnly)) {
- return res.getDrawable(R.drawable.ic_doc_image);
+ return res.getDrawable(R.drawable.ic_doc_image_dark);
} else if ("text".equals(typeOnly)) {
return res.getDrawable(R.drawable.ic_doc_text);
} else if ("video".equals(typeOnly)) {
- return res.getDrawable(R.drawable.ic_doc_video);
+ return res.getDrawable(R.drawable.ic_doc_video_dark);
} else {
return res.getDrawable(R.drawable.ic_doc_generic);
}
diff --git a/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java b/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java
index caa7581..d06e858 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/RootsCache.java
@@ -103,7 +103,7 @@
// Special root for recents
mRecentsRoot.authority = null;
mRecentsRoot.rootId = null;
- mRecentsRoot.icon = R.drawable.ic_root_recent;
+ mRecentsRoot.icon = R.drawable.ic_root_recent_dark;
mRecentsRoot.flags = Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_CREATE
| Root.FLAG_SUPPORTS_IS_CHILD;
mRecentsRoot.title = mContext.getString(R.string.root_recent);
diff --git a/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java b/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java
index e220c9e..efa7785 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/model/RootInfo.java
@@ -159,15 +159,15 @@
// TODO: remove these special case icons
if (isExternalStorage()) {
- derivedIcon = R.drawable.ic_root_sdcard;
+ derivedIcon = R.drawable.ic_root_sdcard_dark;
} else if (isDownloads()) {
- derivedIcon = R.drawable.ic_root_download;
+ derivedIcon = R.drawable.ic_root_download_dark;
} else if (isImages()) {
- derivedIcon = R.drawable.ic_doc_image;
+ derivedIcon = R.drawable.ic_doc_image_dark;
} else if (isVideos()) {
- derivedIcon = R.drawable.ic_doc_video;
+ derivedIcon = R.drawable.ic_doc_video_dark;
} else if (isAudio()) {
- derivedIcon = R.drawable.ic_doc_audio;
+ derivedIcon = R.drawable.ic_doc_audio_dark;
}
}
diff --git a/packages/Keyguard/res/drawable-hdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-hdpi/ic_alarm_small.png
deleted file mode 100644
index 3819029..0000000
--- a/packages/Keyguard/res/drawable-hdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-mdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-mdpi/ic_alarm_small.png
deleted file mode 100644
index 2aeedaf..0000000
--- a/packages/Keyguard/res/drawable-mdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_alarm_small.png
deleted file mode 100644
index e28b3f6..0000000
--- a/packages/Keyguard/res/drawable-sw600dp-hdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_alarm_small.png
deleted file mode 100644
index f727d01..0000000
--- a/packages/Keyguard/res/drawable-sw600dp-mdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_alarm_small.png
deleted file mode 100644
index d9c0623..0000000
--- a/packages/Keyguard/res/drawable-sw600dp-xhdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-sw600dp-xxhdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-sw600dp-xxhdpi/ic_alarm_small.png
deleted file mode 100644
index a36bf1f..0000000
--- a/packages/Keyguard/res/drawable-sw600dp-xxhdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xhdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-xhdpi/ic_alarm_small.png
deleted file mode 100644
index 0290bdc..0000000
--- a/packages/Keyguard/res/drawable-xhdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable-xxhdpi/ic_alarm_small.png b/packages/Keyguard/res/drawable-xxhdpi/ic_alarm_small.png
deleted file mode 100644
index 66968e8..0000000
--- a/packages/Keyguard/res/drawable-xxhdpi/ic_alarm_small.png
+++ /dev/null
Binary files differ
diff --git a/packages/Keyguard/res/drawable/ic_access_alarms_big.xml b/packages/Keyguard/res/drawable/ic_access_alarms_big.xml
new file mode 100644
index 0000000..84ccb7c
--- /dev/null
+++ b/packages/Keyguard/res/drawable/ic_access_alarms_big.xml
@@ -0,0 +1,25 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="18dp"
+ android:height="18dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+
+ <path
+ android:fillColor="@color/clock_gray"
+ android:pathData="M22.0,5.7l-4.6,-3.9l-1.3,1.5l4.6,3.9L22.0,5.7zM7.9,3.4L6.6,1.9L2.0,5.7l1.3,1.5L7.9,3.4zM12.5,8.0L11.0,8.0l0.0,6.0l4.7,2.9l0.8,-1.2l-4.0,-2.4L12.5,8.0zM12.0,4.0c-5.0,0.0 -9.0,4.0 -9.0,9.0c0.0,5.0 4.0,9.0 9.0,9.0s9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0zM12.0,20.0c-3.9,0.0 -7.0,-3.1 -7.0,-7.0c0.0,-3.9 3.1,-7.0 7.0,-7.0c3.9,0.0 7.0,3.1 7.0,7.0C19.0,16.9 15.9,20.0 12.0,20.0z"/>
+</vector>
diff --git a/packages/Keyguard/res/drawable/ic_backspace_24dp.xml b/packages/Keyguard/res/drawable/ic_backspace_24dp.xml
index 9e5016d..47c8d14 100644
--- a/packages/Keyguard/res/drawable/ic_backspace_24dp.xml
+++ b/packages/Keyguard/res/drawable/ic_backspace_24dp.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
android:pathData="M44.0,6.0L14.0,6.0c-1.4,0.0 -2.5,0.7 -3.2,1.8L0.0,24.0l10.8,16.2c0.7,1.1 1.8,1.8 3.2,1.8l30.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L48.0,10.0C48.0,7.8 46.2,6.0 44.0,6.0zM38.0,31.2L35.2,34.0L28.0,26.8L20.8,34.0L18.0,31.2l7.2,-7.2L18.0,16.8l2.8,-2.8l7.2,7.2l7.2,-7.2l2.8,2.8L30.8,24.0L38.0,31.2z"/>
</vector>
diff --git a/packages/Keyguard/res/layout/keyguard_status_area.xml b/packages/Keyguard/res/layout/keyguard_status_area.xml
index 2730517..7d8977c 100644
--- a/packages/Keyguard/res/layout/keyguard_status_area.xml
+++ b/packages/Keyguard/res/layout/keyguard_status_area.xml
@@ -35,13 +35,11 @@
<TextView android:id="@+id/alarm_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:drawablePadding="2dip"
- android:drawableLeft="@drawable/ic_alarm_small"
- android:drawableStart="@drawable/ic_alarm_small"
+ android:drawablePadding="6dp"
+ android:drawableStart="@drawable/ic_access_alarms_big"
android:textColor="@color/clock_gray"
style="@style/widget_label"
- android:layout_marginLeft="8dip"
- android:layout_marginStart="8dip"
+ android:layout_marginStart="6dp"
android:gravity="center"
android:visibility="gone"
/>
diff --git a/packages/Keyguard/res/values-zh-rCN/strings.xml b/packages/Keyguard/res/values-zh-rCN/strings.xml
index 09f521a..1e124b8 100644
--- a/packages/Keyguard/res/values-zh-rCN/strings.xml
+++ b/packages/Keyguard/res/values-zh-rCN/strings.xml
@@ -22,9 +22,9 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name" msgid="719438068451601849">"Keyguard"</string>
<string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"输入 PIN 码"</string>
- <string name="keyguard_password_enter_puk_code" msgid="3035856550289724338">"请输入 SIM 卡 PUK 码和新的 PIN 码"</string>
- <string name="keyguard_password_enter_puk_prompt" msgid="1801941051094974609">"SIM 卡 PUK 码"</string>
- <string name="keyguard_password_enter_pin_prompt" msgid="3201151840570492538">"新 SIM 卡 PIN 码"</string>
+ <string name="keyguard_password_enter_puk_code" msgid="3035856550289724338">"请输入SIM卡PUK码和新的 PIN 码"</string>
+ <string name="keyguard_password_enter_puk_prompt" msgid="1801941051094974609">"SIM卡PUK码"</string>
+ <string name="keyguard_password_enter_pin_prompt" msgid="3201151840570492538">"新SIM卡PIN码"</string>
<string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"触摸可输入密码"</font></string>
<string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"输入密码以解锁"</string>
<string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"输入 PIN 进行解锁"</string>
@@ -36,16 +36,16 @@
<string name="keyguard_low_battery" msgid="8143808018719173859">"请连接充电器。"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="1332288268600329841">"按“菜单”键解锁。"</string>
<string name="keyguard_network_locked_message" msgid="9169717779058037168">"网络已锁定"</string>
- <string name="keyguard_missing_sim_message_short" msgid="494980561304211931">"无 SIM 卡"</string>
- <string name="keyguard_missing_sim_message" product="tablet" msgid="1445849005909260039">"平板电脑中没有 SIM 卡。"</string>
- <string name="keyguard_missing_sim_message" product="default" msgid="3481110395508637643">"手机中没有 SIM 卡。"</string>
- <string name="keyguard_missing_sim_instructions" msgid="5210891509995942250">"请插入 SIM 卡。"</string>
- <string name="keyguard_missing_sim_instructions_long" msgid="5968985489463870358">"SIM 卡缺失或无法读取,请插入 SIM 卡。"</string>
- <string name="keyguard_permanent_disabled_sim_message_short" msgid="8340813989586622356">"SIM 卡无法使用。"</string>
- <string name="keyguard_permanent_disabled_sim_instructions" msgid="5892940909699723544">"您的 SIM 卡已永久停用。\n请与您的无线服务提供商联系,以便重新获取一张 SIM 卡。"</string>
- <string name="keyguard_sim_locked_message" msgid="6875773413306380902">"SIM 卡已被锁定。"</string>
- <string name="keyguard_sim_puk_locked_message" msgid="3747232467471801633">"SIM 卡已被 PUK 锁定。"</string>
- <string name="keyguard_sim_unlock_progress_dialog_message" msgid="7975221805033614426">"正在解锁 SIM 卡..."</string>
+ <string name="keyguard_missing_sim_message_short" msgid="494980561304211931">"无SIM卡"</string>
+ <string name="keyguard_missing_sim_message" product="tablet" msgid="1445849005909260039">"平板电脑中没有SIM卡。"</string>
+ <string name="keyguard_missing_sim_message" product="default" msgid="3481110395508637643">"手机中没有SIM卡。"</string>
+ <string name="keyguard_missing_sim_instructions" msgid="5210891509995942250">"请插入SIM卡。"</string>
+ <string name="keyguard_missing_sim_instructions_long" msgid="5968985489463870358">"SIM卡缺失或无法读取,请插入SIM卡。"</string>
+ <string name="keyguard_permanent_disabled_sim_message_short" msgid="8340813989586622356">"SIM卡无法使用。"</string>
+ <string name="keyguard_permanent_disabled_sim_instructions" msgid="5892940909699723544">"您的SIM卡已永久停用。\n请与您的无线服务提供商联系,以便重新获取一张SIM卡。"</string>
+ <string name="keyguard_sim_locked_message" msgid="6875773413306380902">"SIM卡已被锁定。"</string>
+ <string name="keyguard_sim_puk_locked_message" msgid="3747232467471801633">"SIM卡已被PUK码锁定。"</string>
+ <string name="keyguard_sim_unlock_progress_dialog_message" msgid="7975221805033614426">"正在解锁SIM卡..."</string>
<string name="keyguard_accessibility_widget_changed" msgid="5678624624681400191">"%1$s。%3$d的小部件%2$d。"</string>
<string name="keyguard_accessibility_add_widget" msgid="8273277058724924654">"添加小部件。"</string>
<string name="keyguard_accessibility_widget_empty_slot" msgid="1281505703307930757">"空白"</string>
@@ -106,16 +106,16 @@
<string name="kg_wrong_pin" msgid="1131306510833563801">"PIN 有误"</string>
<string name="kg_too_many_failed_attempts_countdown" msgid="6358110221603297548">"请在 <xliff:g id="NUMBER">%d</xliff:g> 秒后重试。"</string>
<string name="kg_pattern_instructions" msgid="398978611683075868">"绘制您的图案"</string>
- <string name="kg_sim_pin_instructions" msgid="2319508550934557331">"输入 SIM PIN"</string>
+ <string name="kg_sim_pin_instructions" msgid="2319508550934557331">"输入SIM卡PIN码"</string>
<string name="kg_pin_instructions" msgid="2377242233495111557">"输入 PIN"</string>
<string name="kg_password_instructions" msgid="5753646556186936819">"输入密码"</string>
- <string name="kg_puk_enter_puk_hint" msgid="453227143861735537">"SIM 卡已被停用,需要输入 PUK 码才能继续使用。有关详情,请联系您的运营商。"</string>
+ <string name="kg_puk_enter_puk_hint" msgid="453227143861735537">"SIM卡已被停用,需要输入PUK码才能继续使用。有关详情,请联系您的运营商。"</string>
<string name="kg_puk_enter_pin_hint" msgid="7871604527429602024">"请输入所需 PIN 码"</string>
<string name="kg_enter_confirm_pin_hint" msgid="325676184762529976">"请确认所需 PIN 码"</string>
- <string name="kg_sim_unlock_progress_dialog_message" msgid="8950398016976865762">"正在解锁 SIM 卡..."</string>
+ <string name="kg_sim_unlock_progress_dialog_message" msgid="8950398016976865762">"正在解锁SIM卡..."</string>
<string name="kg_invalid_sim_pin_hint" msgid="8795159358110620001">"请输入 4 至 8 位数的 PIN。"</string>
- <string name="kg_invalid_sim_puk_hint" msgid="7553388325654369575">"PUK 码应至少包含 8 位数字。"</string>
- <string name="kg_invalid_puk" msgid="3638289409676051243">"请重新输入正确的 PUK 码。如果尝试错误次数过多,SIM 卡将永久停用。"</string>
+ <string name="kg_invalid_sim_puk_hint" msgid="7553388325654369575">"PUK码应至少包含8位数字。"</string>
+ <string name="kg_invalid_puk" msgid="3638289409676051243">"请重新输入正确的PUK码。如果尝试错误次数过多,SIM卡将永久停用。"</string>
<string name="kg_invalid_confirm_pin_hint" product="default" msgid="7003469261464593516">"PIN 码不匹配"</string>
<string name="kg_login_too_many_attempts" msgid="6486842094005698475">"图案尝试次数过多"</string>
<string name="kg_login_instructions" msgid="1100551261265506448">"要解锁,请登录您的 Google 帐户。"</string>
@@ -136,18 +136,18 @@
<string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"您已经 <xliff:g id="NUMBER_0">%d</xliff:g> 次错误地绘制了解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件帐户解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%d</xliff:g> 秒后重试。"</string>
<string name="kg_text_message_separator" product="default" msgid="4160700433287233771">" — "</string>
<string name="kg_reordering_delete_drop_target_text" msgid="7899202978204438708">"删除"</string>
- <string name="kg_password_wrong_pin_code_pukked" msgid="30531039455764924">"SIM 卡 PIN 码不正确,您现在必须联系运营商为您解锁设备。"</string>
+ <string name="kg_password_wrong_pin_code_pukked" msgid="30531039455764924">"SIM卡PIN码不正确,您现在必须联系运营商为您解锁设备。"</string>
<plurals name="kg_password_wrong_pin_code">
- <item quantity="one" msgid="8134313997799638254">"SIM 卡 PIN 码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,则必须联系运营商帮您解锁设备。"</item>
- <item quantity="other" msgid="2215723361575359486">"SIM 卡 PIN 码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。"</item>
+ <item quantity="one" msgid="8134313997799638254">"SIM卡PIN码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,则必须联系运营商帮您解锁设备。"</item>
+ <item quantity="other" msgid="2215723361575359486">"SIM卡PIN码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。"</item>
</plurals>
- <string name="kg_password_wrong_puk_code_dead" msgid="7077536808291316208">"SIM 卡无法使用,请与您的运营商联系。"</string>
+ <string name="kg_password_wrong_puk_code_dead" msgid="7077536808291316208">"SIM卡无法使用,请与您的运营商联系。"</string>
<plurals name="kg_password_wrong_puk_code">
- <item quantity="one" msgid="3256893607561060649">"SIM 卡 PUK 码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,SIM 卡将永远无法使用。"</item>
- <item quantity="other" msgid="5477305226026342036">"SIM 卡 PUK 码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,SIM 卡将永远无法使用。"</item>
+ <item quantity="one" msgid="3256893607561060649">"SIM卡PUK码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,SIM卡将永远无法使用。"</item>
+ <item quantity="other" msgid="5477305226026342036">"SIM卡PUK码不正确,您还有<xliff:g id="NUMBER">%d</xliff:g>次尝试机会。如果仍然失败,SIM卡将永远无法使用。"</item>
</plurals>
- <string name="kg_password_pin_failed" msgid="6268288093558031564">"SIM 卡 PIN 码操作失败!"</string>
- <string name="kg_password_puk_failed" msgid="2838824369502455984">"SIM 卡 PUK 码操作失败!"</string>
+ <string name="kg_password_pin_failed" msgid="6268288093558031564">"SIM卡PIN码操作失败!"</string>
+ <string name="kg_password_puk_failed" msgid="2838824369502455984">"SIM卡PUK码操作失败!"</string>
<string name="kg_pin_accepted" msgid="1448241673570020097">"代码正确!"</string>
<string name="keyguard_transport_prev_description" msgid="8229108430245669854">"“上一曲”按钮"</string>
<string name="keyguard_transport_next_description" msgid="4299258300283778305">"“下一曲”按钮"</string>
diff --git a/packages/Keyguard/res/values/donottranslate.xml b/packages/Keyguard/res/values/donottranslate.xml
index 78636db..2f54406 100644
--- a/packages/Keyguard/res/values/donottranslate.xml
+++ b/packages/Keyguard/res/values/donottranslate.xml
@@ -18,6 +18,9 @@
<!-- Skeleton string format for displaying the date. -->
<string name="abbrev_wday_month_day_no_year">EEEEMMMMd</string>
+ <!-- Skeleton string format for displaying the date when an alarm is set. -->
+ <string name="abbrev_wday_month_day_no_year_alarm">EEEMMMMd</string>
+
<!-- Skeleton string format for displaying the time in 12-hour format. -->
<string name="clock_12hr_format">hm</string>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
index 02a441b..daba0a2 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
@@ -71,6 +71,12 @@
public void onScreenTurnedOff(int why) {
setEnableMarquee(false);
}
+
+ @Override
+ public void onUserSwitchComplete(int userId) {
+ refresh();
+ updateOwnerInfo();
+ }
};
public KeyguardStatusView(Context context) {
@@ -110,7 +116,8 @@
}
protected void refresh() {
- Patterns.update(mContext);
+ AlarmClockInfo nextAlarm = mLockPatternUtils.getNextAlarm();
+ Patterns.update(mContext, nextAlarm != null);
mDateView.setFormat24Hour(Patterns.dateView);
mDateView.setFormat12Hour(Patterns.dateView);
@@ -118,25 +125,23 @@
mClockView.setFormat12Hour(Patterns.clockView12);
mClockView.setFormat24Hour(Patterns.clockView24);
- refreshAlarmStatus();
+ refreshAlarmStatus(nextAlarm);
}
- void refreshAlarmStatus() {
- // Update Alarm status
- AlarmClockInfo nextAlarm = mLockPatternUtils.getNextAlarm();
+ void refreshAlarmStatus(AlarmClockInfo nextAlarm) {
if (nextAlarm != null) {
- mAlarmStatusView.setText(formatNextAlarm(nextAlarm));
+ mAlarmStatusView.setText(formatNextAlarm(mContext, nextAlarm));
mAlarmStatusView.setVisibility(View.VISIBLE);
} else {
mAlarmStatusView.setVisibility(View.GONE);
}
}
- String formatNextAlarm(AlarmClockInfo info) {
+ public static String formatNextAlarm(Context context, AlarmClockInfo info) {
if (info == null) {
return "";
}
- String skeleton = DateFormat.is24HourFormat(mContext) ? "EHm" : "Ehma";
+ String skeleton = DateFormat.is24HourFormat(context) ? "EHm" : "Ehma";
String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton);
return DateFormat.format(pattern, info.getTriggerTime()).toString();
}
@@ -191,10 +196,12 @@
static String clockView24;
static String cacheKey;
- static void update(Context context) {
+ static void update(Context context, boolean hasAlarm) {
final Locale locale = Locale.getDefault();
final Resources res = context.getResources();
- final String dateViewSkel = res.getString(R.string.abbrev_wday_month_day_no_year);
+ final String dateViewSkel = res.getString(hasAlarm
+ ? R.string.abbrev_wday_month_day_no_year_alarm
+ : R.string.abbrev_wday_month_day_no_year);
final String clockView12Skel = res.getString(R.string.clock_12hr_format);
final String clockView24Skel = res.getString(R.string.clock_24hr_format);
final String key = locale.toString() + dateViewSkel + clockView12Skel + clockView24Skel;
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index a5dbbcb..f0f5772 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -17,6 +17,7 @@
package com.android.keyguard;
import android.app.ActivityManagerNative;
+import android.app.AlarmManager;
import android.app.IUserSwitchObserver;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
@@ -322,7 +323,8 @@
if (Intent.ACTION_TIME_TICK.equals(action)
|| Intent.ACTION_TIME_CHANGED.equals(action)
- || Intent.ACTION_TIMEZONE_CHANGED.equals(action)) {
+ || Intent.ACTION_TIMEZONE_CHANGED.equals(action)
+ || AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED.equals(action)) {
mHandler.sendEmptyMessage(MSG_TIME_UPDATE);
} else if (TelephonyIntents.SPN_STRINGS_UPDATED_ACTION.equals(action)) {
mTelephonyPlmn = getTelephonyPlmnFrom(intent);
@@ -568,6 +570,7 @@
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
filter.addAction(Intent.ACTION_USER_REMOVED);
+ filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
context.registerReceiver(mBroadcastReceiver, filter);
final IntentFilter bootCompleteFilter = new IntentFilter();
diff --git a/packages/SystemUI/res/drawable/ic_access_alarms_small.xml b/packages/SystemUI/res/drawable/ic_access_alarms_small.xml
new file mode 100644
index 0000000..cf64689
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_access_alarms_small.xml
@@ -0,0 +1,25 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="16dp"
+ android:height="16dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+
+ <path
+ android:fillColor="#64ffffff"
+ android:pathData="M22.0,5.7l-4.6,-3.9l-1.3,1.5l4.6,3.9L22.0,5.7zM7.9,3.4L6.6,1.9L2.0,5.7l1.3,1.5L7.9,3.4zM12.5,8.0L11.0,8.0l0.0,6.0l4.7,2.9l0.8,-1.2l-4.0,-2.4L12.5,8.0zM12.0,4.0c-5.0,0.0 -9.0,4.0 -9.0,9.0c0.0,5.0 4.0,9.0 9.0,9.0s9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0zM12.0,20.0c-3.9,0.0 -7.0,-3.1 -7.0,-7.0c0.0,-3.9 3.1,-7.0 7.0,-7.0c3.9,0.0 7.0,3.1 7.0,7.0C19.0,16.9 15.9,20.0 12.0,20.0z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_account_circle.xml b/packages/SystemUI/res/drawable/ic_account_circle.xml
index 4a4c1c1..d8649e5 100644
--- a/packages/SystemUI/res/drawable/ic_account_circle.xml
+++ b/packages/SystemUI/res/drawable/ic_account_circle.xml
@@ -13,14 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<group
android:scaleX="1.2"
@@ -28,7 +25,7 @@
android:pivotX="12.0"
android:pivotY="12.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,5.0c1.7,0.0 3.0,1.3 3.0,3.0c0.0,1.7 -1.3,3.0 -3.0,3.0c-1.7,0.0 -3.0,-1.3 -3.0,-3.0C9.0,6.3 10.3,5.0 12.0,5.0zM12.0,19.2c-2.5,0.0 -4.7,-1.3 -6.0,-3.2c0.0,-2.0 4.0,-3.1 6.0,-3.1c2.0,0.0 6.0,1.1 6.0,3.1C16.7,17.9 14.5,19.2 12.0,19.2z"/>
</group>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_account_circle_qs_muted.xml b/packages/SystemUI/res/drawable/ic_account_circle_qs_muted.xml
index afcddf1..7b8b89f 100644
--- a/packages/SystemUI/res/drawable/ic_account_circle_qs_muted.xml
+++ b/packages/SystemUI/res/drawable/ic_account_circle_qs_muted.xml
@@ -16,14 +16,11 @@
~ limitations under the License
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<group
android:scaleX="1.2"
@@ -31,7 +28,7 @@
android:pivotX="12.0"
android:pivotY="12.0">
<path
- android:fill="@color/qs_user_detail_icon_muted"
+ android:fillColor="@color/qs_user_detail_icon_muted"
android:pathData="M12.0,2.0C6.5,2.0 2.0,6.5 2.0,12.0s4.5,10.0 10.0,10.0c5.5,0.0 10.0,-4.5 10.0,-10.0S17.5,2.0 12.0,2.0zM12.0,5.0c1.7,0.0 3.0,1.3 3.0,3.0c0.0,1.7 -1.3,3.0 -3.0,3.0c-1.7,0.0 -3.0,-1.3 -3.0,-3.0C9.0,6.3 10.3,5.0 12.0,5.0zM12.0,19.2c-2.5,0.0 -4.7,-1.3 -6.0,-3.2c0.0,-2.0 4.0,-3.1 6.0,-3.1c2.0,0.0 6.0,1.1 6.0,3.1C16.7,17.9 14.5,19.2 12.0,19.2z"/>
</group>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_chevron_left.xml b/packages/SystemUI/res/drawable/ic_chevron_left.xml
index 27c2034..379382b 100644
--- a/packages/SystemUI/res/drawable/ic_chevron_left.xml
+++ b/packages/SystemUI/res/drawable/ic_chevron_left.xml
@@ -13,16 +13,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="36.0"
- android:viewportHeight="36.0"/>
+ android:viewportHeight="36.0">
<path
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
android:pathData="M23.1,11.1l-2.1000004,-2.1000004 -9.0,9.0 9.0,9.0 2.1000004,-2.1000004 -6.8999996,-6.8999996z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_clear_all.xml b/packages/SystemUI/res/drawable/ic_clear_all.xml
index b0f3a5a..187a420 100644
--- a/packages/SystemUI/res/drawable/ic_clear_all.xml
+++ b/packages/SystemUI/res/drawable/ic_clear_all.xml
@@ -13,16 +13,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M10.0,26.0l28.0,0.0l0.0,-4.0L10.0,22.0L10.0,26.0zM6.0,34.0l28.0,0.0l0.0,-4.0L6.0,30.0L6.0,34.0zM14.0,14.0l0.0,4.0l28.0,0.0l0.0,-4.0L14.0,14.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_lock_24dp.xml b/packages/SystemUI/res/drawable/ic_lock_24dp.xml
index b2e486c..204af7e 100644
--- a/packages/SystemUI/res/drawable/ic_lock_24dp.xml
+++ b/packages/SystemUI/res/drawable/ic_lock_24dp.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="@color/keyguard_affordance"
+ android:fillColor="@color/keyguard_affordance"
android:pathData="M18.0,8.0l-1.0,0.0L17.0,6.0c0.0,-2.8 -2.2,-5.0 -5.0,-5.0C9.2,1.0 7.0,3.2 7.0,6.0l0.0,2.0L6.0,8.0c-1.1,0.0 -2.0,0.9 -2.0,2.0l0.0,10.0c0.0,1.1 0.9,2.0 2.0,2.0l12.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L20.0,10.0C20.0,8.9 19.1,8.0 18.0,8.0zM12.0,17.0c-1.1,0.0 -2.0,-0.9 -2.0,-2.0s0.9,-2.0 2.0,-2.0c1.1,0.0 2.0,0.9 2.0,2.0S13.1,17.0 12.0,17.0zM15.1,8.0L8.9,8.0L8.9,6.0c0.0,-1.7 1.4,-3.1 3.1,-3.1c1.7,0.0 3.1,1.4 3.1,3.1L15.1,8.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_lock_open_24dp.xml b/packages/SystemUI/res/drawable/ic_lock_open_24dp.xml
index 28b16dd..c877f06 100644
--- a/packages/SystemUI/res/drawable/ic_lock_open_24dp.xml
+++ b/packages/SystemUI/res/drawable/ic_lock_open_24dp.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="@color/keyguard_affordance"
+ android:fillColor="@color/keyguard_affordance"
android:pathData="M12.0,17.0c1.1,0.0 2.0,-0.9 2.0,-2.0s-0.9,-2.0 -2.0,-2.0c-1.1,0.0 -2.0,0.9 -2.0,2.0S10.9,17.0 12.0,17.0zM18.0,8.0l-1.0,0.0L17.0,6.0c0.0,-2.8 -2.2,-5.0 -5.0,-5.0C9.2,1.0 7.0,3.2 7.0,6.0l1.9,0.0c0.0,-1.7 1.4,-3.1 3.1,-3.1c1.7,0.0 3.1,1.4 3.1,3.1l0.0,2.0L6.0,8.0c-1.1,0.0 -2.0,0.9 -2.0,2.0l0.0,10.0c0.0,1.1 0.9,2.0 2.0,2.0l12.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L20.0,10.0C20.0,8.9 19.1,8.0 18.0,8.0zM18.0,20.0L6.0,20.0L6.0,10.0l12.0,0.0L18.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_lock_to_app_24dp.xml b/packages/SystemUI/res/drawable/ic_lock_to_app_24dp.xml
index e5737ee..2d77949 100644
--- a/packages/SystemUI/res/drawable/ic_lock_to_app_24dp.xml
+++ b/packages/SystemUI/res/drawable/ic_lock_to_app_24dp.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="@color/recents_task_view_lock_to_app_button_color"
+ android:fillColor="@color/recents_task_view_lock_to_app_button_color"
android:pathData="M18.0,8.0l-1.0,0.0L17.0,6.0c0.0,-2.8 -2.2,-5.0 -5.0,-5.0C9.2,1.0 7.0,3.2 7.0,6.0l0.0,2.0L6.0,8.0c-1.1,0.0 -2.0,0.9 -2.0,2.0l0.0,10.0c0.0,1.1 0.9,2.0 2.0,2.0l12.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L20.0,10.0C20.0,8.9 19.1,8.0 18.0,8.0zM12.0,17.0c-1.1,0.0 -2.0,-0.9 -2.0,-2.0s0.9,-2.0 2.0,-2.0c1.1,0.0 2.0,0.9 2.0,2.0S13.1,17.0 12.0,17.0zM15.1,8.0L8.9,8.0L8.9,6.0c0.0,-1.7 1.4,-3.1 3.1,-3.1c1.7,0.0 3.1,1.4 3.1,3.1L15.1,8.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_power_low.xml b/packages/SystemUI/res/drawable/ic_power_low.xml
index 5bb7aba..ba99948 100644
--- a/packages/SystemUI/res/drawable/ic_power_low.xml
+++ b/packages/SystemUI/res/drawable/ic_power_low.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M30.0,6.0L30.0,2.0L18.0,2.0l0.0,4.0l-8.0,0.0l0.0,40.0l28.0,0.0L38.0,6.0L30.0,6.0zM26.0,37.0l-4.0,0.0l0.0,-4.0l4.0,0.0L26.0,37.0zM26.0,30.0l-4.0,0.0L22.0,15.0l4.0,0.0L26.0,30.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_power_saver.xml b/packages/SystemUI/res/drawable/ic_power_saver.xml
index 26e7375..2162d79 100644
--- a/packages/SystemUI/res/drawable/ic_power_saver.xml
+++ b/packages/SystemUI/res/drawable/ic_power_saver.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M30.0,6.0L30.0,2.0L18.0,2.0l0.0,4.0l-8.0,0.0l0.0,40.0l28.0,0.0L38.0,6.0L30.0,6.0zM32.0,28.0l-6.0,0.0l0.0,6.0l-4.0,0.0l0.0,-6.0l-6.0,0.0l0.0,-4.0l6.0,0.0l0.0,-6.0l4.0,0.0l0.0,6.0l6.0,0.0L32.0,28.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml b/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
index c68238f..79a9d409 100644
--- a/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_airplane_off.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M26.0,18.0L26.0,7.0c0.0,-1.7 -1.3,-3.0 -3.0,-3.0c-1.7,0.0 -3.0,1.3 -3.0,3.0l0.0,7.4L35.7,30.0l6.3,2.0l0.0,-4.0L26.0,18.0zM6.0,10.5l10.0,10.0L4.0,28.0l0.0,4.0l16.0,-5.0l0.0,11.0l-4.0,3.0l0.0,3.0l7.0,-2.0l7.0,2.0l0.0,-3.0l-4.0,-3.0l0.0,-7.5L37.5,42.0l2.5,-2.5L8.5,8.0L6.0,10.5z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml b/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
index c1e3c7e..5d5d257 100644
--- a/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_airplane_on.xml
@@ -13,19 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M20.4,18.0"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M42.0,32.0l0.0,-4.0L26.0,18.0L26.0,7.0c0.0,-1.7 -1.3,-3.0 -3.0,-3.0c-1.7,0.0 -3.0,1.3 -3.0,3.0l0.0,11.0L4.0,28.0l0.0,4.0l16.0,-5.0l0.0,11.0l-4.0,3.0l0.0,3.0l7.0,-2.0l7.0,2.0l0.0,-3.0l-4.0,-3.0L26.0,27.0L42.0,32.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_back.xml b/packages/SystemUI/res/drawable/ic_qs_back.xml
index 52039f5..f00ba03 100644
--- a/packages/SystemUI/res/drawable/ic_qs_back.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_back.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M20.0,11.0L7.8,11.0l5.6,-5.6L12.0,4.0l-8.0,8.0l8.0,8.0l1.4,-1.4L7.8,13.0L20.0,13.0L20.0,11.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
index 3957d02..0c65389 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connected.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M14.0,24.0l-4.0,-4.0l-4.0,4.0l4.0,4.0L14.0,24.0zM35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6zM38.0,20.0l-4.0,4.0l4.0,4.0l4.0,-4.0L38.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth_connecting.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connecting.xml
index e4038f9..b9a315c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth_connecting.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_connecting.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M28.5,24.0l4.6,4.6c0.6,-1.4 0.9,-3.0 0.9,-4.7c0.0,-1.6 -0.3,-3.2 -0.9,-4.6L28.5,24.0zM39.1,13.4L36.5,16.0c1.3,2.4 2.0,5.1 2.0,8.0s-0.7,5.6 -2.0,8.0l2.4,2.4c1.9,-3.1 3.1,-6.7 3.1,-10.6C42.0,20.0 40.9,16.5 39.1,13.4zM31.4,15.4L20.0,4.0l-2.0,0.0l0.0,15.2L8.8,10.0L6.0,12.8L17.2,24.0L6.0,35.2L8.8,38.0l9.2,-9.2L18.0,44.0l2.0,0.0l11.4,-11.4L22.8,24.0L31.4,15.4zM22.0,11.7l3.8,3.8L22.0,19.2L22.0,11.7zM25.8,32.6L22.0,36.3l0.0,-7.5L25.8,32.6z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth_detail_empty.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_detail_empty.xml
index aa0b369..dd92126 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth_detail_empty.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_detail_empty.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
- android:height="56dp"/>
-
- <viewport
+ android:height="56dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="@color/qs_detail_empty"
+ android:fillColor="@color/qs_detail_empty"
android:pathData="M35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
index 00c5af8..0cb1f32 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_off.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M26.0,11.8l3.8,3.8l-3.2,3.2l2.8,2.8l6.0,-6.0L24.0,4.2l-2.0,0.0l0.0,10.1l4.0,4.0L26.0,11.8zM10.8,8.2L8.0,11.0l13.2,13.2L10.0,35.3l2.8,2.8L22.0,29.0l0.0,15.2l2.0,0.0l8.6,-8.6l4.6,4.6l2.8,-2.8L10.8,8.2zM26.0,36.5L26.0,29.0l3.8,3.8L26.0,36.5z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml b/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
index 2b14f33..9a68dad 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bluetooth_on.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_bugreport.xml b/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
index 2958848..0df1a96 100644
--- a/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_bugreport.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M20.0,8.0l-2.8,0.0c-0.5,-0.8 -1.1,-1.5 -1.8,-2.0L17.0,4.4L15.6,3.0l-2.2,2.2C13.0,5.1 12.5,5.0 12.0,5.0s-1.0,0.1 -1.4,0.2L8.4,3.0L7.0,4.4L8.6,6.0C7.9,6.5 7.3,7.2 6.8,8.0L4.0,8.0l0.0,2.0l2.1,0.0C6.0,10.3 6.0,10.7 6.0,11.0l0.0,1.0L4.0,12.0l0.0,2.0l2.0,0.0l0.0,1.0c0.0,0.3 0.0,0.7 0.1,1.0L4.0,16.0l0.0,2.0l2.8,0.0c1.0,1.8 3.0,3.0 5.2,3.0s4.2,-1.2 5.2,-3.0L20.0,18.0l0.0,-2.0l-2.1,0.0c0.1,-0.3 0.1,-0.7 0.1,-1.0l0.0,-1.0l2.0,0.0l0.0,-2.0l-2.0,0.0l0.0,-1.0c0.0,-0.3 0.0,-0.7 -0.1,-1.0L20.0,10.0L20.0,8.0zM14.0,16.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,16.0zM14.0,12.0l-4.0,0.0l0.0,-2.0l4.0,0.0L14.0,12.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cancel.xml b/packages/SystemUI/res/drawable/ic_qs_cancel.xml
index de72f13..e4f4174 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cancel.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cancel.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.0,4.0C12.9,4.0 4.0,12.9 4.0,24.0s8.9,20.0 20.0,20.0c11.1,0.0 20.0,-8.9 20.0,-20.0S35.1,4.0 24.0,4.0zM34.0,31.2L31.2,34.0L24.0,26.8L16.8,34.0L14.0,31.2l7.2,-7.2L14.0,16.8l2.8,-2.8l7.2,7.2l7.2,-7.2l2.8,2.8L26.8,24.0L34.0,31.2z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast_detail_empty.xml b/packages/SystemUI/res/drawable/ic_qs_cast_detail_empty.xml
index fbc21d4..59dcea2 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cast_detail_empty.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cast_detail_empty.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
- android:height="56dp"/>
-
- <viewport
+ android:height="56dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="@color/qs_detail_empty"
+ android:fillColor="@color/qs_detail_empty"
android:pathData="M42.0,6.0L6.0,6.0c-2.2,0.0 -4.0,1.8 -4.0,4.0l0.0,6.0l4.0,0.0l0.0,-6.0l36.0,0.0l0.0,28.0L28.0,38.0l0.0,4.0l14.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L46.0,10.0C46.0,7.8 44.2,6.0 42.0,6.0zM2.0,36.0l0.0,6.0l6.0,0.0C8.0,38.7 5.3,36.0 2.0,36.0zM2.0,28.0l0.0,4.0c5.5,0.0 10.0,4.5 10.0,10.0l4.0,0.0C16.0,34.3 9.7,28.0 2.0,28.0zM2.0,20.0l0.0,4.0c9.9,0.0 18.0,8.1 18.0,18.0l4.0,0.0C24.0,29.8 14.1,20.0 2.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast_off.xml b/packages/SystemUI/res/drawable/ic_qs_cast_off.xml
index 2a9541e..8051795 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cast_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cast_off.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M42.0,6.0L6.0,6.0c-2.2,0.0 -4.0,1.8 -4.0,4.0l0.0,6.0l4.0,0.0l0.0,-6.0l36.0,0.0l0.0,28.0L28.0,38.0l0.0,4.0l14.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L46.0,10.0C46.0,7.8 44.2,6.0 42.0,6.0zM2.0,36.0l0.0,6.0l6.0,0.0C8.0,38.7 5.3,36.0 2.0,36.0zM2.0,28.0l0.0,4.0c5.5,0.0 10.0,4.5 10.0,10.0l4.0,0.0C16.0,34.3 9.7,28.0 2.0,28.0zM2.0,20.0l0.0,4.0c9.9,0.0 18.0,8.1 18.0,18.0l4.0,0.0C24.0,29.8 14.1,20.0 2.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_cast_on.xml b/packages/SystemUI/res/drawable/ic_qs_cast_on.xml
index 159bf65..794eb9e 100644
--- a/packages/SystemUI/res/drawable/ic_qs_cast_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_cast_on.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M2.0,36.0l0.0,6.0l6.0,0.0C8.0,38.7 5.3,36.0 2.0,36.0zM2.0,28.0l0.0,4.0c5.5,0.0 10.0,4.5 10.0,10.0l4.0,0.0C16.0,34.3 9.7,28.0 2.0,28.0zM38.0,14.0L10.0,14.0l0.0,3.3c7.9,2.6 14.2,8.8 16.7,16.7L38.0,34.0L38.0,14.0zM2.0,20.0l0.0,4.0c9.9,0.0 18.0,8.1 18.0,18.0l4.0,0.0C24.0,29.8 14.1,20.0 2.0,20.0zM42.0,6.0L6.0,6.0c-2.2,0.0 -4.0,1.8 -4.0,4.0l0.0,6.0l4.0,0.0l0.0,-6.0l36.0,0.0l0.0,28.0L28.0,38.0l0.0,4.0l14.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L46.0,10.0C46.0,7.8 44.2,6.0 42.0,6.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_flashlight_off.xml b/packages/SystemUI/res/drawable/ic_qs_flashlight_off.xml
index 0f30be2..d4bd76f 100644
--- a/packages/SystemUI/res/drawable/ic_qs_flashlight_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_flashlight_off.xml
@@ -13,22 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.0dp"
- android:height="64.0dp"/>
-
- <viewport
+ android:height="64.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M14.708,11.394l14.899,14.9l0.0,-6.771c4.359,-2.353 3.831,-7.489 3.831,-7.489l0.0,-0.64L14.708,11.393998z"/>
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M14.568,4.0l18.87,0.0l0.0,3.917l-18.87,0.0z"/>
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M38.284,39.427l-29.767,-29.766998 -2.4750004,2.4750004 12.351999,12.351 0.0,19.514 11.213001,0.0 0.0,-8.300999 6.2019978,6.2019997z"/>
</vector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/ic_qs_flashlight_on.xml b/packages/SystemUI/res/drawable/ic_qs_flashlight_on.xml
index 2e9d4013..5514b44c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_flashlight_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_flashlight_on.xml
@@ -13,19 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.0dp"
- android:height="64.0dp"/>
-
- <viewport
+ android:height="64.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M33.438,12.034l0.0,-0.64l-18.87,0.0l0.0,0.64c0.0,0.0 -0.581,5.189 3.826,7.523L18.394,44.0l11.213,0.0L29.606998,19.523C33.966,17.17 33.438,12.034 33.438,12.034zM24.0,27.697c-1.523,0.0 -2.757,-1.234 -2.757,-2.757c0.0,-1.523 1.234,-2.757 2.757,-2.757c1.523,0.0 2.757,1.234 2.757,2.757C26.757,26.462 25.523,27.697 24.0,27.697z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M14.568,4.0l18.87,0.0l0.0,3.917l-18.87,0.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml b/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
index 0a00d14..d68ee4c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_hotspot_off.xml
@@ -13,16 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.0dp"
- android:height="64.0dp"/>
-
- <viewport
+ android:height="64.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
-
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M35.099998,28.500000c0.600000,-1.400000 0.900000,-2.900000 0.900000,-4.500000c0.000000,-6.600000 -5.400000,-12.000000 -12.000000,-12.000000c-1.600000,0.000000 -3.100000,0.300000 -4.500000,0.900000l3.200000,3.200000c0.400000,-0.100000 0.800000,-0.100000 1.200000,-0.100000c4.400000,0.000000 8.000000,3.600000 8.000000,8.000000c0.000000,0.400000 0.000000,0.800000 -0.100000,1.300000L35.099998,28.500000zM24.000000,8.000000c8.800000,0.000000 16.000000,7.200000 16.000000,16.000000c0.000000,2.700000 -0.700000,5.200000 -1.900000,7.500000l2.900000,2.900000c1.900000,-3.000000 3.000000,-6.600000 3.000000,-10.400000c0.000000,-11.000000 -9.000000,-20.000000 -20.000000,-20.000000c-3.800000,0.000000 -7.400000,1.100000 -10.400000,2.900000l2.900000,2.900000C18.700001,8.700000 21.299999,8.000000 24.000000,8.000000zM6.500000,5.000000L4.000000,7.500000l4.200000,4.200000C5.600000,15.100000 4.000000,19.400000 4.000000,24.000000c0.000000,7.400000 4.000000,13.800000 10.000000,17.299999l2.000000,-3.500000c-4.800000,-2.800000 -8.000000,-7.900000 -8.000000,-13.800000c0.000000,-3.500000 1.100000,-6.800000 3.100000,-9.400000l2.900000,2.900000C12.700000,19.400000 12.000000,21.600000 12.000000,24.000000c0.000000,4.400000 2.400000,8.300000 6.000000,10.400000l2.000000,-3.500000c-2.400000,-1.400000 -4.000000,-3.900000 -4.000000,-6.900000c0.000000,-1.300000 0.300000,-2.500000 0.900000,-3.600000l3.200000,3.200000c0.000000,0.100000 0.000000,0.300000 0.000000,0.400000c0.000000,2.200000 1.800000,4.000000 4.000000,4.000000c0.100000,0.000000 0.300000,0.000000 0.400000,0.000000l0.000000,0.000000l0.000000,0.000000l15.000000,15.000000l2.500000,-2.500000L8.500000,7.000000L6.500000,5.000000z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml b/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
index 01cb0ab..da09f6e 100644
--- a/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_hotspot_on.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64.0dp"
- android:height="64.0dp"/>
-
- <viewport
+ android:height="64.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.000000,22.000000c-2.200000,0.000000 -4.000000,1.800000 -4.000000,4.000000c0.000000,2.200000 1.800000,4.000000 4.000000,4.000000c2.200000,0.000000 4.000000,-1.800000 4.000000,-4.000000C28.000000,23.799999 26.200001,22.000000 24.000000,22.000000zM36.000000,26.000000c0.000000,-6.600000 -5.400000,-12.000000 -12.000000,-12.000000c-6.600000,0.000000 -12.000000,5.400000 -12.000000,12.000000c0.000000,4.400000 2.400000,8.300000 6.000000,10.400000l2.000000,-3.500000c-2.400000,-1.400000 -4.000000,-3.900000 -4.000000,-6.900000c0.000000,-4.400000 3.600000,-8.000000 8.000000,-8.000000s8.000000,3.600000 8.000000,8.000000c0.000000,3.000000 -1.600000,5.500000 -4.000000,6.900000l2.000000,3.500000C33.599998,34.299999 36.000000,30.400000 36.000000,26.000000zM24.000000,6.000000C13.000000,6.000000 4.000000,15.000000 4.000000,26.000000c0.000000,7.400000 4.000000,13.800000 10.000000,17.299999l2.000000,-3.500000c-4.800000,-2.800000 -8.000000,-7.900000 -8.000000,-13.800000c0.000000,-8.800000 7.200000,-16.000000 16.000000,-16.000000s16.000000,7.200000 16.000000,16.000000c0.000000,5.900000 -3.200000,11.100000 -8.000000,13.800000l2.000000,3.500000c6.000000,-3.500000 10.000000,-9.900000 10.000000,-17.299999C44.000000,15.000000 35.000000,6.000000 24.000000,6.000000z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml b/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml
index b6a5cad..4237b63 100644
--- a/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_inversion_off.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M41.3,41.7L36.6,37.0L24.0,24.5l-7.1,-7.1L14.0,14.5L8.5,9.0L6.0,11.5l5.6,5.6c-5.1,6.3 -4.7,15.5 1.1,21.4c3.1,3.1 7.2,4.7 11.3,4.7c3.6,0.0 7.1,-1.2 10.1,-3.6l5.4,5.4l2.5,-2.5L41.3,41.7zM24.0,39.2c-3.2,0.0 -6.2,-1.2 -8.5,-3.5c-2.3,-2.3 -3.5,-5.3 -3.5,-8.5c0.0,-2.6 0.9,-5.1 2.4,-7.2l9.6,9.6L24.0,39.2zM24.0,10.2l0.0,9.2l14.5,14.5c2.7,-5.9 1.7,-13.1 -3.2,-18.0L24.0,4.5l0.0,0.0l0.0,0.0L16.6,12.0l2.8,2.8L24.0,10.2z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml b/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml
index e8d59e0..860e769 100644
--- a/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_inversion_on.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M35.3,15.9L24.0,4.5l0.0,0.0l0.0,0.0L12.7,15.9c-6.2,6.2 -6.2,16.4 0.0,22.6c3.1,3.1 7.2,4.7 11.3,4.7s8.2,-1.6 11.3,-4.7C41.6,32.2 41.6,22.1 35.3,15.9zM24.0,39.2L24.0,39.2c-3.2,0.0 -6.2,-1.2 -8.5,-3.5c-2.3,-2.3 -3.5,-5.3 -3.5,-8.5s1.2,-6.2 3.5,-8.5l8.5,-8.5L24.0,39.2z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_location_off.xml b/packages/SystemUI/res/drawable/ic_qs_location_off.xml
index 26ebfbf..e0fe12e 100644
--- a/packages/SystemUI/res/drawable/ic_qs_location_off.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_location_off.xml
@@ -13,19 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M24.0,13.0c2.8,0.0 5.0,2.2 5.0,5.0c0.0,1.5 -0.7,2.8 -1.7,3.7l7.3,7.3c2.0,-3.7 3.4,-7.6 3.4,-11.0c0.0,-7.7 -6.3,-14.0 -14.0,-14.0c-4.0,0.0 -7.5,1.6 -10.1,4.3l6.4,6.4C21.2,13.6 22.5,13.0 24.0,13.0zM32.7,32.2l-9.3,-9.3l-0.2,-0.2L6.5,6.0L4.0,8.5l6.4,6.4c-0.2,1.0 -0.4,2.0 -0.4,3.1c0.0,10.5 14.0,26.0 14.0,26.0s3.3,-3.7 6.8,-8.7l6.7,6.7l2.5,-2.5L32.7,32.2z"/>
<path
android:pathData="M23.5,22.9l0.0,0.0 -0.20000076,-0.19999886z"
- android:fill="#4DFFFFFF"/>
+ android:fillColor="#4DFFFFFF"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_location_on.xml b/packages/SystemUI/res/drawable/ic_qs_location_on.xml
index bc73005..6a7cd53 100644
--- a/packages/SystemUI/res/drawable/ic_qs_location_on.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_location_on.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.0,4.0c-7.7,0.0 -14.0,6.3 -14.0,14.0c0.0,10.5 14.0,26.0 14.0,26.0s14.0,-15.5 14.0,-26.0C38.0,10.3 31.7,4.0 24.0,4.0zM24.0,23.0c-2.8,0.0 -5.0,-2.2 -5.0,-5.0s2.2,-5.0 5.0,-5.0c2.8,0.0 5.0,2.2 5.0,5.0S26.8,23.0 24.0,23.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_minus.xml b/packages/SystemUI/res/drawable/ic_qs_minus.xml
index 7b76e0f..4722c9e 100644
--- a/packages/SystemUI/res/drawable/ic_qs_minus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_minus.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.0,4.0C13.0,4.0 4.0,13.0 4.0,24.0s9.0,20.0 20.0,20.0c11.0,0.0 20.0,-9.0 20.0,-20.0S35.0,4.0 24.0,4.0zM34.0,26.0L14.0,26.0l0.0,-4.0l20.0,0.0L34.0,26.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_plus.xml b/packages/SystemUI/res/drawable/ic_qs_plus.xml
index 4b9f506..17d74cf 100644
--- a/packages/SystemUI/res/drawable/ic_qs_plus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_plus.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
- android:height="24dp"/>
-
- <viewport
+ android:height="24dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.0,4.0C13.0,4.0 4.0,13.0 4.0,24.0s9.0,20.0 20.0,20.0c11.0,0.0 20.0,-9.0 20.0,-20.0S35.0,4.0 24.0,4.0zM34.0,26.0l-8.0,0.0l0.0,8.0l-4.0,0.0l0.0,-8.0l-8.0,0.0l0.0,-4.0l8.0,0.0l0.0,-8.0l4.0,0.0l0.0,8.0l8.0,0.0L34.0,26.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
index 787eec5..9c5983d 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_audible.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,16.0l0.0,-5.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7c-2.9,0.7 -5.0,3.2 -5.0,6.3L5.0,16.0l-2.0,2.0l0.0,1.0l17.0,0.0l0.0,-1.0L18.0,16.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
index dd6be76..904ccdf 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_silent.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,10.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7C9.5,4.3 9.0,4.5 8.6,4.7l9.4,9.4L18.0,10.5zM17.7,19.0l2.0,2.0l1.3,-1.3L4.3,3.0L3.0,4.3l2.9,2.9C5.3,8.2 5.0,9.3 5.0,10.5L5.0,16.0l-2.0,2.0l0.0,1.0L17.7,19.0z" />
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml b/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
index 96d20e8..a23c6f0 100644
--- a/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_ringer_vibrate.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
index e4c7cb5..4bb3668 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M2.0,14.0l0.0,20.0c0.0,2.2 1.8,4.0 4.0,4.0l36.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L46.0,14.0c0.0,-2.2 -1.8,-4.0 -4.0,-4.0L6.0,10.0C3.8,10.0 2.0,11.8 2.0,14.0zM38.0,14.0l0.0,20.0L10.0,34.0L10.0,14.0L38.0,14.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
index e4bf367..f0878c7 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M34.0,2.0L14.0,2.0c-2.2,0.0 -4.0,1.8 -4.0,4.0l0.0,36.0c0.0,2.2 1.8,4.0 4.0,4.0l20.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L38.0,6.0C38.0,3.8 36.2,2.0 34.0,2.0zM34.0,38.0L14.0,38.0L14.0,10.0l20.0,0.0L34.0,38.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
index a6c2cf8..6872a33 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
@@ -13,22 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M10.25,1.75c-0.6,-0.6 -1.5,-0.6 -2.1,0.0l-6.4,6.4c-0.6,0.6 -0.6,1.5 0.0,2.1l12.0,12.0c0.6,0.6 1.5,0.6 2.1,0.0l6.4,-6.4c0.6,-0.6 0.6,-1.5 0.0,-2.1L10.25,1.75zM14.85,21.25l-12.0,-12.0l6.4,-6.4l12.0,12.0L14.85,21.25z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M16.55,2.5c3.3,1.5 5.6,4.7 6.0,8.5l1.5,0.0c-0.6,-6.2 -5.7,-11.0 -12.0,-11.0c-0.2,0.0 -0.4,0.0 -0.7,0.0l3.8,3.8L16.55,2.5z"/>
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M7.55,21.5c-3.3,-1.5 -5.6,-4.7 -6.0,-8.5l-1.4,0.0c0.5,6.2 5.6,11.0 11.9,11.0c0.2,0.0 0.4,0.0 0.7,0.0l-3.8,-3.8L7.55,21.5z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_detail_empty.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_detail_empty.xml
index 16fa30b..ad6b247 100644
--- a/packages/SystemUI/res/drawable/ic_qs_wifi_detail_empty.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_wifi_detail_empty.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
- android:height="56dp"/>
-
- <viewport
+ android:height="56dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
android:pathData="M24.0,4.0C15.0,4.0 6.7,7.0 0.0,12.0l24.0,32.0l24.0,-32.0C41.3,7.0 33.0,4.0 24.0,4.0z"
- android:fill="@color/qs_detail_empty" />
+ android:fillColor="@color/qs_detail_empty" />
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_ringer_audible.xml b/packages/SystemUI/res/drawable/ic_ringer_audible.xml
index 2969948..f358fa2 100644
--- a/packages/SystemUI/res/drawable/ic_ringer_audible.xml
+++ b/packages/SystemUI/res/drawable/ic_ringer_audible.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,16.0l0.0,-5.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7c-2.9,0.7 -5.0,3.2 -5.0,6.3L5.0,16.0l-2.0,2.0l0.0,1.0l17.0,0.0l0.0,-1.0L18.0,16.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_ringer_vibrate.xml b/packages/SystemUI/res/drawable/ic_ringer_vibrate.xml
index d8ded58..9642be3 100644
--- a/packages/SystemUI/res/drawable/ic_ringer_vibrate.xml
+++ b/packages/SystemUI/res/drawable/ic_ringer_vibrate.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
- android:height="32dp"/>
-
- <viewport
+ android:height="32dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/ic_settings_24dp.xml b/packages/SystemUI/res/drawable/ic_settings_24dp.xml
index a2f7822..9c78742 100644
--- a/packages/SystemUI/res/drawable/ic_settings_24dp.xml
+++ b/packages/SystemUI/res/drawable/ic_settings_24dp.xml
@@ -12,18 +12,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-<size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
-android:height="24dp"/>
-
- <viewport android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+android:height="24dp" android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
<path
android:pathData="M19.4,13.0c0.0,-0.3 0.1,-0.6 0.1,-1.0s0.0,-0.7 -0.1,-1.0l2.1,-1.7c0.2,-0.2 0.2,-0.4 0.1,-0.6l-2.0,-3.5C19.5,5.1 19.3,5.0 19.0,5.1l-2.5,1.0c-0.5,-0.4 -1.1,-0.7 -1.7,-1.0l-0.4,-2.6C14.5,2.2 14.2,2.0 14.0,2.0l-4.0,0.0C9.8,2.0 9.5,2.2 9.5,2.4L9.1,5.1C8.5,5.3 8.0,5.7 7.4,6.1L5.0,5.1C4.7,5.0 4.5,5.1 4.3,5.3l-2.0,3.5C2.2,8.9 2.3,9.2 2.5,9.4L4.6,11.0c0.0,0.3 -0.1,0.6 -0.1,1.0s0.0,0.7 0.1,1.0l-2.1,1.7c-0.2,0.2 -0.2,0.4 -0.1,0.6l2.0,3.5C4.5,18.9 4.7,19.0 5.0,18.9l2.5,-1.0c0.5,0.4 1.1,0.7 1.7,1.0l0.4,2.6c0.0,0.2 0.2,0.4 0.5,0.4l4.0,0.0c0.2,0.0 0.5,-0.2 0.5,-0.4l0.4,-2.6c0.6,-0.3 1.2,-0.6 1.7,-1.0l2.5,1.0c0.2,0.1 0.5,0.0 0.6,-0.2l2.0,-3.5c0.1,-0.2 0.1,-0.5 -0.1,-0.6L19.4,13.0zM12.0,15.5c-1.9,0.0 -3.5,-1.6 -3.5,-3.5s1.6,-3.5 3.5,-3.5s3.5,1.6 3.5,3.5S13.9,15.5 12.0,15.5z"
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
/>
</vector>
diff --git a/packages/SystemUI/res/drawable/qs_dual_tile_caret.xml b/packages/SystemUI/res/drawable/qs_dual_tile_caret.xml
index 9137e7f..71400db 100644
--- a/packages/SystemUI/res/drawable/qs_dual_tile_caret.xml
+++ b/packages/SystemUI/res/drawable/qs_dual_tile_caret.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="@color/qs_tile_text"
+ android:fillColor="@color/qs_tile_text"
android:pathData="M14.0,20.0l10.0,10.0 10.0,-10.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/qs_subhead_caret.xml b/packages/SystemUI/res/drawable/qs_subhead_caret.xml
index f140bd0..13a168d 100644
--- a/packages/SystemUI/res/drawable/qs_subhead_caret.xml
+++ b/packages/SystemUI/res/drawable/qs_subhead_caret.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
- android:height="24.0dp"/>
-
- <viewport
+ android:height="24.0dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="@color/qs_subhead"
+ android:fillColor="@color/qs_subhead"
android:pathData="M14.0,20.0l10.0,10.0 10.0,-10.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
index 9c1165d..337c028 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_dark.xml
@@ -13,20 +13,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="16dp"
- android:width="16dp" />
-
- <viewport
+ android:width="16dp"
android:viewportHeight="100"
- android:viewportWidth="100" />
+ android:viewportWidth="100" >
<path
android:name="x"
android:pathData="M0,0L100,100M0,100L100,0z"
- android:stroke="@color/recents_task_bar_dark_dismiss_color"
+ android:strokeColor="@color/recents_task_bar_dark_dismiss_color"
android:strokeWidth="8.0"
android:strokeLineCap="square" />
diff --git a/packages/SystemUI/res/drawable/recents_dismiss_light.xml b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
index a8afeb3..963ccf7 100644
--- a/packages/SystemUI/res/drawable/recents_dismiss_light.xml
+++ b/packages/SystemUI/res/drawable/recents_dismiss_light.xml
@@ -13,21 +13,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="16dp"
- android:width="16dp" />
-
- <viewport
+ android:width="16dp"
android:viewportHeight="100"
- android:viewportWidth="100" />
+ android:viewportWidth="100" >
<path
android:name="x"
android:pathData="M0,0L100,100M0,100L100,0z"
- android:stroke="@color/recents_task_bar_light_dismiss_color"
+ android:strokeColor="@color/recents_task_bar_light_dismiss_color"
android:strokeWidth="8.0"
android:strokeLineCap="square" />
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml
index e28490b..f53f0e4 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
- android:height="18dp"/>
-
- <viewport
+ android:height="18dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml
index c012d14..2aac4ee 100644
--- a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
- android:height="18dp"/>
-
- <viewport
+ android:height="18dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M14.0,24.0l-4.0,-4.0l-4.0,4.0l4.0,4.0L14.0,24.0zM35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6zM38.0,20.0l-4.0,4.0l4.0,4.0l4.0,-4.0L38.0,20.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_no_sim.xml b/packages/SystemUI/res/drawable/stat_sys_no_sim.xml
index 70948b7..22d1d4b 100644
--- a/packages/SystemUI/res/drawable/stat_sys_no_sim.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_no_sim.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
- android:height="18dp"/>
-
- <viewport
+ android:height="18dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#4DFFFFFF"
+ android:fillColor="#4DFFFFFF"
android:pathData="M19.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-7.0,0.0L7.7,5.3L19.0,16.7L19.0,5.0zM3.7,3.9L2.4,5.2L5.0,7.8L5.0,19.0c0.0,1.1 0.9,2.0 2.0,2.0l10.0,0.0c0.4,0.0 0.7,-0.1 1.0,-0.3l1.9,1.9l1.3,-1.3L3.7,3.9z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_ringer_vibrate.xml b/packages/SystemUI/res/drawable/stat_sys_ringer_vibrate.xml
index e1d63c3..352d86f 100644
--- a/packages/SystemUI/res/drawable/stat_sys_ringer_vibrate.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_ringer_vibrate.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
- android:height="20dp"/>
-
- <viewport
+ android:height="20dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_zen_important.xml b/packages/SystemUI/res/drawable/stat_sys_zen_important.xml
index 54a9b1b..73d7cba 100644
--- a/packages/SystemUI/res/drawable/stat_sys_zen_important.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_zen_important.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
- android:height="20dp"/>
-
- <viewport
+ android:height="20dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0"/>
+ android:viewportHeight="24.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M12.0,17.273l6.1800003,3.7269993 -1.6350002,-7.0290003 5.455,-4.7269993 -7.191,-0.6170006 -2.809,-6.627 -2.809,6.627 -7.191,0.6170006 5.455,4.7269993 -1.6349998,7.0290003z"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_zen_none.xml b/packages/SystemUI/res/drawable/stat_sys_zen_none.xml
index 101e3c4..d8ab078 100644
--- a/packages/SystemUI/res/drawable/stat_sys_zen_none.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_zen_none.xml
@@ -13,16 +13,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="19dp"
- android:height="19dp"/>
-
- <viewport
+ android:height="19dp"
android:viewportWidth="48.0"
- android:viewportHeight="48.0"/>
+ android:viewportHeight="48.0">
<path
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M24.0,4.0C13.0,4.0 4.0,13.0 4.0,24.0c0.0,11.0 9.0,20.0 20.0,20.0c11.0,0.0 20.0,-9.0 20.0,-20.0C44.0,13.0 35.0,4.0 24.0,4.0zM24.0,40.0c-8.8,0.0 -16.0,-7.2 -16.0,-16.0c0.0,-3.7 1.3,-7.1 3.4,-9.8l22.4,22.4C31.1,38.7 27.7,40.0 24.0,40.0zM36.6,33.8L14.2,11.4C16.9,9.3 20.3,8.0 24.0,8.0c8.8,0.0 16.0,7.2 16.0,16.0C40.0,27.7 38.7,31.1 36.6,33.8z"/>
</vector>
diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
index 42fb740..f831570 100644
--- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml
+++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
@@ -22,6 +22,23 @@
android:layout_height="match_parent"
android:layout_width="match_parent"
>
+
+ <com.android.systemui.statusbar.phone.KeyguardIndicationTextView
+ android:id="@+id/keyguard_indication_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="70dp"
+ android:layout_gravity="bottom|center_horizontal"
+ android:textStyle="italic"
+ android:textColor="#ffffff"
+ android:textAppearance="?android:attr/textAppearanceSmall"/>
+
+ <FrameLayout
+ android:id="@+id/preview_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ </FrameLayout>
+
<com.android.systemui.statusbar.KeyguardAffordanceView
android:id="@+id/camera_button"
android:layout_height="64dp"
@@ -42,16 +59,6 @@
android:scaleType="center"
android:contentDescription="@string/accessibility_phone_button" />
- <com.android.systemui.statusbar.phone.KeyguardIndicationTextView
- android:id="@+id/keyguard_indication_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="70dp"
- android:layout_gravity="bottom|center_horizontal"
- android:textStyle="italic"
- android:textColor="#ffffff"
- android:textAppearance="?android:attr/textAppearanceSmall"/>
-
<com.android.systemui.statusbar.KeyguardAffordanceView
android:id="@+id/lock_icon"
android:layout_width="64dp"
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index 595d731..19dc36d 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -87,7 +87,8 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
>
- <LinearLayout android:id="@+id/statusIcons"
+ <com.android.systemui.statusbar.AlphaOptimizedLinearLayout
+ android:id="@+id/statusIcons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
index 272904a..0eec094 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
@@ -68,7 +68,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:layout_marginStart="8dp"
+ android:layout_marginStart="@dimen/header_battery_margin_keyguard"
android:paddingEnd="@dimen/battery_level_padding_end"
android:textColor="#ffffff"
android:textSize="12sp"/>
@@ -87,24 +87,15 @@
android:text="@*android:string/emergency_calls_only"
android:gravity="center_vertical" />
- <RelativeLayout
- android:id="@+id/datetime"
+ <FrameLayout
+ android:id="@+id/date_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="start"
- android:paddingTop="4dp"
- android:paddingStart="16dp"
- android:paddingEnd="16dp"
- android:background="?android:attr/selectableItemBackground"
- android:enabled="false"
- >
- <include layout="@layout/split_clock_view"
- android:id="@+id/clock"
- />
-
+ android:layout_alignParentBottom="true">
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date_collapsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
android:layout_below="@id/clock"
@@ -113,17 +104,45 @@
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date_expanded"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
android:layout_below="@id/clock"
systemui:datePattern="eeeeMMMMd"
/>
- </RelativeLayout>
+ </FrameLayout>
+
+ <include layout="@layout/split_clock_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_above="@id/date_group"
+ android:id="@+id/clock"
+ />
+
+ <Button android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_toEndOf="@id/date_group"
+ android:layout_marginBottom="4dp"
+ android:drawablePadding="6dp"
+ android:drawableStart="@drawable/ic_access_alarms_small"
+ android:textColor="#64ffffff"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
+ android:paddingEnd="6dp"
+ android:paddingStart="6dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"
+ />
+
<com.android.keyguard.CarrierText
android:id="@+id/keyguard_carrier_text"
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_header_height_keyguard"
- android:layout_marginLeft="16dp"
+ android:layout_marginStart="@dimen/keyguard_carrier_text_margin"
android:layout_toStartOf="@id/system_icons_super_container"
android:gravity="center_vertical"
android:ellipsize="marquee"
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index a5e3924..953a3ab 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -62,4 +62,22 @@
keyguard_clock_height_fraction_* for the difference between min and max.-->
<dimen name="keyguard_clock_notifications_margin_min">44dp</dimen>
<dimen name="keyguard_clock_notifications_margin_max">44dp</dimen>
+
+ <!-- Height of the status bar header bar when on Keyguard -->
+ <dimen name="status_bar_header_height_keyguard">60dp</dimen>
+
+ <!-- The width of user avatar when on Keyguard -->
+ <dimen name="multi_user_switch_width_keyguard">48dp</dimen>
+
+ <!-- The width of user avatar when on Keyguard -->
+ <dimen name="multi_user_avatar_keyguard_size">30dp</dimen>
+
+ <!-- end margin for multi user switch in collapsed quick settings -->
+ <dimen name="multi_user_switch_keyguard_margin">6dp</dimen>
+
+ <!-- Margin on the left side of the carrier text on Keyguard -->
+ <dimen name="keyguard_carrier_text_margin">24dp</dimen>
+
+ <!-- end margin for system icons if multi user switch is hidden -->
+ <dimen name="system_icons_switcher_hidden_expanded_margin">20dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index fbd3eb5..bd10623 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -353,15 +353,24 @@
<!-- The padding bottom of the clock group when QS is expanded. -->
<dimen name="clock_expanded_bottom_margin">20dp</dimen>
+ <!-- The padding bottom of the clock group when QS is collapsed. -->
+ <dimen name="clock_collapsed_bottom_margin">10dp</dimen>
+
<!-- The width of the multi user switch on keyguard and collapsed QS header. -->
<dimen name="multi_user_switch_width_collapsed">34dp</dimen>
<!-- The width of the multi user switch in expanded QS header. -->
<dimen name="multi_user_switch_width_expanded">48dp</dimen>
+ <!-- The width of user avatar when on Keyguard -->
+ <dimen name="multi_user_switch_width_keyguard">34dp</dimen>
+
<!-- The width of user avatar when collapsed -->
<dimen name="multi_user_avatar_collapsed_size">22dp</dimen>
+ <!-- The width of user avatar when on Keyguard -->
+ <dimen name="multi_user_avatar_keyguard_size">22dp</dimen>
+
<!-- The font size of the time when collapsed in QS -->
<dimen name="qs_time_collapsed_size">14sp</dimen>
@@ -377,4 +386,13 @@
<!-- Largest size an avatar might need to be drawn in the user picker, status bar, or
quick settings header -->
<dimen name="max_avatar_size">48dp</dimen>
+
+ <!-- Margin on the left side of the carrier text on Keyguard -->
+ <dimen name="keyguard_carrier_text_margin">16dp</dimen>
+
+ <!-- Margin on the left side of the battery % in the header. -->
+ <dimen name="header_battery_margin_expanded">8dp</dimen>
+
+ <!-- Margin on the left side of the battery % when on Keyguard. -->
+ <dimen name="header_battery_margin_keyguard">6dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index ddbddd1..085d2f9 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -741,4 +741,7 @@
<!-- Media projection permission dialog action text. [CHAR LIMIT=60] -->
<string name="media_projection_action_text">Start now</string>
+
+ <!-- Text which is shown in the notification shade when there are no notifications. [CHAR LIMIT=30] -->
+ <string name="empty_shade_text">No notifications</string>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index 5e48258..b9ffdbb 100755
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -402,6 +402,11 @@
}
}
+ @Override
+ public boolean hasOverlappingRendering() {
+ return false;
+ }
+
private boolean mDemoMode;
private BatteryTracker mDemoTracker = new BatteryTracker();
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
index bbda536..a26c534 100644
--- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
@@ -29,11 +29,13 @@
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ScaleGestureDetector.OnScaleGestureListener;
+import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.ExpandableView;
+import com.android.systemui.statusbar.FlingAnimationUtils;
import com.android.systemui.statusbar.policy.ScrollAdapter;
public class ExpandHelper implements Gefingerpoken {
@@ -49,7 +51,7 @@
private static final String TAG = "ExpandHelper";
protected static final boolean DEBUG = false;
protected static final boolean DEBUG_SCALE = false;
- private static final long EXPAND_DURATION = 250;
+ private static final float EXPAND_DURATION = 0.3f;
// Set to false to disable focus-based gestures (spread-finger vertical pull).
private static final boolean USE_DRAG = true;
@@ -112,6 +114,8 @@
private int mGravity;
private ScrollAdapter mScrollAdapter;
+ private FlingAnimationUtils mFlingAnimationUtils;
+ private VelocityTracker mVelocityTracker;
private OnScaleGestureListener mScaleGestureListener
= new ScaleGestureDetector.SimpleOnScaleGestureListener() {
@@ -171,7 +175,6 @@
mScaler = new ViewScaler();
mGravity = Gravity.TOP;
mScaleAnimation = ObjectAnimator.ofFloat(mScaler, "height", 0f);
- mScaleAnimation.setDuration(EXPAND_DURATION);
mPopDuration = mContext.getResources().getInteger(R.integer.blinds_pop_duration_ms);
mPullGestureMinXSpan = mContext.getResources().getDimension(R.dimen.pull_span_min);
@@ -179,6 +182,7 @@
mTouchSlop = configuration.getScaledTouchSlop();
mSGD = new ScaleGestureDetector(context, mScaleGestureListener);
+ mFlingAnimationUtils = new FlingAnimationUtils(context, EXPAND_DURATION);
}
private void updateExpansion() {
@@ -260,6 +264,7 @@
if (!isEnabled()) {
return false;
}
+ trackVelocity(ev);
final int action = ev.getAction();
if (DEBUG_SCALE) Log.d(TAG, "intercept: act=" + MotionEvent.actionToString(action) +
" expanding=" + mExpanding +
@@ -279,6 +284,7 @@
if (mExpanding) {
mLastMotionY = ev.getRawY();
+ maybeRecycleVelocityTracker(ev);
return true;
} else {
if ((action == MotionEvent.ACTION_MOVE) && 0 != (mExpansionStyle & BLINDS)) {
@@ -323,15 +329,52 @@
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (DEBUG) Log.d(TAG, "up/cancel");
- finishExpanding(false);
+ finishExpanding(false, getCurrentVelocity());
clearView();
break;
}
mLastMotionY = ev.getRawY();
+ maybeRecycleVelocityTracker(ev);
return mExpanding;
}
}
+ private void trackVelocity(MotionEvent event) {
+ int action = event.getActionMasked();
+ switch(action) {
+ case MotionEvent.ACTION_DOWN:
+ if (mVelocityTracker == null) {
+ mVelocityTracker = VelocityTracker.obtain();
+ } else {
+ mVelocityTracker.clear();
+ }
+ mVelocityTracker.addMovement(event);
+ break;
+ case MotionEvent.ACTION_MOVE:
+ mVelocityTracker.addMovement(event);
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void maybeRecycleVelocityTracker(MotionEvent event) {
+ if (event.getActionMasked() == MotionEvent.ACTION_CANCEL
+ || event.getActionMasked() == MotionEvent.ACTION_UP) {
+ mVelocityTracker.recycle();
+ mVelocityTracker = null;
+ }
+ }
+
+ private float getCurrentVelocity() {
+ if (mVelocityTracker != null) {
+ mVelocityTracker.computeCurrentVelocity(1000);
+ return mVelocityTracker.getYVelocity();
+ } else {
+ return 0f;
+ }
+ }
+
public void setEnabled(boolean enable) {
mEnabled = enable;
}
@@ -349,6 +392,7 @@
if (!isEnabled()) {
return false;
}
+ trackVelocity(ev);
final int action = ev.getActionMasked();
if (DEBUG_SCALE) Log.d(TAG, "touch: act=" + MotionEvent.actionToString(action) +
" expanding=" + mExpanding +
@@ -438,11 +482,12 @@
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG) Log.d(TAG, "up/cancel");
- finishExpanding(false);
+ finishExpanding(false, getCurrentVelocity());
clearView();
break;
}
mLastMotionY = ev.getRawY();
+ maybeRecycleVelocityTracker(ev);
return mResizedView != null;
}
@@ -476,7 +521,7 @@
return true;
}
- private void finishExpanding(boolean force) {
+ private void finishExpanding(boolean force, float velocity) {
if (!mExpanding) return;
if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mResizedView);
@@ -506,6 +551,7 @@
mScaleAnimation.removeListener(this);
}
});
+ mFlingAnimationUtils.apply(mScaleAnimation, currentHeight, targetHeight, velocity);
mScaleAnimation.start();
} else {
mCallback.setUserLockedChild(mResizedView, false);
@@ -529,7 +575,7 @@
* Use this to abort any pending expansions in progress.
*/
public void cancel() {
- finishExpanding(true);
+ finishExpanding(true, 0f /* velocity */);
clearView();
// reset the gesture detector
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
index 333b8b4..13c15f5 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
@@ -32,7 +32,6 @@
import android.os.PowerManager;
import android.os.SystemProperties;
import android.os.Vibrator;
-import android.service.dreams.DozeHardware;
import android.service.dreams.DreamService;
import android.util.Log;
import android.util.MathUtils;
@@ -55,7 +54,6 @@
private final Handler mHandler = new Handler();
private Host mHost;
- private DozeHardware mDozeHardware;
private SensorManager mSensors;
private Sensor mSigMotionSensor;
private PowerManager mPowerManager;
@@ -77,7 +75,6 @@
protected void dumpOnHandler(FileDescriptor fd, PrintWriter pw, String[] args) {
super.dumpOnHandler(fd, pw, args);
pw.print(" mDreaming: "); pw.println(mDreaming);
- pw.print(" mDozeHardware: "); pw.println(mDozeHardware);
pw.print(" mTeaseReceiverRegistered: "); pw.println(mTeaseReceiverRegistered);
pw.print(" mSigMotionSensor: "); pw.println(mSigMotionSensor);
pw.print(" mSigMotionConfigured: "); pw.println(mSigMotionConfigured);
@@ -123,9 +120,7 @@
@Override
public void onDreamingStarted() {
super.onDreamingStarted();
- mDozeHardware = getDozeHardware();
- if (DEBUG) Log.d(mTag, "onDreamingStarted canDoze=" + canDoze()
- + " dozeHardware=" + mDozeHardware);
+ if (DEBUG) Log.d(mTag, "onDreamingStarted canDoze=" + canDoze());
mDreaming = true;
listenForTeaseSignals(true);
requestDoze();
@@ -162,7 +157,6 @@
super.onDreamingStopped();
mDreaming = false;
- mDozeHardware = null;
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
@@ -292,6 +286,11 @@
@Override
public void onNewNotifications() {
if (DEBUG) Log.d(mTag, "onNewNotifications");
+ // noop for now
+ }
+ @Override
+ public void onBuzzBeepBlinked() {
+ if (DEBUG) Log.d(mTag, "onBuzzBeepBlinked");
requestTease();
}
};
@@ -305,6 +304,7 @@
public interface Callback {
void onNewNotifications();
+ void onBuzzBeepBlinked();
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index d76a2fe..42da282 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -93,10 +93,10 @@
final Resources r = mContext.getResources();
state.iconId = cb.noSim
? R.drawable.stat_sys_no_sim
- : cb.enabled && (cb.mobileSignalIconId > 0)
+ : cb.enabled && (cb.mobileSignalIconId > 0) && !cb.airplaneModeEnabled
? cb.mobileSignalIconId
: R.drawable.ic_qs_signal_no_signal;
- state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiEnabled
+ state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiConnected
? cb.dataTypeIconId
: 0;
state.filter = state.iconId != R.drawable.stat_sys_no_sim;
@@ -132,6 +132,8 @@
private static final class CallbackInfo {
boolean enabled;
boolean wifiEnabled;
+ boolean wifiConnected;
+ boolean airplaneModeEnabled;
int mobileSignalIconId;
String signalContentDescription;
int dataTypeIconId;
@@ -144,12 +146,15 @@
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
private boolean mWifiEnabled;
+ private boolean mWifiConnected;
+ private boolean mAirplaneModeEnabled;
@Override
- public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description) {
mWifiEnabled = enabled;
+ mWifiConnected = connected;
}
@Override
@@ -161,6 +166,8 @@
final CallbackInfo info = new CallbackInfo(); // TODO pool?
info.enabled = enabled;
info.wifiEnabled = mWifiEnabled;
+ info.wifiConnected = mWifiConnected;
+ info.airplaneModeEnabled = mAirplaneModeEnabled;
info.mobileSignalIconId = mobileSignalIconId;
info.signalContentDescription = mobileSignalContentDescriptionId;
info.dataTypeIconId = dataTypeIconId;
@@ -174,7 +181,7 @@
@Override
public void onAirplaneModeChanged(boolean enabled) {
- // noop
+ mAirplaneModeEnabled = enabled;
}
public void onMobileDataEnabled(boolean enabled) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 35dfdda..e0b465e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -24,7 +24,6 @@
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.HotspotController;
-import com.android.systemui.statusbar.policy.KeyguardMonitor;
/** Quick settings tile: Hotspot **/
public class HotspotTile extends QSTile<QSTile.BooleanState> {
@@ -32,14 +31,12 @@
private static final long MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
private final HotspotController mController;
- private final KeyguardMonitor mKeyguard;
private final Callback mCallback = new Callback();
private final long mTimeToShowTile;
public HotspotTile(Host host) {
super(host);
mController = host.getHotspotController();
- mKeyguard = host.getKeyguardMonitor();
mTimeToShowTile = MILLIS_PER_DAY
* mContext.getResources().getInteger(R.integer.days_to_show_hotspot);
@@ -54,10 +51,8 @@
public void setListening(boolean listening) {
if (listening) {
mController.addCallback(mCallback);
- mKeyguard.addCallback(mCallback);
} else {
mController.removeCallback(mCallback);
- mKeyguard.removeCallback(mCallback);
}
}
@@ -69,8 +64,7 @@
@Override
protected void handleUpdateState(BooleanState state, Object arg) {
- state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing())
- && mController.isHotspotSupported() && isHotspotRecentlyUsed();
+ state.visible = mController.isHotspotSupported() && isHotspotRecentlyUsed();
state.label = mContext.getString(R.string.quick_settings_hotspot_label);
state.value = mController.isHotspotEnabled();
@@ -87,16 +81,11 @@
return context.getSharedPreferences(context.getPackageName(), 0);
}
- private final class Callback implements HotspotController.Callback, KeyguardMonitor.Callback {
+ private final class Callback implements HotspotController.Callback {
@Override
public void onHotspotChanged(boolean enabled) {
refreshState();
}
-
- @Override
- public void onKeyguardChanged() {
- refreshState();
- }
};
/**
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index 900c7b26..1707b32 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -143,6 +143,7 @@
private static final class CallbackInfo {
boolean enabled;
+ boolean connected;
int wifiSignalIconId;
String enabledDesc;
boolean activityIn;
@@ -153,6 +154,7 @@
public String toString() {
return new StringBuilder("CallbackInfo[")
.append("enabled=").append(enabled)
+ .append(",connected=").append(connected)
.append(",wifiSignalIconId=").append(wifiSignalIconId)
.append(",enabledDesc=").append(enabledDesc)
.append(",activityIn=").append(activityIn)
@@ -164,12 +166,13 @@
private final NetworkSignalChangedCallback mCallback = new NetworkSignalChangedCallback() {
@Override
- public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ public void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description) {
if (DEBUG) Log.d(TAG, "onWifiSignalChanged enabled=" + enabled);
final CallbackInfo info = new CallbackInfo();
info.enabled = enabled;
+ info.connected = connected;
info.wifiSignalIconId = wifiSignalIconId;
info.enabledDesc = description;
info.activityIn = activityIn;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index eb44002..a82c907 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -54,6 +54,7 @@
private static final int MSG_SET_WINDOW_STATE = 13 << MSG_SHIFT;
private static final int MSG_SHOW_RECENT_APPS = 14 << MSG_SHIFT;
private static final int MSG_HIDE_RECENT_APPS = 15 << MSG_SHIFT;
+ private static final int MSG_BUZZ_BEEP_BLINKED = 16 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -93,6 +94,7 @@
public void showSearchPanel();
public void hideSearchPanel();
public void setWindowState(int window, int state);
+ public void buzzBeepBlinked();
}
public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -221,6 +223,12 @@
}
}
+ public void buzzBeepBlinked() {
+ synchronized (mList) {
+ mHandler.removeMessages(MSG_BUZZ_BEEP_BLINKED);
+ mHandler.sendEmptyMessage(MSG_BUZZ_BEEP_BLINKED);
+ }
+ }
private final class H extends Handler {
public void handleMessage(Message msg) {
@@ -295,6 +303,9 @@
case MSG_SET_WINDOW_STATE:
mCallbacks.setWindowState(msg.arg1, msg.arg2);
break;
+ case MSG_BUZZ_BEEP_BLINKED:
+ mCallbacks.buzzBeepBlinked();
+ break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java
index 517a4e8..e9989ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java
@@ -19,6 +19,7 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
+import android.animation.ValueAnimator;
import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
@@ -46,22 +47,23 @@
private float mInitialTouchY;
private boolean mDraggingDown;
private float mTouchSlop;
- private OnDragDownListener mOnDragDownListener;
+ private DragDownCallback mDragDownCallback;
private View mHost;
private final int[] mTemp2 = new int[2];
private boolean mDraggedFarEnough;
private ExpandableView mStartingChild;
private Interpolator mInterpolator;
+ private float mLastHeight;
public DragDownHelper(Context context, View host, ExpandHelper.Callback callback,
- OnDragDownListener onDragDownListener) {
+ DragDownCallback dragDownCallback) {
mMinDragDistance = context.getResources().getDimensionPixelSize(
R.dimen.keyguard_drag_down_min_distance);
mInterpolator =
AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mCallback = callback;
- mOnDragDownListener = onDragDownListener;
+ mDragDownCallback = dragDownCallback;
mHost = host;
}
@@ -86,7 +88,7 @@
captureStartingChild(mInitialTouchX, mInitialTouchY);
mInitialTouchY = y;
mInitialTouchX = x;
- mOnDragDownListener.onTouchSlopExceeded();
+ mDragDownCallback.onTouchSlopExceeded();
return true;
}
break;
@@ -104,29 +106,32 @@
switch (event.getActionMasked()) {
case MotionEvent.ACTION_MOVE:
- final float h = y - mInitialTouchY;
+ mLastHeight = y - mInitialTouchY;
captureStartingChild(mInitialTouchX, mInitialTouchY);
if (mStartingChild != null) {
- handleExpansion(h, mStartingChild);
+ handleExpansion(mLastHeight, mStartingChild);
+ } else {
+ mDragDownCallback.setEmptyDragAmount(mLastHeight);
}
- if (h > mMinDragDistance) {
+ if (mLastHeight > mMinDragDistance) {
if (!mDraggedFarEnough) {
mDraggedFarEnough = true;
- mOnDragDownListener.onThresholdReached();
+ mDragDownCallback.onThresholdReached();
}
} else {
if (mDraggedFarEnough) {
mDraggedFarEnough = false;
- mOnDragDownListener.onDragDownReset();
+ mDragDownCallback.onDragDownReset();
}
}
return true;
case MotionEvent.ACTION_UP:
- if (mDraggedFarEnough) {
+ if (mDraggedFarEnough && mDragDownCallback.onDraggedDown(mStartingChild)) {
if (mStartingChild != null) {
mCallback.setUserLockedChild(mStartingChild, false);
+ } else {
+ mDragDownCallback.setEmptyDragAmount(0f);
}
- mOnDragDownListener.onDraggedDown(mStartingChild);
mDraggingDown = false;
} else {
stopDragging();
@@ -183,12 +188,27 @@
anim.start();
}
+ private void cancelExpansion() {
+ ValueAnimator anim = ValueAnimator.ofFloat(mLastHeight, 0);
+ anim.setInterpolator(mInterpolator);
+ anim.setDuration(SPRING_BACK_ANIMATION_LENGTH_MS);
+ anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator animation) {
+ mDragDownCallback.setEmptyDragAmount((Float) animation.getAnimatedValue());
+ }
+ });
+ anim.start();
+ }
+
private void stopDragging() {
if (mStartingChild != null) {
cancelExpansion(mStartingChild);
+ } else {
+ cancelExpansion();
}
mDraggingDown = false;
- mOnDragDownListener.onDragDownReset();
+ mDragDownCallback.onDragDownReset();
}
private ExpandableView findView(float x, float y) {
@@ -198,10 +218,15 @@
return mCallback.getChildAtRawPosition(x, y);
}
- public interface OnDragDownListener {
- void onDraggedDown(View startingChild);
+ public interface DragDownCallback {
+
+ /**
+ * @return true if the interaction is accepted, false if it should be cancelled
+ */
+ boolean onDraggedDown(View startingChild);
void onDragDownReset();
void onThresholdReached();
void onTouchSlopExceeded();
+ void setEmptyDragAmount(float amount);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java b/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java
index 9968bbc..9f0f84e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/FlingAnimationUtils.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar;
+import android.animation.Animator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.view.ViewPropertyAnimator;
@@ -72,7 +73,7 @@
* @param endValue the end value of the animator
* @param velocity the current velocity of the motion
*/
- public void apply(ValueAnimator animator, float currValue, float endValue, float velocity) {
+ public void apply(Animator animator, float currValue, float endValue, float velocity) {
apply(animator, currValue, endValue, velocity, Math.abs(endValue - currValue));
}
@@ -101,7 +102,7 @@
* @param maxDistance the maximum distance for this interaction; the maximum animation length
* gets multiplied by the ratio between the actual distance and this value
*/
- public void apply(ValueAnimator animator, float currValue, float endValue, float velocity,
+ public void apply(Animator animator, float currValue, float endValue, float velocity,
float maxDistance) {
AnimatorProperties properties = getProperties(currValue, endValue, velocity,
maxDistance);
@@ -168,7 +169,7 @@
* @param maxDistance the maximum distance for this interaction; the maximum animation length
* gets multiplied by the ratio between the actual distance and this value
*/
- public void applyDismissing(ValueAnimator animator, float currValue, float endValue,
+ public void applyDismissing(Animator animator, float currValue, float endValue,
float velocity, float maxDistance) {
AnimatorProperties properties = getDismissingProperties(currValue, endValue, velocity,
maxDistance);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
index 845e0ae..19bf121 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java
@@ -28,6 +28,8 @@
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewAnimationUtils;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.ImageView;
@@ -69,6 +71,16 @@
private int mCircleColor;
private boolean mIsLeft;
private float mArrowAlpha = 0.0f;
+ private View mPreviewView;
+ private float mCircleStartRadius;
+ private float mMaxCircleSize;
+ private Animator mPreviewClipper;
+ private AnimatorListenerAdapter mClipEndListener = new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mPreviewClipper = null;
+ }
+ };
private AnimatorListenerAdapter mCircleEndListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -136,6 +148,7 @@
super.onLayout(changed, left, top, right, bottom);
mCenterX = getWidth() / 2;
mCenterY = getHeight() / 2;
+ mMaxCircleSize = getMaxCircleSize();
}
@Override
@@ -149,6 +162,10 @@
canvas.restore();
}
+ public void setPreviewView(View v) {
+ mPreviewView = v;
+ }
+
private void drawArrow(Canvas canvas) {
if (mArrowAlpha > 0) {
canvas.save();
@@ -183,6 +200,11 @@
private void updateCircleColor() {
float fraction = 0.5f + 0.5f * Math.max(0.0f, Math.min(1.0f,
(mCircleRadius - mMinBackgroundRadius) / (0.5f * mMinBackgroundRadius)));
+ if (mPreviewView != null) {
+ float finishingFraction = 1 - Math.max(0, mCircleRadius - mCircleStartRadius)
+ / (mMaxCircleSize - mCircleStartRadius);
+ fraction *= finishingFraction;
+ }
int color = Color.argb((int) (Color.alpha(mCircleColor) * fraction),
Color.red(mCircleColor),
Color.green(mCircleColor), Color.blue(mCircleColor));
@@ -191,6 +213,8 @@
public void finishAnimation(float velocity, final Runnable mAnimationEndRunnable) {
cancelAnimator(mCircleAnimator);
+ cancelAnimator(mPreviewClipper);
+ mCircleStartRadius = mCircleRadius;
float maxCircleSize = getMaxCircleSize();
ValueAnimator animatorToRadius = getAnimatorToRadius(maxCircleSize);
mFlingAnimationUtils.applyDismissing(animatorToRadius, mCircleRadius, maxCircleSize,
@@ -203,6 +227,16 @@
});
animatorToRadius.start();
setImageAlpha(0, true);
+ if (mPreviewView != null) {
+ mPreviewView.setVisibility(View.VISIBLE);
+ mPreviewClipper = ViewAnimationUtils.createCircularReveal(
+ mPreviewView, getLeft() + mCenterX, getTop() + mCenterY, mCircleRadius,
+ maxCircleSize);
+ mFlingAnimationUtils.applyDismissing(mPreviewClipper, mCircleRadius, maxCircleSize,
+ velocity, maxCircleSize);
+ mPreviewClipper.addListener(mClipEndListener);
+ mPreviewClipper.start();
+ }
}
private float getMaxCircleSize() {
@@ -234,6 +268,11 @@
if (mCircleAnimator == null) {
mCircleRadius = circleRadius;
invalidate();
+ if (nowHidden) {
+ if (mPreviewView != null) {
+ mPreviewView.setVisibility(View.INVISIBLE);
+ }
+ }
} else if (!mCircleWillBeHidden) {
// We just update the end value
@@ -244,6 +283,7 @@
}
} else {
cancelAnimator(mCircleAnimator);
+ cancelAnimator(mPreviewClipper);
ValueAnimator animator = getAnimatorToRadius(circleRadius);
Interpolator interpolator = circleRadius == 0.0f
? mDisappearInterpolator
@@ -255,6 +295,22 @@
duration = Math.min(duration, CIRCLE_DISAPPEAR_MAX_DURATION);
animator.setDuration(duration);
animator.start();
+ if (mPreviewView != null) {
+ mPreviewView.setVisibility(View.VISIBLE);
+ mPreviewClipper = ViewAnimationUtils.createCircularReveal(
+ mPreviewView, getLeft() + mCenterX, getTop() + mCenterY, mCircleRadius,
+ circleRadius);
+ mPreviewClipper.setInterpolator(interpolator);
+ mPreviewClipper.setDuration(duration);
+ mPreviewClipper.addListener(mClipEndListener);
+ mPreviewClipper.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mPreviewView.setVisibility(View.INVISIBLE);
+ }
+ });
+ mPreviewClipper.start();
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index f5d4889..8bae19a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -167,6 +167,11 @@
apply();
}
+ @Override
+ public boolean hasOverlappingRendering() {
+ return false;
+ }
+
private void applyInetProblem(ImageView iv) {
iv.setColorFilter(Build.IS_DEBUGGABLE && mInetProblem ? PROBLEM_FILTER : null);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
index a8a0cb1..9cc559f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java
@@ -67,7 +67,6 @@
private Animator mSwipeAnimator;
private int mMinBackgroundRadius;
private boolean mMotionPerformedByUser;
- private PowerManager mPM;
private AnimatorListenerAdapter mFlingEndListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -89,11 +88,12 @@
mLeftIcon.setIsLeft(true);
mCenterIcon = mCallback.getCenterIcon();
mRightIcon = mCallback.getRightIcon();
+ mLeftIcon.setPreviewView(mCallback.getLeftPreview());
+ mRightIcon.setPreviewView(mCallback.getRightPreview());
updateIcon(mLeftIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false);
updateIcon(mCenterIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false);
updateIcon(mRightIcon, 0.0f, SWIPE_RESTING_ALPHA_AMOUNT, false);
initDimens();
- mPM = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
}
private void initDimens() {
@@ -334,7 +334,6 @@
float absTranslation = Math.abs(translation);
if (absTranslation > Math.abs(mTranslationOnDown) + mMinTranslationAmount ||
mMotionPerformedByUser) {
- userActivity();
mMotionPerformedByUser = true;
}
if (translation != mTranslation || isReset) {
@@ -387,11 +386,6 @@
return translation * BACKGROUND_RADIUS_SCALE_FACTOR + mMinBackgroundRadius;
}
-
- private void userActivity() {
- mPM.userActivity(SystemClock.uptimeMillis(), false);
- }
-
public void animateHideLeftRightIcon() {
updateIcon(mRightIcon, 0f, 0f, true);
updateIcon(mLeftIcon, 0f, 0f, true);
@@ -475,5 +469,9 @@
KeyguardAffordanceView getCenterIcon();
KeyguardAffordanceView getRightIcon();
+
+ View getLeftPreview();
+
+ View getRightPreview();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index b9f012c..b5f517d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -30,6 +30,7 @@
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
+import android.view.ViewGroup;
import android.view.accessibility.AccessibilityManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -40,6 +41,7 @@
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.FlashlightController;
import com.android.systemui.statusbar.KeyguardAffordanceView;
+import com.android.systemui.statusbar.policy.PreviewInflater;
/**
* Implementation for the bottom area of the Keyguard, including camera/phone affordance and status
@@ -61,6 +63,10 @@
private KeyguardAffordanceView mPhoneImageView;
private KeyguardAffordanceView mLockIcon;
private View mIndicationText;
+ private ViewGroup mPreviewContainer;
+
+ private View mPhonePreview;
+ private View mCameraPreview;
private ActivityStarter mActivityStarter;
private UnlockMethodCache mUnlockMethodCache;
@@ -88,6 +94,7 @@
protected void onFinishInflate() {
super.onFinishInflate();
mLockPatternUtils = new LockPatternUtils(mContext);
+ mPreviewContainer = (ViewGroup) findViewById(R.id.preview_container);
mCameraImageView = (KeyguardAffordanceView) findViewById(R.id.camera_button);
mPhoneImageView = (KeyguardAffordanceView) findViewById(R.id.phone_button);
mLockIcon = (KeyguardAffordanceView) findViewById(R.id.lock_icon);
@@ -101,6 +108,7 @@
updateTrust();
setClipChildren(false);
setClipToPadding(false);
+ inflatePreviews();
}
public void setActivityStarter(ActivityStarter activityStarter) {
@@ -239,6 +247,14 @@
return mCameraImageView;
}
+ public View getPhonePreview() {
+ return mPhonePreview;
+ }
+
+ public View getCameraPreview() {
+ return mCameraPreview;
+ }
+
public KeyguardAffordanceView getLockIcon() {
return mLockIcon;
}
@@ -258,6 +274,20 @@
updateCameraVisibility();
}
+ private void inflatePreviews() {
+ PreviewInflater inflater = new PreviewInflater(mContext, new LockPatternUtils(mContext));
+ mPhonePreview = inflater.inflatePreview(PHONE_INTENT);
+ mCameraPreview = inflater.inflatePreview(getCameraIntent());
+ if (mPhonePreview != null) {
+ mPreviewContainer.addView(mPhonePreview);
+ mPhonePreview.setVisibility(View.INVISIBLE);
+ }
+ if (mCameraPreview != null) {
+ mPreviewContainer.addView(mCameraPreview);
+ mCameraPreview.setVisibility(View.INVISIBLE);
+ }
+ }
+
private final BroadcastReceiver mDevicePolicyReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
post(new Runnable() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index 319096d..a15d35e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -36,7 +36,6 @@
private static final float CLOCK_SCALE_FADE_END = 0.75f;
private static final float CLOCK_SCALE_FADE_END_NO_NOTIFS = 0.5f;
-
private static final float CLOCK_ADJ_TOP_PADDING_MULTIPLIER_MIN = 1.4f;
private static final float CLOCK_ADJ_TOP_PADDING_MULTIPLIER_MAX = 3.2f;
@@ -50,6 +49,8 @@
private int mNotificationCount;
private int mHeight;
private int mKeyguardStatusHeight;
+ private float mEmptyDragAmount;
+ private float mDensity;
/**
* The number (fractional) of notifications the "more" card counts when calculating how many
@@ -81,16 +82,18 @@
mMoreCardNotificationAmount =
(float) res.getDimensionPixelSize(R.dimen.notification_summary_height) /
res.getDimensionPixelSize(R.dimen.notification_min_height);
+ mDensity = res.getDisplayMetrics().density;
}
public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight,
- int notificationCount, int height, int keyguardStatusHeight) {
+ int notificationCount, int height, int keyguardStatusHeight, float emptyDragAmount) {
mMaxKeyguardNotifications = maxKeyguardNotifications;
mMaxPanelHeight = maxPanelHeight;
mExpandedHeight = expandedHeight;
mNotificationCount = notificationCount;
mHeight = height;
mKeyguardStatusHeight = keyguardStatusHeight;
+ mEmptyDragAmount = emptyDragAmount;
}
public void run(Result result) {
@@ -116,6 +119,7 @@
float progress = distanceToScaleEnd / (startPadding - scaleEnd);
progress = Math.max(0.0f, Math.min(progress, 1.0f));
progress = mAccelerateInterpolator.getInterpolation(progress);
+ progress *= Math.pow(1 + mEmptyDragAmount / mDensity / 300, 0.3f);
return progress;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java
new file mode 100644
index 0000000..7579039
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.phone;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.ColorFilter;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.WindowInsets;
+import android.widget.FrameLayout;
+
+/**
+ * A view group which contains the preview of phone/camera and draws a black bar at the bottom as
+ * the fake navigation bar.
+ */
+public class KeyguardPreviewContainer extends FrameLayout {
+
+ private Drawable mBlackBarDrawable = new Drawable() {
+ @Override
+ public void draw(Canvas canvas) {
+ canvas.save();
+ canvas.clipRect(0, getHeight() - getPaddingBottom(), getWidth(), getHeight());
+ canvas.drawColor(Color.BLACK);
+ canvas.restore();
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ // noop
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ // noop
+ }
+
+ @Override
+ public int getOpacity() {
+ return android.graphics.PixelFormat.OPAQUE;
+ }
+ };
+
+ public KeyguardPreviewContainer(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ setBackground(mBlackBarDrawable);
+ }
+
+ @Override
+ public WindowInsets onApplyWindowInsets(WindowInsets insets) {
+ setPadding(0, 0, 0, insets.getStableInsetBottom());
+ return super.onApplyWindowInsets(insets);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 11a38b5..909972a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -45,8 +45,6 @@
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.stack.StackStateAnimator;
-import java.util.ArrayList;
-
public class NotificationPanelView extends PanelView implements
ExpandableView.OnHeightChangedListener, ObservableScrollView.Listener,
View.OnClickListener, NotificationStackScrollLayout.OnOverscrollTopChangedListener,
@@ -112,6 +110,7 @@
private boolean mUnlockIconActive;
private int mNotificationsHeaderCollideDistance;
private int mUnlockMoveDistance;
+ private float mEmptyDragAmount;
private Interpolator mFastOutSlowInInterpolator;
private Interpolator mFastOutLinearInterpolator;
@@ -236,7 +235,8 @@
getExpandedHeight(),
mNotificationStackScroller.getNotGoneChildCount(),
getHeight(),
- mKeyguardStatusView.getHeight());
+ mKeyguardStatusView.getHeight(),
+ mEmptyDragAmount);
mClockPositionAlgorithm.run(mClockPositionResult);
if (animate || mClockAnimator != null) {
startClockAnimation(mClockPositionResult.clockY);
@@ -1257,6 +1257,20 @@
}
@Override
+ public View getLeftPreview() {
+ return getLayoutDirection() == LAYOUT_DIRECTION_RTL
+ ? mKeyguardBottomArea.getCameraPreview()
+ : mKeyguardBottomArea.getPhonePreview();
+ }
+
+ @Override
+ public View getRightPreview() {
+ return getLayoutDirection() == LAYOUT_DIRECTION_RTL
+ ? mKeyguardBottomArea.getPhonePreview()
+ : mKeyguardBottomArea.getCameraPreview();
+ }
+
+ @Override
protected float getPeekHeight() {
if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
return mNotificationStackScroller.getPeekHeight();
@@ -1307,4 +1321,15 @@
public void setLaunchTransitionEndRunnable(Runnable r) {
mLaunchAnimationEndRunnable = r;
}
+
+ public void setEmptyDragAmount(float amount) {
+ float factor = 1f;
+ if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
+ factor = 0.6f;
+ } else if (!mStatusBar.hasNotifications()) {
+ factor = 0.4f;
+ }
+ mEmptyDragAmount = amount * factor;
+ positionClockAndNotifications();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 13fad7b3..2123bd9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -70,7 +70,6 @@
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
-import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.NotificationListenerService.RankingMap;
@@ -130,6 +129,7 @@
import com.android.systemui.statusbar.SpeedBumpView;
import com.android.systemui.statusbar.StatusBarIconView;
import com.android.systemui.statusbar.StatusBarState;
+import com.android.systemui.statusbar.policy.NextAlarmController;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback;
import com.android.systemui.statusbar.policy.BluetoothControllerImpl;
@@ -159,7 +159,7 @@
import java.util.List;
public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
- DragDownHelper.OnDragDownListener, ActivityStarter {
+ DragDownHelper.DragDownCallback, ActivityStarter {
static final String TAG = "PhoneStatusBar";
public static final boolean DEBUG = BaseStatusBar.DEBUG;
public static final boolean SPEW = false;
@@ -224,6 +224,7 @@
KeyguardUserSwitcher mKeyguardUserSwitcher;
FlashlightController mFlashlightController;
UserSwitcherController mUserSwitcherController;
+ NextAlarmController mNextAlarmController;
KeyguardMonitor mKeyguardMonitor;
int mNaturalBarHeight = -1;
@@ -282,7 +283,6 @@
private long mKeyguardFadingAwayDuration;
int mKeyguardMaxNotificationCount;
- View mDateTimeView;
// carrier/wifi label
private TextView mCarrierLabel;
@@ -453,6 +453,8 @@
private Runnable mLaunchTransitionEndRunnable;
private boolean mLaunchTransitionFadingAway;
+ private boolean mHasNotifications;
+
private static final int VISIBLE_LOCATIONS = ViewState.LOCATION_FIRST_CARD
| ViewState.LOCATION_TOP_STACK_PEEKING
| ViewState.LOCATION_MAIN_AREA
@@ -702,12 +704,6 @@
(KeyguardIndicationTextView) mStatusBarWindow.findViewById(
R.id.keyguard_indication_text));
- mDateTimeView = mHeader.findViewById(R.id.datetime);
- if (mDateTimeView != null) {
- mDateTimeView.setOnClickListener(mClockClickListener);
- mDateTimeView.setEnabled(true);
- }
-
mTickerEnabled = res.getBoolean(R.bool.enable_ticker);
if (mTickerEnabled) {
final ViewStub tickerStub = (ViewStub) mStatusBarView.findViewById(R.id.ticker_stub);
@@ -784,6 +780,7 @@
mFlashlightController = new FlashlightController(mContext);
mKeyguardBottomArea.setFlashlightController(mFlashlightController);
mUserSwitcherController = new UserSwitcherController(mContext);
+ mNextAlarmController = new NextAlarmController(mContext);
mKeyguardMonitor = new KeyguardMonitor();
mKeyguardUserSwitcher = new KeyguardUserSwitcher(mContext,
@@ -815,6 +812,7 @@
mUserInfoController.reloadUserInfo();
mHeader.setBatteryController(mBatteryController);
+ mHeader.setNextAlarmController(mNextAlarmController);
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mBroadcastReceiver.onReceive(mContext,
@@ -1317,8 +1315,12 @@
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0
- && !mNotificationPanel.isTracking() && mState != StatusBarState.KEYGUARD) {
- animateCollapsePanels();
+ && !mNotificationPanel.isTracking()) {
+ if (mState == StatusBarState.SHADE) {
+ animateCollapsePanels();
+ } else if (mState == StatusBarState.SHADE_LOCKED) {
+ goToKeyguard();
+ }
}
}
setAreThereNotifications();
@@ -1614,6 +1616,9 @@
findAndUpdateMediaNotifications();
updateCarrierLabelVisibility(false);
+
+ // TODO: Multiuser handling!
+ mHasNotifications = any;
}
public void findAndUpdateMediaNotifications() {
@@ -2346,6 +2351,13 @@
}
@Override // CommandQueue
+ public void buzzBeepBlinked() {
+ if (mDozeServiceHost != null) {
+ mDozeServiceHost.fireBuzzBeepBlinked();
+ }
+ }
+
+ @Override // CommandQueue
public void setSystemUiVisibility(int vis, int mask) {
final int oldVal = mSystemUiVisibility;
final int newVal = (oldVal&~mask) | (vis&mask);
@@ -2795,6 +2807,9 @@
if (mBatteryController != null) {
mBatteryController.dump(fd, pw, args);
}
+ if (mNextAlarmController != null) {
+ mNextAlarmController.dump(fd, pw, args);
+ }
}
private String hunStateToString(Entry entry) {
@@ -2851,6 +2866,7 @@
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned) {
if (onlyProvisioned && !isDeviceProvisioned()) return;
+ final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
dismissKeyguardThenExecute(new OnDismissAction() {
@Override
public boolean onDismiss() {
@@ -2861,7 +2877,10 @@
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
mContext.startActivityAsUser(
intent, new UserHandle(UserHandle.USER_CURRENT));
- mWindowManagerService.overridePendingAppTransition(null, 0, 0, null);
+ if (keyguardShowing) {
+ mWindowManagerService.overridePendingAppTransition(
+ null, 0, 0, null);
+ }
} catch (RemoteException e) {
}
}
@@ -2886,11 +2905,9 @@
String action = intent.getAction();
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
int flags = CommandQueue.FLAG_EXCLUDE_NONE;
- if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
- String reason = intent.getStringExtra("reason");
- if (reason != null && reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
- flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
- }
+ String reason = intent.getStringExtra("reason");
+ if (reason != null && reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
+ flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
}
animateCollapsePanels(flags);
}
@@ -3592,8 +3609,17 @@
// ---------------------- DragDownHelper.OnDragDownListener ------------------------------------
@Override
- public void onDraggedDown(View startingChild) {
- goToLockedShade(startingChild);
+ public boolean onDraggedDown(View startingChild) {
+ if (mHasNotifications) {
+
+ // We have notifications, go to locked shade.
+ goToLockedShade(startingChild);
+ return true;
+ } else {
+
+ // No notifications - abort gesture.
+ return false;
+ }
}
@Override
@@ -3601,6 +3627,7 @@
mStackScroller.setDimmed(true /* dimmed */, true /* animated */);
}
+ @Override
public void onThresholdReached() {
mStackScroller.setDimmed(false /* dimmed */, true /* animate */);
}
@@ -3610,6 +3637,11 @@
mStackScroller.removeLongPressCallback();
}
+ @Override
+ public void setEmptyDragAmount(float amount) {
+ mNotificationPanel.setEmptyDragAmount(amount);
+ }
+
/**
* If secure with redaction: Show bouncer, go to unlocked shade.
*
@@ -3720,6 +3752,10 @@
notifyUiVisibilityChanged(mSystemUiVisibility);
}
+ public boolean hasNotifications() {
+ return mHasNotifications;
+ }
+
private final class ShadeUpdates {
private final ArraySet<String> mVisibleNotifications = new ArraySet<String>();
private final ArraySet<String> mNewVisibleNotifications = new ArraySet<String>();
@@ -3757,6 +3793,12 @@
private DozeService mCurrentDozeService;
+ public void fireBuzzBeepBlinked() {
+ for (Callback callback : mCallbacks) {
+ callback.onBuzzBeepBlinked();
+ }
+ }
+
public void fireNewNotifications() {
for (Callback callback : mCallbacks) {
callback.onNewNotifications();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index 65359ee..7b40d72 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -16,6 +16,8 @@
package com.android.systemui.statusbar.phone;
+import android.app.AlarmClockInfo;
+import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Outline;
@@ -31,18 +33,20 @@
import android.widget.Switch;
import android.widget.TextView;
+import com.android.keyguard.KeyguardStatusView;
import com.android.systemui.R;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
+import com.android.systemui.statusbar.policy.NextAlarmController;
import com.android.systemui.statusbar.policy.UserInfoController;
/**
* The view to manage the header area in the expanded status bar.
*/
public class StatusBarHeaderView extends RelativeLayout implements View.OnClickListener,
- BatteryController.BatteryStateChangeCallback {
+ BatteryController.BatteryStateChangeCallback, NextAlarmController.NextAlarmChangeCallback {
private boolean mExpanded;
private boolean mListening;
@@ -52,7 +56,8 @@
private ViewGroup mSystemIconsContainer;
private View mSystemIconsSuperContainer;
- private View mDateTime;
+ private View mDateGroup;
+ private View mClock;
private View mTime;
private View mAmPm;
private View mKeyguardCarrierText;
@@ -68,9 +73,12 @@
private Switch mQsDetailHeaderSwitch;
private View mEmergencyCallsOnly;
private TextView mBatteryLevel;
+ private TextView mAlarmStatus;
private boolean mShowEmergencyCallsOnly;
private boolean mKeyguardUserSwitcherShowing;
+ private boolean mAlarmShowing;
+ private AlarmClockInfo mNextAlarm;
private int mCollapsedHeight;
private int mExpandedHeight;
@@ -84,9 +92,13 @@
private int mMultiUserKeyguardMargin;
private int mSystemIconsSwitcherHiddenExpandedMargin;
private int mClockMarginBottomExpanded;
+ private int mClockMarginBottomCollapsed;
private int mMultiUserSwitchWidthCollapsed;
private int mMultiUserSwitchWidthExpanded;
+ private int mMultiUserSwitchWidthKeyguard;
private int mBatteryPaddingEnd;
+ private int mBatteryMarginExpanded;
+ private int mBatteryMarginKeyguard;
/**
* In collapsed QS, the clock and avatar are scaled down a bit post-layout to allow for a nice
@@ -94,9 +106,11 @@
*/
private float mClockCollapsedScaleFactor;
private float mAvatarCollapsedScaleFactor;
+ private float mAvatarKeyguardScaleFactor;
private ActivityStarter mActivityStarter;
private BatteryController mBatteryController;
+ private NextAlarmController mNextAlarmController;
private QSPanel mQSPanel;
private KeyguardUserSwitcher mKeyguardUserSwitcher;
@@ -113,7 +127,8 @@
mSystemIconsSuperContainer = findViewById(R.id.system_icons_super_container);
mSystemIconsContainer = (ViewGroup) findViewById(R.id.system_icons_container);
mSystemIconsSuperContainer.setOnClickListener(this);
- mDateTime = findViewById(R.id.datetime);
+ mDateGroup = findViewById(R.id.date_group);
+ mClock = findViewById(R.id.clock);
mTime = findViewById(R.id.time_view);
mAmPm = findViewById(R.id.am_pm_view);
mKeyguardCarrierText = findViewById(R.id.keyguard_carrier_text);
@@ -129,6 +144,8 @@
mQsDetailHeaderSwitch = (Switch) mQsDetailHeader.findViewById(android.R.id.toggle);
mEmergencyCallsOnly = findViewById(R.id.header_emergency_calls_only);
mBatteryLevel = (TextView) findViewById(R.id.battery_level);
+ mAlarmStatus = (TextView) findViewById(R.id.alarm_status);
+ mAlarmStatus.setOnClickListener(this);
loadDimens();
updateVisibilities();
updateClockScale();
@@ -175,18 +192,29 @@
R.dimen.system_icons_switcher_hidden_expanded_margin);
mClockMarginBottomExpanded =
getResources().getDimensionPixelSize(R.dimen.clock_expanded_bottom_margin);
+ mClockMarginBottomCollapsed =
+ getResources().getDimensionPixelSize(R.dimen.clock_collapsed_bottom_margin);
mMultiUserSwitchWidthCollapsed =
getResources().getDimensionPixelSize(R.dimen.multi_user_switch_width_collapsed);
mMultiUserSwitchWidthExpanded =
getResources().getDimensionPixelSize(R.dimen.multi_user_switch_width_expanded);
+ mMultiUserSwitchWidthKeyguard =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_switch_width_keyguard);
mAvatarCollapsedScaleFactor =
getResources().getDimensionPixelSize(R.dimen.multi_user_avatar_collapsed_size)
/ (float) mMultiUserAvatar.getLayoutParams().width;
+ mAvatarKeyguardScaleFactor =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_avatar_keyguard_size)
+ / (float) mMultiUserAvatar.getLayoutParams().width;
mClockCollapsedScaleFactor =
(float) getResources().getDimensionPixelSize(R.dimen.qs_time_collapsed_size)
/ (float) getResources().getDimensionPixelSize(R.dimen.qs_time_expanded_size);
mBatteryPaddingEnd =
getResources().getDimensionPixelSize(R.dimen.battery_level_padding_end);
+ mBatteryMarginExpanded =
+ getResources().getDimensionPixelSize(R.dimen.header_battery_margin_expanded);
+ mBatteryMarginKeyguard =
+ getResources().getDimensionPixelSize(R.dimen.header_battery_margin_keyguard);
}
public void setActivityStarter(ActivityStarter activityStarter) {
@@ -197,6 +225,10 @@
mBatteryController = batteryController;
}
+ public void setNextAlarmController(NextAlarmController nextAlarmController) {
+ mNextAlarmController = nextAlarmController;
+ }
+
public int getCollapsedHeight() {
return mKeyguardShowing ? mKeyguardHeight : mCollapsedHeight;
}
@@ -210,7 +242,7 @@
return;
}
mListening = listening;
- updateBatteryListening();
+ updateListeners();
}
public void setExpanded(boolean expanded, boolean overscrolled) {
@@ -234,6 +266,7 @@
updateAvatarScale();
updateClockLp();
updateBatteryLevelPaddingEnd();
+ updateBatteryLevelLp();
mStatusIconClipper.update();
}
}
@@ -282,10 +315,15 @@
} else {
setBackgroundResource(R.drawable.notification_header_bg);
}
- mDateTime.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
+ mDateGroup.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
+ mClock.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
mKeyguardCarrierText.setVisibility(onKeyguardAndCollapsed ? View.VISIBLE : View.GONE);
- mDateCollapsed.setVisibility(mExpanded && !mOverscrolled ? View.GONE : View.VISIBLE);
- mDateExpanded.setVisibility(mExpanded && !mOverscrolled ? View.VISIBLE : View.GONE);
+ mDateCollapsed.setVisibility(mExpanded && !mOverscrolled && mAlarmShowing
+ ? View.VISIBLE : View.GONE);
+ mDateExpanded.setVisibility(mExpanded && !mOverscrolled && mAlarmShowing
+ ? View.GONE : View.VISIBLE);
+ mAlarmStatus.setVisibility(mExpanded && !mOverscrolled && mAlarmShowing
+ ? View.VISIBLE : View.GONE);
mSettingsButton.setVisibility(mExpanded && !mOverscrolled ? View.VISIBLE : View.GONE);
mQsDetailHeader.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
if (mStatusIcons != null) {
@@ -319,21 +357,26 @@
mSystemIconsSuperContainer.setLayoutParams(lp);
}
- private void updateBatteryListening() {
+ private void updateListeners() {
if (mListening) {
mBatteryController.addStateChangedCallback(this);
+ mNextAlarmController.addStateChangedCallback(this);
} else {
mBatteryController.removeStateChangedCallback(this);
+ mNextAlarmController.removeStateChangedCallback(this);
}
}
private void updateAvatarScale() {
- if (!mExpanded || mOverscrolled) {
- mMultiUserSwitch.setScaleX(mAvatarCollapsedScaleFactor);
- mMultiUserSwitch.setScaleY(mAvatarCollapsedScaleFactor);
- } else {
+ if (mExpanded && !mOverscrolled) {
mMultiUserSwitch.setScaleX(1f);
mMultiUserSwitch.setScaleY(1f);
+ } else if (mKeyguardShowing) {
+ mMultiUserSwitch.setScaleX(mAvatarKeyguardScaleFactor);
+ mMultiUserSwitch.setScaleY(mAvatarKeyguardScaleFactor);
+ } else {
+ mMultiUserSwitch.setScaleX(mAvatarCollapsedScaleFactor);
+ mMultiUserSwitch.setScaleY(mAvatarCollapsedScaleFactor);
}
}
@@ -375,15 +418,26 @@
// could not care less
}
+ @Override
+ public void onNextAlarmChanged(AlarmClockInfo nextAlarm) {
+ mNextAlarm = nextAlarm;
+ if (nextAlarm != null) {
+ mAlarmStatus.setText(KeyguardStatusView.formatNextAlarm(getContext(), nextAlarm));
+ }
+ mAlarmShowing = nextAlarm != null;
+ updateVisibilities();
+ }
+
+
private void updateClickTargets() {
setClickable(!mKeyguardShowing || mExpanded);
- mDateTime.setClickable(mExpanded);
boolean keyguardSwitcherAvailable =
mKeyguardUserSwitcher != null && mKeyguardShowing && !mExpanded;
mMultiUserSwitch.setClickable(mExpanded || keyguardSwitcherAvailable);
mMultiUserSwitch.setKeyguardMode(keyguardSwitcherAvailable);
mSystemIconsSuperContainer.setClickable(mExpanded);
+ mAlarmStatus.setClickable(mNextAlarm != null && mNextAlarm.getShowIntent() != null);
}
private void updateZTranslation() {
@@ -404,29 +458,29 @@
}
private void updateClockLp() {
- int marginBottom = mExpanded && !mOverscrolled ? mClockMarginBottomExpanded : 0;
- LayoutParams lp = (LayoutParams) mDateTime.getLayoutParams();
- int rule = mExpanded && !mOverscrolled ? TRUE : 0;
- if (marginBottom != lp.bottomMargin
- || lp.getRules()[RelativeLayout.ALIGN_PARENT_BOTTOM] != rule) {
+ int marginBottom = mExpanded && !mOverscrolled
+ ? mClockMarginBottomExpanded
+ : mClockMarginBottomCollapsed;
+ LayoutParams lp = (LayoutParams) mDateGroup.getLayoutParams();
+ if (marginBottom != lp.bottomMargin) {
lp.bottomMargin = marginBottom;
- lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, rule);
- mDateTime.setLayoutParams(lp);
+ mDateGroup.setLayoutParams(lp);
}
}
private void updateMultiUserSwitch() {
int marginEnd;
+ int width;
if (mExpanded && !mOverscrolled) {
marginEnd = mMultiUserExpandedMargin;
+ width = mMultiUserSwitchWidthExpanded;
} else if (mKeyguardShowing) {
marginEnd = mMultiUserKeyguardMargin;
+ width = mMultiUserSwitchWidthKeyguard;
} else {
marginEnd = mMultiUserCollapsedMargin;
+ width = mMultiUserSwitchWidthCollapsed;
}
- int width = mExpanded && !mOverscrolled
- ? mMultiUserSwitchWidthExpanded
- : mMultiUserSwitchWidthCollapsed;
MarginLayoutParams lp = (MarginLayoutParams) mMultiUserSwitch.getLayoutParams();
if (marginEnd != lp.getMarginEnd() || lp.width != width) {
lp.setMarginEnd(marginEnd);
@@ -435,6 +489,17 @@
}
}
+ private void updateBatteryLevelLp() {
+ int marginStart = mExpanded && !mOverscrolled
+ ? mBatteryMarginExpanded
+ : mBatteryMarginKeyguard;
+ MarginLayoutParams lp = (MarginLayoutParams) mBatteryLevel.getLayoutParams();
+ if (marginStart != lp.getMarginStart()) {
+ lp.setMarginStart(marginStart);
+ mBatteryLevel.setLayoutParams(lp);
+ }
+ }
+
public void setExpansion(float t) {
float height = mCollapsedHeight + t * (mExpandedHeight - mCollapsedHeight);
if (height < mCollapsedHeight) {
@@ -481,6 +546,7 @@
updateMultiUserSwitch();
updateClickTargets();
updateBatteryLevelPaddingEnd();
+ updateAvatarScale();
mStatusIconClipper.update();
}
@@ -499,6 +565,11 @@
startSettingsActivity();
} else if (v == mSystemIconsSuperContainer) {
startBatteryActivity();
+ } else if (v == mAlarmStatus && mNextAlarm != null) {
+ PendingIntent showIntent = mNextAlarm.getShowIntent();
+ if (showIntent != null && showIntent.isActivity()) {
+ mActivityStarter.startActivity(showIntent.getIntent());
+ }
}
}
@@ -613,7 +684,8 @@
private void handleShowingDetail(final QSTile.DetailAdapter detail) {
final boolean showingDetail = detail != null;
- transition(mDateTime, !showingDetail);
+ transition(mClock, !showingDetail);
+ transition(mDateGroup, !showingDetail);
transition(mQsDetailHeader, showingDetail);
if (showingDetail) {
mQsDetailHeaderTitle.setText(detail.getTitle());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 6d8b400..b64dcbe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -24,7 +24,7 @@
void setWifiEnabled(boolean enabled);
public interface NetworkSignalChangedCallback {
- void onWifiSignalChanged(boolean enabled, int wifiSignalIconId,
+ void onWifiSignalChanged(boolean enabled, boolean connected, int wifiSignalIconId,
boolean activityIn, boolean activityOut,
String wifiSignalContentDescriptionId, String description);
void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 2b08902..4fc2e06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -401,7 +401,7 @@
boolean wifiOut = wifiEnabled && mWifiSsid != null
&& (mWifiActivity == WifiManager.DATA_ACTIVITY_INOUT
|| mWifiActivity == WifiManager.DATA_ACTIVITY_OUT);
- cb.onWifiSignalChanged(mWifiEnabled, mQSWifiIconId, wifiIn, wifiOut,
+ cb.onWifiSignalChanged(mWifiEnabled, mWifiConnected, mQSWifiIconId, wifiIn, wifiOut,
mContentDescriptionWifi, wifiDesc);
boolean mobileIn = mDataConnected && (mDataActivity == TelephonyManager.DATA_ACTIVITY_INOUT
@@ -573,9 +573,11 @@
switch(mServiceState.getVoiceRegState()) {
case ServiceState.STATE_POWER_OFF:
retVal = false;
+ break;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
retVal = mServiceState.getDataRegState() == ServiceState.STATE_IN_SERVICE;
+ break;
default:
retVal = true;
}
@@ -597,8 +599,8 @@
private final void updateTelephonySignalStrength() {
Rlog.d(TAG, "updateTelephonySignalStrength: hasService=" + hasService() + " ss=" + mSignalStrength);
- if (false/*!hasService()*/) {
- if (CHATTY) Log.d(TAG, "updateTelephonySignalStrength: !hasService()");
+ if (!hasService()) {
+ if (true/*CHATTY*/) Log.d(TAG, "updateTelephonySignalStrength: !hasService()");
mPhoneSignalIconId = R.drawable.stat_sys_signal_null;
mQSPhoneSignalIconId = R.drawable.ic_qs_signal_no_signal;
mDataSignalIconId = R.drawable.stat_sys_signal_null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmController.java
new file mode 100644
index 0000000..ca71521
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NextAlarmController.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.app.AlarmClockInfo;
+import android.app.AlarmManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.UserHandle;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+public class NextAlarmController extends BroadcastReceiver {
+
+ private final ArrayList<NextAlarmChangeCallback> mChangeCallbacks = new ArrayList<>();
+
+ private AlarmManager mAlarmManager;
+ private AlarmClockInfo mNextAlarm;
+
+ public NextAlarmController(Context context) {
+ mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(Intent.ACTION_USER_SWITCHED);
+ filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
+ context.registerReceiver(this, filter);
+ updateNextAlarm();
+ }
+
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ pw.println("NextAlarmController state:");
+ pw.print(" mNextAlarm="); pw.println(mNextAlarm);
+ }
+
+ public void addStateChangedCallback(NextAlarmChangeCallback cb) {
+ mChangeCallbacks.add(cb);
+ cb.onNextAlarmChanged(mNextAlarm);
+ }
+
+ public void removeStateChangedCallback(NextAlarmChangeCallback cb) {
+ mChangeCallbacks.remove(cb);
+ }
+
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ if (action.equals(Intent.ACTION_USER_SWITCHED)
+ || action.equals(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED)) {
+ updateNextAlarm();
+ }
+ }
+
+ private void updateNextAlarm() {
+ mNextAlarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT);
+ fireNextAlarmChanged();
+ }
+
+ private void fireNextAlarmChanged() {
+ int n = mChangeCallbacks.size();
+ for (int i = 0; i < n; i++) {
+ mChangeCallbacks.get(i).onNextAlarmChanged(mNextAlarm);
+ }
+ }
+
+ public interface NextAlarmChangeCallback {
+ void onNextAlarmChanged(AlarmClockInfo nextAlarm);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java
new file mode 100644
index 0000000..d405172
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/PreviewInflater.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.pm.UserInfo;
+import android.os.UserHandle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardActivityLauncher;
+import com.android.systemui.statusbar.phone.KeyguardPreviewContainer;
+
+import java.util.List;
+
+/**
+ * Utility class to inflate previews for phone and camera affordance.
+ */
+public class PreviewInflater {
+
+ private static final String TAG = "PreviewInflater";
+
+ private static final String META_DATA_KEYGUARD_LAYOUT = "com.android.keyguard.layout";
+
+ private Context mContext;
+ private LockPatternUtils mLockPatternUtils;
+
+ public PreviewInflater(Context context, LockPatternUtils lockPatternUtils) {
+ mContext = context;
+ mLockPatternUtils = lockPatternUtils;
+ }
+
+ public View inflatePreview(Intent intent) {
+ WidgetInfo info = getWidgetInfo(intent);
+ if (info == null) {
+ return null;
+ }
+ View v = inflateWidgetView(info);
+ if (v == null) {
+ return null;
+ }
+ KeyguardPreviewContainer container = new KeyguardPreviewContainer(mContext, null);
+ container.addView(v);
+ return container;
+ }
+
+ private View inflateWidgetView(WidgetInfo widgetInfo) {
+ View widgetView = null;
+ try {
+ Context appContext = mContext.createPackageContext(
+ widgetInfo.contextPackage, Context.CONTEXT_RESTRICTED);
+ LayoutInflater appInflater = (LayoutInflater)
+ appContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ appInflater = appInflater.cloneInContext(appContext);
+ widgetView = appInflater.inflate(widgetInfo.layoutId, null, false);
+ } catch (PackageManager.NameNotFoundException|RuntimeException e) {
+ Log.w(TAG, "Error creating widget view", e);
+ }
+ return widgetView;
+ }
+
+ private WidgetInfo getWidgetInfo(Intent intent) {
+ WidgetInfo info = new WidgetInfo();
+ PackageManager packageManager = mContext.getPackageManager();
+ final List<ResolveInfo> appList = packageManager.queryIntentActivitiesAsUser(
+ intent, PackageManager.MATCH_DEFAULT_ONLY, mLockPatternUtils.getCurrentUser());
+ if (appList.size() == 0) {
+ return null;
+ }
+ ResolveInfo resolved = packageManager.resolveActivityAsUser(intent,
+ PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_META_DATA,
+ mLockPatternUtils.getCurrentUser());
+ if (wouldLaunchResolverActivity(resolved, appList)) {
+ return null;
+ }
+ if (resolved == null || resolved.activityInfo == null) {
+ return null;
+ }
+ if (resolved.activityInfo.metaData == null || resolved.activityInfo.metaData.isEmpty()) {
+ return null;
+ }
+ int layoutId = resolved.activityInfo.metaData.getInt(META_DATA_KEYGUARD_LAYOUT);
+ if (layoutId == 0) {
+ return null;
+ }
+ info.contextPackage = resolved.activityInfo.packageName;
+ info.layoutId = layoutId;
+ return info;
+ }
+
+ private boolean wouldLaunchResolverActivity(ResolveInfo resolved, List<ResolveInfo> appList) {
+ // If the list contains the above resolved activity, then it can't be
+ // ResolverActivity itself.
+ for (int i = 0; i < appList.size(); i++) {
+ ResolveInfo tmp = appList.get(i);
+ if (tmp.activityInfo.name.equals(resolved.activityInfo.name)
+ && tmp.activityInfo.packageName.equals(resolved.activityInfo.packageName)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static class WidgetInfo {
+ String contextPackage;
+ int layoutId;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
index d0f61f0..a123bf7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
@@ -95,6 +95,10 @@
public void setWindowState(int window, int state) {
}
+ @Override // CommandQueue
+ public void buzzBeepBlinked() {
+ }
+
@Override
protected WindowManager.LayoutParams getSearchLayoutParams(
LayoutParams layoutParams) {
diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
index 5c8a8ef8..57b0731 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -133,6 +133,14 @@
setCropViewTileSource(bitmapSource, true, false, onLoad);
}
+ @Override
+ protected void onDestroy() {
+ if (mCropView != null) {
+ mCropView.destroy();
+ }
+ super.onDestroy();
+ }
+
public void setCropViewTileSource(
final BitmapRegionTileSource.BitmapSource bitmapSource, final boolean touchEnabled,
final boolean moveToLeft, final Runnable postExecute) {
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 392c280..3e75947 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -211,6 +211,9 @@
private float mElevation;
+ /** Whether window content should be clipped to the background outline. */
+ private boolean mClipToOutline;
+
private int mFrameResource = 0;
private int mTextColor = 0;
@@ -1173,7 +1176,7 @@
mDecorContentParent != null) {
final TypedValue outValue = new TypedValue();
final Theme baseTheme = context.getTheme();
- baseTheme.resolveAttribute(com.android.internal.R.attr.actionBarTheme, outValue, true);
+ baseTheme.resolveAttribute(R.attr.actionBarTheme, outValue, true);
Theme widgetTheme = null;
if (outValue.resourceId != 0) {
@@ -1181,10 +1184,10 @@
widgetTheme.setTo(baseTheme);
widgetTheme.applyStyle(outValue.resourceId, true);
widgetTheme.resolveAttribute(
- com.android.internal.R.attr.actionBarWidgetTheme, outValue, true);
+ R.attr.actionBarWidgetTheme, outValue, true);
} else {
baseTheme.resolveAttribute(
- com.android.internal.R.attr.actionBarWidgetTheme, outValue, true);
+ R.attr.actionBarWidgetTheme, outValue, true);
}
if (outValue.resourceId != 0) {
@@ -1305,6 +1308,7 @@
mBackgroundDrawable = drawable;
if (mDecor != null) {
mDecor.setWindowBackground(drawable);
+ mDecor.setClipToOutline(drawable != null && mClipToOutline);
}
}
}
@@ -1428,7 +1432,7 @@
if (featureId == FEATURE_PROGRESS || featureId == FEATURE_INDETERMINATE_PROGRESS) {
updateProgressBars(value);
} else if (featureId == FEATURE_CUSTOM_TITLE) {
- FrameLayout titleContainer = (FrameLayout) findViewById(com.android.internal.R.id.title_container);
+ FrameLayout titleContainer = (FrameLayout) findViewById(R.id.title_container);
if (titleContainer != null) {
mLayoutInflater.inflate(value, titleContainer);
}
@@ -1546,7 +1550,7 @@
private void hideProgressBars(ProgressBar horizontalProgressBar, ProgressBar spinnyProgressBar) {
final int features = getLocalFeatures();
- Animation anim = AnimationUtils.loadAnimation(getContext(), com.android.internal.R.anim.fade_out);
+ Animation anim = AnimationUtils.loadAnimation(getContext(), R.anim.fade_out);
anim.setDuration(1000);
if ((features & (1 << FEATURE_INDETERMINATE_PROGRESS)) != 0 &&
spinnyProgressBar != null &&
@@ -2440,7 +2444,7 @@
&& getAttributes().height
== WindowManager.LayoutParams.MATCH_PARENT) {
mMenuBackground = getContext().getDrawable(
- com.android.internal.R.drawable.menu_background);
+ R.drawable.menu_background);
}
if (mMenuBackground != null) {
mMenuBackground.setBounds(drawingBounds.left,
@@ -2606,7 +2610,7 @@
if (isFloating()) {
mActionModeView = new ActionBarContextView(mContext);
mActionModePopup = new PopupWindow(mContext, null,
- com.android.internal.R.attr.actionModePopupWindowStyle);
+ R.attr.actionModePopupWindowStyle);
mActionModePopup.setWindowLayoutType(
WindowManager.LayoutParams.TYPE_APPLICATION);
mActionModePopup.setContentView(mActionModeView);
@@ -2614,7 +2618,7 @@
TypedValue heightValue = new TypedValue();
mContext.getTheme().resolveAttribute(
- com.android.internal.R.attr.actionBarSize, heightValue, true);
+ R.attr.actionBarSize, heightValue, true);
final int height = TypedValue.complexToDimensionPixelSize(heightValue.data,
mContext.getResources().getDisplayMetrics());
mActionModeView.setContentHeight(height);
@@ -2628,7 +2632,7 @@
};
} else {
ViewStub stub = (ViewStub) findViewById(
- com.android.internal.R.id.action_mode_bar_stub);
+ R.id.action_mode_bar_stub);
if (stub != null) {
mActionModeView = (ActionBarContextView) stub.inflate();
}
@@ -3093,14 +3097,14 @@
if (false) {
System.out.println("From style:");
String s = "Attrs:";
- for (int i = 0; i < com.android.internal.R.styleable.Window.length; i++) {
- s = s + " " + Integer.toHexString(com.android.internal.R.styleable.Window[i]) + "="
+ for (int i = 0; i < R.styleable.Window.length; i++) {
+ s = s + " " + Integer.toHexString(R.styleable.Window[i]) + "="
+ a.getString(i);
}
System.out.println(s);
}
- mIsFloating = a.getBoolean(com.android.internal.R.styleable.Window_windowIsFloating, false);
+ mIsFloating = a.getBoolean(R.styleable.Window_windowIsFloating, false);
int flagsToUpdate = (FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR)
& (~getForcedWindowFlags());
if (mIsFloating) {
@@ -3110,78 +3114,78 @@
setFlags(FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR, flagsToUpdate);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowNoTitle, false)) {
+ if (a.getBoolean(R.styleable.Window_windowNoTitle, false)) {
requestFeature(FEATURE_NO_TITLE);
- } else if (a.getBoolean(com.android.internal.R.styleable.Window_windowActionBar, false)) {
+ } else if (a.getBoolean(R.styleable.Window_windowActionBar, false)) {
// Don't allow an action bar if there is no title.
requestFeature(FEATURE_ACTION_BAR);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowActionBarOverlay, false)) {
+ if (a.getBoolean(R.styleable.Window_windowActionBarOverlay, false)) {
requestFeature(FEATURE_ACTION_BAR_OVERLAY);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowActionModeOverlay, false)) {
+ if (a.getBoolean(R.styleable.Window_windowActionModeOverlay, false)) {
requestFeature(FEATURE_ACTION_MODE_OVERLAY);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowSwipeToDismiss, false)) {
+ if (a.getBoolean(R.styleable.Window_windowSwipeToDismiss, false)) {
requestFeature(FEATURE_SWIPE_TO_DISMISS);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowFullscreen, false)) {
+ if (a.getBoolean(R.styleable.Window_windowFullscreen, false)) {
setFlags(FLAG_FULLSCREEN, FLAG_FULLSCREEN & (~getForcedWindowFlags()));
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowTranslucentStatus,
+ if (a.getBoolean(R.styleable.Window_windowTranslucentStatus,
false)) {
setFlags(FLAG_TRANSLUCENT_STATUS, FLAG_TRANSLUCENT_STATUS
& (~getForcedWindowFlags()));
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowTranslucentNavigation,
+ if (a.getBoolean(R.styleable.Window_windowTranslucentNavigation,
false)) {
setFlags(FLAG_TRANSLUCENT_NAVIGATION, FLAG_TRANSLUCENT_NAVIGATION
& (~getForcedWindowFlags()));
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowOverscan, false)) {
+ if (a.getBoolean(R.styleable.Window_windowOverscan, false)) {
setFlags(FLAG_LAYOUT_IN_OVERSCAN, FLAG_LAYOUT_IN_OVERSCAN&(~getForcedWindowFlags()));
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowShowWallpaper, false)) {
+ if (a.getBoolean(R.styleable.Window_windowShowWallpaper, false)) {
setFlags(FLAG_SHOW_WALLPAPER, FLAG_SHOW_WALLPAPER&(~getForcedWindowFlags()));
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowEnableSplitTouch,
+ if (a.getBoolean(R.styleable.Window_windowEnableSplitTouch,
getContext().getApplicationInfo().targetSdkVersion
>= android.os.Build.VERSION_CODES.HONEYCOMB)) {
setFlags(FLAG_SPLIT_TOUCH, FLAG_SPLIT_TOUCH&(~getForcedWindowFlags()));
}
- a.getValue(com.android.internal.R.styleable.Window_windowMinWidthMajor, mMinWidthMajor);
- a.getValue(com.android.internal.R.styleable.Window_windowMinWidthMinor, mMinWidthMinor);
- if (a.hasValue(com.android.internal.R.styleable.Window_windowFixedWidthMajor)) {
+ a.getValue(R.styleable.Window_windowMinWidthMajor, mMinWidthMajor);
+ a.getValue(R.styleable.Window_windowMinWidthMinor, mMinWidthMinor);
+ if (a.hasValue(R.styleable.Window_windowFixedWidthMajor)) {
if (mFixedWidthMajor == null) mFixedWidthMajor = new TypedValue();
- a.getValue(com.android.internal.R.styleable.Window_windowFixedWidthMajor,
+ a.getValue(R.styleable.Window_windowFixedWidthMajor,
mFixedWidthMajor);
}
- if (a.hasValue(com.android.internal.R.styleable.Window_windowFixedWidthMinor)) {
+ if (a.hasValue(R.styleable.Window_windowFixedWidthMinor)) {
if (mFixedWidthMinor == null) mFixedWidthMinor = new TypedValue();
- a.getValue(com.android.internal.R.styleable.Window_windowFixedWidthMinor,
+ a.getValue(R.styleable.Window_windowFixedWidthMinor,
mFixedWidthMinor);
}
- if (a.hasValue(com.android.internal.R.styleable.Window_windowFixedHeightMajor)) {
+ if (a.hasValue(R.styleable.Window_windowFixedHeightMajor)) {
if (mFixedHeightMajor == null) mFixedHeightMajor = new TypedValue();
- a.getValue(com.android.internal.R.styleable.Window_windowFixedHeightMajor,
+ a.getValue(R.styleable.Window_windowFixedHeightMajor,
mFixedHeightMajor);
}
- if (a.hasValue(com.android.internal.R.styleable.Window_windowFixedHeightMinor)) {
+ if (a.hasValue(R.styleable.Window_windowFixedHeightMinor)) {
if (mFixedHeightMinor == null) mFixedHeightMinor = new TypedValue();
- a.getValue(com.android.internal.R.styleable.Window_windowFixedHeightMinor,
+ a.getValue(R.styleable.Window_windowFixedHeightMinor,
mFixedHeightMinor);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_windowContentTransitions, false)) {
+ if (a.getBoolean(R.styleable.Window_windowContentTransitions, false)) {
requestFeature(FEATURE_CONTENT_TRANSITIONS);
}
@@ -3190,9 +3194,9 @@
if (windowService != null) {
final Display display = windowService.getDefaultDisplay();
if (display.getDisplayId() == Display.DEFAULT_DISPLAY &&
- a.hasValue(com.android.internal.R.styleable.Window_windowOutsetBottom)) {
+ a.hasValue(R.styleable.Window_windowOutsetBottom)) {
if (mOutsetBottom == null) mOutsetBottom = new TypedValue();
- a.getValue(com.android.internal.R.styleable.Window_windowOutsetBottom,
+ a.getValue(R.styleable.Window_windowOutsetBottom,
mOutsetBottom);
}
}
@@ -3203,7 +3207,7 @@
final boolean targetPreIcs = targetSdk < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH;
final boolean targetPreL = targetSdk < android.os.Build.VERSION_CODES.L;
final boolean targetHcNeedsOptions = context.getResources().getBoolean(
- com.android.internal.R.bool.target_honeycomb_needs_options_menu);
+ R.bool.target_honeycomb_needs_options_menu);
final boolean noActionBar = !hasFeature(FEATURE_ACTION_BAR) || hasFeature(FEATURE_NO_TITLE);
if (targetPreHoneycomb || (targetPreIcs && targetHcNeedsOptions && noActionBar)) {
@@ -3216,7 +3220,7 @@
// therefore must know about visibility changes of those.
if (!mIsFloating && ActivityManager.isHighEndGfx()) {
if (!targetPreL && a.getBoolean(
- com.android.internal.R.styleable.Window_windowDrawsSystemBarBackgrounds,
+ R.styleable.Window_windowDrawsSystemBarBackgrounds,
false)) {
setFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS & ~getForcedWindowFlags());
@@ -3233,7 +3237,7 @@
if (mAlwaysReadCloseOnTouchAttr || getContext().getApplicationInfo().targetSdkVersion
>= android.os.Build.VERSION_CODES.HONEYCOMB) {
if (a.getBoolean(
- com.android.internal.R.styleable.Window_windowCloseOnTouchOutside,
+ R.styleable.Window_windowCloseOnTouchOutside,
false)) {
setCloseOnTouchOutsideIfNotSet(true);
}
@@ -3243,11 +3247,11 @@
if (!hasSoftInputMode()) {
params.softInputMode = a.getInt(
- com.android.internal.R.styleable.Window_windowSoftInputMode,
+ R.styleable.Window_windowSoftInputMode,
params.softInputMode);
}
- if (a.getBoolean(com.android.internal.R.styleable.Window_backgroundDimEnabled,
+ if (a.getBoolean(R.styleable.Window_backgroundDimEnabled,
mIsFloating)) {
/* All dialogs should have the window dimmed */
if ((getForcedWindowFlags()&WindowManager.LayoutParams.FLAG_DIM_BEHIND) == 0) {
@@ -3261,7 +3265,7 @@
if (params.windowAnimations == 0) {
params.windowAnimations = a.getResourceId(
- com.android.internal.R.styleable.Window_windowAnimationStyle, 0);
+ R.styleable.Window_windowAnimationStyle, 0);
}
// The rest are only done if this window is not embedded; otherwise,
@@ -3270,10 +3274,10 @@
if (mBackgroundDrawable == null) {
if (mBackgroundResource == 0) {
mBackgroundResource = a.getResourceId(
- com.android.internal.R.styleable.Window_windowBackground, 0);
+ R.styleable.Window_windowBackground, 0);
}
if (mFrameResource == 0) {
- mFrameResource = a.getResourceId(com.android.internal.R.styleable.Window_windowFrame, 0);
+ mFrameResource = a.getResourceId(R.styleable.Window_windowFrame, 0);
}
if (false) {
System.out.println("Background: "
@@ -3281,8 +3285,9 @@
+ Integer.toHexString(mFrameResource));
}
}
- mElevation = a.getDimension(com.android.internal.R.styleable.Window_windowElevation, 0);
- mTextColor = a.getColor(com.android.internal.R.styleable.Window_textColor, 0xFF000000);
+ mElevation = a.getDimension(R.styleable.Window_windowElevation, 0);
+ mClipToOutline = a.getBoolean(R.styleable.Window_windowClipToOutline, false);
+ mTextColor = a.getColor(R.styleable.Window_textColor, Color.TRANSPARENT);
}
// Inflate the window decor.
@@ -3291,15 +3296,15 @@
int features = getLocalFeatures();
// System.out.println("Features: 0x" + Integer.toHexString(features));
if ((features & (1 << FEATURE_SWIPE_TO_DISMISS)) != 0) {
- layoutResource = com.android.internal.R.layout.screen_swipe_dismiss;
+ layoutResource = R.layout.screen_swipe_dismiss;
} else if ((features & ((1 << FEATURE_LEFT_ICON) | (1 << FEATURE_RIGHT_ICON))) != 0) {
if (mIsFloating) {
TypedValue res = new TypedValue();
getContext().getTheme().resolveAttribute(
- com.android.internal.R.attr.dialogTitleIconsDecorLayout, res, true);
+ R.attr.dialogTitleIconsDecorLayout, res, true);
layoutResource = res.resourceId;
} else {
- layoutResource = com.android.internal.R.layout.screen_title_icons;
+ layoutResource = R.layout.screen_title_icons;
}
// XXX Remove this once action bar supports these features.
removeFeature(FEATURE_ACTION_BAR);
@@ -3308,7 +3313,7 @@
&& (features & (1 << FEATURE_ACTION_BAR)) == 0) {
// Special case for a window with only a progress bar (and title).
// XXX Need to have a no-title version of embedded windows.
- layoutResource = com.android.internal.R.layout.screen_progress;
+ layoutResource = R.layout.screen_progress;
// System.out.println("Progress!");
} else if ((features & (1 << FEATURE_CUSTOM_TITLE)) != 0) {
// Special case for a window with a custom title.
@@ -3316,10 +3321,10 @@
if (mIsFloating) {
TypedValue res = new TypedValue();
getContext().getTheme().resolveAttribute(
- com.android.internal.R.attr.dialogCustomTitleDecorLayout, res, true);
+ R.attr.dialogCustomTitleDecorLayout, res, true);
layoutResource = res.resourceId;
} else {
- layoutResource = com.android.internal.R.layout.screen_custom_title;
+ layoutResource = R.layout.screen_custom_title;
}
// XXX Remove this once action bar supports these features.
removeFeature(FEATURE_ACTION_BAR);
@@ -3329,21 +3334,21 @@
if (mIsFloating) {
TypedValue res = new TypedValue();
getContext().getTheme().resolveAttribute(
- com.android.internal.R.attr.dialogTitleDecorLayout, res, true);
+ R.attr.dialogTitleDecorLayout, res, true);
layoutResource = res.resourceId;
} else if ((features & (1 << FEATURE_ACTION_BAR)) != 0) {
layoutResource = a.getResourceId(
- com.android.internal.R.styleable.Window_windowActionBarFullscreenDecorLayout,
- com.android.internal.R.layout.screen_action_bar);
+ R.styleable.Window_windowActionBarFullscreenDecorLayout,
+ R.layout.screen_action_bar);
} else {
- layoutResource = com.android.internal.R.layout.screen_title;
+ layoutResource = R.layout.screen_title;
}
// System.out.println("Title!");
} else if ((features & (1 << FEATURE_ACTION_MODE_OVERLAY)) != 0) {
- layoutResource = com.android.internal.R.layout.screen_simple_overlay_action_mode;
+ layoutResource = R.layout.screen_simple_overlay_action_mode;
} else {
// Embedded, so no decoration is needed.
- layoutResource = com.android.internal.R.layout.screen_simple;
+ layoutResource = R.layout.screen_simple;
// System.out.println("Simple!");
}
@@ -3379,8 +3384,9 @@
}
mDecor.setWindowBackground(background);
- // By default, clip content to the background outline.
- mDecor.setClipToOutline(true);
+ if (background != null) {
+ mDecor.setClipToOutline(mClipToOutline);
+ }
final Drawable frame;
if (mFrameResource != 0) {
@@ -3428,7 +3434,7 @@
mDecor.makeOptionalFitsSystemWindows();
final DecorContentParent decorContentParent = (DecorContentParent) mDecor.findViewById(
- com.android.internal.R.id.decor_content_parent);
+ R.id.decor_content_parent);
if (decorContentParent != null) {
mDecorContentParent = decorContentParent;
@@ -3472,12 +3478,12 @@
}
});
} else {
- mTitleView = (TextView)findViewById(com.android.internal.R.id.title);
+ mTitleView = (TextView)findViewById(R.id.title);
if (mTitleView != null) {
mTitleView.setLayoutDirection(mDecor.getLayoutDirection());
if ((getLocalFeatures() & (1 << FEATURE_NO_TITLE)) != 0) {
View titleContainer = findViewById(
- com.android.internal.R.id.title_container);
+ R.id.title_container);
if (titleContainer != null) {
titleContainer.setVisibility(View.GONE);
} else {
@@ -3497,7 +3503,7 @@
if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
if (mTransitionManager == null) {
final int transitionRes = getWindowStyle().getResourceId(
- com.android.internal.R.styleable.Window_windowContentTransitionManager,
+ R.styleable.Window_windowContentTransitionManager,
0);
if (transitionRes != 0) {
final TransitionInflater inflater = TransitionInflater.from(getContext());
@@ -3509,26 +3515,26 @@
}
mEnterTransition = getTransition(mEnterTransition,
- com.android.internal.R.styleable.Window_windowEnterTransition);
+ R.styleable.Window_windowEnterTransition);
mExitTransition = getTransition(mExitTransition,
- com.android.internal.R.styleable.Window_windowExitTransition);
+ R.styleable.Window_windowExitTransition);
mSharedElementEnterTransition = getTransition(mSharedElementEnterTransition,
- com.android.internal.R.styleable.Window_windowSharedElementEnterTransition);
+ R.styleable.Window_windowSharedElementEnterTransition);
mSharedElementExitTransition = getTransition(mSharedElementExitTransition,
- com.android.internal.R.styleable.Window_windowSharedElementExitTransition);
+ R.styleable.Window_windowSharedElementExitTransition);
if (mAllowEnterTransitionOverlap == null) {
mAllowEnterTransitionOverlap = getWindowStyle().getBoolean(
- com.android.internal.R.styleable.
+ R.styleable.
Window_windowAllowEnterTransitionOverlap, true);
}
if (mAllowExitTransitionOverlap == null) {
mAllowExitTransitionOverlap = getWindowStyle().getBoolean(
- com.android.internal.R.styleable.
+ R.styleable.
Window_windowAllowExitTransitionOverlap, true);
}
if (mBackgroundFadeDurationMillis < 0) {
mBackgroundFadeDurationMillis = getWindowStyle().getInteger(
- com.android.internal.R.styleable.
+ R.styleable.
Window_windowTransitionBackgroundFadeDuration,
DEFAULT_BACKGROUND_FADE_DURATION_MS);
}
@@ -3542,7 +3548,7 @@
}
int transitionId = getWindowStyle().getResourceId(id, -1);
Transition transition = null;
- if (transitionId != -1 && transitionId != com.android.internal.R.transition.no_transition) {
+ if (transitionId != -1 && transitionId != R.transition.no_transition) {
TransitionInflater inflater = TransitionInflater.from(getContext());
transition = inflater.inflateTransition(transitionId);
}
@@ -3716,7 +3722,7 @@
if (mContentParent == null) {
installDecor();
}
- return (mLeftIconView = (ImageView)findViewById(com.android.internal.R.id.left_icon));
+ return (mLeftIconView = (ImageView)findViewById(R.id.left_icon));
}
@Override
@@ -3734,7 +3740,7 @@
if (mContentParent == null && shouldInstallDecor) {
installDecor();
}
- mCircularProgressBar = (ProgressBar) findViewById(com.android.internal.R.id.progress_circular);
+ mCircularProgressBar = (ProgressBar) findViewById(R.id.progress_circular);
if (mCircularProgressBar != null) {
mCircularProgressBar.setVisibility(View.INVISIBLE);
}
@@ -3748,7 +3754,7 @@
if (mContentParent == null && shouldInstallDecor) {
installDecor();
}
- mHorizontalProgressBar = (ProgressBar) findViewById(com.android.internal.R.id.progress_horizontal);
+ mHorizontalProgressBar = (ProgressBar) findViewById(R.id.progress_horizontal);
if (mHorizontalProgressBar != null) {
mHorizontalProgressBar.setVisibility(View.INVISIBLE);
}
@@ -3762,12 +3768,12 @@
if (mContentParent == null) {
installDecor();
}
- return (mRightIconView = (ImageView)findViewById(com.android.internal.R.id.right_icon));
+ return (mRightIconView = (ImageView)findViewById(R.id.right_icon));
}
private void registerSwipeCallbacks() {
SwipeDismissLayout swipeDismiss =
- (SwipeDismissLayout) findViewById(com.android.internal.R.id.content);
+ (SwipeDismissLayout) findViewById(R.id.content);
swipeDismiss.setOnDismissedListener(new SwipeDismissLayout.OnDismissedListener() {
@Override
public void onDismissed(SwipeDismissLayout layout) {
@@ -3885,7 +3891,7 @@
private boolean isTranslucent() {
TypedArray a = getWindowStyle();
return a.getBoolean(a.getResourceId(
- com.android.internal.R.styleable.Window_windowIsTranslucent, 0), false);
+ R.styleable.Window_windowIsTranslucent, 0), false);
}
@Override
@@ -4103,18 +4109,18 @@
}
void setStyle(Context context) {
- TypedArray a = context.obtainStyledAttributes(com.android.internal.R.styleable.Theme);
+ TypedArray a = context.obtainStyledAttributes(R.styleable.Theme);
background = a.getResourceId(
- com.android.internal.R.styleable.Theme_panelBackground, 0);
+ R.styleable.Theme_panelBackground, 0);
fullBackground = a.getResourceId(
- com.android.internal.R.styleable.Theme_panelFullBackground, 0);
+ R.styleable.Theme_panelFullBackground, 0);
windowAnimations = a.getResourceId(
- com.android.internal.R.styleable.Theme_windowAnimationStyle, 0);
+ R.styleable.Theme_windowAnimationStyle, 0);
isCompact = a.getBoolean(
- com.android.internal.R.styleable.Theme_panelMenuIsCompact, false);
+ R.styleable.Theme_panelMenuIsCompact, false);
listPresenterTheme = a.getResourceId(
- com.android.internal.R.styleable.Theme_panelMenuListTheme,
- com.android.internal.R.style.Theme_ExpandedMenu);
+ R.styleable.Theme_panelMenuListTheme,
+ R.style.Theme_ExpandedMenu);
a.recycle();
}
@@ -4141,9 +4147,9 @@
if (listMenuPresenter == null) {
listMenuPresenter = new ListMenuPresenter(
- com.android.internal.R.layout.list_menu_item_layout, listPresenterTheme);
+ R.layout.list_menu_item_layout, listPresenterTheme);
listMenuPresenter.setCallback(cb);
- listMenuPresenter.setId(com.android.internal.R.id.list_menu_presenter);
+ listMenuPresenter.setId(R.id.list_menu_presenter);
menu.addMenuPresenter(listMenuPresenter);
}
@@ -4162,7 +4168,7 @@
if (iconMenuPresenter == null) {
iconMenuPresenter = new IconMenuPresenter(context);
iconMenuPresenter.setCallback(cb);
- iconMenuPresenter.setId(com.android.internal.R.id.icon_menu_presenter);
+ iconMenuPresenter.setId(R.id.icon_menu_presenter);
menu.addMenuPresenter(iconMenuPresenter);
}
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 44a5344..324f536 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -5401,7 +5401,7 @@
}
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
- if (!always && (hapticsDisabled || mKeyguardDelegate.isShowingAndNotOccluded())) {
+ if (hapticsDisabled && !always) {
return false;
}
long[] pattern = null;
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 595e91e..291d366 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -34,6 +34,7 @@
import android.app.backup.IFullBackupRestoreObserver;
import android.app.backup.IRestoreObserver;
import android.app.backup.IRestoreSession;
+import android.app.job.JobParameters;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -78,6 +79,7 @@
import android.provider.Settings;
import android.system.ErrnoException;
import android.system.Os;
+import android.util.AtomicFile;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
@@ -119,6 +121,7 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -154,6 +157,7 @@
private static final String TAG = "BackupManagerService";
private static final boolean DEBUG = true;
private static final boolean MORE_DEBUG = false;
+ private static final boolean DEBUG_SCHEDULING = MORE_DEBUG || true;
// System-private key used for backing up an app's widget state. Must
// begin with U+FFxx by convention (we reserve all keys starting
@@ -239,7 +243,10 @@
// order to give them time to enter the backup password.
static final long TIMEOUT_FULL_CONFIRMATION = 60 * 1000;
- private Context mContext;
+ // How long between attempts to perform a full-data backup of any given app
+ static final long MIN_FULL_BACKUP_INTERVAL = 1000 * 60 * 60 * 24; // one day
+
+ Context mContext;
private PackageManager mPackageManager;
IPackageManager mPackageManagerBinder;
private IActivityManager mActivityManager;
@@ -313,17 +320,32 @@
// Watch the device provisioning operation during setup
ContentObserver mProvisionedObserver;
+ static BackupManagerService sInstance;
+ static BackupManagerService getInstance() {
+ // Always constructed during system bringup, so no need to lazy-init
+ return sInstance;
+ }
+
public static final class Lifecycle extends SystemService {
- private final BackupManagerService mService;
public Lifecycle(Context context) {
super(context);
- mService = new BackupManagerService(context);
+ sInstance = new BackupManagerService(context);
}
@Override
public void onStart() {
- publishBinderService(Context.BACKUP_SERVICE, mService);
+ publishBinderService(Context.BACKUP_SERVICE, sInstance);
+ }
+
+ @Override
+ public void onBootPhase(int phase) {
+ if (phase == PHASE_THIRD_PARTY_APPS_CAN_START) {
+ ContentResolver r = sInstance.mContext.getContentResolver();
+ boolean areEnabled = Settings.Secure.getInt(r,
+ Settings.Secure.BACKUP_ENABLED, 0) != 0;
+ sInstance.setBackupEnabled(areEnabled);
+ }
}
}
@@ -542,6 +564,30 @@
static final String INIT_SENTINEL_FILE_NAME = "_need_init_";
HashSet<String> mPendingInits = new HashSet<String>(); // transport names
+ // Round-robin queue for scheduling full backup passes
+ static final int SCHEDULE_FILE_VERSION = 1; // current version of the schedule file
+ class FullBackupEntry implements Comparable<FullBackupEntry> {
+ String packageName;
+ long lastBackup;
+
+ FullBackupEntry(String pkg, long when) {
+ packageName = pkg;
+ lastBackup = when;
+ }
+
+ @Override
+ public int compareTo(FullBackupEntry other) {
+ if (lastBackup < other.lastBackup) return -1;
+ else if (lastBackup > other.lastBackup) return 1;
+ else return 0;
+ }
+ }
+
+ File mFullBackupScheduleFile;
+ // If we're running a schedule-driven full backup, this is the task instance doing it
+ PerformFullTransportBackupTask mRunningFullBackupTask; // inside mQueueLock
+ ArrayList<FullBackupEntry> mFullBackupQueue; // inside mQueueLock
+
// Utility: build a new random integer token
int generateToken() {
int token;
@@ -573,6 +619,17 @@
return true;
}
+ /* does *not* check overall backup eligibility policy! */
+ public static boolean appGetsFullBackup(PackageInfo pkg) {
+ if (pkg.applicationInfo.backupAgentName != null) {
+ // If it has an agent, it gets full backups only if it says so
+ return (pkg.applicationInfo.flags & ApplicationInfo.FLAG_FULL_BACKUP_ONLY) != 0;
+ }
+
+ // No agent means we do full backups for it
+ return true;
+ }
+
// ----- Asynchronous backup/restore handler thread -----
private class BackupHandler extends Handler {
@@ -892,8 +949,6 @@
// Set up our bookkeeping
final ContentResolver resolver = context.getContentResolver();
- boolean areEnabled = Settings.Secure.getInt(resolver,
- Settings.Secure.BACKUP_ENABLED, 0) != 0;
mProvisioned = Settings.Global.getInt(resolver,
Settings.Global.DEVICE_PROVISIONED, 0) != 0;
mAutoRestore = Settings.Secure.getInt(resolver,
@@ -987,6 +1042,7 @@
mJournal = null; // will be created on first use
// Set up the various sorts of package tracking we do
+ mFullBackupScheduleFile = new File(mBaseStateDir, "fb-schedule");
initPackageTracking();
// Build our mapping of uid to backup client services. This implicitly
@@ -1050,9 +1106,6 @@
// Power management
mWakelock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*");
-
- // Start the backup passes going
- setBackupEnabled(areEnabled);
}
private class RunBackupReceiver extends BroadcastReceiver {
@@ -1192,6 +1245,9 @@
}
}
+ // Resume the full-data backup queue
+ mFullBackupQueue = readFullBackupSchedule();
+
// Register for broadcasts about package install, etc., so we can
// update the provider list.
IntentFilter filter = new IntentFilter();
@@ -1206,6 +1262,96 @@
mContext.registerReceiver(mBroadcastReceiver, sdFilter);
}
+ private ArrayList<FullBackupEntry> readFullBackupSchedule() {
+ ArrayList<FullBackupEntry> schedule = null;
+ synchronized (mQueueLock) {
+ if (mFullBackupScheduleFile.exists()) {
+ try {
+ FileInputStream fstream = new FileInputStream(mFullBackupScheduleFile);
+ BufferedInputStream bufStream = new BufferedInputStream(fstream);
+ DataInputStream in = new DataInputStream(bufStream);
+
+ int version = in.readInt();
+ if (version != SCHEDULE_FILE_VERSION) {
+ Slog.e(TAG, "Unknown backup schedule version " + version);
+ return null;
+ }
+
+ int N = in.readInt();
+ schedule = new ArrayList<FullBackupEntry>(N);
+ for (int i = 0; i < N; i++) {
+ String pkgName = in.readUTF();
+ long lastBackup = in.readLong();
+ schedule.add(new FullBackupEntry(pkgName, lastBackup));
+ }
+ Collections.sort(schedule);
+ } catch (Exception e) {
+ Slog.e(TAG, "Unable to read backup schedule", e);
+ mFullBackupScheduleFile.delete();
+ schedule = null;
+ }
+ }
+
+ if (schedule == null) {
+ // no prior queue record, or unable to read it. Set up the queue
+ // from scratch.
+ List<PackageInfo> apps =
+ PackageManagerBackupAgent.getStorableApplications(mPackageManager);
+ final int N = apps.size();
+ schedule = new ArrayList<FullBackupEntry>(N);
+ for (int i = 0; i < N; i++) {
+ PackageInfo info = apps.get(i);
+ if (appGetsFullBackup(info)) {
+ schedule.add(new FullBackupEntry(info.packageName, 0));
+ }
+ }
+ writeFullBackupScheduleAsync();
+ }
+ }
+ return schedule;
+ }
+
+ Runnable mFullBackupScheduleWriter = new Runnable() {
+ @Override public void run() {
+ synchronized (mQueueLock) {
+ try {
+ ByteArrayOutputStream bufStream = new ByteArrayOutputStream(4096);
+ DataOutputStream bufOut = new DataOutputStream(bufStream);
+ bufOut.writeInt(SCHEDULE_FILE_VERSION);
+
+ // version 1:
+ //
+ // [int] # of packages in the queue = N
+ // N * {
+ // [utf8] package name
+ // [long] last backup time for this package
+ // }
+ int N = mFullBackupQueue.size();
+ bufOut.writeInt(N);
+
+ for (int i = 0; i < N; i++) {
+ FullBackupEntry entry = mFullBackupQueue.get(i);
+ bufOut.writeUTF(entry.packageName);
+ bufOut.writeLong(entry.lastBackup);
+ }
+ bufOut.flush();
+
+ AtomicFile af = new AtomicFile(mFullBackupScheduleFile);
+ FileOutputStream out = af.startWrite();
+ out.write(bufStream.toByteArray());
+ af.finishWrite(out);
+ } catch (Exception e) {
+ Slog.e(TAG, "Unable to write backup schedule!", e);
+ }
+ }
+ }
+ };
+
+ private void writeFullBackupScheduleAsync() {
+ mBackupHandler.removeCallbacks(mFullBackupScheduleWriter);
+ mBackupHandler.post(mFullBackupScheduleWriter);
+ }
+
private void parseLeftoverJournals() {
for (File f : mJournalDir.listFiles()) {
if (mJournal == null || f.compareTo(mJournal) != 0) {
@@ -1633,6 +1779,22 @@
}
addPackageParticipantsLocked(pkgList);
}
+ // If they're full-backup candidates, add them there instead
+ for (String packageName : pkgList) {
+ try {
+ PackageInfo app = mPackageManager.getPackageInfo(packageName, 0);
+ long now = System.currentTimeMillis();
+ if (appGetsFullBackup(app)) {
+ enqueueFullBackup(packageName, now);
+ scheduleNextFullBackupJob();
+ }
+ } catch (NameNotFoundException e) {
+ // doesn't really exist; ignore it
+ if (DEBUG) {
+ Slog.i(TAG, "Can't resolve new app " + packageName);
+ }
+ }
+ }
} else {
if (replacing) {
// The package is being updated. We'll receive a PACKAGE_ADDED shortly.
@@ -3437,12 +3599,19 @@
class PerformFullTransportBackupTask extends FullBackupTask {
static final String TAG = "PFTBT";
ArrayList<PackageInfo> mPackages;
+ boolean mUpdateSchedule;
AtomicBoolean mLatch;
+ AtomicBoolean mKeepRunning; // signal from job scheduler
+ FullBackupJob mJob; // if a scheduled job needs to be finished afterwards
PerformFullTransportBackupTask(IFullBackupRestoreObserver observer,
- String[] whichPackages, AtomicBoolean latch) {
+ String[] whichPackages, boolean updateSchedule,
+ FullBackupJob runningJob, AtomicBoolean latch) {
super(observer);
+ mUpdateSchedule = updateSchedule;
mLatch = latch;
+ mKeepRunning = new AtomicBoolean(true);
+ mJob = runningJob;
mPackages = new ArrayList<PackageInfo>(whichPackages.length);
for (String pkg : whichPackages) {
@@ -3474,119 +3643,164 @@
}
}
+ public void setRunning(boolean running) {
+ mKeepRunning.set(running);
+ }
+
@Override
public void run() {
- IBackupTransport transport = getTransport(mCurrentTransport);
- if (transport == null) {
- Slog.w(TAG, "Transport not present; full data backup not performed");
- return;
- }
-
// data from the app, passed to us for bridging to the transport
ParcelFileDescriptor[] enginePipes = null;
// Pipe through which we write data to the transport
ParcelFileDescriptor[] transportPipes = null;
+ PackageInfo currentPackage;
+
try {
+ IBackupTransport transport = getTransport(mCurrentTransport);
+ if (transport == null) {
+ Slog.w(TAG, "Transport not present; full data backup not performed");
+ return;
+ }
+
// Set up to send data to the transport
- if (transport != null) {
- for (PackageInfo target : mPackages) {
- if (DEBUG) {
- Slog.i(TAG, "Initiating full-data transport backup of "
- + target.packageName);
- }
- transportPipes = ParcelFileDescriptor.createPipe();
-
- // Tell the transport the data's coming
- int result = transport.performFullBackup(target, transportPipes[0]);
- if (result == BackupTransport.TRANSPORT_OK) {
- // The transport has its own copy of the read end of the pipe,
- // so close ours now
- transportPipes[0].close();
- transportPipes[0] = null;
-
- // Now set up the backup engine / data source end of things
- enginePipes = ParcelFileDescriptor.createPipe();
- AtomicBoolean runnerLatch = new AtomicBoolean(false);
- SinglePackageBackupRunner backupRunner =
- new SinglePackageBackupRunner(enginePipes[1], target,
- runnerLatch);
- // The runner dup'd the pipe half, so we close it here
- enginePipes[1].close();
- enginePipes[1] = null;
-
- // Spin off the runner to fetch the app's data and pipe it
- // into the engine pipes
- (new Thread(backupRunner, "package-backup-bridge")).start();
-
- // Read data off the engine pipe and pass it to the transport
- // pipe until we hit EOD on the input stream.
- FileInputStream in = new FileInputStream(
- enginePipes[0].getFileDescriptor());
- FileOutputStream out = new FileOutputStream(
- transportPipes[1].getFileDescriptor());
- byte[] buffer = new byte[8192];
- int nRead = 0;
- do {
- nRead = in.read(buffer);
- if (nRead > 0) {
- out.write(buffer, 0, nRead);
- result = transport.sendBackupData(nRead);
- }
- } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK);
-
- // In all cases we need to give the transport its finish callback
- int finishResult = transport.finishBackup();
-
- if (MORE_DEBUG) {
- Slog.i(TAG, "Done trying to send backup data: result="
- + result + " finishResult=" + finishResult);
- }
-
- // If we were otherwise in a good state, now interpret the final
- // result based on what finishBackup() returned. If we're in a
- // failure case already, preserve that result and ignore whatever
- // finishBackup() reported.
- if (result == BackupTransport.TRANSPORT_OK) {
- result = finishResult;
- }
-
- if (result != BackupTransport.TRANSPORT_OK) {
- Slog.e(TAG, "Error " + result
- + " backing up " + target.packageName);
- }
- }
-
- if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) {
- if (DEBUG) {
- Slog.i(TAG, "Transport rejected backup of " + target.packageName
- + ", skipping");
- }
- // do nothing, clean up, and continue looping
- } else if (result != BackupTransport.TRANSPORT_OK) {
- if (DEBUG) {
- Slog.i(TAG, "Transport failed; aborting backup: " + result);
- return;
- }
- }
- cleanUpPipes(transportPipes);
- cleanUpPipes(enginePipes);
- }
-
+ final int N = mPackages.size();
+ for (int i = 0; i < N; i++) {
+ currentPackage = mPackages.get(i);
if (DEBUG) {
- Slog.i(TAG, "Full backup completed.");
+ Slog.i(TAG, "Initiating full-data transport backup of "
+ + currentPackage.packageName);
}
+ transportPipes = ParcelFileDescriptor.createPipe();
+
+ // Tell the transport the data's coming
+ int result = transport.performFullBackup(currentPackage,
+ transportPipes[0]);
+ if (result == BackupTransport.TRANSPORT_OK) {
+ // The transport has its own copy of the read end of the pipe,
+ // so close ours now
+ transportPipes[0].close();
+ transportPipes[0] = null;
+
+ // Now set up the backup engine / data source end of things
+ enginePipes = ParcelFileDescriptor.createPipe();
+ AtomicBoolean runnerLatch = new AtomicBoolean(false);
+ SinglePackageBackupRunner backupRunner =
+ new SinglePackageBackupRunner(enginePipes[1], currentPackage,
+ runnerLatch);
+ // The runner dup'd the pipe half, so we close it here
+ enginePipes[1].close();
+ enginePipes[1] = null;
+
+ // Spin off the runner to fetch the app's data and pipe it
+ // into the engine pipes
+ (new Thread(backupRunner, "package-backup-bridge")).start();
+
+ // Read data off the engine pipe and pass it to the transport
+ // pipe until we hit EOD on the input stream.
+ FileInputStream in = new FileInputStream(
+ enginePipes[0].getFileDescriptor());
+ FileOutputStream out = new FileOutputStream(
+ transportPipes[1].getFileDescriptor());
+ byte[] buffer = new byte[8192];
+ int nRead = 0;
+ do {
+ if (!mKeepRunning.get()) {
+ if (DEBUG_SCHEDULING) {
+ Slog.i(TAG, "Full backup task told to stop");
+ }
+ break;
+ }
+ nRead = in.read(buffer);
+ if (nRead > 0) {
+ out.write(buffer, 0, nRead);
+ result = transport.sendBackupData(nRead);
+ }
+ } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK);
+
+ int finishResult;
+
+ if (!mKeepRunning.get()) {
+ result = BackupTransport.TRANSPORT_ERROR;
+ // TODO: tell the transport to abort the backup
+ Slog.w(TAG, "TODO: tell transport to halt & roll back");
+ }
+
+ // In all cases we need to give the transport its finish callback
+ finishResult = transport.finishBackup();
+
+ if (MORE_DEBUG) {
+ Slog.i(TAG, "Done trying to send backup data: result="
+ + result + " finishResult=" + finishResult);
+ }
+
+ // If we were otherwise in a good state, now interpret the final
+ // result based on what finishBackup() returned. If we're in a
+ // failure case already, preserve that result and ignore whatever
+ // finishBackup() reported.
+ if (result == BackupTransport.TRANSPORT_OK) {
+ result = finishResult;
+ }
+
+ if (result != BackupTransport.TRANSPORT_OK) {
+ Slog.e(TAG, "Error " + result
+ + " backing up " + currentPackage.packageName);
+ }
+ }
+
+ // Roll this package to the end of the backup queue if we're
+ // in a queue-driven mode (regardless of success/failure)
+ if (mUpdateSchedule) {
+ enqueueFullBackup(currentPackage.packageName,
+ System.currentTimeMillis());
+ }
+
+ if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) {
+ if (DEBUG) {
+ Slog.i(TAG, "Transport rejected backup of "
+ + currentPackage.packageName
+ + ", skipping");
+ }
+ // do nothing, clean up, and continue looping
+ } else if (result != BackupTransport.TRANSPORT_OK) {
+ if (DEBUG) {
+ Slog.i(TAG, "Transport failed; aborting backup: " + result);
+ return;
+ }
+ }
+ cleanUpPipes(transportPipes);
+ cleanUpPipes(enginePipes);
+ currentPackage = null;
+ }
+
+ if (DEBUG) {
+ Slog.i(TAG, "Full backup completed.");
}
} catch (Exception e) {
Slog.w(TAG, "Exception trying full transport backup", e);
} finally {
cleanUpPipes(transportPipes);
cleanUpPipes(enginePipes);
+
+ if (mJob != null) {
+ mJob.finishBackupPass();
+ }
+
+ synchronized (mQueueLock) {
+ mRunningFullBackupTask = null;
+ }
+
synchronized (mLatch) {
mLatch.set(true);
mLatch.notifyAll();
}
+
+ // Now that we're actually done with schedule-driven work, reschedule
+ // the next pass based on the new queue state.
+ if (mUpdateSchedule) {
+ scheduleNextFullBackupJob();
+ }
}
}
@@ -3653,6 +3867,146 @@
}
}
+ // ----- Full-data backup scheduling -----
+
+ /**
+ * Schedule a job to tell us when it's a good time to run a full backup
+ */
+ void scheduleNextFullBackupJob() {
+ synchronized (mQueueLock) {
+ if (mFullBackupQueue.size() > 0) {
+ // schedule the next job at the point in the future when the least-recently
+ // backed up app comes due for backup again; or immediately if it's already
+ // due.
+ long upcomingLastBackup = mFullBackupQueue.get(0).lastBackup;
+ long timeSinceLast = System.currentTimeMillis() - upcomingLastBackup;
+ final long latency = (timeSinceLast < MIN_FULL_BACKUP_INTERVAL)
+ ? (MIN_FULL_BACKUP_INTERVAL - timeSinceLast) : 0;
+ Runnable r = new Runnable() {
+ @Override public void run() {
+ FullBackupJob.schedule(mContext, latency);
+ }
+ };
+ mBackupHandler.postDelayed(r, 2500);
+ } else {
+ if (DEBUG_SCHEDULING) {
+ Slog.i(TAG, "Full backup queue empty; not scheduling");
+ }
+ }
+ }
+ }
+
+ /**
+ * Enqueue full backup for the given app, with a note about when it last ran.
+ */
+ void enqueueFullBackup(String packageName, long lastBackedUp) {
+ FullBackupEntry newEntry = new FullBackupEntry(packageName, lastBackedUp);
+ synchronized (mQueueLock) {
+ int N = mFullBackupQueue.size();
+ // First, sanity check that we aren't adding a duplicate. Slow but
+ // straightforward; we'll have at most on the order of a few hundred
+ // items in this list.
+ for (int i = N-1; i >= 0; i--) {
+ final FullBackupEntry e = mFullBackupQueue.get(i);
+ if (packageName.equals(e.packageName)) {
+ if (DEBUG) {
+ Slog.w(TAG, "Removing schedule queue dupe of " + packageName);
+ }
+ mFullBackupQueue.remove(i);
+ }
+ }
+
+ // This is also slow but easy for modest numbers of apps: work backwards
+ // from the end of the queue until we find an item whose last backup
+ // time was before this one, then insert this new entry after it.
+ int which;
+ for (which = mFullBackupQueue.size() - 1; which >= 0; which--) {
+ final FullBackupEntry entry = mFullBackupQueue.get(which);
+ if (entry.lastBackup <= lastBackedUp) {
+ mFullBackupQueue.add(which + 1, newEntry);
+ break;
+ }
+ }
+ if (which < 0) {
+ // this one is earlier than any existing one, so prepend
+ mFullBackupQueue.add(0, newEntry);
+ }
+ }
+ writeFullBackupScheduleAsync();
+ }
+
+ /**
+ * Conditions are right for a full backup operation, so run one. The model we use is
+ * to perform one app backup per scheduled job execution, and to reschedule the job
+ * with zero latency as long as conditions remain right and we still have work to do.
+ *
+ * @return Whether ongoing work will continue. The return value here will be passed
+ * along as the return value to the scheduled job's onStartJob() callback.
+ */
+ boolean beginFullBackup(FullBackupJob scheduledJob) {
+ long now = System.currentTimeMillis();
+ FullBackupEntry entry = null;
+
+ if (DEBUG_SCHEDULING) {
+ Slog.i(TAG, "Beginning scheduled full backup operation");
+ }
+
+ // Great; we're able to run full backup jobs now. See if we have any work to do.
+ synchronized (mQueueLock) {
+ if (mRunningFullBackupTask != null) {
+ Slog.e(TAG, "Backup triggered but one already/still running!");
+ return false;
+ }
+
+ if (mFullBackupQueue.size() == 0) {
+ // no work to do so just bow out
+ if (DEBUG) {
+ Slog.i(TAG, "Backup queue empty; doing nothing");
+ }
+ return false;
+ }
+
+ entry = mFullBackupQueue.get(0);
+ long timeSinceRun = now - entry.lastBackup;
+ if (timeSinceRun < MIN_FULL_BACKUP_INTERVAL) {
+ // It's too early to back up the next thing in the queue, so bow out
+ if (MORE_DEBUG) {
+ Slog.i(TAG, "Device ready but too early to back up next app");
+ }
+ final long latency = MIN_FULL_BACKUP_INTERVAL - timeSinceRun;
+ mBackupHandler.post(new Runnable() {
+ @Override public void run() {
+ FullBackupJob.schedule(mContext, latency);
+ }
+ });
+ return false;
+ }
+
+ // Okay, the top thing is runnable now. Pop it off and get going.
+ mFullBackupQueue.remove(0);
+ AtomicBoolean latch = new AtomicBoolean(false);
+ String[] pkg = new String[] {entry.packageName};
+ mRunningFullBackupTask = new PerformFullTransportBackupTask(null, pkg, true,
+ scheduledJob, latch);
+ (new Thread(mRunningFullBackupTask)).start();
+ }
+
+ return true;
+ }
+
+ // The job scheduler says our constraints don't hold any more,
+ // so tear down any ongoing backup task right away.
+ void endFullBackup() {
+ synchronized (mQueueLock) {
+ if (mRunningFullBackupTask != null) {
+ if (DEBUG_SCHEDULING) {
+ Slog.i(TAG, "Telling running backup to stop");
+ }
+ mRunningFullBackupTask.setRunning(false);
+ }
+ }
+ }
+
// ----- Restore infrastructure -----
abstract class RestoreEngine {
@@ -7726,7 +8080,8 @@
}
AtomicBoolean latch = new AtomicBoolean(false);
- PerformFullTransportBackupTask task = new PerformFullTransportBackupTask(null, pkgNames, latch);
+ PerformFullTransportBackupTask task =
+ new PerformFullTransportBackupTask(null, pkgNames, false, null, latch);
(new Thread(task, "full-transport-master")).start();
synchronized (latch) {
try {
@@ -7915,6 +8270,7 @@
if (enable && !wasEnabled && mProvisioned) {
// if we've just been enabled, start scheduling backup passes
startBackupAlarmsLocked(BACKUP_INTERVAL);
+ scheduleNextFullBackupJob();
} else if (!enable) {
// No longer enabled, so stop running backups
if (DEBUG) Slog.i(TAG, "Opting out of backup");
@@ -8653,10 +9009,16 @@
pw.println(" " + pkg);
}
- pw.println("Pending backup: " + mPendingBackups.size());
+ pw.println("Pending key/value backup: " + mPendingBackups.size());
for (BackupRequest req : mPendingBackups.values()) {
pw.println(" " + req);
}
+
+ pw.println("Full backup queue:" + mFullBackupQueue.size());
+ for (FullBackupEntry entry : mFullBackupQueue) {
+ pw.print(" "); pw.print(entry.lastBackup);
+ pw.print(" : "); pw.println(entry.packageName);
+ }
}
}
}
diff --git a/services/backup/java/com/android/server/backup/FullBackupJob.java b/services/backup/java/com/android/server/backup/FullBackupJob.java
new file mode 100644
index 0000000..deb2293
--- /dev/null
+++ b/services/backup/java/com/android/server/backup/FullBackupJob.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.backup;
+
+import android.app.job.JobInfo;
+import android.app.job.JobParameters;
+import android.app.job.JobScheduler;
+import android.app.job.JobService;
+import android.app.job.JobInfo.NetworkType;
+import android.content.ComponentName;
+import android.content.Context;
+import android.util.Slog;
+
+public class FullBackupJob extends JobService {
+ private static final String TAG = "FullBackupJob";
+ private static final boolean DEBUG = true;
+
+ private static ComponentName sIdleService =
+ new ComponentName("android", FullBackupJob.class.getName());
+
+ private static final int JOB_ID = 0x5038;
+
+ JobParameters mParams;
+
+ public static void schedule(Context ctx, long minDelay) {
+ JobScheduler js = (JobScheduler) ctx.getSystemService(Context.JOB_SCHEDULER_SERVICE);
+ JobInfo.Builder builder = new JobInfo.Builder(JOB_ID, sIdleService)
+ .setRequiresDeviceIdle(true)
+ .setRequiredNetworkCapabilities(NetworkType.UNMETERED)
+ .setRequiresCharging(true);
+ if (minDelay > 0) {
+ builder.setMinimumLatency(minDelay);
+ }
+ js.schedule(builder.build());
+ }
+
+ // callback from the Backup Manager Service: it's finished its work for this pass
+ public void finishBackupPass() {
+ if (mParams != null) {
+ jobFinished(mParams, false);
+ mParams = null;
+ }
+ }
+
+ // ----- scheduled job interface -----
+
+ @Override
+ public boolean onStartJob(JobParameters params) {
+ mParams = params;
+ BackupManagerService service = BackupManagerService.getInstance();
+ return service.beginFullBackup(this);
+ }
+
+ @Override
+ public boolean onStopJob(JobParameters params) {
+ if (mParams != null) {
+ mParams = null;
+ BackupManagerService service = BackupManagerService.getInstance();
+ service.endFullBackup();
+ }
+ return false;
+ }
+
+}
diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java
index 5a510a9..13e1b37 100644
--- a/services/core/java/com/android/server/AppOpsService.java
+++ b/services/core/java/com/android/server/AppOpsService.java
@@ -96,8 +96,6 @@
final SparseArray<HashMap<String, Ops>> mUidOps
= new SparseArray<HashMap<String, Ops>>();
- private int mDeviceOwnerUid;
- private final SparseIntArray mProfileOwnerUids = new SparseIntArray();
private final SparseArray<boolean[]> mOpRestrictions = new SparseArray<boolean[]>();
public final static class Ops extends SparseArray<Op> {
@@ -873,15 +871,7 @@
}
}
}
- if (userHandle == UserHandle.USER_OWNER) {
- if (uid != mDeviceOwnerUid) {
- return true;
- }
- } else {
- if (uid != mProfileOwnerUids.get(userHandle, -1)) {
- return true;
- }
- }
+ return true;
}
return false;
}
@@ -1256,35 +1246,6 @@
}
@Override
- public void setDeviceOwner(String packageName) throws RemoteException {
- checkSystemUid("setDeviceOwner");
- try {
- mDeviceOwnerUid = mContext.getPackageManager().getPackageUid(packageName,
- UserHandle.USER_OWNER);
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Could not find Device Owner UID");
- mDeviceOwnerUid = -1;
- throw new IllegalArgumentException("Could not find device owner package "
- + packageName);
- }
- }
-
- @Override
- public void setProfileOwner(String packageName, int userHandle) throws RemoteException {
- checkSystemUid("setProfileOwner");
- try {
- int uid = mContext.getPackageManager().getPackageUid(packageName,
- userHandle);
- mProfileOwnerUids.put(userHandle, uid);
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Could not find Profile Owner UID");
- mProfileOwnerUids.put(userHandle, -1);
- throw new IllegalArgumentException("Could not find profile owner package "
- + packageName);
- }
- }
-
- @Override
public void setUserRestrictions(Bundle restrictions, int userHandle) throws RemoteException {
checkSystemUid("setUserRestrictions");
boolean[] opRestrictions = mOpRestrictions.get(userHandle);
@@ -1306,10 +1267,6 @@
public void removeUser(int userHandle) throws RemoteException {
checkSystemUid("removeUser");
mOpRestrictions.remove(userHandle);
- final int index = mProfileOwnerUids.indexOfKey(userHandle);
- if (index >= 0) {
- mProfileOwnerUids.removeAt(index);
- }
}
private void checkSystemUid(String function) {
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index ec9243f..56265e1 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -817,13 +817,7 @@
mDataConnectionStats = new DataConnectionStats(mContext);
mDataConnectionStats.startMonitoring();
- // start network sampling ..
- Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED, null);
- mSampleIntervalElapsedIntent = PendingIntent.getBroadcast(mContext,
- SAMPLE_INTERVAL_ELAPSED_REQUEST_CODE, intent, 0);
-
mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
- setAlarm(DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS * 1000, mSampleIntervalElapsedIntent);
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED);
@@ -2145,6 +2139,14 @@
}
void systemReady() {
+ // start network sampling ..
+ Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED);
+ intent.setPackage(mContext.getPackageName());
+
+ mSampleIntervalElapsedIntent = PendingIntent.getBroadcast(mContext,
+ SAMPLE_INTERVAL_ELAPSED_REQUEST_CODE, intent, 0);
+ setAlarm(DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS * 1000, mSampleIntervalElapsedIntent);
+
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {
mCaptivePortalTracker = CaptivePortalTracker.makeCaptivePortalTracker(mContext, this);
}
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 87084d5..cb410ef 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -67,12 +67,22 @@
/**
* Since phone process can be restarted, this class provides a centralized place
* that applications can register and be called back from.
+ *
+ * Change-Id: I450c968bda93767554b5188ee63e10c9f43c5aa4 fixes bugs 16148026
+ * and 15973975 by saving the phoneId of the registrant and then using the
+ * phoneId when deciding to to make a callback. This is necessary because
+ * a subId changes from to a dummy value when a SIM is removed and thus won't
+ * compare properly. Because SubscriptionManager.getPhoneId(long subId) handles
+ * the dummy value conversion we properly do the callbacks.
+ *
+ * Eventually we may want to remove the notion of dummy value but for now this
+ * looks like the best approach.
*/
class TelephonyRegistry extends ITelephonyRegistry.Stub {
private static final String TAG = "TelephonyRegistry";
- private static final boolean DBG = false; // STOPSHIP if true
+ private static final boolean DBG = true; // STOPSHIP if true
private static final boolean DBG_LOC = false; // STOPSHIP if true
- private static final boolean VDBG = false; // STOPSHIP if true
+ private static final boolean VDBG = true; // STOPSHIP if true
private static class Record {
String pkgForDebug;
@@ -87,12 +97,14 @@
long subId;
+ int phoneId;
+
boolean isLegacyApp;
@Override
public String toString() {
return "{pkgForDebug=" + pkgForDebug + " callerUid=" + callerUid + " subId=" + subId +
- " events=" + Integer.toHexString(events) + "}";
+ " phoneId=" + phoneId + " events=" + Integer.toHexString(events) + "}";
}
}
@@ -146,6 +158,8 @@
private long mDefaultSubId;
+ private int mDefaultPhoneIdForDefaultSubId;
+
private DataConnectionRealTimeInfo mDcRtInfo = new DataConnectionRealTimeInfo();
private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
@@ -179,15 +193,19 @@
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_USER_SWITCHED: {
- log("MSG_USER_SWITCHED userId=" + msg.arg1);
+ if (VDBG) log("MSG_USER_SWITCHED userId=" + msg.arg1);
int numPhones = TelephonyManager.getDefault().getPhoneCount();
for (int sub = 0; sub < numPhones; sub++) {
- TelephonyRegistry.this.notifyCellLocationUsingSubId(sub, mCellLocation[sub]);
+ TelephonyRegistry.this.notifyCellLocationUsingSubId(sub,
+ mCellLocation[sub]);
}
break;
}
case MSG_UPDATE_DEFAULT_SUB: {
- log("MSG_UPDATE_DEFAULT_SUB subid=" + mDefaultSubId);
+ if (VDBG) {
+ log("MSG_UPDATE_DEFAULT_SUB subid=" + mDefaultSubId
+ + " phoneId=" + mDefaultPhoneIdForDefaultSubId);
+ }
// Default subscription id changed, update the changed default subscription
// id in all the legacy application listener records.
synchronized (mRecords) {
@@ -195,6 +213,7 @@
// FIXME: Be sure we're using isLegacyApp correctly!
if (r.isLegacyApp == true) {
r.subId = mDefaultSubId;
+ r.phoneId = mDefaultPhoneIdForDefaultSubId;
}
}
}
@@ -208,7 +227,7 @@
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
- log("mBroadcastReceiver: action=" + action);
+ if (VDBG) log("mBroadcastReceiver: action=" + action);
if (Intent.ACTION_USER_SWITCHED.equals(action)) {
int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
if (DBG) log("onReceive: userHandle=" + userHandle);
@@ -216,7 +235,12 @@
} else if (action.equals(TelephonyIntents.ACTION_DEFAULT_SUBSCRIPTION_CHANGED)) {
mDefaultSubId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY,
SubscriptionManager.getDefaultSubId());
- if (DBG) log("onReceive: mDefaultSubId=" + mDefaultSubId);
+ mDefaultPhoneIdForDefaultSubId = intent.getIntExtra(PhoneConstants.SLOT_KEY,
+ SubscriptionManager.getPhoneId(mDefaultSubId));
+ if (DBG) {
+ log("onReceive: mDefaultSubId=" + mDefaultSubId
+ + " mDefaultPhoneIdForDefaultSubId=" + mDefaultPhoneIdForDefaultSubId);
+ }
mHandler.sendMessage(mHandler.obtainMessage(MSG_UPDATE_DEFAULT_SUB, 0, 0));
}
}
@@ -236,8 +260,9 @@
mBatteryStats = BatteryStatsService.getService();
mConnectedApns = new ArrayList<String>();
- // Initialize default subscription to be used for single standby.
+ // Initialize default subId and its phoneId.
mDefaultSubId = SubscriptionManager.getDefaultSubId();
+ mDefaultPhoneIdForDefaultSubId = SubscriptionManager.getPhoneId(mDefaultSubId);
int numPhones = TelephonyManager.getDefault().getPhoneCount();
if (DBG) log("TelephonyRegistor: ctor numPhones=" + numPhones);
@@ -310,9 +335,10 @@
boolean notifyNow, long subId, boolean isLegacyApp) {
int callerUid = UserHandle.getCallingUserId();
int myUid = UserHandle.myUserId();
- if (true /*VDBG*/) {
+ int phoneId = SubscriptionManager.getPhoneId(subId);
+ if (VDBG) {
log("listen: E pkg=" + pkgForDebug + " events=0x" + Integer.toHexString(events)
- + " notifyNow=" + notifyNow + " subId=" + subId
+ + " notifyNow=" + notifyNow + " subId=" + subId + " phoneId=" + phoneId
+ " isLegacyApp=" + isLegacyApp
+ " myUid=" + myUid
+ " callerUid=" + callerUid);
@@ -339,29 +365,33 @@
r.pkgForDebug = pkgForDebug;
r.callerUid = callerUid;
r.subId = subId;
+ r.phoneId = phoneId;
r.isLegacyApp = isLegacyApp;
// Legacy applications pass invalid subId(-1), based on
// the received subId value update the isLegacyApp field
if ((r.subId <= 0) || (r.subId == SubscriptionManager.INVALID_SUB_ID)) {
r.subId = mDefaultSubId;
- r.isLegacyApp = true; // r.subId is to be update when default changes.
+ r.phoneId = mDefaultPhoneIdForDefaultSubId;
+ r.isLegacyApp = true; // subId & phoneId are updated when default changes.
}
if (r.subId == SubscriptionManager.DEFAULT_SUB_ID) {
r.subId = mDefaultSubId;
- r.isLegacyApp = true; // r.subId is to be update when default changes.
- if (true/*DBG*/) log("listen: DEFAULT_SUB_ID");
+ r.phoneId = mDefaultPhoneIdForDefaultSubId;
+ r.isLegacyApp = true; // subId & phoneId are updated when default changes.
+ if (DBG) log("listen: DEFAULT_SUB_ID");
}
mRecords.add(r);
- if (true/*DBG*/) log("listen: add new record");
+ if (DBG) log("listen: add new record");
}
- int phoneId = SubscriptionManager.getPhoneId(subId);
r.events = events;
- if (true/*DBG*/) log("listen: set events record=" + r + " subId=" + subId + " phoneId=" + phoneId);
- toStringLogSSC("listen");
+ if (DBG) {
+ log("listen: r=" + r + " subId=" + subId + " phoneId=" + phoneId);
+ }
+ if (VDBG) toStringLogSSC("listen");
if (notifyNow && validatePhoneId(phoneId)) {
if ((events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) {
try {
- log("listen: call onSSC state=" + mServiceState[phoneId]);
+ if (VDBG) log("listen: call onSSC state=" + mServiceState[phoneId]);
r.callback.onServiceStateChanged(
new ServiceState(mServiceState[phoneId]));
} catch (RemoteException ex) {
@@ -516,7 +546,7 @@
if (!checkNotifyPermission("notifyCallState()")) {
return;
}
- if (true /*VDBG*/) {
+ if (VDBG) {
log("notifyCallStateUsingSubId: subId=" + subId
+ " state=" + state + " incomingNumber=" + incomingNumber);
}
@@ -527,8 +557,8 @@
mCallIncomingNumber[phoneId] = incomingNumber;
for (Record r : mRecords) {
if (((r.events & PhoneStateListener.LISTEN_CALL_STATE) != 0) &&
- (r.subId == subId) && (r.isLegacyApp == false)) {
- // FIXME: why isLegacyApp false?
+ (r.phoneId == phoneId) &&
+ (r.isLegacyApp == false)) { // FIXME: why isLegacyApp false?
try {
r.callback.onCallStateChanged(state, incomingNumber);
} catch (RemoteException ex) {
@@ -552,27 +582,32 @@
}
if (subId == SubscriptionManager.DEFAULT_SUB_ID) {
subId = mDefaultSubId;
- log("notifyServiceStateUsingSubId: using mDefaultSubId=" + mDefaultSubId);
+ if (VDBG) log("notifyServiceStateUsingSubId: using mDefaultSubId=" + mDefaultSubId);
}
synchronized (mRecords) {
int phoneId = SubscriptionManager.getPhoneId(subId);
- if (true/*VDBG*/) {
+ if (VDBG) {
log("notifyServiceStateUsingSubId: subId=" + subId + " phoneId=" + phoneId
+ " state=" + state);
}
if (validatePhoneId(phoneId)) {
mServiceState[phoneId] = state;
logServiceStateChanged("notifyServiceStateUsingSubId", subId, phoneId, state);
- toStringLogSSC("notifyServiceStateUsingSubId");
+ if (VDBG) toStringLogSSC("notifyServiceStateUsingSubId");
for (Record r : mRecords) {
- log("notifyServiceStateUsingSubId: r.events=0x" + Integer.toHexString(r.events) + " r.subId=" + r.subId + " subId=" + subId + " state=" + state);
- // FIXME: use DEFAULT_SUB_ID instead??
+ if (VDBG) {
+ log("notifyServiceStateUsingSubId: r=" + r + " subId=" + subId
+ + " phoneId=" + phoneId + " state=" + state);
+ }
if (((r.events & PhoneStateListener.LISTEN_SERVICE_STATE) != 0) &&
- (r.subId == subId)) {
+ (r.phoneId == phoneId)) {
try {
- log("notifyServiceStateUsingSubId: call onSSC subId=" + subId
- + " state=" + state);
+ if (DBG) {
+ log("notifyServiceStateUsingSubId: callback.onSSC r=" + r
+ + " subId=" + subId + " phoneId=" + phoneId
+ + " state=" + state);
+ }
r.callback.onServiceStateChanged(new ServiceState(state));
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
@@ -595,7 +630,7 @@
if (!checkNotifyPermission("notifySignalStrength()")) {
return;
}
- if (true/*VDBG*/) {
+ if (VDBG) {
log("notifySignalStrengthUsingSubId: subId=" + subId
+ " signalStrength=" + signalStrength);
toStringLogSSC("notifySignalStrengthUsingSubId");
@@ -603,25 +638,36 @@
synchronized (mRecords) {
int phoneId = SubscriptionManager.getPhoneId(subId);
if (validatePhoneId(phoneId)) {
- log("notifySignalStrengthUsingSubId: valid phoneId=" + phoneId);
+ if (VDBG) log("notifySignalStrengthUsingSubId: valid phoneId=" + phoneId);
mSignalStrength[phoneId] = signalStrength;
for (Record r : mRecords) {
- log("notifySignalStrengthUsingSubId: r.events=0x" + Integer.toHexString(r.events) + " r.subId=" + r.subId + " subId=" + subId);
+ if (VDBG) {
+ log("notifySignalStrengthUsingSubId: r=" + r + " subId=" + subId
+ + " phoneId=" + phoneId + " ss=" + signalStrength);
+ }
if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTHS) != 0) &&
- (r.subId == subId)){
+ (r.phoneId == phoneId)) {
try {
- log("notifySignalStrengthUsingSubId: callback.onSsS ss=" + signalStrength);
+ if (DBG) {
+ log("notifySignalStrengthUsingSubId: callback.onSsS r=" + r
+ + " subId=" + subId + " phoneId=" + phoneId
+ + " ss=" + signalStrength);
+ }
r.callback.onSignalStrengthsChanged(new SignalStrength(signalStrength));
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
}
}
if (((r.events & PhoneStateListener.LISTEN_SIGNAL_STRENGTH) != 0) &&
- (r.subId == subId)) {
+ (r.phoneId == phoneId)) {
try {
int gsmSignalStrength = signalStrength.getGsmSignalStrength();
int ss = (gsmSignalStrength == 99 ? -1 : gsmSignalStrength);
- log("notifySignalStrengthUsingSubId: callback.onSS gsmSS=" + gsmSignalStrength + " ss=" + ss);
+ if (DBG) {
+ log("notifySignalStrengthUsingSubId: callback.onSS r=" + r
+ + " subId=" + subId + " phoneId=" + phoneId
+ + " gsmSS=" + gsmSignalStrength + " ss=" + ss);
+ }
r.callback.onSignalStrengthChanged(ss);
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
@@ -714,7 +760,7 @@
mMessageWaiting[phoneId] = mwi;
for (Record r : mRecords) {
if (((r.events & PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR) != 0) &&
- (r.subId == subId)) {
+ (r.phoneId == phoneId)) {
try {
r.callback.onMessageWaitingIndicatorChanged(mwi);
} catch (RemoteException ex) {
@@ -745,7 +791,7 @@
mCallForwarding[phoneId] = cfi;
for (Record r : mRecords) {
if (((r.events & PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR) != 0) &&
- (r.subId == subId)) {
+ (r.phoneId == phoneId)) {
try {
r.callback.onCallForwardingIndicatorChanged(cfi);
} catch (RemoteException ex) {
@@ -842,7 +888,7 @@
}
for (Record r : mRecords) {
if (((r.events & PhoneStateListener.LISTEN_DATA_CONNECTION_STATE) != 0) &&
- (r.subId == subId)) {
+ (r.phoneId == phoneId)) {
try {
log("Notify data connection state changed on sub: " +
subId);
@@ -1092,8 +1138,7 @@
pw.println(" mDcRtInfo=" + mDcRtInfo);
pw.println("registrations: count=" + recordCount);
for (Record r : mRecords) {
- pw.println(" " + r.pkgForDebug + " 0x" + Integer.toHexString(r.events));
- pw.println("is Legacy = " + r.isLegacyApp + " subId = " + r.subId);
+ pw.println(" " + r);
}
}
}
@@ -1360,6 +1405,7 @@
i = 0;
}
} while (i != next);
+ log(prompt + ": ----------------");
}
}
}
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index 248a303..20f6f1c 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -55,6 +55,7 @@
public class VibratorService extends IVibratorService.Stub
implements InputManager.InputDeviceListener {
private static final String TAG = "VibratorService";
+ private static final boolean DEBUG = false;
private final LinkedList<Vibration> mVibrations;
private Vibration mCurrentVibration;
@@ -205,6 +206,7 @@
}
}
+ @Override // Binder call
public boolean hasVibrator() {
return doVibratorExists();
}
@@ -220,6 +222,7 @@
Binder.getCallingPid(), Binder.getCallingUid(), null);
}
+ @Override // Binder call
public void vibrate(int uid, String opPkg, long milliseconds, int usageHint,
IBinder token) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.VIBRATE)
@@ -237,6 +240,10 @@
return;
}
+ if (DEBUG) {
+ Slog.d(TAG, "Vibrating for " + milliseconds + " ms.");
+ }
+
Vibration vib = new Vibration(token, milliseconds, usageHint, uid, opPkg);
final long ident = Binder.clearCallingIdentity();
@@ -262,6 +269,7 @@
return true;
}
+ @Override // Binder call
public void vibratePattern(int uid, String packageName, long[] pattern, int repeat,
int usageHint, IBinder token) {
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.VIBRATE)
@@ -272,13 +280,13 @@
// so wakelock calls will succeed
long identity = Binder.clearCallingIdentity();
try {
- if (false) {
+ if (DEBUG) {
String s = "";
int N = pattern.length;
for (int i=0; i<N; i++) {
s += " " + pattern[i];
}
- Slog.i(TAG, "vibrating with pattern: " + s);
+ Slog.d(TAG, "Vibrating with pattern:" + s);
}
// we're running in the server so we can't fail
@@ -314,6 +322,7 @@
}
}
+ @Override // Binder call
public void cancelVibrate(IBinder token) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.VIBRATE,
@@ -325,6 +334,9 @@
synchronized (mVibrations) {
final Vibration vib = removeVibrationLocked(token);
if (vib == mCurrentVibration) {
+ if (DEBUG) {
+ Slog.d(TAG, "Canceling vibration.");
+ }
doCancelVibrateLocked();
startNextVibrationLocked();
}
@@ -336,6 +348,7 @@
}
private final Runnable mVibrationRunnable = new Runnable() {
+ @Override
public void run() {
synchronized (mVibrations) {
doCancelVibrateLocked();
@@ -516,6 +529,9 @@
private void doVibratorOn(long millis, int uid, int usageHint) {
synchronized (mInputDeviceVibrators) {
+ if (DEBUG) {
+ Slog.d(TAG, "Turning vibrator on for " + millis + " ms.");
+ }
try {
mBatteryStatsService.noteVibratorOn(uid, millis);
mCurVibUid = uid;
@@ -536,6 +552,9 @@
private void doVibratorOff() {
synchronized (mInputDeviceVibrators) {
+ if (DEBUG) {
+ Slog.d(TAG, "Turning vibrator off.");
+ }
if (mCurVibUid >= 0) {
try {
mBatteryStatsService.noteVibratorOff(mCurVibUid);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 3f95ae2..36093c0 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1159,6 +1159,7 @@
static final int SYSTEM_USER_START_MSG = 42;
static final int SYSTEM_USER_CURRENT_MSG = 43;
static final int ENTER_ANIMATION_COMPLETE_MSG = 44;
+ static final int ENABLE_SCREEN_AFTER_BOOT_MSG = 45;
static final int FIRST_ACTIVITY_STACK_MSG = 100;
static final int FIRST_BROADCAST_QUEUE_MSG = 200;
@@ -1826,6 +1827,10 @@
}
break;
}
+ case ENABLE_SCREEN_AFTER_BOOT_MSG: {
+ enableScreenAfterBoot();
+ break;
+ }
}
}
};
@@ -5525,6 +5530,10 @@
Binder.restoreCallingIdentity(origId);
}
+ void postEnableScreenAfterBootLocked() {
+ mHandler.sendEmptyMessage(ENABLE_SCREEN_AFTER_BOOT_MSG);
+ }
+
void enableScreenAfterBoot() {
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_ENABLE_SCREEN,
SystemClock.uptimeMillis());
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 1c0057b..d069dfe 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1052,6 +1052,14 @@
next.idle = false;
next.results = null;
next.newIntents = null;
+
+ if (next.isHomeActivity() && next.isNotResolverActivity()) {
+ ProcessRecord app = next.task.mActivities.get(0).app;
+ if (app != null && app != mService.mHomeProcess) {
+ mService.mHomeProcess = app;
+ }
+ }
+
if (next.nowVisible) {
// We won't get a call to reportActivityVisibleLocked() so dismiss lockscreen now.
mStackSupervisor.dismissKeyguard();
@@ -2067,6 +2075,8 @@
final int rootActivityNdx = task.findEffectiveRootIndex();
for (int i = numActivities - 1; i > rootActivityNdx; --i ) {
ActivityRecord target = activities.get(i);
+ if (target.frontOfTask)
+ break;
final int flags = target.info.flags;
final boolean finishOnTaskLaunch =
@@ -2223,6 +2233,8 @@
// Do not operate on or below the effective root Activity.
for (int i = numActivities - 1; i > rootActivityNdx; --i) {
ActivityRecord target = activities.get(i);
+ if (target.frontOfTask)
+ break;
final int flags = target.info.flags;
boolean finishOnTaskLaunch = (flags & ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH) != 0;
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 690b90a..48ed5ea 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2176,7 +2176,7 @@
//mWindowManager.dump();
if (enableScreen) {
- mService.enableScreenAfterBoot();
+ mService.postEnableScreenAfterBootLocked();
}
if (activityRemoved) {
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index cdcc74b..4e554eb 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -424,11 +424,16 @@
Intent intent, int resultCode, String data, Bundle extras,
boolean ordered, boolean sticky, int sendingUser) throws RemoteException {
// Send the intent to the receiver asynchronously using one-way binder calls.
- if (app != null && app.thread != null) {
- // If we have an app thread, do the call through that so it is
- // correctly ordered with other one-way calls.
- app.thread.scheduleRegisteredReceiver(receiver, intent, resultCode,
- data, extras, ordered, sticky, sendingUser, app.repProcState);
+ if (app != null) {
+ if (app.thread != null) {
+ // If we have an app thread, do the call through that so it is
+ // correctly ordered with other one-way calls.
+ app.thread.scheduleRegisteredReceiver(receiver, intent, resultCode,
+ data, extras, ordered, sticky, sendingUser, app.repProcState);
+ } else {
+ // Application has died. Receiver doesn't exist.
+ throw new RemoteException("app.thread must not be null");
+ }
} else {
receiver.performReceive(intent, resultCode, data, extras, ordered,
sticky, sendingUser);
@@ -670,6 +675,7 @@
// (local and remote) isn't kept in the mBroadcastHistory.
r.resultTo = null;
} catch (RemoteException e) {
+ r.resultTo = null;
Slog.w(TAG, "Failure ["
+ mQueueName + "] sending broadcast result of "
+ r.intent, e);
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index ba9a183..0305424 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -495,9 +495,6 @@
throw e;
}
Log.i(TAG, "Established by " + config.user + " on " + mInterface);
-
- // TODO: ensure that contract class eventually marks as connected
- updateState(DetailedState.AUTHENTICATING, "establish");
return tun;
}
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 09221a3e..d0e4b33 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -566,8 +566,10 @@
// Apply dimming by at least some minimum amount when user activity
// timeout is about to expire.
if (mPowerRequest.policy == DisplayPowerRequest.POLICY_DIM) {
- brightness = Math.max(Math.min(brightness - SCREEN_DIM_MINIMUM_REDUCTION,
- mScreenBrightnessDimConfig), mScreenBrightnessRangeMinimum);
+ if (brightness > mScreenBrightnessRangeMinimum) {
+ brightness = Math.max(Math.min(brightness - SCREEN_DIM_MINIMUM_REDUCTION,
+ mScreenBrightnessDimConfig), mScreenBrightnessRangeMinimum);
+ }
if (!mAppliedDimming) {
slowChange = false;
}
diff --git a/services/core/java/com/android/server/dreams/DreamManagerService.java b/services/core/java/com/android/server/dreams/DreamManagerService.java
index 107a6f6..b894304 100644
--- a/services/core/java/com/android/server/dreams/DreamManagerService.java
+++ b/services/core/java/com/android/server/dreams/DreamManagerService.java
@@ -45,7 +45,6 @@
import android.provider.Settings;
import android.service.dreams.DreamManagerInternal;
import android.service.dreams.DreamService;
-import android.service.dreams.IDozeHardware;
import android.service.dreams.IDreamManager;
import android.text.TextUtils;
import android.util.Slog;
@@ -75,7 +74,6 @@
private final PowerManager mPowerManager;
private final PowerManagerInternal mPowerManagerInternal;
private final PowerManager.WakeLock mDozeWakeLock;
- private final McuHal mMcuHal; // synchronized on self
private Binder mCurrentDreamToken;
private ComponentName mCurrentDreamName;
@@ -86,7 +84,6 @@
private boolean mCurrentDreamIsWaking;
private int mCurrentDreamDozeScreenState = Display.STATE_UNKNOWN;
private int mCurrentDreamDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT;
- private DozeHardwareWrapper mCurrentDreamDozeHardware;
public DreamManagerService(Context context) {
super(context);
@@ -97,11 +94,6 @@
mPowerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mPowerManagerInternal = getLocalService(PowerManagerInternal.class);
mDozeWakeLock = mPowerManager.newWakeLock(PowerManager.DOZE_WAKE_LOCK, TAG);
-
- mMcuHal = McuHal.open();
- if (mMcuHal != null) {
- mMcuHal.reset();
- }
}
@Override
@@ -130,9 +122,6 @@
private void dumpInternal(PrintWriter pw) {
pw.println("DREAM MANAGER (dumpsys dreams)");
pw.println();
-
- pw.println("mMcuHal=" + mMcuHal);
- pw.println();
pw.println("mCurrentDreamToken=" + mCurrentDreamToken);
pw.println("mCurrentDreamName=" + mCurrentDreamName);
pw.println("mCurrentDreamUserId=" + mCurrentDreamUserId);
@@ -143,7 +132,6 @@
pw.println("mCurrentDreamDozeScreenState="
+ Display.stateToString(mCurrentDreamDozeScreenState));
pw.println("mCurrentDreamDozeScreenBrightness=" + mCurrentDreamDozeScreenBrightness);
- pw.println("mCurrentDreamDozeHardware=" + mCurrentDreamDozeHardware);
pw.println("getDozeComponent()=" + getDozeComponent());
pw.println();
@@ -259,17 +247,6 @@
}
}
- private IDozeHardware getDozeHardwareInternal(IBinder token) {
- synchronized (mLock) {
- if (mCurrentDreamToken == token && mCurrentDreamCanDoze
- && mCurrentDreamDozeHardware == null && mMcuHal != null) {
- mCurrentDreamDozeHardware = new DozeHardwareWrapper();
- return mCurrentDreamDozeHardware;
- }
- return null;
- }
- }
-
private ComponentName chooseDreamForUser(boolean doze, int userId) {
if (doze) {
ComponentName dozeComponent = getDozeComponent();
@@ -420,10 +397,6 @@
}
mCurrentDreamDozeScreenState = Display.STATE_UNKNOWN;
mCurrentDreamDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT;
- if (mCurrentDreamDozeHardware != null) {
- mCurrentDreamDozeHardware.release();
- mCurrentDreamDozeHardware = null;
- }
}
private void checkPermission(String permission) {
@@ -642,21 +615,6 @@
Binder.restoreCallingIdentity(ident);
}
}
-
- @Override // Binder call
- public IDozeHardware getDozeHardware(IBinder token) {
- // Requires no permission, called by Dream from an arbitrary process.
- if (token == null) {
- throw new IllegalArgumentException("token must not be null");
- }
-
- final long ident = Binder.clearCallingIdentity();
- try {
- return getDozeHardwareInternal(token);
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
}
private final class LocalService extends DreamManagerInternal {
@@ -676,40 +634,6 @@
}
}
- private final class DozeHardwareWrapper extends IDozeHardware.Stub {
- private boolean mReleased;
-
- public void release() {
- synchronized (mMcuHal) {
- if (!mReleased) {
- mReleased = true;
- mMcuHal.reset();
- }
- }
- }
-
- @Override // Binder call
- public byte[] sendMessage(String msg, byte[] arg) {
- if (msg == null) {
- throw new IllegalArgumentException("msg must not be null");
- }
-
- final long ident = Binder.clearCallingIdentity();
- try {
- synchronized (mMcuHal) {
- if (mReleased) {
- Slog.w(TAG, "Ignoring message to MCU HAL because the dream "
- + "has already ended: " + msg);
- return null;
- }
- return mMcuHal.sendMessage(msg, arg);
- }
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
- }
-
private final Runnable mSystemPropertiesChanged = new Runnable() {
@Override
public void run() {
diff --git a/services/core/java/com/android/server/dreams/McuHal.java b/services/core/java/com/android/server/dreams/McuHal.java
deleted file mode 100644
index 1dc79c7..0000000
--- a/services/core/java/com/android/server/dreams/McuHal.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.dreams;
-
-import android.service.dreams.DozeHardware;
-
-/**
- * Provides access to the low-level microcontroller hardware abstraction layer.
- */
-final class McuHal {
- private final long mPtr;
-
- private static native long nativeOpen();
- private static native byte[] nativeSendMessage(long ptr, String msg, byte[] arg);
-
- private McuHal(long ptr) {
- mPtr = ptr;
- }
-
- public static McuHal open() {
- long ptr = nativeOpen();
- return ptr != 0 ? new McuHal(ptr) : null;
- }
-
- public void reset() {
- sendMessage(DozeHardware.MSG_ENABLE_MCU, DozeHardware.VALUE_OFF);
- }
-
- public byte[] sendMessage(String msg, byte[] arg) {
- return nativeSendMessage(mPtr, msg, arg);
- }
-}
diff --git a/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java b/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
index 432424b..f3d570e 100644
--- a/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
+++ b/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
@@ -23,6 +23,8 @@
import android.os.RemoteException;
import android.util.Slog;
+import com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource;
+
/**
* Handles CEC command <Active Source>.
* <p>
@@ -54,44 +56,45 @@
/**
* Handles the incoming active source command.
*
- * @param activeAddress logical address of the device to be the active source
- * @param activePath routing path of the device to be the active source
+ * @param newActive new active source information
*/
- void process(int activeAddress, int activePath) {
+ void process(ActiveSource newActive) {
// Seq #17
HdmiCecLocalDeviceTv tv = mSource;
- if (getSourcePath() == activePath && tv.getActiveSource() == getSourceAddress()) {
+ ActiveSource activeSource = tv.getActiveSource();
+ if (activeSource.equals(newActive)) {
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
return;
}
- HdmiCecDeviceInfo device = mService.getDeviceInfo(activeAddress);
+ HdmiCecDeviceInfo device = mService.getDeviceInfo(newActive.logicalAddress);
if (device == null) {
- tv.startNewDeviceAction(activeAddress, activePath);
+ tv.startNewDeviceAction(newActive);
}
- int currentActive = tv.getActiveSource();
- int currentPath = tv.getActivePath();
+ ActiveSource current = tv.getActiveSource();
if (!tv.isProhibitMode()) {
- tv.updateActiveSource(activeAddress, activePath);
- if (currentActive != activeAddress && currentPath != activePath) {
- tv.updateActivePortId(mService.pathToPortId(activePath));
+ tv.updateActiveSource(newActive);
+ if (!current.equals(newActive)) {
+ boolean notifyInputChange = (mCallback == null);
+ tv.updateActiveInput(newActive.physicalAddress, notifyInputChange);
}
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
} else {
// TV is in a mode that should keep its current source/input from
// being changed for its operation. Reclaim the active source
// or switch the port back to the one used for the current mode.
- if (currentActive == getSourceAddress()) {
- HdmiCecMessage activeSource =
- HdmiCecMessageBuilder.buildActiveSource(currentActive, currentPath);
- mService.sendCecCommand(activeSource);
- tv.updateActiveSource(currentActive, currentPath);
+ if (current.logicalAddress == getSourceAddress()) {
+ HdmiCecMessage activeSourceCommand = HdmiCecMessageBuilder.buildActiveSource(
+ current.logicalAddress, current.physicalAddress);
+ mService.sendCecCommand(activeSourceCommand);
+ tv.updateActiveSource(current);
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
} else {
HdmiCecMessage routingChange = HdmiCecMessageBuilder.buildRoutingChange(
- getSourceAddress(), activePath, currentPath);
+ getSourceAddress(), newActive.physicalAddress, current.physicalAddress);
mService.sendCecCommand(routingChange);
- tv.addAndStartAction(new RoutingControlAction(tv, currentPath, true, mCallback));
+ tv.addAndStartAction(
+ new RoutingControlAction(tv, current.physicalAddress, true, mCallback));
}
}
}
diff --git a/services/core/java/com/android/server/hdmi/DeviceSelectAction.java b/services/core/java/com/android/server/hdmi/DeviceSelectAction.java
index d4fffcf..018b34d 100644
--- a/services/core/java/com/android/server/hdmi/DeviceSelectAction.java
+++ b/services/core/java/com/android/server/hdmi/DeviceSelectAction.java
@@ -23,6 +23,7 @@
import android.os.RemoteException;
import android.util.Slog;
+import com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource;
import com.android.server.hdmi.HdmiControlService.SendMessageCallback;
/**
@@ -130,10 +131,10 @@
return false;
case STATE_WAIT_FOR_ACTIVE_SOURCE:
if (opcode == Constants.MESSAGE_ACTIVE_SOURCE) {
- int activePath = HdmiUtils.twoBytesToInt(params);
+ int physicalAddress = HdmiUtils.twoBytesToInt(params);
ActiveSourceHandler
.create((HdmiCecLocalDeviceTv) localDevice(), mCallback)
- .process(cmd.getSource(), activePath);
+ .process(ActiveSource.of(cmd.getSource(), physicalAddress));
finish();
return true;
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index dbcdfc0..40eb3e44 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -49,9 +49,41 @@
protected int mPreferredAddress;
protected HdmiCecDeviceInfo mDeviceInfo;
+ static class ActiveSource {
+ int logicalAddress;
+ int physicalAddress;
+
+ public ActiveSource(int logical, int physical) {
+ logicalAddress = logical;
+ physicalAddress = physical;
+ }
+ public static ActiveSource of(int logical, int physical) {
+ return new ActiveSource(logical, physical);
+ }
+ public boolean isValid() {
+ return HdmiUtils.isValidAddress(logicalAddress);
+ }
+ public boolean equals(int logical, int physical) {
+ return logicalAddress == logical && physicalAddress == physical;
+ }
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof ActiveSource) {
+ ActiveSource that = (ActiveSource) obj;
+ return that.logicalAddress == logicalAddress &&
+ that.physicalAddress == physicalAddress;
+ }
+ return false;
+ }
+ @Override
+ public int hashCode() {
+ return logicalAddress * 29 + physicalAddress;
+ }
+ }
// Logical address of the active source.
@GuardedBy("mLock")
- private int mActiveSource;
+ protected final ActiveSource mActiveSource =
+ new ActiveSource(-1, Constants.INVALID_PHYSICAL_ADDRESS);
// Active routing path. Physical address of the active source but not all the time, such as
// when the new active source does not claim itself to be one. Note that we don't keep
@@ -549,15 +581,24 @@
return mService.isConnectedToArcPort(path);
}
- int getActiveSource() {
+ ActiveSource getActiveSource() {
synchronized (mLock) {
return mActiveSource;
}
}
- void setActiveSource(int source) {
+ void setActiveSource(ActiveSource newActive) {
+ setActiveSource(newActive.logicalAddress, newActive.physicalAddress);
+ }
+
+ void setActiveSource(HdmiCecDeviceInfo info) {
+ setActiveSource(info.getLogicalAddress(), info.getPhysicalAddress());
+ }
+
+ void setActiveSource(int logicalAddress, int physicalAddress) {
synchronized (mLock) {
- mActiveSource = source;
+ mActiveSource.logicalAddress = logicalAddress;
+ mActiveSource.physicalAddress = physicalAddress;
}
}
@@ -596,13 +637,6 @@
}
}
- void updateActiveDevice(int logicalAddress, int physicalAddress) {
- synchronized (mLock) {
- mActiveSource = logicalAddress;
- mActiveRoutingPath = physicalAddress;
- }
- }
-
@ServiceThreadOnly
HdmiCecMessageCache getCecMessageCache() {
assertRunOnServiceThread();
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 0d457e3..f93d20f 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -147,12 +147,15 @@
if (targetAddress == Constants.ADDR_INTERNAL) {
handleSelectInternalSource();
// Switching to internal source is always successful even when CEC control is disabled.
- setActiveSource(targetAddress);
+ setActiveSource(targetAddress, mService.getPhysicalAddress());
invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
return;
}
if (!mService.isControlEnabled()) {
- setActiveSource(targetAddress);
+ HdmiCecDeviceInfo info = getDeviceInfo(targetAddress);
+ if (info != null) {
+ setActiveSource(info);
+ }
invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE);
return;
}
@@ -169,7 +172,7 @@
private void handleSelectInternalSource() {
assertRunOnServiceThread();
// Seq #18
- if (mService.isControlEnabled() && getActiveSource() != mAddress) {
+ if (mService.isControlEnabled() && mActiveSource.logicalAddress != mAddress) {
updateActiveSource(mAddress, mService.getPhysicalAddress());
// TODO: Check if this comes from <Text/Image View On> - if true, do nothing.
HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
@@ -179,16 +182,22 @@
}
@ServiceThreadOnly
- void updateActiveSource(int activeSource, int activePath) {
+ void updateActiveSource(int logicalAddress, int physicalAddress) {
+ assertRunOnServiceThread();
+ updateActiveSource(ActiveSource.of(logicalAddress, physicalAddress));
+ }
+
+ @ServiceThreadOnly
+ void updateActiveSource(ActiveSource newActive) {
assertRunOnServiceThread();
// Seq #14
- if (activeSource == getActiveSource() && activePath == getActivePath()) {
+ if (mActiveSource.equals(newActive)) {
return;
}
- setActiveSource(activeSource);
- setActivePath(activePath);
- if (getDeviceInfo(activeSource) != null && activeSource != mAddress) {
- if (mService.pathToPortId(activePath) == getActivePortId()) {
+ setActiveSource(newActive);
+ int logicalAddress = newActive.logicalAddress;
+ if (getDeviceInfo(logicalAddress) != null && logicalAddress != mAddress) {
+ if (mService.pathToPortId(newActive.physicalAddress) == getActivePortId()) {
setPrevPortId(getActivePortId());
}
// TODO: Show the OSD banner related to the new active source device.
@@ -222,16 +231,26 @@
}
@ServiceThreadOnly
- void updateActivePortId(int portId) {
+ void updateActiveInput(int path, boolean notifyInputChange) {
assertRunOnServiceThread();
// Seq #15
+ int portId = mService.pathToPortId(path);
if (portId == getActivePortId()) {
return;
}
+ setActivePath(path);
setPrevPortId(portId);
- // TODO: Actually switch the physical port here. Handle PAP/PIP as well.
- // Show OSD port change banner
- mService.invokeInputChangeListener(getActiveSource());
+ // TODO: Handle PAP/PIP case.
+ // Show OSD port change banner
+ if (notifyInputChange) {
+ ActiveSource activeSource = getActiveSource();
+ HdmiCecDeviceInfo info = getDeviceInfo(activeSource.logicalAddress);
+ if (info == null) {
+ info = new HdmiCecDeviceInfo(Constants.ADDR_INVALID, path, portId,
+ HdmiCecDeviceInfo.DEVICE_RESERVED, 0, null);
+ }
+ mService.invokeInputChangeListener(info);
+ }
}
@ServiceThreadOnly
@@ -242,26 +261,25 @@
invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE);
return;
}
+ if (portId == getActivePortId()) {
+ invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
+ return;
+ }
+ setActiveSource(Constants.ADDR_INVALID, Constants.INVALID_PHYSICAL_ADDRESS);
if (!mService.isControlEnabled()) {
setActivePortId(portId);
invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE);
return;
}
- if (portId == getActivePortId()) {
- invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
- return;
- }
- setActivePortId(portId);
// TODO: Return immediately if the operation is triggered by <Text/Image View On>
- // and this is the first notification about the active input after power-on
- // (switch to HDMI didn't happen so far but is expected to happen soon).
- removeAction(RoutingControlAction.class);
-
- int oldPath = mService.portIdToPath(mService.portIdToPath(getActivePortId()));
+ // and this is the first notification about the active input after power-on
+ // (switch to HDMI didn't happen so far but is expected to happen soon).
+ int oldPath = mService.portIdToPath(getActivePortId());
int newPath = mService.portIdToPath(portId);
HdmiCecMessage routingChange =
HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath);
mService.sendCecCommand(routingChange);
+ removeAction(RoutingControlAction.class);
addAndStartAction(new RoutingControlAction(this, newPath, false, callback));
}
@@ -284,7 +302,8 @@
action.get(0).processKeyEvent(keyCode, isPressed);
} else {
if (isPressed) {
- addAndStartAction(new SendKeyAction(this, getActiveSource(), keyCode));
+ int logicalAddress = getActiveSource().logicalAddress;
+ addAndStartAction(new SendKeyAction(this, logicalAddress, keyCode));
} else {
Slog.w(TAG, "Discard key release event");
}
@@ -306,12 +325,13 @@
@ServiceThreadOnly
protected boolean handleActiveSource(HdmiCecMessage message) {
assertRunOnServiceThread();
- int address = message.getSource();
- int path = HdmiUtils.twoBytesToInt(message.getParams());
- if (getDeviceInfo(address) == null) {
- handleNewDeviceAtTheTailOfActivePath(path);
+ int logicalAddress = message.getSource();
+ int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
+ if (getDeviceInfo(logicalAddress) == null) {
+ handleNewDeviceAtTheTailOfActivePath(physicalAddress);
} else {
- ActiveSourceHandler.create(this, null).process(address, path);
+ ActiveSource activeSource = ActiveSource.of(logicalAddress, physicalAddress);
+ ActiveSourceHandler.create(this, null).process(activeSource);
}
return true;
}
@@ -323,7 +343,7 @@
// Seq #10
// Ignore <Inactive Source> from non-active source device.
- if (getActiveSource() != message.getSource()) {
+ if (getActiveSource().logicalAddress != message.getSource()) {
return true;
}
if (isProhibitMode()) {
@@ -342,7 +362,6 @@
}
// TODO: Switch the TV freeze mode off
- setActivePortId(portId);
doManualPortSwitching(portId, null);
setPrevPortId(Constants.INVALID_PORT_ID);
}
@@ -354,7 +373,7 @@
protected boolean handleRequestActiveSource(HdmiCecMessage message) {
assertRunOnServiceThread();
// Seq #19
- if (mAddress == getActiveSource()) {
+ if (mAddress == getActiveSource().logicalAddress) {
mService.sendCecCommand(
HdmiCecMessageBuilder.buildActiveSource(mAddress, getActivePath()));
}
@@ -392,11 +411,11 @@
if (!isInDeviceList(path, address)) {
handleNewDeviceAtTheTailOfActivePath(path);
}
- startNewDeviceAction(address, path);
+ startNewDeviceAction(ActiveSource.of(address, path));
return true;
}
- void startNewDeviceAction(int address, int path) {
+ void startNewDeviceAction(ActiveSource activeSource) {
for (NewDeviceAction action : getActions(NewDeviceAction.class)) {
// If there is new device action which has the same logical address and path
// ignore new request.
@@ -406,12 +425,13 @@
// in. However, TV can detect a new device from HotPlugDetectionAction,
// which sends <Give Physical Address> to the source for newly detected
// device.
- if (action.isActionOf(address, path)) {
+ if (action.isActionOf(activeSource)) {
return;
}
}
- addAndStartAction(new NewDeviceAction(this, address, path));
+ addAndStartAction(new NewDeviceAction(this, activeSource.logicalAddress,
+ activeSource.physicalAddress));
}
private void handleNewDeviceAtTheTailOfActivePath(int path) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 3532213..37c297b 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -724,6 +724,10 @@
runOnServiceThread(new Runnable() {
@Override
public void run() {
+ if (callback == null) {
+ Slog.e(TAG, "Callback cannot be null");
+ return;
+ }
HdmiCecLocalDeviceTv tv = tv();
if (tv == null) {
Slog.w(TAG, "Local tv device not available");
@@ -741,6 +745,10 @@
runOnServiceThread(new Runnable() {
@Override
public void run() {
+ if (callback == null) {
+ Slog.e(TAG, "Callback cannot be null");
+ return;
+ }
HdmiCecLocalDeviceTv tv = tv();
if (tv == null) {
Slog.w(TAG, "Local tv device not available");
@@ -1218,12 +1226,11 @@
}
}
- void invokeInputChangeListener(int activeAddress) {
+ void invokeInputChangeListener(HdmiCecDeviceInfo info) {
synchronized (mLock) {
if (mInputChangeListener != null) {
- HdmiCecDeviceInfo activeSource = getDeviceInfo(activeAddress);
try {
- mInputChangeListener.onChanged(activeSource);
+ mInputChangeListener.onChanged(info);
} catch (RemoteException e) {
Slog.w(TAG, "Exception thrown by IHdmiInputChangeListener: " + e);
}
diff --git a/services/core/java/com/android/server/hdmi/NewDeviceAction.java b/services/core/java/com/android/server/hdmi/NewDeviceAction.java
index 4ef7c96..907015b 100644
--- a/services/core/java/com/android/server/hdmi/NewDeviceAction.java
+++ b/services/core/java/com/android/server/hdmi/NewDeviceAction.java
@@ -18,6 +18,7 @@
import android.hardware.hdmi.HdmiCecDeviceInfo;
import android.util.Slog;
+import com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource;
import java.io.UnsupportedEncodingException;
/**
@@ -190,7 +191,8 @@
}
}
- boolean isActionOf(int address, int path) {
- return (mDeviceLogicalAddress == address) && (mDevicePhysicalAddress == path);
+ boolean isActionOf(ActiveSource activeSource) {
+ return (mDeviceLogicalAddress == activeSource.logicalAddress)
+ && (mDevicePhysicalAddress == activeSource.physicalAddress);
}
}
diff --git a/services/core/java/com/android/server/hdmi/RoutingControlAction.java b/services/core/java/com/android/server/hdmi/RoutingControlAction.java
index 8296f69..f05394f 100644
--- a/services/core/java/com/android/server/hdmi/RoutingControlAction.java
+++ b/services/core/java/com/android/server/hdmi/RoutingControlAction.java
@@ -60,6 +60,12 @@
// true if <Give Power Status> should be sent once the new active routing path is determined.
private final boolean mQueryDevicePowerStatus;
+ // If set to true, call {@link HdmiControlService#invokeInputChangeListener()} when
+ // the routing control/active source change happens. The listener should be called if
+ // the events are triggered by external events such as manual switch port change or incoming
+ // <Inactive Source> command.
+ private final boolean mNotifyInputChange;
+
@Nullable private final IHdmiControlCallback mCallback;
// The latest routing path. Updated by each <Routing Information> from CEC switches.
@@ -71,6 +77,11 @@
mCallback = callback;
mCurrentRoutingPath = path;
mQueryDevicePowerStatus = queryDevicePowerStatus;
+ // Callback is non-null when routing control action is brought up by binder API. Use
+ // this as an indicator for the input change notification. These API calls will get
+ // the result through this callback, not through notification. Any other events that
+ // trigger the routing control is external, for which notifcation is used.
+ mNotifyInputChange = (callback == null);
}
@Override
@@ -111,7 +122,7 @@
if (isPowerOnOrTransient(devicePowerStatus)) {
sendSetStreamPath();
} else {
- tv().updateActivePortId(tv().pathToPortId(mCurrentRoutingPath));
+ tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange);
}
}
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
@@ -155,13 +166,13 @@
}
});
} else {
- tv().updateActivePortId(tv().pathToPortId(mCurrentRoutingPath));
+ tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange);
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
}
return;
case STATE_WAIT_FOR_REPORT_POWER_STATUS:
if (isPowerOnOrTransient(getTvPowerStatus())) {
- tv().updateActivePortId(tv().pathToPortId(mCurrentRoutingPath));
+ tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange);
sendSetStreamPath();
}
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
@@ -179,7 +190,7 @@
mState = STATE_WAIT_FOR_REPORT_POWER_STATUS;
addTimer(mState, TIMEOUT_REPORT_POWER_STATUS_MS);
} else {
- tv().updateActivePortId(tv().pathToPortId(mCurrentRoutingPath));
+ tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange);
sendSetStreamPath();
finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
}
diff --git a/services/core/java/com/android/server/job/controllers/IdleController.java b/services/core/java/com/android/server/job/controllers/IdleController.java
index 451960c..2213934 100644
--- a/services/core/java/com/android/server/job/controllers/IdleController.java
+++ b/services/core/java/com/android/server/job/controllers/IdleController.java
@@ -184,6 +184,16 @@
@Override
public void dumpControllerState(PrintWriter pw) {
-
+ synchronized (mTrackedTasks) {
+ pw.print("Idle: ");
+ pw.println(mIdleTracker.isIdle() ? "true" : "false");
+ pw.println(mTrackedTasks.size());
+ for (int i = 0; i < mTrackedTasks.size(); i++) {
+ final JobStatus js = mTrackedTasks.get(i);
+ pw.print(" ");
+ pw.print(String.valueOf(js.hashCode()).substring(0, 3));
+ pw.println("..");
+ }
+ }
}
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index a6711c3..f117f99 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -740,6 +740,13 @@
private SettingsObserver mSettingsObserver;
private ZenModeHelper mZenModeHelper;
+ private final Runnable mBuzzBeepBlinked = new Runnable() {
+ @Override
+ public void run() {
+ mStatusBar.buzzBeepBlinked();
+ }
+ };
+
static long[] getLongArray(Resources r, int resid, int maxlen, long[] def) {
int[] ar = r.getIntArray(resid);
if (ar == null) {
@@ -1645,6 +1652,7 @@
}
private void buzzBeepBlinkLocked(NotificationRecord record) {
+ boolean buzzBeepBlinked = false;
final Notification notification = record.sbn.getNotification();
// Should this notification make noise, vibe, or use the LED?
@@ -1726,6 +1734,7 @@
+ " on stream " + audioStreamType);
player.playAsync(soundUri, record.sbn.getUser(), looping,
audioStreamType);
+ buzzBeepBlinked = true;
}
} catch (RemoteException e) {
} finally {
@@ -1765,6 +1774,7 @@
: mFallbackVibrationPattern,
((notification.flags & Notification.FLAG_INSISTENT) != 0)
? 0: -1, audioAttributesForNotification(notification));
+ buzzBeepBlinked = true;
} finally {
Binder.restoreCallingIdentity(identity);
}
@@ -1775,6 +1785,7 @@
notification.vibrate,
((notification.flags & Notification.FLAG_INSISTENT) != 0)
? 0: -1, audioAttributesForNotification(notification));
+ buzzBeepBlinked = true;
}
}
}
@@ -1791,9 +1802,13 @@
if (mUseAttentionLight) {
mAttentionLight.pulse();
}
+ buzzBeepBlinked = true;
} else if (wasShowLights) {
updateLightsLocked();
}
+ if (buzzBeepBlinked) {
+ mHandler.post(mBuzzBeepBlinked);
+ }
}
private static AudioAttributes audioAttributesForNotification(Notification n) {
diff --git a/services/core/java/com/android/server/notification/ZenLog.java b/services/core/java/com/android/server/notification/ZenLog.java
index 81f64b1..3069ad9 100644
--- a/services/core/java/com/android/server/notification/ZenLog.java
+++ b/services/core/java/com/android/server/notification/ZenLog.java
@@ -30,6 +30,8 @@
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
public class ZenLog {
private static final String TAG = "ZenLog";
@@ -41,6 +43,10 @@
private static final String[] MSGS = new String[SIZE];
private static final SimpleDateFormat FORMAT = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");
+ private static final Set<String> SYSTEM_PACKAGES = new HashSet<String>(Arrays.asList(
+ "android",
+ "com.android.systemui"
+ ));
private static final int TYPE_INTERCEPTED = 1;
private static final int TYPE_ALLOW_DISABLE = 2;
@@ -61,6 +67,7 @@
}
public static void traceAllowDisable(String pkg, boolean allowDisable, String reason) {
+ if (SYSTEM_PACKAGES.contains(pkg)) return;
append(TYPE_ALLOW_DISABLE, allowDisable + "," + pkg + "," + reason);
}
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index a896550..1289cf7 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -37,7 +37,9 @@
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
+import android.os.UserHandle;
import android.provider.Settings.Global;
+import android.provider.Settings.Secure;
import android.service.notification.ZenModeConfig;
import android.telecomm.TelecommManager;
import android.util.Slog;
@@ -53,11 +55,9 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.Objects;
/**
* NotificationManagerService helper for functionality related to zen mode.
@@ -84,17 +84,6 @@
private AudioManager mAudioManager;
private int mPreviousRingerMode = -1;
- // temporary, until we update apps to provide metadata
- private static final Set<String> MESSAGE_PACKAGES = new HashSet<String>(Arrays.asList(
- "com.google.android.talk",
- "com.android.mms",
- "com.android.example.notificationshowcase"
- ));
- private static final Set<String> SYSTEM_PACKAGES = new HashSet<String>(Arrays.asList(
- "android",
- "com.android.systemui"
- ));
-
public ZenModeHelper(Context context, Handler handler) {
mContext = context;
mHandler = handler;
@@ -249,9 +238,7 @@
allowDisable = mZenMode == Global.ZEN_MODE_OFF || mConfig.allowCalls;
reason = mZenMode == Global.ZEN_MODE_OFF ? "zenOff" : "allowCalls";
}
- if (!SYSTEM_PACKAGES.contains(pkg)) {
- ZenLog.traceAllowDisable(pkg, allowDisable, reason);
- }
+ ZenLog.traceAllowDisable(pkg, allowDisable, reason);
return allowDisable;
}
@@ -305,8 +292,7 @@
}
private boolean isSystem(NotificationRecord record) {
- return SYSTEM_PACKAGES.contains(record.sbn.getPackageName())
- && record.isCategory(Notification.CATEGORY_SYSTEM);
+ return record.isCategory(Notification.CATEGORY_SYSTEM);
}
private boolean isAlarm(NotificationRecord record) {
@@ -330,8 +316,16 @@
&& pkg.equals(mDefaultPhoneApp.getPackageName());
}
+ private boolean isDefaultMessagingApp(NotificationRecord record) {
+ final int userId = record.getUserId();
+ if (userId == UserHandle.USER_NULL || userId == UserHandle.USER_ALL) return false;
+ final String defaultApp = Secure.getStringForUser(mContext.getContentResolver(),
+ Secure.SMS_DEFAULT_APPLICATION, userId);
+ return Objects.equals(defaultApp, record.sbn.getPackageName());
+ }
+
private boolean isMessage(NotificationRecord record) {
- return MESSAGE_PACKAGES.contains(record.sbn.getPackageName());
+ return record.isCategory(Notification.CATEGORY_MESSAGE) || isDefaultMessagingApp(record);
}
private boolean audienceMatches(NotificationRecord record) {
diff --git a/services/core/java/com/android/server/pm/CrossProfileIntentFilter.java b/services/core/java/com/android/server/pm/CrossProfileIntentFilter.java
index 3ce19c1f..c61d344 100644
--- a/services/core/java/com/android/server/pm/CrossProfileIntentFilter.java
+++ b/services/core/java/com/android/server/pm/CrossProfileIntentFilter.java
@@ -33,17 +33,24 @@
class CrossProfileIntentFilter extends IntentFilter {
private static final String ATTR_TARGET_USER_ID = "targetUserId";
private static final String ATTR_FLAGS = "flags";
+ private static final String ATTR_OWNER_USER_ID = "ownerUserId";
+ private static final String ATTR_OWNER_PACKAGE = "ownerPackage";
private static final String ATTR_FILTER = "filter";
private static final String TAG = "CrossProfileIntentFilter";
// If the intent matches the IntentFilter, then it can be forwarded to this userId.
final int mTargetUserId;
+ final int mOwnerUserId; // userId of the app which has set this CrossProfileIntentFilter.
+ final String mOwnerPackage; // packageName of the app.
final int mFlags;
- CrossProfileIntentFilter(IntentFilter filter, int targetUserId, int flags) {
+ CrossProfileIntentFilter(IntentFilter filter, String ownerPackage, int ownerUserId,
+ int targetUserId, int flags) {
super(filter);
mTargetUserId = targetUserId;
+ mOwnerUserId = ownerUserId;
+ mOwnerPackage = ownerPackage;
mFlags = flags;
}
@@ -55,25 +62,20 @@
return mFlags;
}
+ public int getOwnerUserId() {
+ return mOwnerUserId;
+ }
+
+ public String getOwnerPackage() {
+ return mOwnerPackage;
+ }
+
CrossProfileIntentFilter(XmlPullParser parser) throws XmlPullParserException, IOException {
- String targetUserIdString = parser.getAttributeValue(null, ATTR_TARGET_USER_ID);
- if (targetUserIdString == null) {
- String msg = "Missing element under " + TAG +": " + ATTR_TARGET_USER_ID + " at " +
- parser.getPositionDescription();
- PackageManagerService.reportSettingsProblem(Log.WARN, msg);
- mTargetUserId = UserHandle.USER_NULL;
- } else {
- mTargetUserId = Integer.parseInt(targetUserIdString);
- }
- String flagsString = parser.getAttributeValue(null, ATTR_FLAGS);
- if (flagsString == null) {
- String msg = "Missing element under " + TAG +": " + ATTR_FLAGS + " at " +
- parser.getPositionDescription();
- PackageManagerService.reportSettingsProblem(Log.WARN, msg);
- mFlags = 0;
- } else {
- mFlags = Integer.parseInt(flagsString);
- }
+ mTargetUserId = getIntFromXml(parser, ATTR_TARGET_USER_ID, UserHandle.USER_NULL);
+ mOwnerUserId = getIntFromXml(parser, ATTR_OWNER_USER_ID, UserHandle.USER_NULL);
+ mOwnerPackage = getStringFromXml(parser, ATTR_OWNER_PACKAGE, "");
+ mFlags = getIntFromXml(parser, ATTR_FLAGS, 0);
+
int outerDepth = parser.getDepth();
String tagName = parser.getName();
int type;
@@ -103,9 +105,31 @@
}
}
+ String getStringFromXml(XmlPullParser parser, String attribute, String defaultValue) {
+ String value = parser.getAttributeValue(null, attribute);
+ if (value == null) {
+ String msg = "Missing element under " + TAG +": " + attribute + " at " +
+ parser.getPositionDescription();
+ PackageManagerService.reportSettingsProblem(Log.WARN, msg);
+ return defaultValue;
+ } else {
+ return value;
+ }
+ }
+
+ int getIntFromXml(XmlPullParser parser, String attribute, int defaultValue) {
+ String stringValue = getStringFromXml(parser, attribute, null);
+ if (stringValue != null) {
+ return Integer.parseInt(stringValue);
+ }
+ return defaultValue;
+ }
+
public void writeToXml(XmlSerializer serializer) throws IOException {
serializer.attribute(null, ATTR_TARGET_USER_ID, Integer.toString(mTargetUserId));
serializer.attribute(null, ATTR_FLAGS, Integer.toString(mFlags));
+ serializer.attribute(null, ATTR_OWNER_USER_ID, Integer.toString(mOwnerUserId));
+ serializer.attribute(null, ATTR_OWNER_PACKAGE, mOwnerPackage);
serializer.startTag(null, ATTR_FILTER);
super.writeToXml(serializer);
serializer.endTag(null, ATTR_FILTER);
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index a07eb7e..68ae6ff 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -11635,22 +11635,25 @@
}
@Override
- public void addCrossProfileIntentFilter(IntentFilter intentFilter, int sourceUserId,
- int targetUserId, int flags) {
+ public void addCrossProfileIntentFilter(IntentFilter intentFilter, String ownerPackage,
+ int ownerUserId, int sourceUserId, int targetUserId, int flags) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
+ int callingUid = Binder.getCallingUid();
+ enforceOwnerRights(ownerPackage, ownerUserId, callingUid);
if (intentFilter.countActions() == 0) {
Slog.w(TAG, "Cannot set a crossProfile intent filter with no filter actions");
return;
}
synchronized (mPackages) {
CrossProfileIntentFilter filter = new CrossProfileIntentFilter(intentFilter,
- targetUserId, flags);
+ ownerPackage, UserHandle.getUserId(callingUid), targetUserId, flags);
mSettings.editCrossProfileIntentResolverLPw(sourceUserId).addFilter(filter);
mSettings.writePackageRestrictionsLPr(sourceUserId);
}
}
+ @Override
public void addCrossProfileIntentsForPackage(String packageName,
int sourceUserId, int targetUserId) {
mContext.enforceCallingOrSelfPermission(
@@ -11668,16 +11671,21 @@
}
@Override
- public void clearCrossProfileIntentFilters(int sourceUserId) {
+ public void clearCrossProfileIntentFilters(int sourceUserId, String ownerPackage,
+ int ownerUserId) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, null);
+ int callingUid = Binder.getCallingUid();
+ enforceOwnerRights(ownerPackage, ownerUserId, callingUid);
+ int callingUserId = UserHandle.getUserId(callingUid);
synchronized (mPackages) {
CrossProfileIntentResolver resolver =
mSettings.editCrossProfileIntentResolverLPw(sourceUserId);
HashSet<CrossProfileIntentFilter> set =
new HashSet<CrossProfileIntentFilter>(resolver.filterSet());
for (CrossProfileIntentFilter filter : set) {
- if ((filter.getFlags() & PackageManager.SET_BY_PROFILE_OWNER) != 0) {
+ if (filter.getOwnerPackage().equals(ownerPackage)
+ && filter.getOwnerUserId() == callingUserId) {
resolver.removeFilter(filter);
}
}
@@ -11685,6 +11693,29 @@
}
}
+ // Enforcing that callingUid is owning pkg on userId
+ private void enforceOwnerRights(String pkg, int userId, int callingUid) {
+ // The system owns everything.
+ if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID) {
+ return;
+ }
+ int callingUserId = UserHandle.getUserId(callingUid);
+ if (callingUserId != userId) {
+ throw new SecurityException("calling uid " + callingUid
+ + " pretends to own " + pkg + " on user " + userId + " but belongs to user "
+ + callingUserId);
+ }
+ PackageInfo pi = getPackageInfo(pkg, 0, callingUserId);
+ if (pi == null) {
+ throw new IllegalArgumentException("Unknown package " + pkg + " on user "
+ + callingUserId);
+ }
+ if (!UserHandle.isSameApp(pi.applicationInfo.uid, callingUid)) {
+ throw new SecurityException("Calling uid " + callingUid
+ + " does not own package " + pkg);
+ }
+ }
+
@Override
public ComponentName getHomeActivities(List<ResolveInfo> allHomeCandidates) {
Intent intent = new Intent(Intent.ACTION_MAIN);
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
index dc44e51..463f763 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
@@ -18,9 +18,7 @@
import com.android.server.notification.NotificationDelegate;
-import android.os.IBinder;
-import android.service.notification.StatusBarNotification;
-
public interface StatusBarManagerInternal {
void setNotificationDelegate(NotificationDelegate delegate);
+ void buzzBeepBlinked();
}
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index e548fa5..d0013aa 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -111,6 +111,15 @@
public void setNotificationDelegate(NotificationDelegate delegate) {
mNotificationDelegate = delegate;
}
+ @Override
+ public void buzzBeepBlinked() {
+ if (mBar != null) {
+ try {
+ mBar.buzzBeepBlinked();
+ } catch (RemoteException ex) {
+ }
+ }
+ }
};
// ================================================================================
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java
index 6f72b94..14436aa 100644
--- a/services/core/java/com/android/server/trust/TrustManagerService.java
+++ b/services/core/java/com/android/server/trust/TrustManagerService.java
@@ -372,7 +372,7 @@
private void removeListener(ITrustListener listener) {
for (int i = 0; i < mTrustListeners.size(); i++) {
if (mTrustListeners.get(i).asBinder() == listener.asBinder()) {
- mTrustListeners.get(i);
+ mTrustListeners.remove(i);
return;
}
}
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index c97ed82..1a9a85c 100644
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -745,7 +745,7 @@
private void setStateLocked(String inputId, int state, int userId) {
UserState userState = getUserStateLocked(userId);
TvInputState inputState = userState.inputMap.get(inputId);
- ServiceState serviceState = userState.serviceStateMap.get(inputId);
+ ServiceState serviceState = userState.serviceStateMap.get(inputState.mInfo.getComponent());
int oldState = inputState.mState;
inputState.mState = state;
if (serviceState != null && serviceState.mService == null
diff --git a/services/core/jni/Android.mk b/services/core/jni/Android.mk
index 5599760..9a4d900 100644
--- a/services/core/jni/Android.mk
+++ b/services/core/jni/Android.mk
@@ -10,7 +10,6 @@
$(LOCAL_REL_DIR)/com_android_server_AssetAtlasService.cpp \
$(LOCAL_REL_DIR)/com_android_server_connectivity_Vpn.cpp \
$(LOCAL_REL_DIR)/com_android_server_ConsumerIrService.cpp \
- $(LOCAL_REL_DIR)/com_android_server_dreams_McuHal.cpp \
$(LOCAL_REL_DIR)/com_android_server_hdmi_HdmiCecController.cpp \
$(LOCAL_REL_DIR)/com_android_server_hdmi_HdmiMhlController.cpp \
$(LOCAL_REL_DIR)/com_android_server_input_InputApplicationHandle.cpp \
diff --git a/services/core/jni/com_android_server_dreams_McuHal.cpp b/services/core/jni/com_android_server_dreams_McuHal.cpp
deleted file mode 100644
index a6d9297..0000000
--- a/services/core/jni/com_android_server_dreams_McuHal.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "McuHal"
-
-//#define LOG_NDEBUG 0
-
-#include "JNIHelp.h"
-#include "jni.h"
-
-#include <ScopedUtfChars.h>
-#include <ScopedPrimitiveArray.h>
-
-#include <utils/Errors.h>
-#include <utils/Log.h>
-#include <hardware/mcu.h>
-
-namespace android {
-
-static jlong nativeOpen(JNIEnv* env, jclass clazz) {
- mcu_module_t* module = NULL;
- status_t err = hw_get_module(MCU_HARDWARE_MODULE_ID,
- (hw_module_t const**)&module);
- if (err) {
- ALOGE("Couldn't load %s module (%s)", MCU_HARDWARE_MODULE_ID, strerror(-err));
- return 0;
- }
-
- err = module->init(module);
- if (err) {
- ALOGE("Couldn't initialize %s module (%s)", MCU_HARDWARE_MODULE_ID, strerror(-err));
- return 0;
- }
-
- return reinterpret_cast<jlong>(module);
-}
-
-static jbyteArray nativeSendMessage(JNIEnv* env, jclass clazz,
- jlong ptr, jstring msgStr, jbyteArray argArray) {
- mcu_module_t* module = reinterpret_cast<mcu_module_t*>(ptr);
-
- ScopedUtfChars msg(env, msgStr);
- ALOGV("Sending message %s to MCU", msg.c_str());
-
- void* result = NULL;
- size_t resultSize = 0;
- status_t err;
- if (argArray) {
- ScopedByteArrayRO arg(env, argArray);
- err = module->sendMessage(module, msg.c_str(), arg.get(), arg.size(),
- &result, &resultSize);
- } else {
- err = module->sendMessage(module, msg.c_str(), NULL, 0, &result, &resultSize);
- }
- if (err) {
- ALOGE("Couldn't send message to MCU (%s)", strerror(-err));
- return NULL;
- }
-
- if (!result) {
- return NULL;
- }
-
- jbyteArray resultArray = env->NewByteArray(resultSize);
- if (resultArray) {
- env->SetByteArrayRegion(resultArray, 0, resultSize, static_cast<jbyte*>(result));
- }
- free(result);
- return resultArray;
-}
-
-static JNINativeMethod gMcuHalMethods[] = {
- /* name, signature, funcPtr */
- { "nativeOpen", "()J",
- (void*) nativeOpen },
- { "nativeSendMessage", "(JLjava/lang/String;[B)[B",
- (void*) nativeSendMessage },
-};
-
-int register_android_server_dreams_McuHal(JNIEnv* env) {
- int res = jniRegisterNativeMethods(env, "com/android/server/dreams/McuHal",
- gMcuHalMethods, NELEM(gMcuHalMethods));
- LOG_FATAL_IF(res < 0, "Unable to register native methods.");
- return 0;
-}
-
-} /* namespace android */
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index bf7501e..ce2ca9b 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -37,7 +37,6 @@
int register_android_server_location_GpsLocationProvider(JNIEnv* env);
int register_android_server_location_FlpHardwareProvider(JNIEnv* env);
int register_android_server_connectivity_Vpn(JNIEnv* env);
-int register_android_server_dreams_McuHal(JNIEnv* env);
int register_android_server_hdmi_HdmiCecController(JNIEnv* env);
int register_android_server_hdmi_HdmiMhlController(JNIEnv* env);
int register_android_server_tv_TvInputHal(JNIEnv* env);
@@ -73,7 +72,6 @@
register_android_server_connectivity_Vpn(env);
register_android_server_AssetAtlasService(env);
register_android_server_ConsumerIrService(env);
- register_android_server_dreams_McuHal(env);
register_android_server_BatteryStatsService(env);
register_android_server_hdmi_HdmiCecController(env);
register_android_server_hdmi_HdmiMhlController(env);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index dc55e6d..25f9e9b 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -252,8 +252,6 @@
}
};
- private IAppOpsService mAppOpsService;
-
static class ActiveAdmin {
private static final String TAG_DISABLE_KEYGUARD_FEATURES = "disable-keyguard-features";
private static final String TAG_DISABLE_CAMERA = "disable-camera";
@@ -1288,24 +1286,6 @@
getUserData(UserHandle.USER_OWNER);
loadDeviceOwner();
cleanUpOldUsers();
- mAppOpsService = IAppOpsService.Stub.asInterface(
- ServiceManager.getService(Context.APP_OPS_SERVICE));
- if (mDeviceOwner != null) {
- if (mDeviceOwner.hasDeviceOwner()) {
- try {
- mAppOpsService.setDeviceOwner(mDeviceOwner.getDeviceOwnerPackageName());
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Unable to notify AppOpsService of DeviceOwner", e);
- }
- }
- for (Integer i : mDeviceOwner.getProfileOwnerKeys()) {
- try {
- mAppOpsService.setProfileOwner(mDeviceOwner.getProfileOwnerPackageName(i), i);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Unable to notify AppOpsService of ProfileOwner", e);
- }
- }
- }
// Register an observer for watching for user setup complete.
new SetupContentObserver(mHandler).register(mContext.getContentResolver());
// Initialize the user setup state, to handle the upgrade case.
@@ -3169,14 +3149,6 @@
"Trying to set device owner but device owner is already set.");
}
- long token = Binder.clearCallingIdentity();
- try {
- mAppOpsService.setDeviceOwner(packageName);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Unable to notify AppOpsService of DeviceOwner", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
if (mDeviceOwner == null) {
// Device owner is not set and does not exist, set it.
mDeviceOwner = DeviceOwner.createWithDeviceOwner(packageName, ownerName);
@@ -3284,14 +3256,7 @@
throw new IllegalStateException(
"Trying to set profile owner but user is already set-up.");
}
- long token = Binder.clearCallingIdentity();
- try {
- mAppOpsService.setProfileOwner(packageName, userHandle);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Unable to notify AppOpsService of ProfileOwner", e);
- } finally {
- Binder.restoreCallingIdentity(token);
- }
+
if (mDeviceOwner == null) {
// Device owner state does not exist, create it.
mDeviceOwner = DeviceOwner.createWithProfileOwner(packageName, ownerName,
@@ -3606,12 +3571,12 @@
long id = Binder.clearCallingIdentity();
try {
if ((flags & DevicePolicyManager.FLAG_PARENT_CAN_ACCESS_MANAGED) != 0) {
- pm.addCrossProfileIntentFilter(filter, callingUserId, UserHandle.USER_OWNER,
- PackageManager.SET_BY_PROFILE_OWNER);
+ pm.addCrossProfileIntentFilter(filter, who.getPackageName(),
+ mContext.getUserId(), callingUserId, UserHandle.USER_OWNER, 0);
}
if ((flags & DevicePolicyManager.FLAG_MANAGED_CAN_ACCESS_PARENT) != 0) {
- pm.addCrossProfileIntentFilter(filter, UserHandle.USER_OWNER, callingUserId,
- PackageManager.SET_BY_PROFILE_OWNER);
+ pm.addCrossProfileIntentFilter(filter, who.getPackageName(),
+ mContext.getUserId(), UserHandle.USER_OWNER, callingUserId, 0);
}
} catch (RemoteException re) {
// Shouldn't happen
@@ -3631,10 +3596,12 @@
IPackageManager pm = AppGlobals.getPackageManager();
long id = Binder.clearCallingIdentity();
try {
- pm.clearCrossProfileIntentFilters(callingUserId);
+ pm.clearCrossProfileIntentFilters(callingUserId, who.getPackageName(),
+ callingUserId);
// If we want to support multiple managed profiles, we will have to only remove
// those that have callingUserId as their target.
- pm.clearCrossProfileIntentFilters(UserHandle.USER_OWNER);
+ pm.clearCrossProfileIntentFilters(UserHandle.USER_OWNER, who.getPackageName(),
+ callingUserId);
} catch (RemoteException re) {
// Shouldn't happen
} finally {
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 0cc6e0f..70266ee 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -673,6 +673,8 @@
mSystemServiceManager.startService(
"com.android.server.wifi.WifiScanningService");
+ mSystemServiceManager.startService("com.android.server.wifi.RttService");
+
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_ETHERNET)) {
mSystemServiceManager.startService(ETHERNET_SERVICE_CLASS);
}
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
index 1e0d6de..8913eb9 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java
@@ -28,8 +28,6 @@
import android.text.TextUtils;
import android.util.Slog;
-import java.util.ArrayList;
-import java.util.List;
import java.util.UUID;
/**
@@ -39,43 +37,35 @@
*/
public class DatabaseHelper extends SQLiteOpenHelper {
static final String TAG = "SoundModelDBHelper";
- static final boolean DBG = false;
+ // TODO: Set to false.
+ static final boolean DBG = true;
private static final String NAME = "sound_model.db";
- private static final int VERSION = 2;
-
- public static interface KeyphraseContract {
- public static final String TABLE = "keyphrase";
- public static final String KEY_ID = "_id";
- public static final String KEY_RECOGNITION_MODES = "modes";
- public static final String KEY_LOCALE = "locale";
- public static final String KEY_HINT_TEXT = "hint_text";
- public static final String KEY_USERS = "users";
- public static final String KEY_SOUND_MODEL_ID = "sound_model_id";
- }
+ private static final int VERSION = 3;
public static interface SoundModelContract {
public static final String TABLE = "sound_model";
- public static final String KEY_ID = "_id";
+ public static final String KEY_KEYPHRASE_ID = "keyphrase_id";
+ public static final String KEY_MODEL_UUID = "model_uuid";
public static final String KEY_TYPE = "type";
public static final String KEY_DATA = "data";
+ public static final String KEY_RECOGNITION_MODES = "recognition_modes";
+ public static final String KEY_LOCALE = "locale";
+ public static final String KEY_HINT_TEXT = "hint_text";
+ public static final String KEY_USERS = "users";
}
- // Table Create Statements
- private static final String CREATE_TABLE_KEYPRHASES = "CREATE TABLE "
- + KeyphraseContract.TABLE + "("
- + KeyphraseContract.KEY_ID + " INTEGER PRIMARY KEY,"
- + KeyphraseContract.KEY_RECOGNITION_MODES + " INTEGER,"
- + KeyphraseContract.KEY_USERS + " TEXT,"
- + KeyphraseContract.KEY_SOUND_MODEL_ID + " TEXT,"
- + KeyphraseContract.KEY_LOCALE + " TEXT,"
- + KeyphraseContract.KEY_HINT_TEXT + " TEXT" + ")";
-
+ // Table Create Statement
private static final String CREATE_TABLE_SOUND_MODEL = "CREATE TABLE "
+ SoundModelContract.TABLE + "("
- + SoundModelContract.KEY_ID + " TEXT PRIMARY KEY,"
+ + SoundModelContract.KEY_KEYPHRASE_ID + " INTEGER PRIMARY KEY,"
+ + SoundModelContract.KEY_MODEL_UUID + " TEXT,"
+ SoundModelContract.KEY_TYPE + " INTEGER,"
- + SoundModelContract.KEY_DATA + " BLOB" + ")";
+ + SoundModelContract.KEY_DATA + " BLOB,"
+ + SoundModelContract.KEY_RECOGNITION_MODES + " INTEGER,"
+ + SoundModelContract.KEY_LOCALE + " TEXT,"
+ + SoundModelContract.KEY_HINT_TEXT + " TEXT,"
+ + SoundModelContract.KEY_USERS + " TEXT" + ")";
private final UserManager mUserManager;
@@ -87,57 +77,44 @@
@Override
public void onCreate(SQLiteDatabase db) {
// creating required tables
- db.execSQL(CREATE_TABLE_KEYPRHASES);
db.execSQL(CREATE_TABLE_SOUND_MODEL);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO: For now, drop older tables and recreate new ones.
- db.execSQL("DROP TABLE IF EXISTS " + KeyphraseContract.TABLE);
db.execSQL("DROP TABLE IF EXISTS " + SoundModelContract.TABLE);
onCreate(db);
}
- public boolean addOrUpdateKeyphraseSoundModel(KeyphraseSoundModel soundModel) {
+ /**
+ * Updates the given keyphrase model, adds it, if it doesn't already exist.
+ *
+ * TODO: We only support one keyphrase currently.
+ */
+ public boolean updateKeyphraseSoundModel(KeyphraseSoundModel soundModel) {
synchronized(this) {
SQLiteDatabase db = getWritableDatabase();
ContentValues values = new ContentValues();
- // Generate a random ID for the model.
- values.put(SoundModelContract.KEY_ID, soundModel.uuid.toString());
- values.put(SoundModelContract.KEY_DATA, soundModel.data);
+ values.put(SoundModelContract.KEY_MODEL_UUID, soundModel.uuid.toString());
values.put(SoundModelContract.KEY_TYPE, SoundTrigger.SoundModel.TYPE_KEYPHRASE);
-
- boolean status = true;
- if (db.insertWithOnConflict(SoundModelContract.TABLE, null, values,
- SQLiteDatabase.CONFLICT_REPLACE) != -1) {
- for (Keyphrase keyphrase : soundModel.keyphrases) {
- status &= addOrUpdateKeyphraseLocked(db, soundModel.uuid, keyphrase);
- }
- db.close();
- return status;
- } else {
- Slog.w(TAG, "Failed to persist sound model to database");
- db.close();
- return false;
- }
- }
- }
+ values.put(SoundModelContract.KEY_DATA, soundModel.data);
- private boolean addOrUpdateKeyphraseLocked(
- SQLiteDatabase db, UUID modelId, Keyphrase keyphrase) {
- ContentValues values = new ContentValues();
- values.put(KeyphraseContract.KEY_ID, keyphrase.id);
- values.put(KeyphraseContract.KEY_RECOGNITION_MODES, keyphrase.recognitionModes);
- values.put(KeyphraseContract.KEY_SOUND_MODEL_ID, modelId.toString());
- values.put(KeyphraseContract.KEY_HINT_TEXT, keyphrase.text);
- values.put(KeyphraseContract.KEY_LOCALE, keyphrase.locale);
- values.put(KeyphraseContract.KEY_USERS, getCommaSeparatedString(keyphrase.users));
- if (db.insertWithOnConflict(
- KeyphraseContract.TABLE, null, values, SQLiteDatabase.CONFLICT_REPLACE) != -1) {
- return true;
- } else {
- Slog.w(TAG, "Failed to persist keyphrase to database");
+ if (soundModel.keyphrases != null && soundModel.keyphrases.length == 1) {
+ values.put(SoundModelContract.KEY_KEYPHRASE_ID, soundModel.keyphrases[0].id);
+ values.put(SoundModelContract.KEY_RECOGNITION_MODES,
+ soundModel.keyphrases[0].recognitionModes);
+ values.put(SoundModelContract.KEY_USERS,
+ getCommaSeparatedString(soundModel.keyphrases[0].users));
+ values.put(SoundModelContract.KEY_LOCALE, soundModel.keyphrases[0].locale);
+ values.put(SoundModelContract.KEY_HINT_TEXT, soundModel.keyphrases[0].text);
+ try {
+ return db.insertWithOnConflict(SoundModelContract.TABLE, null, values,
+ SQLiteDatabase.CONFLICT_REPLACE) != -1;
+ } finally {
+ db.close();
+ }
+ }
return false;
}
}
@@ -145,111 +122,90 @@
/**
* Deletes the sound model and associated keyphrases.
*/
- public boolean deleteKeyphraseSoundModel(UUID uuid) {
+ public boolean deleteKeyphraseSoundModel(int keyphraseId) {
synchronized(this) {
SQLiteDatabase db = getWritableDatabase();
- String modelId = uuid.toString();
- String soundModelClause = SoundModelContract.KEY_ID + "=" + modelId;
- boolean status = true;
- if (db.delete(SoundModelContract.TABLE, soundModelClause, null) == 0) {
- Slog.w(TAG, "No sound models deleted from the database");
- status = false;
+ String soundModelClause = SoundModelContract.KEY_KEYPHRASE_ID + "=" + keyphraseId;
+
+ try {
+ return db.delete(SoundModelContract.TABLE, soundModelClause, null) != 0;
+ } finally {
+ db.close();
}
- String keyphraseClause = KeyphraseContract.KEY_SOUND_MODEL_ID + "=" + modelId;
- if (db.delete(KeyphraseContract.TABLE, keyphraseClause, null) == 0) {
- Slog.w(TAG, "No keyphrases deleted from the database");
- status = false;
- }
- db.close();
- return status;
}
}
/**
- * Lists all the keyphrase sound models currently registered with the system.
+ * Returns a matching {@link KeyphraseSoundModel} for the keyphrase ID.
+ * Returns null if a match isn't found.
+ *
+ * TODO: We only support one keyphrase currently.
*/
- public List<KeyphraseSoundModel> getKephraseSoundModels() {
+ public KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId) {
synchronized(this) {
- List<KeyphraseSoundModel> models = new ArrayList<>();
- String selectQuery = "SELECT * FROM " + SoundModelContract.TABLE;
+ // Find the corresponding sound model ID for the keyphrase.
+ String selectQuery = "SELECT * FROM " + SoundModelContract.TABLE
+ + " WHERE " + SoundModelContract.KEY_KEYPHRASE_ID + " = '" + keyphraseId + "'";
SQLiteDatabase db = getReadableDatabase();
Cursor c = db.rawQuery(selectQuery, null);
-
- // looping through all rows and adding to list
- if (c.moveToFirst()) {
- do {
+
+ try {
+ if (c.moveToFirst()) {
int type = c.getInt(c.getColumnIndex(SoundModelContract.KEY_TYPE));
if (type != SoundTrigger.SoundModel.TYPE_KEYPHRASE) {
- // Ignore non-keyphrase sound models.
- continue;
+ Slog.w(TAG, "No KeyphraseSoundModel available for the given keyphrase");
+ return null;
}
- String id = c.getString(c.getColumnIndex(SoundModelContract.KEY_ID));
- byte[] data = c.getBlob(c.getColumnIndex(SoundModelContract.KEY_DATA));
- // Get all the keyphrases for this this sound model.
- // Validate the sound model.
- if (id == null) {
+
+ String modelUuid = c.getString(
+ c.getColumnIndex(SoundModelContract.KEY_MODEL_UUID));
+ if (modelUuid == null) {
Slog.w(TAG, "Ignoring sound model since it doesn't specify an ID");
- continue;
+ return null;
}
- KeyphraseSoundModel model = new KeyphraseSoundModel(
- UUID.fromString(id), data, getKeyphrasesForSoundModelLocked(db, id));
- if (DBG) {
- Slog.d(TAG, "Adding model: " + model);
+
+ byte[] data = c.getBlob(c.getColumnIndex(SoundModelContract.KEY_DATA));
+ int recognitionModes = c.getInt(
+ c.getColumnIndex(SoundModelContract.KEY_RECOGNITION_MODES));
+ int[] users = getArrayForCommaSeparatedString(
+ c.getString(c.getColumnIndex(SoundModelContract.KEY_USERS)));
+ String locale = c.getString(c.getColumnIndex(SoundModelContract.KEY_LOCALE));
+ String text = c.getString(
+ c.getColumnIndex(SoundModelContract.KEY_HINT_TEXT));
+
+ // Only add keyphrases meant for the current user.
+ if (users == null) {
+ // No users present in the keyphrase.
+ Slog.w(TAG, "Ignoring keyphrase since it doesn't specify users");
+ return null;
}
- models.add(model);
- } while (c.moveToNext());
+ boolean isAvailableForCurrentUser = false;
+ int currentUser = mUserManager.getUserHandle();
+ for (int user : users) {
+ if (currentUser == user) {
+ isAvailableForCurrentUser = true;
+ break;
+ }
+ }
+ if (!isAvailableForCurrentUser) {
+ Slog.w(TAG, "Ignoring keyphrase since it's not for the current user");
+ return null;
+ }
+
+ Keyphrase[] keyphrases = new Keyphrase[1];
+ keyphrases[0] = new Keyphrase(
+ keyphraseId, recognitionModes, locale, text, users);
+ return new KeyphraseSoundModel(UUID.fromString(modelUuid), data, keyphrases);
+ }
+ Slog.w(TAG, "No SoundModel available for the given keyphrase");
+ } finally {
+ c.close();
+ db.close();
}
- c.close();
- db.close();
- return models;
+ return null;
}
}
- private Keyphrase[] getKeyphrasesForSoundModelLocked(SQLiteDatabase db, String modelId) {
- List<Keyphrase> keyphrases = new ArrayList<>();
- String selectQuery = "SELECT * FROM " + KeyphraseContract.TABLE
- + " WHERE " + KeyphraseContract.KEY_SOUND_MODEL_ID + " = '" + modelId + "'";
- Cursor c = db.rawQuery(selectQuery, null);
-
- // looping through all rows and adding to list
- if (c.moveToFirst()) {
- do {
- int id = c.getInt(c.getColumnIndex(KeyphraseContract.KEY_ID));
- int modes = c.getInt(c.getColumnIndex(KeyphraseContract.KEY_RECOGNITION_MODES));
- int[] users = getArrayForCommaSeparatedString(
- c.getString(c.getColumnIndex(KeyphraseContract.KEY_USERS)));
- String locale = c.getString(c.getColumnIndex(KeyphraseContract.KEY_LOCALE));
- String hintText = c.getString(c.getColumnIndex(KeyphraseContract.KEY_HINT_TEXT));
-
- // Only add keyphrases meant for the current user.
- if (users == null) {
- // No users present in the keyphrase.
- Slog.w(TAG, "Ignoring keyphrase since it doesn't specify users");
- continue;
- }
- boolean isAvailableForCurrentUser = false;
- int currentUser = mUserManager.getUserHandle();
- for (int user : users) {
- if (currentUser == user) {
- isAvailableForCurrentUser = true;
- break;
- }
- }
- if (!isAvailableForCurrentUser) {
- Slog.w(TAG, "Ignoring keyphrase since it's not for the current user");
- continue;
- }
-
- keyphrases.add(new Keyphrase(id, modes, locale, hintText, users));
- } while (c.moveToNext());
- }
- Keyphrase[] keyphraseArr = new Keyphrase[keyphrases.size()];
- keyphrases.toArray(keyphraseArr);
- c.close();
- return keyphraseArr;
- }
-
-
private static String getCommaSeparatedString(int[] users) {
if (users == null || users.length == 0) {
return "";
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
index 4430586..86dca79 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java
@@ -38,7 +38,8 @@
*/
public class SoundTriggerHelper implements SoundTrigger.StatusListener {
static final String TAG = "SoundTriggerHelper";
- static final boolean DBG = false;
+ // TODO: Set to false.
+ static final boolean DBG = true;
// TODO: Remove this.
static final int TEMP_KEYPHRASE_ID = 100;
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index 5d9e107..a3d578a 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -50,6 +50,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;
+import java.util.UUID;
/**
@@ -243,34 +244,18 @@
//----------------- Model management APIs --------------------------------//
@Override
- public List<KeyphraseSoundModel> listRegisteredKeyphraseSoundModels(
- IVoiceInteractionService service) {
- // Allow the call if this is the current voice interaction service
- // or the caller holds the MANAGE_VOICE_KEYPHRASES permission.
+ public KeyphraseSoundModel getKeyphraseSoundModel(int keyphraseId) {
synchronized (this) {
- boolean permissionGranted =
- mContext.checkCallingPermission(Manifest.permission.MANAGE_VOICE_KEYPHRASES)
- == PackageManager.PERMISSION_GRANTED;
- boolean currentVoiceInteractionService = service != null
- && mImpl != null
- && mImpl.mService != null
- && service.asBinder() == mImpl.mService.asBinder();
-
- if (!permissionGranted && !currentVoiceInteractionService) {
- if (!currentVoiceInteractionService) {
- throw new SecurityException(
- "Caller is not the current voice interaction service");
- }
- if (!permissionGranted) {
- throw new SecurityException("Caller does not hold the permission "
- + Manifest.permission.MANAGE_VOICE_KEYPHRASES);
- }
+ if (mContext.checkCallingPermission(Manifest.permission.MANAGE_VOICE_KEYPHRASES)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException("Caller does not hold the permission "
+ + Manifest.permission.MANAGE_VOICE_KEYPHRASES);
}
}
final long caller = Binder.clearCallingIdentity();
try {
- return mDbHelper.getKephraseSoundModels();
+ return mDbHelper.getKeyphraseSoundModel(keyphraseId);
} finally {
Binder.restoreCallingIdentity(caller);
}
@@ -291,15 +276,35 @@
final long caller = Binder.clearCallingIdentity();
try {
- boolean success = false;
- if (model.keyphrases == null) {
- // If the keyphrases are not present in the model, delete the model.
- success = mDbHelper.deleteKeyphraseSoundModel(model.uuid);
+ if (mDbHelper.updateKeyphraseSoundModel(model)) {
+ synchronized (this) {
+ // Notify the voice interaction service of a change in sound models.
+ if (mImpl != null && mImpl.mService != null) {
+ mImpl.notifySoundModelsChangedLocked();
+ }
+ }
+ return SoundTriggerHelper.STATUS_OK;
} else {
- // Else update the model.
- success = mDbHelper.addOrUpdateKeyphraseSoundModel(model);
+ return SoundTriggerHelper.STATUS_ERROR;
}
- if (success) {
+ } finally {
+ Binder.restoreCallingIdentity(caller);
+ }
+ }
+
+ @Override
+ public int deleteKeyphraseSoundModel(int keyphraseId) {
+ synchronized (this) {
+ if (mContext.checkCallingPermission(Manifest.permission.MANAGE_VOICE_KEYPHRASES)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException("Caller does not hold the permission "
+ + Manifest.permission.MANAGE_VOICE_KEYPHRASES);
+ }
+ }
+
+ final long caller = Binder.clearCallingIdentity();
+ try {
+ if (mDbHelper.deleteKeyphraseSoundModel(keyphraseId)) {
synchronized (this) {
// Notify the voice interaction service of a change in sound models.
if (mImpl != null && mImpl.mService != null) {
@@ -317,6 +322,25 @@
//----------------- SoundTrigger APIs --------------------------------//
@Override
+ public boolean isEnrolledForKeyphrase(IVoiceInteractionService service, int keyphraseId) {
+ synchronized (this) {
+ if (mImpl == null || mImpl.mService == null
+ || service.asBinder() != mImpl.mService.asBinder()) {
+ throw new SecurityException(
+ "Caller is not the current voice interaction service");
+ }
+ }
+
+ final long caller = Binder.clearCallingIdentity();
+ try {
+ KeyphraseSoundModel model = mDbHelper.getKeyphraseSoundModel(keyphraseId);
+ return model != null;
+ } finally {
+ Binder.restoreCallingIdentity(caller);
+ }
+ }
+
+ @Override
public ModuleProperties getDspModuleProperties(IVoiceInteractionService service) {
// Allow the call if this is the current voice interaction service.
synchronized (this) {
@@ -337,8 +361,7 @@
@Override
public int startRecognition(IVoiceInteractionService service, int keyphraseId,
- KeyphraseSoundModel soundModel, IRecognitionStatusCallback callback,
- RecognitionConfig recognitionConfig) {
+ IRecognitionStatusCallback callback, RecognitionConfig recognitionConfig) {
// Allow the call if this is the current voice interaction service.
synchronized (this) {
if (mImpl == null || mImpl.mService == null
@@ -347,13 +370,25 @@
"Caller is not the current voice interaction service");
}
- final long caller = Binder.clearCallingIdentity();
- try {
+ if (callback == null || recognitionConfig == null) {
+ throw new IllegalArgumentException("Illegal argument(s) in startRecognition");
+ }
+ }
+
+ final long caller = Binder.clearCallingIdentity();
+ try {
+ KeyphraseSoundModel soundModel = mDbHelper.getKeyphraseSoundModel(keyphraseId);
+ if (soundModel == null
+ || soundModel.uuid == null
+ || soundModel.keyphrases == null) {
+ Slog.w(TAG, "No matching sound model found in startRecognition");
+ return SoundTriggerHelper.STATUS_ERROR;
+ } else {
return mSoundTriggerHelper.startRecognition(
keyphraseId, soundModel, callback, recognitionConfig);
- } finally {
- Binder.restoreCallingIdentity(caller);
}
+ } finally {
+ Binder.restoreCallingIdentity(caller);
}
}
@@ -367,13 +402,13 @@
throw new SecurityException(
"Caller is not the current voice interaction service");
}
+ }
- final long caller = Binder.clearCallingIdentity();
- try {
- return mSoundTriggerHelper.stopRecognition(keyphraseId, callback);
- } finally {
- Binder.restoreCallingIdentity(caller);
- }
+ final long caller = Binder.clearCallingIdentity();
+ try {
+ return mSoundTriggerHelper.stopRecognition(keyphraseId, callback);
+ } finally {
+ Binder.restoreCallingIdentity(caller);
}
}
diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java
index 6043232..322dafe 100644
--- a/telecomm/java/android/telecomm/Connection.java
+++ b/telecomm/java/android/telecomm/Connection.java
@@ -44,7 +44,8 @@
public void onDestroyed(Connection c) {}
public void onCallCapabilitiesChanged(Connection c, int callCapabilities) {}
public void onParentConnectionChanged(Connection c, Connection parent) {}
- public void onVideoCallProviderChanged(Connection c, VideoCallProvider videoCallProvider) {}
+ public void onVideoCallProviderChanged(
+ Connection c, ConnectionService.VideoCallProvider videoCallProvider) {}
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
public void onStatusHintsChanged(Connection c, StatusHints statusHints) {}
public void onStartActivityFromInCall(Connection c, PendingIntent intent) {}
@@ -78,7 +79,7 @@
private boolean mRequestingRingback = false;
private int mCallCapabilities;
private Connection mParentConnection;
- private VideoCallProvider mVideoCallProvider;
+ private ConnectionService.VideoCallProvider mVideoCallProvider;
private boolean mAudioModeIsVoip;
private StatusHints mStatusHints;
private int mVideoState;
@@ -417,14 +418,14 @@
* Sets the video call provider.
* @param videoCallProvider The video call provider.
*/
- public final void setVideoCallProvider(VideoCallProvider videoCallProvider) {
+ public final void setVideoCallProvider(ConnectionService.VideoCallProvider videoCallProvider) {
mVideoCallProvider = videoCallProvider;
for (Listener l : mListeners) {
l.onVideoCallProviderChanged(this, videoCallProvider);
}
}
- public final VideoCallProvider getVideoCallProvider() {
+ public final ConnectionService.VideoCallProvider getVideoCallProvider() {
return mVideoCallProvider;
}
diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java
index 51876df..cefa929 100644
--- a/telecomm/java/android/telecomm/ConnectionService.java
+++ b/telecomm/java/android/telecomm/ConnectionService.java
@@ -29,9 +29,14 @@
import android.os.Looper;
import android.os.Message;
import android.telephony.DisconnectCause;
+import android.os.RemoteException;
+import android.view.Surface;
+
import com.android.internal.os.SomeArgs;
import com.android.internal.telecomm.IConnectionService;
import com.android.internal.telecomm.IConnectionServiceAdapter;
+import com.android.internal.telecomm.IVideoCallCallback;
+import com.android.internal.telecomm.IVideoCallProvider;
import com.android.internal.telecomm.RemoteServiceCallback;
import java.util.Collection;
@@ -758,4 +763,312 @@
Log.w(this, "%s - Cannot find Connection %s", action, callId);
return NULL_CONNECTION;
}
+
+ public static abstract class VideoCallProvider {
+ private static final int MSG_SET_VIDEO_CALL_LISTENER = 1;
+ private static final int MSG_SET_CAMERA = 2;
+ private static final int MSG_SET_PREVIEW_SURFACE = 3;
+ private static final int MSG_SET_DISPLAY_SURFACE = 4;
+ private static final int MSG_SET_DEVICE_ORIENTATION = 5;
+ private static final int MSG_SET_ZOOM = 6;
+ private static final int MSG_SEND_SESSION_MODIFY_REQUEST = 7;
+ private static final int MSG_SEND_SESSION_MODIFY_RESPONSE = 8;
+ private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9;
+ private static final int MSG_REQUEST_CALL_DATA_USAGE = 10;
+ private static final int MSG_SET_PAUSE_IMAGE = 11;
+
+ private final VideoCallProviderHandler mMessageHandler = new VideoCallProviderHandler();
+ private final VideoCallProviderBinder mBinder;
+ private IVideoCallCallback mVideoCallListener;
+
+ /**
+ * Default handler used to consolidate binder method calls onto a single thread.
+ */
+ private final class VideoCallProviderHandler extends Handler {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_SET_VIDEO_CALL_LISTENER:
+ mVideoCallListener = IVideoCallCallback.Stub.asInterface((IBinder) msg.obj);
+ break;
+ case MSG_SET_CAMERA:
+ onSetCamera((String) msg.obj);
+ break;
+ case MSG_SET_PREVIEW_SURFACE:
+ onSetPreviewSurface((Surface) msg.obj);
+ break;
+ case MSG_SET_DISPLAY_SURFACE:
+ onSetDisplaySurface((Surface) msg.obj);
+ break;
+ case MSG_SET_DEVICE_ORIENTATION:
+ onSetDeviceOrientation(msg.arg1);
+ break;
+ case MSG_SET_ZOOM:
+ onSetZoom((Float) msg.obj);
+ break;
+ case MSG_SEND_SESSION_MODIFY_REQUEST:
+ onSendSessionModifyRequest((VideoCallProfile) msg.obj);
+ break;
+ case MSG_SEND_SESSION_MODIFY_RESPONSE:
+ onSendSessionModifyResponse((VideoCallProfile) msg.obj);
+ break;
+ case MSG_REQUEST_CAMERA_CAPABILITIES:
+ onRequestCameraCapabilities();
+ break;
+ case MSG_REQUEST_CALL_DATA_USAGE:
+ onRequestCallDataUsage();
+ break;
+ case MSG_SET_PAUSE_IMAGE:
+ onSetPauseImage((String) msg.obj);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ /**
+ * IVideoCallProvider stub implementation.
+ */
+ private final class VideoCallProviderBinder extends IVideoCallProvider.Stub {
+ public void setVideoCallListener(IBinder videoCallListenerBinder) {
+ mMessageHandler.obtainMessage(
+ MSG_SET_VIDEO_CALL_LISTENER, videoCallListenerBinder).sendToTarget();
+ }
+
+ public void setCamera(String cameraId) {
+ mMessageHandler.obtainMessage(MSG_SET_CAMERA, cameraId).sendToTarget();
+ }
+
+ public void setPreviewSurface(Surface surface) {
+ mMessageHandler.obtainMessage(MSG_SET_PREVIEW_SURFACE, surface).sendToTarget();
+ }
+
+ public void setDisplaySurface(Surface surface) {
+ mMessageHandler.obtainMessage(MSG_SET_DISPLAY_SURFACE, surface).sendToTarget();
+ }
+
+ public void setDeviceOrientation(int rotation) {
+ mMessageHandler.obtainMessage(MSG_SET_DEVICE_ORIENTATION, rotation).sendToTarget();
+ }
+
+ public void setZoom(float value) {
+ mMessageHandler.obtainMessage(MSG_SET_ZOOM, value).sendToTarget();
+ }
+
+ public void sendSessionModifyRequest(VideoCallProfile requestProfile) {
+ mMessageHandler.obtainMessage(
+ MSG_SEND_SESSION_MODIFY_REQUEST, requestProfile).sendToTarget();
+ }
+
+ public void sendSessionModifyResponse(VideoCallProfile responseProfile) {
+ mMessageHandler.obtainMessage(
+ MSG_SEND_SESSION_MODIFY_RESPONSE, responseProfile).sendToTarget();
+ }
+
+ public void requestCameraCapabilities() {
+ mMessageHandler.obtainMessage(MSG_REQUEST_CAMERA_CAPABILITIES).sendToTarget();
+ }
+
+ public void requestCallDataUsage() {
+ mMessageHandler.obtainMessage(MSG_REQUEST_CALL_DATA_USAGE).sendToTarget();
+ }
+
+ public void setPauseImage(String uri) {
+ mMessageHandler.obtainMessage(MSG_SET_PAUSE_IMAGE, uri).sendToTarget();
+ }
+ }
+
+ public VideoCallProvider() {
+ mBinder = new VideoCallProviderBinder();
+ }
+
+ /**
+ * Returns binder object which can be used across IPC methods.
+ * @hide
+ */
+ public final IVideoCallProvider getInterface() {
+ return mBinder;
+ }
+
+ /**
+ * Sets the camera to be used for video recording in a video call.
+ *
+ * @param cameraId The id of the camera.
+ */
+ public abstract void onSetCamera(String cameraId);
+
+ /**
+ * Sets the surface to be used for displaying a preview of what the user's camera is
+ * currently capturing. When video transmission is enabled, this is the video signal which is
+ * sent to the remote device.
+ *
+ * @param surface The surface.
+ */
+ public abstract void onSetPreviewSurface(Surface surface);
+
+ /**
+ * Sets the surface to be used for displaying the video received from the remote device.
+ *
+ * @param surface The surface.
+ */
+ public abstract void onSetDisplaySurface(Surface surface);
+
+ /**
+ * Sets the device orientation, in degrees. Assumes that a standard portrait orientation of the
+ * device is 0 degrees.
+ *
+ * @param rotation The device orientation, in degrees.
+ */
+ public abstract void onSetDeviceOrientation(int rotation);
+
+ /**
+ * Sets camera zoom ratio.
+ *
+ * @param value The camera zoom ratio.
+ */
+ public abstract void onSetZoom(float value);
+
+ /**
+ * Issues a request to modify the properties of the current session. The request is sent to
+ * the remote device where it it handled by
+ * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
+ * Some examples of session modification requests: upgrade call from audio to video, downgrade
+ * call from video to audio, pause video.
+ *
+ * @param requestProfile The requested call video properties.
+ */
+ public abstract void onSendSessionModifyRequest(VideoCallProfile requestProfile);
+
+ /**te
+ * Provides a response to a request to change the current call session video
+ * properties.
+ * This is in response to a request the InCall UI has received via
+ * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
+ * The response is handled on the remove device by
+ * {@link InCallService.VideoCall.Listener#onSessionModifyResponseReceived}.
+ *
+ * @param responseProfile The response call video properties.
+ */
+ public abstract void onSendSessionModifyResponse(VideoCallProfile responseProfile);
+
+ /**
+ * Issues a request to the video provider to retrieve the camera capabilities.
+ * Camera capabilities are reported back to the caller via
+ * {@link InCallService.VideoCall.Listener#onCameraCapabilitiesChanged(CallCameraCapabilities)}.
+ */
+ public abstract void onRequestCameraCapabilities();
+
+ /**
+ * Issues a request to the video telephony framework to retrieve the cumulative data usage for
+ * the current call. Data usage is reported back to the caller via
+ * {@link InCallService.VideoCall.Listener#onCallDataUsageChanged}.
+ */
+ public abstract void onRequestCallDataUsage();
+
+ /**
+ * Provides the video telephony framework with the URI of an image to be displayed to remote
+ * devices when the video signal is paused.
+ *
+ * @param uri URI of image to display.
+ */
+ public abstract void onSetPauseImage(String uri);
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param videoCallProfile The requested video call profile.
+ */
+ public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.receiveSessionModifyRequest(videoCallProfile);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param status Status of the session modify request. Valid values are
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_FAIL},
+ * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_INVALID}
+ * @param requestedProfile The original request which was sent to the remote device.
+ * @param responseProfile The actual profile changes made by the remote device.
+ */
+ public void receiveSessionModifyResponse(int status,
+ VideoCallProfile requestedProfile, VideoCallProfile responseProfile) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.receiveSessionModifyResponse(
+ status, requestedProfile, responseProfile);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * Valid values are: {@link InCallService.VideoCall#SESSION_EVENT_RX_PAUSE},
+ * {@link InCallService.VideoCall#SESSION_EVENT_RX_RESUME},
+ * {@link InCallService.VideoCall#SESSION_EVENT_TX_START},
+ * {@link InCallService.VideoCall#SESSION_EVENT_TX_STOP}
+ *
+ * @param event The event.
+ */
+ public void handleCallSessionEvent(int event) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.handleCallSessionEvent(event);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param width The updated peer video width.
+ * @param height The updated peer video height.
+ */
+ public void changePeerDimensions(int width, int height) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changePeerDimensions(width, height);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param dataUsage The updated data usage.
+ */
+ public void changeCallDataUsage(int dataUsage) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changeCallDataUsage(dataUsage);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+
+ /**
+ * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
+ *
+ * @param callCameraCapabilities The changed camera capabilities.
+ */
+ public void changeCameraCapabilities(CallCameraCapabilities callCameraCapabilities) {
+ if (mVideoCallListener != null) {
+ try {
+ mVideoCallListener.changeCameraCapabilities(callCameraCapabilities);
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
+ }
}
diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
index 8f91e72..ea61362 100644
--- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java
@@ -275,7 +275,8 @@
* @param callId The unique ID of the call to set with the given call video provider.
* @param videoCallProvider The call video provider instance to set on the call.
*/
- void setVideoCallProvider(String callId, VideoCallProvider videoCallProvider) {
+ void setVideoCallProvider(
+ String callId, ConnectionService.VideoCallProvider videoCallProvider) {
for (IConnectionServiceAdapter adapter : mAdapters) {
try {
adapter.setVideoCallProvider(
diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java
index 38de08e..14b25dc8 100644
--- a/telecomm/java/android/telecomm/InCallService.java
+++ b/telecomm/java/android/telecomm/InCallService.java
@@ -339,12 +339,13 @@
public static abstract class Listener {
/**
* Called when a session modification request is received from the remote device.
- * The remote request is sent via {@link VideoCallProvider#onSendSessionModifyRequest}.
- * The InCall UI is responsible for potentially prompting the user whether they wish to
- * accept the new call profile (e.g. prompt user if they wish to accept an upgrade from
- * an audio to a video call) and should call
- * {@link VideoCallProvider#onSendSessionModifyResponse} to indicate the video settings
- * the user has agreed to.
+ * The remote request is sent via
+ * {@link ConnectionService.VideoCallProvider#onSendSessionModifyRequest}. The InCall UI
+ * is responsible for potentially prompting the user whether they wish to accept the new
+ * call profile (e.g. prompt user if they wish to accept an upgrade from an audio to a
+ * video call) and should call
+ * {@link ConnectionService.VideoCallProvider#onSendSessionModifyResponse} to indicate
+ * the video settings the user has agreed to.
*
* @param videoCallProfile The requested video call profile.
*/
@@ -353,7 +354,7 @@
/**
* Called when a response to a session modification request is received from the remote
* device. The remote InCall UI sends the response using
- * {@link VideoCallProvider#onSendSessionModifyResponse}.
+ * {@link ConnectionService.VideoCallProvider#onSendSessionModifyResponse}.
*
* @param status Status of the session modify request. Valid values are
* {@link VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
diff --git a/telecomm/java/android/telecomm/VideoCallImpl.java b/telecomm/java/android/telecomm/VideoCallImpl.java
index 3e538cb..c32bcd2 100644
--- a/telecomm/java/android/telecomm/VideoCallImpl.java
+++ b/telecomm/java/android/telecomm/VideoCallImpl.java
@@ -30,8 +30,8 @@
/**
* Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying
- * {@link VideoCallProvider}, and direct callbacks from the {@link VideoCallProvider} to the
- * appropriate {@link VideoCall.Listener}.
+ * {@link ConnectionService.VideoCallProvider}, and direct callbacks from the
+ * {@link ConnectionService.VideoCallProvider} to the appropriate {@link VideoCall.Listener}.
*/
public class VideoCallImpl extends VideoCall {
private static final int MSG_RECEIVE_SESSION_MODIFY_REQUEST = 1;
diff --git a/telecomm/java/android/telecomm/VideoCallProvider.java b/telecomm/java/android/telecomm/VideoCallProvider.java
deleted file mode 100644
index de0126d..0000000
--- a/telecomm/java/android/telecomm/VideoCallProvider.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.telecomm;
-
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.RemoteException;
-import android.view.Surface;
-
-import com.android.internal.telecomm.IVideoCallCallback;
-import com.android.internal.telecomm.IVideoCallProvider;
-
-public abstract class VideoCallProvider {
- private static final int MSG_SET_VIDEO_CALL_LISTENER = 1;
- private static final int MSG_SET_CAMERA = 2;
- private static final int MSG_SET_PREVIEW_SURFACE = 3;
- private static final int MSG_SET_DISPLAY_SURFACE = 4;
- private static final int MSG_SET_DEVICE_ORIENTATION = 5;
- private static final int MSG_SET_ZOOM = 6;
- private static final int MSG_SEND_SESSION_MODIFY_REQUEST = 7;
- private static final int MSG_SEND_SESSION_MODIFY_RESPONSE = 8;
- private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9;
- private static final int MSG_REQUEST_CALL_DATA_USAGE = 10;
- private static final int MSG_SET_PAUSE_IMAGE = 11;
-
- private final VideoCallProviderHandler mMessageHandler = new VideoCallProviderHandler();
- private final VideoCallProviderBinder mBinder;
- private IVideoCallCallback mVideoCallListener;
-
- /**
- * Default handler used to consolidate binder method calls onto a single thread.
- */
- private final class VideoCallProviderHandler extends Handler {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_SET_VIDEO_CALL_LISTENER:
- mVideoCallListener = IVideoCallCallback.Stub.asInterface((IBinder) msg.obj);
- break;
- case MSG_SET_CAMERA:
- onSetCamera((String) msg.obj);
- break;
- case MSG_SET_PREVIEW_SURFACE:
- onSetPreviewSurface((Surface) msg.obj);
- break;
- case MSG_SET_DISPLAY_SURFACE:
- onSetDisplaySurface((Surface) msg.obj);
- break;
- case MSG_SET_DEVICE_ORIENTATION:
- onSetDeviceOrientation(msg.arg1);
- break;
- case MSG_SET_ZOOM:
- onSetZoom((Float) msg.obj);
- break;
- case MSG_SEND_SESSION_MODIFY_REQUEST:
- onSendSessionModifyRequest((VideoCallProfile) msg.obj);
- break;
- case MSG_SEND_SESSION_MODIFY_RESPONSE:
- onSendSessionModifyResponse((VideoCallProfile) msg.obj);
- break;
- case MSG_REQUEST_CAMERA_CAPABILITIES:
- onRequestCameraCapabilities();
- break;
- case MSG_REQUEST_CALL_DATA_USAGE:
- onRequestCallDataUsage();
- break;
- case MSG_SET_PAUSE_IMAGE:
- onSetPauseImage((String) msg.obj);
- break;
- default:
- break;
- }
- }
- }
-
- /**
- * IVideoCallProvider stub implementation.
- */
- private final class VideoCallProviderBinder extends IVideoCallProvider.Stub {
- public void setVideoCallListener(IBinder videoCallListenerBinder) {
- mMessageHandler.obtainMessage(
- MSG_SET_VIDEO_CALL_LISTENER, videoCallListenerBinder).sendToTarget();
- }
-
- public void setCamera(String cameraId) {
- mMessageHandler.obtainMessage(MSG_SET_CAMERA, cameraId).sendToTarget();
- }
-
- public void setPreviewSurface(Surface surface) {
- mMessageHandler.obtainMessage(MSG_SET_PREVIEW_SURFACE, surface).sendToTarget();
- }
-
- public void setDisplaySurface(Surface surface) {
- mMessageHandler.obtainMessage(MSG_SET_DISPLAY_SURFACE, surface).sendToTarget();
- }
-
- public void setDeviceOrientation(int rotation) {
- mMessageHandler.obtainMessage(MSG_SET_DEVICE_ORIENTATION, rotation).sendToTarget();
- }
-
- public void setZoom(float value) {
- mMessageHandler.obtainMessage(MSG_SET_ZOOM, value).sendToTarget();
- }
-
- public void sendSessionModifyRequest(VideoCallProfile requestProfile) {
- mMessageHandler.obtainMessage(
- MSG_SEND_SESSION_MODIFY_REQUEST, requestProfile).sendToTarget();
- }
-
- public void sendSessionModifyResponse(VideoCallProfile responseProfile) {
- mMessageHandler.obtainMessage(
- MSG_SEND_SESSION_MODIFY_RESPONSE, responseProfile).sendToTarget();
- }
-
- public void requestCameraCapabilities() {
- mMessageHandler.obtainMessage(MSG_REQUEST_CAMERA_CAPABILITIES).sendToTarget();
- }
-
- public void requestCallDataUsage() {
- mMessageHandler.obtainMessage(MSG_REQUEST_CALL_DATA_USAGE).sendToTarget();
- }
-
- public void setPauseImage(String uri) {
- mMessageHandler.obtainMessage(MSG_SET_PAUSE_IMAGE, uri).sendToTarget();
- }
- }
-
- public VideoCallProvider() {
- mBinder = new VideoCallProviderBinder();
- }
-
- /**
- * Returns binder object which can be used across IPC methods.
- * @hide
- */
- public final IVideoCallProvider getInterface() {
- return mBinder;
- }
-
- /**
- * Sets the camera to be used for video recording in a video call.
- *
- * @param cameraId The id of the camera.
- */
- public abstract void onSetCamera(String cameraId);
-
- /**
- * Sets the surface to be used for displaying a preview of what the user's camera is
- * currently capturing. When video transmission is enabled, this is the video signal which is
- * sent to the remote device.
- *
- * @param surface The surface.
- */
- public abstract void onSetPreviewSurface(Surface surface);
-
- /**
- * Sets the surface to be used for displaying the video received from the remote device.
- *
- * @param surface The surface.
- */
- public abstract void onSetDisplaySurface(Surface surface);
-
- /**
- * Sets the device orientation, in degrees. Assumes that a standard portrait orientation of the
- * device is 0 degrees.
- *
- * @param rotation The device orientation, in degrees.
- */
- public abstract void onSetDeviceOrientation(int rotation);
-
- /**
- * Sets camera zoom ratio.
- *
- * @param value The camera zoom ratio.
- */
- public abstract void onSetZoom(float value);
-
- /**
- * Issues a request to modify the properties of the current session. The request is sent to
- * the remote device where it it handled by
- * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
- * Some examples of session modification requests: upgrade call from audio to video, downgrade
- * call from video to audio, pause video.
- *
- * @param requestProfile The requested call video properties.
- */
- public abstract void onSendSessionModifyRequest(VideoCallProfile requestProfile);
-
- /**te
- * Provides a response to a request to change the current call session video
- * properties.
- * This is in response to a request the InCall UI has received via
- * {@link InCallService.VideoCall.Listener#onSessionModifyRequestReceived}.
- * The response is handled on the remove device by
- * {@link InCallService.VideoCall.Listener#onSessionModifyResponseReceived}.
- *
- * @param responseProfile The response call video properties.
- */
- public abstract void onSendSessionModifyResponse(VideoCallProfile responseProfile);
-
- /**
- * Issues a request to the video provider to retrieve the camera capabilities.
- * Camera capabilities are reported back to the caller via
- * {@link InCallService.VideoCall.Listener#onCameraCapabilitiesChanged(CallCameraCapabilities)}.
- */
- public abstract void onRequestCameraCapabilities();
-
- /**
- * Issues a request to the video telephony framework to retrieve the cumulative data usage for
- * the current call. Data usage is reported back to the caller via
- * {@link InCallService.VideoCall.Listener#onCallDataUsageChanged}.
- */
- public abstract void onRequestCallDataUsage();
-
- /**
- * Provides the video telephony framework with the URI of an image to be displayed to remote
- * devices when the video signal is paused.
- *
- * @param uri URI of image to display.
- */
- public abstract void onSetPauseImage(String uri);
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * @param videoCallProfile The requested video call profile.
- */
- public void receiveSessionModifyRequest(VideoCallProfile videoCallProfile) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.receiveSessionModifyRequest(videoCallProfile);
- } catch (RemoteException ignored) {
- }
- }
- }
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * @param status Status of the session modify request. Valid values are
- * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_SUCCESS},
- * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_FAIL},
- * {@link InCallService.VideoCall#SESSION_MODIFY_REQUEST_INVALID}
- * @param requestedProfile The original request which was sent to the remote device.
- * @param responseProfile The actual profile changes made by the remote device.
- */
- public void receiveSessionModifyResponse(int status,
- VideoCallProfile requestedProfile, VideoCallProfile responseProfile) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.receiveSessionModifyResponse(
- status, requestedProfile, responseProfile);
- } catch (RemoteException ignored) {
- }
- }
- }
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * Valid values are: {@link InCallService.VideoCall#SESSION_EVENT_RX_PAUSE},
- * {@link InCallService.VideoCall#SESSION_EVENT_RX_RESUME},
- * {@link InCallService.VideoCall#SESSION_EVENT_TX_START},
- * {@link InCallService.VideoCall#SESSION_EVENT_TX_STOP}
- *
- * @param event The event.
- */
- public void handleCallSessionEvent(int event) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.handleCallSessionEvent(event);
- } catch (RemoteException ignored) {
- }
- }
- }
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * @param width The updated peer video width.
- * @param height The updated peer video height.
- */
- public void changePeerDimensions(int width, int height) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.changePeerDimensions(width, height);
- } catch (RemoteException ignored) {
- }
- }
- }
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * @param dataUsage The updated data usage.
- */
- public void changeCallDataUsage(int dataUsage) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.changeCallDataUsage(dataUsage);
- } catch (RemoteException ignored) {
- }
- }
- }
-
- /**
- * Invokes callback method defined in {@link InCallService.VideoCall.Listener}.
- *
- * @param callCameraCapabilities The changed camera capabilities.
- */
- public void changeCameraCapabilities(CallCameraCapabilities callCameraCapabilities) {
- if (mVideoCallListener != null) {
- try {
- mVideoCallListener.changeCameraCapabilities(callCameraCapabilities);
- } catch (RemoteException ignored) {
- }
- }
- }
-}
diff --git a/tests/DozeTest/src/com/android/dreams/dozetest/DozeTestDream.java b/tests/DozeTest/src/com/android/dreams/dozetest/DozeTestDream.java
index f72e331..f4f610b 100644
--- a/tests/DozeTest/src/com/android/dreams/dozetest/DozeTestDream.java
+++ b/tests/DozeTest/src/com/android/dreams/dozetest/DozeTestDream.java
@@ -24,7 +24,6 @@
import android.content.IntentFilter;
import android.os.Handler;
import android.os.PowerManager;
-import android.service.dreams.DozeHardware;
import android.service.dreams.DreamService;
import android.text.format.DateFormat;
import android.util.Log;
@@ -49,10 +48,6 @@
// refreshed once the dream has finished rendering a new frame.
private static final int UPDATE_TIME_TIMEOUT = 100;
- // A doze hardware message string we use for end-to-end testing.
- // Doesn't mean anything. Real hardware won't handle it.
- private static final String TEST_PING_MESSAGE = "test.ping";
-
// Not all hardware supports dozing. We should use Display.STATE_DOZE but
// for testing purposes it is convenient to use Display.STATE_ON so the
// test still works on hardware that does not support dozing.
@@ -70,7 +65,6 @@
private java.text.DateFormat mTimeFormat;
private boolean mDreaming;
- private DozeHardware mDozeHardware;
private long mLastTime = Long.MIN_VALUE;
@@ -121,17 +115,11 @@
super.onDreamingStarted();
mDreaming = true;
- mDozeHardware = getDozeHardware();
- Log.d(TAG, "Dream started: canDoze=" + canDoze()
- + ", dozeHardware=" + mDozeHardware);
+ Log.d(TAG, "Dream started: canDoze=" + canDoze());
performTimeUpdate();
- if (mDozeHardware != null) {
- mDozeHardware.sendMessage(TEST_PING_MESSAGE, null);
- mDozeHardware.setEnableMcu(true);
- }
startDozing();
}
@@ -140,10 +128,6 @@
super.onDreamingStopped();
mDreaming = false;
- if (mDozeHardware != null) {
- mDozeHardware.setEnableMcu(false);
- mDozeHardware = null;
- }
Log.d(TAG, "Dream ended: isDozing=" + isDozing());
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml
index 3b01e02..705cc34 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml
@@ -13,22 +13,18 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="48dp"
- android:width="48dp" />
-
- <viewport
+ android:width="48dp"
android:viewportHeight="480"
- android:viewportWidth="480" />
+ android:viewportWidth="480" >
<group>
<path
android:name="box1"
android:pathData="m20,200l100,90l180-180l-35-35l-145,145l-60-60l-40,40z"
- android:fill="?android:attr/colorControlActivated"
- android:stroke="?android:attr/colorControlActivated"
+ android:fillColor="?android:attr/colorControlActivated"
+ android:strokeColor="?android:attr/colorControlActivated"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml
index 40f23f0..f5d647c 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml
@@ -12,14 +12,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport android:viewportWidth="320"
- android:viewportHeight="320"/>
+ android:height="64dp" android:viewportWidth="320"
+ android:viewportHeight="320">
<group
android:rotation="180"
android:pivotX="70"
@@ -27,8 +23,8 @@
<path
android:name="house"
android:pathData="M 130,225 L 130,115 L 130,115 L 70,15 L 10,115 L 10,115 L 10,225 z"
- android:fill="#ff440000"
- android:stroke="#FF00FF00"
+ android:fillColor="#ff440000"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="10"
android:trimPathStart=".1"
android:trimPathEnd=".9"/>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml
index cd2fd47..a0b0e00 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml
@@ -14,23 +14,17 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:autoMirrored="true" >
-
- <size
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="12.25"
- android:viewportWidth="7.30625" />
+ android:viewportWidth="7.30625" >
<group
android:pivotX="3.65"
android:pivotY="6.125"
android:rotation="-30" >
- <path
+ <clip-path
android:name="clip1"
- android:clipToPath="true"
android:pathData="
M 0, 6.125
l 7.3, 0
@@ -41,7 +35,7 @@
<group>
<path
android:name="one"
- android:fill="#ff88ff"
+ android:fillColor="#ff88ff"
android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125
l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
l-5.046875,0.0 0.0-1.0Z" />
@@ -50,9 +44,8 @@
android:pivotX="3.65"
android:pivotY="6.125"
android:rotation="-30" >
- <path
+ <clip-path
android:name="clip2"
- android:clipToPath="true"
android:pathData="
M 0, 0
l 7.3, 0
@@ -63,7 +56,7 @@
<group>
<path
android:name="two"
- android:fill="#ff88ff"
+ android:fillColor="#ff88ff"
android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625
q 0.234375-0.453125 0.234375-0.875 0.0-0.703125-0.5-1.140625
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
index d57ae8b..5a7f380 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
@@ -13,45 +13,33 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:autoMirrored="true">
-
- <size
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="7.30625"
- android:viewportHeight="12.25"/>
+ android:viewportHeight="12.25">
<group>
- <path
+ <clip-path
android:name="clip1"
android:pathData="
M 3.65, 6.125
m-.001, 0
a .001,.001 0 1,0 .002,0
- a .001,.001 0 1,0-.002,0z"
- android:clipToPath="true"
- android:fill="#112233"
- />
-
+ a .001,.001 0 1,0-.002,0z"/>
<path
android:name="one"
android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125
l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
l-5.046875,0.0 0.0-1.0Z"
- android:fill="#ff88ff"
- />
- <path
+ android:fillColor="#ff88ff"/>
+
+ <clip-path
android:name="clip2"
android:pathData="
M 3.65, 6.125
m-6, 0
a 6,6 0 1,0 12,0
- a 6,6 0 1,0-12,0z"
- android:clipToPath="true"
- android:fill="#112233"
- />
+ a 6,6 0 1,0-12,0z"/>
<path
android:name="two"
android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
@@ -63,7 +51,6 @@
q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125-0.203125,1.015625
q-0.203125,0.484375-0.734375,1.140625-0.15625,0.171875-0.9375,0.984375
q-0.78125024,0.8125-2.2187502,2.265625Z"
- android:fill="#ff88ff"
- />
+ android:fillColor="#ff88ff"/>
</group>
</vector>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml
index 673c465..5b1f6ab 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml
@@ -14,26 +14,21 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:autoMirrored="true">
-
- <size
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="12.25"
- android:viewportWidth="7.30625" />
+ android:viewportWidth="7.30625" >
<group>
<path
android:name="one"
- android:fill="#ffff00"
+ android:fillColor="#ffff00"
android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125
l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
l-5.046875,0.0 0.0-1.0Z" />
<path
android:name="two"
- android:fill="#ffff00"
+ android:fillColor="#ffff00"
android:fillOpacity="0"
android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375
q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml
index ab5f7f4..98b6235 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml
@@ -12,41 +12,37 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport
+ android:height="64dp"
android:viewportWidth="700"
- android:viewportHeight="700"/>
+ android:viewportHeight="700">
<group>
<path android:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z"
android:name="path2451"
- android:fill="#00000000"
- android:stroke="#FF000000"
+ android:fillColor="#00000000"
+ android:strokeColor="#FF000000"
android:strokeWidth="30.65500000000000"/>
<path android:pathData="M 365.015 311.066"
android:name="path2453"
- android:fill="#00000000"
- android:stroke="#FF000000"
+ android:fillColor="#00000000"
+ android:strokeColor="#FF000000"
android:strokeWidth="30.655000000000001"/>
<path android:pathData="M 164.46 164.49L 340.78 343.158C 353.849 356.328 377.63 356.172 390.423 343.278L 566.622 165.928"
android:name="path2455"
- android:stroke="#FF000000"
- android:fill="#FFFFFFFF"
+ android:strokeColor="#FF000000"
+ android:fillColor="#FFFFFFFF"
android:strokeWidth="30.655000000000001"/>
<path android:pathData="M 170.515 451.566L 305.61 313.46"
android:name="path2457"
- android:fill="#00000000"
- android:stroke="#000000"
+ android:fillColor="#00000000"
+ android:strokeColor="#000000"
android:strokeWidth="30.655000000000001"/>
<path android:pathData="M 557.968 449.974L 426.515 315.375"
android:name="path2459"
- android:fill="#00000000"
- android:stroke="#000000"
+ android:fillColor="#00000000"
+ android:strokeColor="#000000"
android:strokeWidth="30.655000000000001"/>
</group>
</vector>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml
index ccb0df0..88c4a1e 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml
@@ -12,13 +12,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport android:viewportWidth="140"
- android:viewportHeight="110"/>
+ android:height="64dp" android:viewportWidth="140"
+ android:viewportHeight="110">
<group>
<path
@@ -26,7 +23,7 @@
android:pathData="M 20,55 l 35.3-35.3 7.07,7.07-35.3,35.3 z
M 27,50 l 97,0 0,10-97,0 z
M 20,55 l 7.07-7.07 35.3,35.3-7.07,7.07 z"
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
/>
</group>
</vector>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml
index 59f7459..75529e2 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml
@@ -12,22 +12,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
-
- <viewport android:viewportWidth="600"
- android:viewportHeight="600"/>
+ android:height="64dp" android:viewportWidth="600"
+ android:viewportHeight="600">
<group>
<path
android:name="pie1"
android:pathData="M535.441,412.339A280.868,280.868 0 1,1 536.186,161.733L284.493,286.29Z"
- android:fill="#ffffcc00"
- android:stroke="#FF00FF00"
+ android:fillColor="#ffffcc00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="1"/>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml
index 77434fc..853a770 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="200"
- android:viewportWidth="200" />
+ android:viewportWidth="200" >
<group
android:pivotX="100"
@@ -29,7 +25,7 @@
android:rotation="90">
<path
android:name="house"
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
android:pathData="M 100,20 l 0,0 0,140-80,0 z M 100,20 l 0,0 80,140-80,0 z"/>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml
index df24713..83ed194 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml
@@ -14,32 +14,28 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportWidth="200"
- android:viewportHeight="200"/>
+ android:viewportHeight="200">
<group>
<path
android:name="bar3"
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M49.001,60c-5.466,0-9.899,4.478-9.899,10s4.434,10,9.899,10c5.468,0,9.899-4.478,9.899-10S54.469,60,49.001,60z" />
<path
android:name="bar2"
- android:fill="#FFFFFFFF"
+ android:fillColor="#FFFFFFFF"
android:pathData="M28.001,48.787l7,7.07c7.731-7.811,20.269-7.81,28.001,0l6.999-7.07C58.403,37.071,39.599,37.071,28.001,48.787z" />
<path
android:name="bar1"
- android:fill="#FF555555"
+ android:fillColor="#FF555555"
android:pathData="M14.001,34.645 L21,41.716c15.464-15.621,40.536-15.621,56,0l7.001-7.071C64.672,15.119,33.33,15.119,14.001,34.645z" />
<path
android:name="bar0"
- android:fill="#FF555555"
+ android:fillColor="#FF555555"
android:pathData="M0,20.502l6.999,7.071 c23.196-23.431,60.806-23.431,84.002,0L98,20.503C70.938-6.834,27.063-6.834,0,20.502z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml
index 3422bbf..b3d7d8e 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml
@@ -13,26 +13,22 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="80"
- android:viewportWidth="40" />
+ android:viewportWidth="40" >
<group>
<path
android:name="battery"
- android:fill="#3388ff"
+ android:fillColor="#3388ff"
android:pathData="M 20.28125,2.0000002 C 17.352748,2.0000002 15,4.3527485 15,7.2812502 L 15,8.0000002 L 13.15625,8.0000002 C 9.7507553,8.0000002 7,10.750759 7,14.15625 L 7,39.84375 C 7,43.24924 9.7507558,46 13.15625,46 L 33.84375,46 C 37.249245,46 39.999999,43.24924 40,39.84375 L 40,14.15625 C 40,10.75076 37.249243,8.0000002 33.84375,8.0000002 L 32,8.0000002 L 32,7.2812502 C 32,4.3527485 29.647252,2.0000002 26.71875,2.0000002 L 20.28125,2.0000002 z"
- android:stroke="#ff8833"
+ android:strokeColor="#ff8833"
android:strokeWidth="1" />
<path
android:name="spark"
- android:fill="#FFFF0000"
+ android:fillColor="#FFFF0000"
android:pathData="M 30,18.031528 L 25.579581,23.421071 L 29.370621,26.765348 L 20.096792,37 L 21.156922,28.014053 L 17,24.902844 L 20.880632,18 L 30,18.031528 z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml
index a212def..2c8b751 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="600"
- android:viewportWidth="600" />
+ android:viewportWidth="600" >
<group
android:name="rotationGroup"
@@ -30,16 +26,16 @@
android:rotation="45.0" >
<path
android:name="pie1"
- android:fill="#00000000"
+ android:fillColor="#00000000"
android:pathData="M300,70 a230,230 0 1,0 1,0 z"
- android:stroke="#FF777777"
+ android:strokeColor="#FF777777"
android:strokeWidth="70"
android:trimPathEnd=".75"
android:trimPathOffset="0"
android:trimPathStart="0" />
<path
android:name="v"
- android:fill="#000000"
+ android:fillColor="#000000"
android:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" />
<group
@@ -55,7 +51,7 @@
<path
android:name="twoLines1"
android:pathData="@string/twoLinePathData"
- android:stroke="#FFFF0000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="20" />
<group
@@ -69,9 +65,9 @@
android:rotation="-45.0" >
<path
android:name="twoLines2"
- android:fill="#FF00FF00"
+ android:fillColor="#FF00FF00"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="20" />
<group
@@ -86,7 +82,7 @@
<path
android:name="twoLines3"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="20" />
</group>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml
index 8c946df..2468a1b 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml
@@ -13,28 +13,24 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="600" />
+ android:viewportWidth="600" >
<group>
<path
android:name="pie1"
- android:fill="#ffffffff"
+ android:fillColor="#ffffffff"
android:pathData="M300,200 h-150 a150,150 0 1,0 150,-150 z"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="1" />
<path
android:name="half"
- android:fill="#FFFF0000"
+ android:fillColor="#FFFF0000"
android:pathData="M275,175 v-150 a150,150 0 0,0 -150,150 z"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="5" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml
index 8d4ca61..01e24d302 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="500"
- android:viewportWidth="800" />
+ android:viewportWidth="800" >
<group
android:pivotX="90"
@@ -34,8 +30,8 @@
a25,25 -30 0,1 100,-50 l 50,-25
a25,37 -30 0,1 100,-50 l 50,-25
a25,50 -30 0,1 100,-50 l 50,-25"
- android:fill="#00000000"
- android:stroke="#FF00FF00"
+ android:fillColor="#00000000"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml
index b08e157..4bab2e3 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="500" />
+ android:viewportWidth="500" >
<group
android:pivotX="250"
@@ -29,9 +25,9 @@
android:rotation="180">
<path
android:name="house"
- android:fill="#ff440000"
+ android:fillColor="#ff440000"
android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200"
- android:stroke="#FFFF0000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml
index ae85d9b..107cda2 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml
@@ -13,25 +13,21 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="200"
- android:viewportWidth="200" />
+ android:viewportWidth="200" >
<group>
<path
android:name="background1"
android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z"
- android:fill="#FF000000"/>
+ android:fillColor="#FF000000"/>
<path
android:name="background2"
android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z"
- android:fill="#FF000000"/>
+ android:fillColor="#FF000000"/>
</group>
<group
android:pivotX="100"
@@ -44,7 +40,7 @@
<path
android:name="twoLines"
android:pathData="M 100,10 v 90 M 10,100 h 90"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml
index c28aff4..8019549 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml
@@ -12,21 +12,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
- android:height="64dp"/>
-
- <viewport android:viewportWidth="1200"
- android:viewportHeight="600"/>
+ android:height="64dp" android:viewportWidth="1200"
+ android:viewportHeight="600">
<group>
<path
android:name="house"
android:pathData="M200,300 Q400,50 600,300 T1000,300"
- android:fill="#00000000"
- android:stroke="#FFFF0000"
+ android:fillColor="#00000000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="10"/>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml
index d7042fd..c93bdb9 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml
@@ -13,22 +13,18 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="500" />
+ android:viewportWidth="500" >
<group>
<path
android:name="house"
android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200"
- android:fill="#00000000"
- android:stroke="#FFFFFF00"
+ android:fillColor="#00000000"
+ android:strokeColor="#FFFFFF00"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml
index 47a9574..996b6be 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="800"
- android:viewportWidth="1000" />
+ android:viewportWidth="1000" >
<group>
<path
@@ -29,8 +25,8 @@
android:pathData="M10,300 Q400,550 600,300 T1000,300"
android:pivotX="90"
android:pivotY="100"
- android:fill="#00000000"
- android:stroke="#FFFF0000"
+ android:fillColor="#00000000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="60" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable20.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable20.xml
index b8af7e2..5802144 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable20.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable20.xml
@@ -13,25 +13,21 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="480"
- android:viewportWidth="480" />
+ android:viewportWidth="480" >
<group>
<path
android:name="edit"
- android:fill="#FF00FFFF"
+ android:fillColor="#FF00FFFF"
android:pathData="M406.667,180c0,0 -100 -100 -113.334 -113.333
c-13.333 -13.334 -33.333,0 -33.333,0l-160,160c0,0 -40,153.333 -40,173.333c0,13.333,13.333,13.333,13.333,13.333l173.334 -40
c0,0,146.666 -146.666,160 -160C420,200,406.667,180,406.667,180z M226.399,356.823L131.95,378.62l-38.516 -38.522
c7.848 -34.675,20.152 -82.52,23.538 -95.593l3.027,2.162l106.667,106.666L226.399,356.823z"
- android:stroke="#FF000000"
+ android:strokeColor="#FF000000"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable21.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable21.xml
index e0013e7..5626b44 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable21.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable21.xml
@@ -13,25 +13,21 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="200"
- android:viewportWidth="200" />
+ android:viewportWidth="200" >
<group>
<path
android:name="background1"
android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z"
- android:fill="#FF000000"/>
+ android:fillColor="#FF000000"/>
<path
android:name="background2"
android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z"
- android:fill="#FF000000"/>
+ android:fillColor="#FF000000"/>
</group>
<group
android:pivotX="0"
@@ -44,7 +40,7 @@
<path
android:name="twoLines"
android:pathData="M 100,10 v 90 M 10,100 h 90"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="10" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml
index 8d38cb5..5b40d0d0 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml
@@ -13,24 +13,20 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="400" />
+ android:viewportWidth="400" >
<group android:name="backgroundGroup" >
<path
android:name="background1"
- android:fill="#80000000"
+ android:fillColor="#80000000"
android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
<path
android:name="background2"
- android:fill="#80000000"
+ android:fillColor="#80000000"
android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
</group>
<group
@@ -40,7 +36,7 @@
<path
android:name="twoLines"
android:pathData="M 0,0 v 100 M 0,0 h 100"
- android:stroke="#FFFF0000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="20" />
<group
@@ -51,7 +47,7 @@
<path
android:name="twoLines1"
android:pathData="M 0,0 v 100 M 0,0 h 100"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="20" />
<group
@@ -62,7 +58,7 @@
<path
android:name="twoLines2"
android:pathData="M 0,0 v 100 M 0,0 h 100"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="20" />
</group>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml
index 52acd7a..6ab6ffd 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml
@@ -13,24 +13,20 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="400" />
+ android:viewportWidth="400" >
<group android:name="backgroundGroup" >
<path
android:name="background1"
- android:fill="#80000000"
+ android:fillColor="#80000000"
android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
<path
android:name="background2"
- android:fill="#80000000"
+ android:fillColor="#80000000"
android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
</group>
<group
@@ -40,7 +36,7 @@
<path
android:name="twoLines"
android:pathData="@string/twoLinePathData"
- android:stroke="#FFFF0000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="20" />
<group
@@ -51,7 +47,7 @@
<path
android:name="twoLines1"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="20" />
<group
@@ -62,7 +58,7 @@
<path
android:name="twoLines3"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="20" />
</group>
</group>
@@ -75,8 +71,8 @@
<path
android:name="twoLines2"
android:pathData="@string/twoLinePathData"
- android:fill="?android:attr/colorForeground"
- android:stroke="?android:attr/colorForeground"
+ android:fillColor="?android:attr/colorForeground"
+ android:strokeColor="?android:attr/colorForeground"
android:strokeWidth="20" />
</group>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml
index c062d70..5c1ccaa 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml
@@ -13,25 +13,21 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="400" />
+ android:viewportWidth="400" >
<group android:name="backgroundGroup"
android:alpha = "0.5" >
<path
android:name="background1"
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" />
<path
android:name="background2"
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" />
</group>
<group
@@ -42,7 +38,7 @@
<path
android:name="twoLines"
android:pathData="@string/twoLinePathData"
- android:stroke="#FFFF0000"
+ android:strokeColor="#FFFF0000"
android:strokeWidth="20" />
<group
@@ -54,7 +50,7 @@
<path
android:name="twoLines1"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF00FF00"
+ android:strokeColor="#FF00FF00"
android:strokeWidth="20" />
<group
@@ -66,7 +62,7 @@
<path
android:name="twoLines3"
android:pathData="@string/twoLinePathData"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="20" />
</group>
</group>
@@ -80,8 +76,8 @@
<path
android:name="twoLines2"
android:pathData="@string/twoLinePathData"
- android:fill="?android:attr/colorForeground"
- android:stroke="?android:attr/colorForeground"
+ android:fillColor="?android:attr/colorForeground"
+ android:strokeColor="?android:attr/colorForeground"
android:strokeWidth="20" />
</group>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml
index a3f0447..069a531 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="400"
- android:viewportWidth="400" />
+ android:viewportWidth="400" >
<group
android:name="FirstLevelGroup"
@@ -34,7 +30,7 @@
android:translateX="-100.0"
android:translateY="50.0" >
<path
- android:fill="#FF00FF00"
+ android:fillColor="#FF00FF00"
android:pathData="@string/rectangle200" />
<group
@@ -43,7 +39,7 @@
android:translateX="-100.0"
android:translateY="50.0" >
<path
- android:fill="#FF0000FF"
+ android:fillColor="#FF0000FF"
android:pathData="@string/rectangle200" />
</group>
<group
@@ -52,7 +48,7 @@
android:translateX="100.0"
android:translateY="50.0" >
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="@string/rectangle200" />
</group>
</group>
@@ -62,7 +58,7 @@
android:translateX="100.0"
android:translateY="50.0" >
<path
- android:fill="#FF0000FF"
+ android:fillColor="#FF0000FF"
android:pathData="@string/rectangle200" />
<group
@@ -71,7 +67,7 @@
android:translateX="-100.0"
android:translateY="50.0" >
<path
- android:fill="#FFFF0000"
+ android:fillColor="#FFFF0000"
android:pathData="@string/rectangle200" />
</group>
<group
@@ -80,13 +76,13 @@
android:translateX="100.0"
android:translateY="50.0" >
<path
- android:fill="#FF00FF00"
+ android:fillColor="#FF00FF00"
android:pathData="@string/rectangle200" />
</group>
</group>
<path
- android:fill="#FFFF0000"
+ android:fillColor="#FFFF0000"
android:pathData="@string/rectangle200" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
index 5a66e2d..7be49a9 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="128dp"
- android:width="128dp" />
-
- <viewport
+ android:width="128dp"
android:viewportHeight="480"
- android:viewportWidth="480" />
+ android:viewportWidth="480" >
<group
android:name="root"
@@ -29,7 +25,7 @@
android:translateY="240.0" >
<path
android:name="favorite"
- android:fill="#ff000000"
+ android:fillColor="#ff000000"
android:pathData="M2.100006104,-6
C0.1449127197,-6,1.600006104,-5.975006104,0,-5.975006104
C-1.574996948,-5.975006104,0.00309753418,-6-1.949996948-6
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
index 558de94..7839ad1 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="256"
- android:viewportWidth="256" />
+ android:viewportWidth="256" >
<group
android:name="shape_layer_1"
@@ -30,7 +26,7 @@
<group android:name="sun" >
<path
android:name="ellipse_path_1"
- android:fill="#ffff8000"
+ android:fillColor="#ffff8000"
android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0" />
<group
@@ -38,7 +34,7 @@
android:translateX="75" >
<path
android:name="ellipse_path_1_1"
- android:fill="#ff5656ea"
+ android:fillColor="#ff5656ea"
android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0" />
<group
@@ -46,7 +42,7 @@
android:translateX="25" >
<path
android:name="ellipse_path_1_2"
- android:fill="#ffadadad"
+ android:fillColor="#ffadadad"
android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" />
</group>
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
index f1b2996..4544cae 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="64"
- android:viewportWidth="64" />
+ android:viewportWidth="64" >
<group
android:name="root"
@@ -37,9 +33,9 @@
android:rotation="0" >
<path
android:name="pie1"
- android:fill="#00000000"
+ android:fillColor="#00000000"
android:pathData="M0, 0 m 0, -9.5 a 9.5,9.5 0 1,1 0,19 a 9.5,9.5 0 1,1 0,-19"
- android:stroke="?android:attr/colorControlActivated"
+ android:strokeColor="?android:attr/colorControlActivated"
android:strokeLineCap="round"
android:strokeLineJoin="miter"
android:strokeWidth="2"
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_create.xml b/tests/VectorDrawableTest/res/drawable/vector_icon_create.xml
index 22ce795..0a6cedc 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_icon_create.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_icon_create.xml
@@ -13,19 +13,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="24"
- android:viewportWidth="24" />
+ android:viewportWidth="24" >
<group>
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M3.0,17.25L3.0,21.0l3.75,0.0L17.813995,9.936001l-3.75,-3.75L3.0,17.25zM20.707,7.0429993c0.391,-0.391 0.391,-1.023 0.0,-1.414l-2.336,-2.336c-0.391,-0.391 -1.023,-0.391 -1.414,0.0l-1.832,1.832l3.75,3.75L20.707,7.0429993z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml b/tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml
index 042173c..94c10df 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml
@@ -13,19 +13,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="24"
- android:viewportWidth="24" />
+ android:viewportWidth="24" >
<group>
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M6.0,19.0c0.0,1.104 0.896,2.0 2.0,2.0l8.0,0.0c1.104,0.0 2.0,-0.896 2.0,-2.0l0.0,-12.0L6.0,7.0L6.0,19.0zM18.0,4.0l-2.5,0.0l-1.0,-1.0l-5.0,0.0l-1.0,1.0L6.0,4.0C5.4469986,4.0 5.0,4.4469986 5.0,5.0l0.0,1.0l14.0,0.0l0.0,-1.0C19.0,4.4469986 18.552002,4.0 18.0,4.0z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml b/tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml
index 6b6f43d..870e508 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml
@@ -13,19 +13,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="24"
- android:viewportWidth="24" />
+ android:viewportWidth="24" >
<group>
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M16.0,5.0c-1.955,0.0 -3.83,1.268 -4.5,3.0c-0.67,-1.732 -2.547,-3.0 -4.5,-3.0C4.4570007,5.0 2.5,6.931999 2.5,9.5c0.0,3.529 3.793,6.258 9.0,11.5c5.207,-5.242 9.0,-7.971 9.0,-11.5C20.5,6.931999 18.543,5.0 16.0,5.0z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml b/tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
index ba8ebca..8cabca8 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
@@ -13,15 +13,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="24"
- android:viewportWidth="24" />
+ android:viewportWidth="24" >
<group>
<path
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml b/tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml
index 896a938..7bd6304 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml
@@ -13,19 +13,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="64dp"
- android:width="64dp" />
-
- <viewport
+ android:width="64dp"
android:viewportHeight="24"
- android:viewportWidth="24" />
+ android:viewportWidth="24" >
<group>
<path
- android:fill="#FF000000"
+ android:fillColor="#FF000000"
android:pathData="M19.429,12.975998c0.042,-0.32 0.07,-0.645 0.07,-0.976s-0.029,-0.655 -0.07,-0.976l2.113,-1.654c0.188,-0.151 0.243,-0.422 0.118,-0.639l-2.0,-3.463c-0.125,-0.217 -0.386,-0.304 -0.612,-0.218l-2.49,1.004c-0.516,-0.396 -1.081,-0.731 -1.69,-0.984l-0.375,-2.648C14.456,2.1829987 14.25,2.0 14.0,2.0l-4.0,0.0C9.75,2.0 9.544,2.1829987 9.506,2.422001L9.131,5.0699997C8.521,5.322998 7.957,5.6570015 7.44,6.054001L4.952,5.0509987C4.726,4.965 4.464,5.052002 4.34,5.269001l-2.0,3.463C2.2150002,8.947998 2.27,9.219002 2.4580002,9.369999l2.112,1.653C4.528,11.344002 4.5,11.668999 4.5,12.0s0.029,0.656 0.071,0.977L2.4580002,14.630001c-0.188,0.151 -0.243,0.422 -0.118,0.639l2.0,3.463c0.125,0.217 0.386,0.304 0.612,0.218l2.489,-1.004c0.516,0.396 1.081,0.731 1.69,0.984l0.375,2.648C9.544,21.817001 9.75,22.0 10.0,22.0l4.0,0.0c0.25,0.0 0.456,-0.183 0.494,-0.422l0.375,-2.648c0.609,-0.253 1.174,-0.588 1.689,-0.984l2.49,1.004c0.226,0.086 0.487,-0.001 0.612,-0.218l2.0,-3.463c0.125,-0.217 0.07,-0.487 -0.118,-0.639L19.429,12.975998zM12.0,16.0c-2.21,0.0 -4.0,-1.791 -4.0,-4.0c0.0,-2.21 1.79,-4.0 4.0,-4.0c2.208,0.0 4.0,1.79 4.0,4.0C16.0,14.209 14.208,16.0 12.0,16.0z" />
</group>
diff --git a/tests/VectorDrawableTest/res/drawable/vector_test01.xml b/tests/VectorDrawableTest/res/drawable/vector_test01.xml
index fc2a15c..dd71ef0 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_test01.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_test01.xml
@@ -13,23 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="128dp"
- android:width="128dp" />
-
- <viewport
+ android:width="128dp"
android:viewportHeight="512"
- android:viewportWidth="512" />
+ android:viewportWidth="512" >
<group>
<path
android:name="002b"
android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0t-200,299"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="4"
- android:fill="#00000000" />
+ android:fillColor="#00000000" />
</group>
</vector>
\ No newline at end of file
diff --git a/tests/VectorDrawableTest/res/drawable/vector_test02.xml b/tests/VectorDrawableTest/res/drawable/vector_test02.xml
index 9f4abbf..e4f48de 100644
--- a/tests/VectorDrawableTest/res/drawable/vector_test02.xml
+++ b/tests/VectorDrawableTest/res/drawable/vector_test02.xml
@@ -13,23 +13,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<vector xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <size
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="128dp"
- android:width="128dp" />
-
- <viewport
+ android:width="128dp"
android:viewportHeight="512"
- android:viewportWidth="512" />
+ android:viewportWidth="512" >
<group>
<path
android:name="002b"
android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0T-200,299"
- android:stroke="#FF0000FF"
+ android:strokeColor="#FF0000FF"
android:strokeWidth="4"
- android:fill="#00000000" />
+ android:fillColor="#00000000" />
</group>
</vector>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 70a7be8..03b5211 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -619,39 +619,36 @@
}
if (value != null) {
- if ((value.getFirst() == ResourceType.STYLE)
- || (value.getFirst() == ResourceType.ATTR)) {
- // look for the style in the current theme, and its parent:
- ResourceValue item = mRenderResources.findItemInTheme(value.getSecond(),
+ if ((value.getFirst() == ResourceType.STYLE)) {
+ // look for the style in all resources:
+ StyleResourceValue item = mRenderResources.getStyle(value.getSecond(),
isFrameworkRes);
if (item != null) {
- if (item instanceof StyleResourceValue) {
- if (defaultPropMap != null) {
- defaultPropMap.put("style", item.getName());
- }
-
- defStyleValues = (StyleResourceValue)item;
+ if (defaultPropMap != null) {
+ defaultPropMap.put("style", item.getName());
}
+
+ defStyleValues = item;
} else {
Bridge.getLog().error(null,
String.format(
"Style with id 0x%x (resolved to '%s') does not exist.",
defStyleRes, value.getSecond()),
- null /*data*/);
+ null);
}
} else {
Bridge.getLog().error(null,
String.format(
- "Resouce id 0x%x is not of type STYLE (instead %s)",
+ "Resource id 0x%x is not of type STYLE (instead %s)",
defStyleRes, value.getFirst().toString()),
- null /*data*/);
+ null);
}
} else {
Bridge.getLog().error(null,
String.format(
"Failed to find style with id 0x%x in current theme",
defStyleRes),
- null /*data*/);
+ null);
}
}
diff --git a/tools/obbtool/Android.mk b/tools/obbtool/Android.mk
index 9ff56d6..99a5671 100644
--- a/tools/obbtool/Android.mk
+++ b/tools/obbtool/Android.mk
@@ -13,7 +13,7 @@
LOCAL_SRC_FILES := \
Main.cpp
-LOCAL_CFLAGS := -Wall -Werror
+LOCAL_CFLAGS := -Wall -Werror -Wno-mismatched-tags
#LOCAL_C_INCLUDES +=
@@ -36,7 +36,7 @@
LOCAL_MODULE := pbkdf2gen
LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := -Wall -Werror
+LOCAL_CFLAGS := -Wall -Werror -Wno-mismatched-tags
LOCAL_SRC_FILES := pbkdf2gen.cpp
LOCAL_LDLIBS += -ldl
LOCAL_C_INCLUDES := external/openssl/include $(LOCAL_C_INCLUDES)
diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java
index 50fd260..57343c5 100644
--- a/wifi/java/android/net/wifi/RttManager.java
+++ b/wifi/java/android/net/wifi/RttManager.java
@@ -2,16 +2,20 @@
import android.annotation.SystemApi;
import android.content.Context;
+import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
+import android.os.Parcel;
+import android.os.Parcelable;
import android.os.RemoteException;
import android.util.Log;
import android.util.SparseArray;
import com.android.internal.util.AsyncChannel;
+import com.android.internal.util.Protocol;
import java.util.concurrent.CountDownLatch;
@@ -51,12 +55,15 @@
public static final int RTT_STATUS_ABORTED = 8;
public static final int REASON_UNSPECIFIED = -1;
- public static final int REASON_INVALID_LISTENER = -2;
- public static final int REASON_INVALID_REQUEST = -3;
+ public static final int REASON_NOT_AVAILABLE = -2;
+ public static final int REASON_INVALID_LISTENER = -3;
+ public static final int REASON_INVALID_REQUEST = -4;
+
+ public static final String DESCRIPTION_KEY = "android.net.wifi.RttManager.Description";
public class Capabilities {
- int supportedType;
- int supportedPeerType;
+ public int supportedType;
+ public int supportedPeerType;
}
public Capabilities getCapabilities() {
@@ -91,6 +98,73 @@
public int num_retries;
}
+ /** pseudo-private class used to parcel arguments */
+ public static class ParcelableRttParams implements Parcelable {
+
+ public RttParams mParams[];
+
+ ParcelableRttParams(RttParams[] params) {
+ mParams = params;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ if (mParams != null) {
+ dest.writeInt(mParams.length);
+
+ for (RttParams params : mParams) {
+ dest.writeInt(params.deviceType);
+ dest.writeInt(params.requestType);
+ dest.writeString(params.bssid);
+ dest.writeInt(params.frequency);
+ dest.writeInt(params.channelWidth);
+ dest.writeInt(params.num_samples);
+ dest.writeInt(params.num_retries);
+ }
+ } else {
+ dest.writeInt(0);
+ }
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<ParcelableRttParams> CREATOR =
+ new Creator<ParcelableRttParams>() {
+ public ParcelableRttParams createFromParcel(Parcel in) {
+
+ int num = in.readInt();
+
+ if (num == 0) {
+ return new ParcelableRttParams(null);
+ }
+
+ RttParams params[] = new RttParams[num];
+ for (int i = 0; i < num; i++) {
+ params[i] = new RttParams();
+ params[i].deviceType = in.readInt();
+ params[i].requestType = in.readInt();
+ params[i].bssid = in.readString();
+ params[i].frequency = in.readInt();
+ params[i].channelWidth = in.readInt();
+ params[i].num_samples = in.readInt();
+ params[i].num_retries = in.readInt();
+
+ }
+
+ ParcelableRttParams parcelableParams = new ParcelableRttParams(params);
+ return parcelableParams;
+ }
+
+ public ParcelableRttParams[] newArray(int size) {
+ return new ParcelableRttParams[size];
+ }
+ };
+ }
+
/** specifies RTT results */
public static class RttResult {
/** mac address of the device being ranged */
@@ -99,6 +173,9 @@
/** status of the request */
public int status;
+ /** type of the request used */
+ public int requestType;
+
/** timestamp of completion, in microsecond since boot */
public long ts;
@@ -121,24 +198,105 @@
public long rtt_spread_ns;
/** average distance in centimeter, computed based on rtt_ns */
- public long distance_cm;
+ public int distance_cm;
/** standard deviation observed in distance */
- public long distance_sd_cm;
+ public int distance_sd_cm;
/** spread (i.e. max - min) distance */
- public long distance_spread_cm;
+ public int distance_spread_cm;
}
+
+ /** pseudo-private class used to parcel results */
+ public static class ParcelableRttResults implements Parcelable {
+
+ public RttResult mResults[];
+
+ public ParcelableRttResults(RttResult[] results) {
+ mResults = results;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public int describeContents() {
+ return 0;
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public void writeToParcel(Parcel dest, int flags) {
+ if (mResults != null) {
+ dest.writeInt(mResults.length);
+ for (RttResult result : mResults) {
+ dest.writeString(result.bssid);
+ dest.writeInt(result.status);
+ dest.writeInt(result.requestType);
+ dest.writeLong(result.ts);
+ dest.writeInt(result.rssi);
+ dest.writeInt(result.rssi_spread);
+ dest.writeInt(result.tx_rate);
+ dest.writeLong(result.rtt_ns);
+ dest.writeLong(result.rtt_sd_ns);
+ dest.writeLong(result.rtt_spread_ns);
+ dest.writeInt(result.distance_cm);
+ dest.writeInt(result.distance_sd_cm);
+ dest.writeInt(result.distance_spread_cm);
+ }
+ } else {
+ dest.writeInt(0);
+ }
+ }
+
+ /** Implement the Parcelable interface {@hide} */
+ public static final Creator<ParcelableRttResults> CREATOR =
+ new Creator<ParcelableRttResults>() {
+ public ParcelableRttResults createFromParcel(Parcel in) {
+
+ int num = in.readInt();
+
+ if (num == 0) {
+ return new ParcelableRttResults(null);
+ }
+
+ RttResult results[] = new RttResult[num];
+ for (int i = 0; i < num; i++) {
+ results[i] = new RttResult();
+ results[i].bssid = in.readString();
+ results[i].status = in.readInt();
+ results[i].requestType = in.readInt();
+ results[i].ts = in.readLong();
+ results[i].rssi = in.readInt();
+ results[i].rssi_spread = in.readInt();
+ results[i].tx_rate = in.readInt();
+ results[i].rtt_ns = in.readLong();
+ results[i].rtt_sd_ns = in.readLong();
+ results[i].rtt_spread_ns = in.readLong();
+ results[i].distance_cm = in.readInt();
+ results[i].distance_sd_cm = in.readInt();
+ results[i].distance_spread_cm = in.readInt();
+ }
+
+ ParcelableRttResults parcelableResults = new ParcelableRttResults(results);
+ return parcelableResults;
+ }
+
+ public ParcelableRttResults[] newArray(int size) {
+ return new ParcelableRttResults[size];
+ }
+ };
+ }
+
+
public static interface RttListener {
- public void onSuccess(RttResult results[]);
+ public void onSuccess(RttResult[] results);
public void onFailure(int reason, String description);
public void onAborted();
}
- public void startRanging(RttParams params[], RttListener listener) {
+ public void startRanging(RttParams[] params, RttListener listener) {
validateChannel();
- sAsyncChannel.sendMessage(CMD_OP_START_RANGING, 0, removeListener(listener), params);
+ ParcelableRttParams parcelableParams = new ParcelableRttParams(params);
+ sAsyncChannel.sendMessage(CMD_OP_START_RANGING,
+ 0, putListener(listener), parcelableParams);
}
public void stopRanging(RttListener listener) {
@@ -147,11 +305,13 @@
}
/* private methods */
- public static final int CMD_OP_START_RANGING = 0;
- public static final int CMD_OP_STOP_RANGING = 1;
- public static final int CMD_OP_FAILED = 2;
- public static final int CMD_OP_SUCCEEDED = 3;
- public static final int CMD_OP_ABORTED = 4;
+ public static final int BASE = Protocol.BASE_WIFI_RTT_MANAGER;
+
+ public static final int CMD_OP_START_RANGING = BASE + 0;
+ public static final int CMD_OP_STOP_RANGING = BASE + 1;
+ public static final int CMD_OP_FAILED = BASE + 2;
+ public static final int CMD_OP_SUCCEEDED = BASE + 3;
+ public static final int CMD_OP_ABORTED = BASE + 4;
private Context mContext;
private IRttManager mService;
@@ -173,7 +333,7 @@
* Create a new WifiScanner instance.
* Applications will almost always want to use
* {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
- * the standard {@link android.content.Context#WIFI_SERVICE Context.WIFI_SERVICE}.
+ * the standard {@link android.content.Context#WIFI_RTT_SERVICE Context.WIFI_RTT_SERVICE}.
* @param context the application context
* @param service the Binder interface
* @hide
@@ -190,6 +350,7 @@
if (++sThreadRefCount == 1) {
Messenger messenger = null;
try {
+ Log.d(TAG, "Get the messenger from " + mService);
messenger = mService.getMessenger();
} catch (RemoteException e) {
/* do nothing */
@@ -313,10 +474,11 @@
switch (msg.what) {
/* ActionListeners grouped together */
case CMD_OP_SUCCEEDED :
- ((RttListener) listener).onSuccess((RttResult[])msg.obj);
+ reportSuccess(listener, msg);
+ removeListener(msg.arg2);
break;
case CMD_OP_FAILED :
- ((RttListener) listener).onFailure(msg.arg1, (String)msg.obj);
+ reportFailure(listener, msg);
removeListener(msg.arg2);
break;
case CMD_OP_ABORTED :
@@ -328,6 +490,18 @@
return;
}
}
+
+ void reportSuccess(Object listener, Message msg) {
+ RttListener rttListener = (RttListener) listener;
+ ParcelableRttResults parcelableResults = (ParcelableRttResults) msg.obj;
+ ((RttListener) listener).onSuccess(parcelableResults.mResults);
+ }
+
+ void reportFailure(Object listener, Message msg) {
+ RttListener rttListener = (RttListener) listener;
+ Bundle bundle = (Bundle) msg.obj;
+ ((RttListener) listener).onFailure(msg.arg1, bundle.getString(DESCRIPTION_KEY));
+ }
}
}