diff options
132 files changed, 1261 insertions, 377 deletions
diff --git a/api/current.txt b/api/current.txt index 3ab4ce46fe05..9aba0f3d3ee7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10707,9 +10707,6 @@ package android.graphics { public class ColorMatrixColorFilter extends android.graphics.ColorFilter { ctor public ColorMatrixColorFilter(android.graphics.ColorMatrix); ctor public ColorMatrixColorFilter(float[]); - method public android.graphics.ColorMatrix getColorMatrix(); - method public void setColorMatrix(android.graphics.ColorMatrix); - method public void setColorMatrix(float[]); } public class ComposePathEffect extends android.graphics.PathEffect { @@ -10786,10 +10783,6 @@ package android.graphics { public class LightingColorFilter extends android.graphics.ColorFilter { ctor public LightingColorFilter(int, int); - method public int getColorAdd(); - method public int getColorMultiply(); - method public void setColorAdd(int); - method public void setColorMultiply(int); } public class LinearGradient extends android.graphics.Shader { @@ -11295,8 +11288,6 @@ package android.graphics { public class PorterDuffColorFilter extends android.graphics.ColorFilter { ctor public PorterDuffColorFilter(int, android.graphics.PorterDuff.Mode); - method public int getColor(); - method public android.graphics.PorterDuff.Mode getMode(); } public class PorterDuffXfermode extends android.graphics.Xfermode { @@ -28179,6 +28170,7 @@ package android.telecom { public final class DisconnectCause implements android.os.Parcelable { ctor public DisconnectCause(int); ctor public DisconnectCause(int, java.lang.String); + ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String); ctor public DisconnectCause(int, java.lang.CharSequence, java.lang.CharSequence, java.lang.String, int); method public int describeContents(); method public int getCode(); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 5f3ed61fee20..25c489736dfa 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -745,6 +745,11 @@ public class Activity extends ContextThemeWrapper public View findViewById(int id) { return Activity.this.findViewById(id); } + @Override + public boolean hasView() { + Window window = Activity.this.getWindow(); + return (window != null && window.peekDecorView() != null); + } }; // Most recent call to requestVisibleBehind(). diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java index 137f77d038b6..540376ec5fb7 100644 --- a/core/java/android/app/ActivityTransitionCoordinator.java +++ b/core/java/android/app/ActivityTransitionCoordinator.java @@ -219,7 +219,9 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { protected void viewsReady(ArrayMap<String, View> sharedElements) { sharedElements.retainAll(mAllSharedElementNames); - mListener.onMapSharedElements(mAllSharedElementNames, sharedElements); + if (mListener != null) { + mListener.onMapSharedElements(mAllSharedElementNames, sharedElements); + } mSharedElementNames.addAll(sharedElements.keySet()); mSharedElements.addAll(sharedElements.values()); if (getViewsTransition() != null && mTransitioningViews != null) { @@ -461,7 +463,8 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { if (sharedElementState != null) { Matrix tempMatrix = new Matrix(); RectF tempRect = new RectF(); - for (int i = 0; i < mSharedElementNames.size(); i++) { + final int numSharedElements = mSharedElements.size(); + for (int i = 0; i < numSharedElements; i++) { View sharedElement = mSharedElements.get(i); String name = mSharedElementNames.get(i); SharedElementOriginalState originalState = getOldSharedElementState(sharedElement, @@ -471,12 +474,16 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { tempMatrix, tempRect, null); } } - mListener.onSharedElementStart(mSharedElementNames, mSharedElements, snapshots); + if (mListener != null) { + mListener.onSharedElementStart(mSharedElementNames, mSharedElements, snapshots); + } return originalImageState; } protected void notifySharedElementEnd(ArrayList<View> snapshots) { - mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, snapshots); + if (mListener != null) { + mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, snapshots); + } } protected void scheduleSetSharedElementEnd(final ArrayList<View> snapshots) { @@ -544,7 +551,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { if (sharedElementBundle != null) { Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT); View snapshot = null; - if (parcelable != null) { + if (parcelable != null && mListener != null) { snapshot = mListener.onCreateSnapshotView(context, parcelable); } if (snapshot != null) { @@ -659,7 +666,11 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver { sharedElementBundle.putFloat(KEY_TRANSLATION_Z, view.getTranslationZ()); sharedElementBundle.putFloat(KEY_ELEVATION, view.getElevation()); - Parcelable bitmap = mListener.onCaptureSharedElementSnapshot(view, tempMatrix, tempBounds); + Parcelable bitmap = null; + if (mListener != null) { + bitmap = mListener.onCaptureSharedElementSnapshot(view, tempMatrix, tempBounds); + } + if (bitmap != null) { sharedElementBundle.putParcelable(KEY_SNAPSHOT, bitmap); } diff --git a/core/java/android/app/BackStackRecord.java b/core/java/android/app/BackStackRecord.java index 832e1e38d322..8644c3d87474 100644 --- a/core/java/android/app/BackStackRecord.java +++ b/core/java/android/app/BackStackRecord.java @@ -868,6 +868,9 @@ final class BackStackRecord extends FragmentTransaction implements */ private void calculateFragments(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { + if (!mManager.mContainer.hasView()) { + return; // nothing to see, so no transitions + } Op op = mHead; while (op != null) { switch (op.cmd) { @@ -923,6 +926,9 @@ final class BackStackRecord extends FragmentTransaction implements */ public void calculateBackFragments(SparseArray<Fragment> firstOutFragments, SparseArray<Fragment> lastInFragments) { + if (!mManager.mContainer.hasView()) { + return; // nothing to see, so no transitions + } Op op = mHead; while (op != null) { switch (op.cmd) { diff --git a/core/java/android/app/EnterTransitionCoordinator.java b/core/java/android/app/EnterTransitionCoordinator.java index 16a3575933eb..216d6bab38ad 100644 --- a/core/java/android/app/EnterTransitionCoordinator.java +++ b/core/java/android/app/EnterTransitionCoordinator.java @@ -306,7 +306,9 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator { ArrayList<String> rejectedNames = new ArrayList<String>(mAllSharedElementNames); rejectedNames.removeAll(mSharedElementNames); ArrayList<View> rejectedSnapshots = createSnapshots(sharedElementState, rejectedNames); - mListener.onRejectSharedElements(rejectedSnapshots); + if (mListener != null) { + mListener.onRejectSharedElements(rejectedSnapshots); + } startRejectedAnimations(rejectedSnapshots); // Now start shared element transition diff --git a/core/java/android/app/ExitTransitionCoordinator.java b/core/java/android/app/ExitTransitionCoordinator.java index 812dfdb41d74..d4d3eda91e75 100644 --- a/core/java/android/app/ExitTransitionCoordinator.java +++ b/core/java/android/app/ExitTransitionCoordinator.java @@ -181,7 +181,10 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator { }); setGhostVisibility(View.INVISIBLE); scheduleGhostVisibilityChange(View.INVISIBLE); - mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, sharedElementSnapshots); + if (mListener != null) { + mListener.onSharedElementEnd(mSharedElementNames, mSharedElements, + sharedElementSnapshots); + } TransitionManager.beginDelayedTransition(decorView, transition); scheduleGhostVisibilityChange(View.VISIBLE); setGhostVisibility(View.VISIBLE); diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java index a95abab94eb9..5196834eefed 100644 --- a/core/java/android/app/Fragment.java +++ b/core/java/android/app/Fragment.java @@ -2015,6 +2015,11 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene } return mView.findViewById(id); } + + @Override + public boolean hasView() { + return (mView != null); + } }, this); } diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index ef69fddf01e7..fc761fe54a45 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -395,6 +395,7 @@ final class FragmentManagerState implements Parcelable { */ interface FragmentContainer { public View findViewById(int id); + public boolean hasView(); } /** diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 13ed8d1f7bce..2eba29a8adfe 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -2408,8 +2408,8 @@ public class DevicePolicyManager { } /** - * Sets the name of the Managed profile. In the device owner case it sets the name of the user - * which it is called from. Only the profile owner or device owner can call this. If this is + * Sets the name of the profile. In the device owner case it sets the name of the user + * which it is called from. Only a profile owner or device owner can call this. If this is * never called by the profile or device owner, the name will be set to default values. * * @see #isProfileOwnerApp @@ -2428,9 +2428,9 @@ public class DevicePolicyManager { } /** - * Used to determine if a particular package is registered as the Profile Owner for the + * Used to determine if a particular package is registered as the profile owner for the * current user. A profile owner is a special device admin that has additional privileges - * within the managed profile. + * within the profile. * * @param packageName The package name of the app to compare with the registered profile owner. * @return Whether or not the package is registered as the profile owner. @@ -2568,12 +2568,10 @@ public class DevicePolicyManager { /** * Called by a profile or device owner to set the application restrictions for a given target - * application running in the managed profile. + * application running in the profile. * * <p>The provided {@link Bundle} consists of key-value pairs, where the types of values may be - * boolean, int, String, or String[]. The recommended format for keys - * is "com.example.packagename/example-setting" to avoid naming conflicts with library - * components such as {@link android.webkit.WebView}. + * boolean, int, String, or String[]. * * <p>The application restrictions are only made visible to the target application and the * profile or device owner. @@ -2645,8 +2643,8 @@ public class DevicePolicyManager { } /** - * Called by a profile owner to set whether caller-Id information from the managed - * profile will be shown for incoming calls. + * Called by a profile owner of a managed profile to set whether caller-Id information from + * the managed profile will be shown in the parent profile, for incoming calls. * * <p>The calling device admin must be a profile owner. If it is not, a * security exception will be thrown. @@ -2665,7 +2663,8 @@ public class DevicePolicyManager { } /** - * Determine whether or not caller-Id information has been disabled. + * Called by a profile owner of a managed profile to determine whether or not caller-Id + * information has been disabled. * * <p>The calling device admin must be a profile owner. If it is not, a * security exception will be thrown. @@ -2701,8 +2700,8 @@ public class DevicePolicyManager { } /** - * Called by the profile owner so that some intents sent in the managed profile can also be - * resolved in the parent, or vice versa. + * Called by the profile owner of a managed profile so that some intents sent in the managed + * profile can also be resolved in the parent, or vice versa. * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param filter The {@link IntentFilter} the intent has to match to be also resolved in the * other profile @@ -2720,8 +2719,8 @@ public class DevicePolicyManager { } /** - * 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. + * Called by a profile owner of a managed profile 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. */ @@ -2982,7 +2981,7 @@ public class DevicePolicyManager { /** * Called by a profile or device owner to get the application restrictions for a given target - * application running in the managed profile. + * application running in the profile. * * <p>The calling device admin must be a profile or device owner; if it is not, a security * exception will be thrown. @@ -3090,8 +3089,7 @@ public class DevicePolicyManager { /** * Called by profile or device owner to re-enable a system app that was disabled by default - * when the managed profile was created. This can only be called from a profile or device - * owner running within a managed profile. + * when the user was initialized. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param packageName The package to be re-enabled in the current profile. @@ -3108,8 +3106,7 @@ public class DevicePolicyManager { /** * Called by profile or device owner to re-enable system apps by intent that were disabled - * by default when the managed profile was created. This can only be called from a profile - * or device owner running within a managed profile. + * by default when the user was initialized. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param intent An intent matching the app(s) to be installed. All apps that resolve for this @@ -3391,10 +3388,10 @@ public class DevicePolicyManager { } /** - * Called by the profile owner to enable widget providers from a given package - * to be available in the parent profile. As a result the user will be able to + * Called by the profile owner of a managed profile to enable widget providers from a + * given package to be available in the parent profile. As a result the user will be able to * add widgets from the white-listed package running under the profile to a widget - * host which runs under the device owner, for example the home screen. Note that + * host which runs under the parent profile, for example the home screen. Note that * a package may have zero or more provider components, where each component * provides a different widget type. * <p> @@ -3420,8 +3417,8 @@ public class DevicePolicyManager { } /** - * Called by the profile owner to disable widget providers from a given package - * to be available in the parent profile. For this method to take effect the + * Called by the profile owner of a managed profile to disable widget providers from a given + * package to be available in the parent profile. For this method to take effect the * package should have been added via {@link #addCrossProfileWidgetProvider( * android.content.ComponentName, String)}. * <p> @@ -3448,7 +3445,7 @@ public class DevicePolicyManager { } /** - * Called by the profile owner to query providers from which packages are + * Called by the profile owner of a managed profile to query providers from which packages are * available in the parent profile. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 53912e1fd859..a19fbd368903 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3587,7 +3587,7 @@ public class Intent implements Parcelable, Cloneable { * creating new document tasks. * * <p>This flag is ignored if one of {@link #FLAG_ACTIVITY_NEW_TASK} or - * {@link #FLAG_ACTIVITY_NEW_TASK} is not also set. + * {@link #FLAG_ACTIVITY_NEW_DOCUMENT} is not also set. * * <p>See * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index ffde7cefa943..3364741e52c4 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -4675,6 +4675,28 @@ public class PackageParser { return ai; } + public static ApplicationInfo generateApplicationInfo(ApplicationInfo ai, int flags, + PackageUserState state, int userId) { + if (ai == null) return null; + if (!checkUseInstalledOrHidden(flags, state)) { + return null; + } + // This is only used to return the ResolverActivity; we will just always + // make a copy. + ai = new ApplicationInfo(ai); + if (userId != 0) { + ai.uid = UserHandle.getUid(userId, ai.uid); + ai.dataDir = PackageManager.getDataDirForUser(userId, ai.packageName); + } + if (state.stopped) { + ai.flags |= ApplicationInfo.FLAG_STOPPED; + } else { + ai.flags &= ~ApplicationInfo.FLAG_STOPPED; + } + updateApplicationInfo(ai, flags, state); + return ai; + } + public static final PermissionInfo generatePermissionInfo( Permission p, int flags) { if (p == null) return null; @@ -4738,6 +4760,19 @@ public class PackageParser { return ai; } + public static final ActivityInfo generateActivityInfo(ActivityInfo ai, int flags, + PackageUserState state, int userId) { + if (ai == null) return null; + if (!checkUseInstalledOrHidden(flags, state)) { + return null; + } + // This is only used to return the ResolverActivity; we will just always + // make a copy. + ai = new ActivityInfo(ai); + ai.applicationInfo = generateApplicationInfo(ai.applicationInfo, flags, state, userId); + return ai; + } + public final static class Service extends Component<ServiceIntentInfo> { public final ServiceInfo info; diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 82016c305f90..2315c74a32b8 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -123,7 +123,8 @@ public class UserManager { /** * Specifies if a user is disallowed from transferring files over - * USB. This can only be set by device owners. The default value is <code>false</code>. + * USB. This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -178,8 +179,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring Tethering - * & portable hotspots. This can only be set by device owners. The default value is - * <code>false</code>. + * & portable hotspots. This can only be set by device owners and profile owners on the + * primary user. The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -190,8 +191,8 @@ public class UserManager { /** * Specifies if a user is disallowed from factory resetting - * from Settings. This can only be set by device owners. The default value is - * <code>false</code>. + * from Settings. This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -202,7 +203,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adding new users and - * profiles. This can only be set by device owners. The default value is <code>false</code>. + * profiles. This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -224,7 +226,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring cell - * broadcasts. This can only be set by device owners. The default value is <code>false</code>. + * broadcasts. This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -235,7 +238,8 @@ public class UserManager { /** * Specifies if a user is disallowed from configuring mobile - * networks. This can only be set by device owners. The default value is <code>false</code>. + * networks. This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -266,8 +270,8 @@ public class UserManager { /** * Specifies if a user is disallowed from mounting - * physical external media. This can only be set by device owners. The default value is - * <code>false</code>. + * physical external media. This can only be set by device owners and profile owners on the + * primary user. The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -278,8 +282,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adjusting microphone - * volume. If set, the microphone will be muted. This can only be set by device owners. - * The default value is <code>false</code>. + * volume. If set, the microphone will be muted. This can only be set by device owners + * and profile owners on the primary user. The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -290,8 +294,8 @@ public class UserManager { /** * Specifies if a user is disallowed from adjusting the master - * volume. If set, the master volume will be muted. This can only be set by device owners. - * The default value is <code>false</code>. + * volume. If set, the master volume will be muted. This can only be set by device owners + * and profile owners on the primary user. The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -314,7 +318,7 @@ public class UserManager { /** * Specifies that the user is not allowed to send or receive - * SMS messages. This can only be set by device owners. The default value is <code>false</code>. + * SMS messages. The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean @@ -333,7 +337,8 @@ public class UserManager { * <li>{@link LayoutParams#TYPE_SYSTEM_ERROR}</li> * <li>{@link LayoutParams#TYPE_SYSTEM_OVERLAY}</li> * - * <p>This can only be set by device owners. The default value is <code>false</code>. + * <p>This can only be set by device owners and profile owners on the primary user. + * The default value is <code>false</code>. * * <p/>Key for user restrictions. * <p/>Type: Boolean diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index 5f3704224ef9..1546877aee77 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -209,7 +209,7 @@ public abstract class LayoutInflater { mFactory = original.mFactory; mFactory2 = original.mFactory2; mPrivateFactory = original.mPrivateFactory; - mFilter = original.mFilter; + setFilter(original.mFilter); } /** diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java index 0a8e4b9c2181..11d0f4a89361 100644 --- a/core/java/android/view/inputmethod/InputMethodInfo.java +++ b/core/java/android/view/inputmethod/InputMethodInfo.java @@ -27,6 +27,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Resources; +import android.content.res.Resources.NotFoundException; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; @@ -421,7 +422,7 @@ public final class InputMethodInfo implements Parcelable { } final Resources res = context.createPackageContext(getPackageName(), 0).getResources(); return res.getBoolean(getIsDefaultResourceId()); - } catch (NameNotFoundException e) { + } catch (NameNotFoundException | NotFoundException e) { return false; } } diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java index 06b7a9308e34..068790553708 100644 --- a/core/java/android/widget/FastScroller.java +++ b/core/java/android/widget/FastScroller.java @@ -1205,7 +1205,6 @@ class FastScroller { if (!hasSections || !mMatchDragPosition) { return (float) firstVisibleItem / (totalItemCount - visibleItemCount); } - // Ignore headers. firstVisibleItem -= mHeaderCount; if (firstVisibleItem < 0) { @@ -1255,9 +1254,19 @@ class FastScroller { // across the last item account for whatever space is remaining. if (firstVisibleItem > 0 && firstVisibleItem + visibleItemCount == totalItemCount) { final View lastChild = mList.getChildAt(visibleItemCount - 1); - final float lastItemVisible = (float) (mList.getHeight() - mList.getPaddingBottom() - - lastChild.getTop()) / lastChild.getHeight(); - result += (1 - result) * lastItemVisible; + final int bottomPadding = mList.getPaddingBottom(); + final int maxSize; + final int currentVisibleSize; + if (mList.getClipToPadding()) { + maxSize = lastChild.getHeight(); + currentVisibleSize = mList.getHeight() - bottomPadding - lastChild.getTop(); + } else { + maxSize = lastChild.getHeight() + bottomPadding; + currentVisibleSize = mList.getHeight() - lastChild.getTop(); + } + if (currentVisibleSize > 0 && maxSize > 0) { + result += (1 - result) * ((float) currentVisibleSize / maxSize ); + } } return result; diff --git a/core/java/android/widget/RadialTimePickerView.java b/core/java/android/widget/RadialTimePickerView.java index 046028233f63..56f126cbe447 100644 --- a/core/java/android/widget/RadialTimePickerView.java +++ b/core/java/android/widget/RadialTimePickerView.java @@ -557,7 +557,7 @@ public class RadialTimePickerView extends View implements View.OnTouchListener { if (mIsOnInnerCircle && hour == 0) { // Inner circle is 1 through 12. hour = 12; - } else if (hour != 0) { + } else if (!mIsOnInnerCircle && hour != 0) { // Outer circle is 13 through 23 and 0. hour += 12; } diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 157310657c59..1f4105fdca98 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -905,6 +905,20 @@ char* AndroidRuntime::toSlashClassName(const char* className) return result; } +/** Create a Java string from an ASCII or Latin-1 string */ +jstring AndroidRuntime::NewStringLatin1(JNIEnv* env, const char* bytes) { + if (!bytes) return NULL; + int length = strlen(bytes); + jchar* buffer = (jchar *)alloca(length * sizeof(jchar)); + if (!buffer) return NULL; + jchar* chp = buffer; + for (int i = 0; i < length; i++) { + *chp++ = *bytes++; + } + return env->NewString(buffer, length); +} + + /* * Start the Android runtime. This involves starting the virtual machine * and calling the "static void main(String[] args)" method in the class diff --git a/core/res/res/values-mcc204-mnc04/config.xml b/core/res/res/values-mcc204-mnc04/config.xml index 7a483421a975..b89a31143961 100644 --- a/core/res/res/values-mcc204-mnc04/config.xml +++ b/core/res/res/values-mcc204-mnc04/config.xml @@ -25,4 +25,9 @@ --> <integer name="config_mobile_mtu">1358</integer> + <!-- service number convert map in roaming network. --> + <!-- [dialstring],[replacement][,optional gid] --> + <string-array translatable="false" name="dial_string_replace"> + <item>"*611:+19085594899,BAE0000000000000"</item> + </string-array> </resources> diff --git a/core/res/res/values-mcc238-mnc06/config.xml b/core/res/res/values-mcc238-mnc06/config.xml new file mode 100644 index 000000000000..afc0cc4011a0 --- /dev/null +++ b/core/res/res/values-mcc238-mnc06/config.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 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. +*/ +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- SIM does not save, but the voice mail number to be changed. --> + <bool name="editable_voicemailnumber">true</bool> +</resources> diff --git a/core/res/res/values-mcc311-mnc480/config.xml b/core/res/res/values-mcc311-mnc480/config.xml index cf19235909dc..d01d9f8042fe 100644 --- a/core/res/res/values-mcc311-mnc480/config.xml +++ b/core/res/res/values-mcc311-mnc480/config.xml @@ -44,4 +44,8 @@ <bool name="config_carrier_volte_vt_available">false</bool> <bool name="config_auto_attach_data_on_creation">false</bool> + <!-- service number convert map in roaming network. --> + <string-array translatable="false" name="dial_string_replace"> + <item>"*611:+19085594899,"</item> + </string-array> </resources> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index ef3f47e97e17..c5d3c5725bbb 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1811,4 +1811,12 @@ <!-- Sprint need a 70 ms delay for 3way call --> <integer name="config_cdma_3waycall_flash_delay">0</integer> + + <!--SIM does not save, but the voice mail number to be changed. --> + <bool name="editable_voicemailnumber">false</bool> + + <!-- service number convert map in roaming network. --> + <!-- [dialstring],[replacement][,optional gid] --> + <string-array translatable="false" name="dial_string_replace"> + </string-array> </resources> diff --git a/core/res/res/values/removed.xml b/core/res/res/values/removed.xml deleted file mode 100644 index 8eaca29656b6..000000000000 --- a/core/res/res/values/removed.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- 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. ---> - -<!-- Placeholder resources to be removed before release. --> -<resources> - <style name="__removed1" /> - <attr name="__removed2" /> - <style name="__removed3" /> - <style name="__removed4" /> - <style name="__removed5" /> - <style name="__removed6" /> - <style name="__removed7" /> -</resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index ea7188d00fa9..edcfb8bea960 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -322,6 +322,7 @@ <java-symbol type="integer" name="config_wifi_framework_wifi_score_bad_link_speed_5" /> <java-symbol type="integer" name="config_wifi_framework_wifi_score_good_link_speed_24" /> <java-symbol type="integer" name="config_wifi_framework_wifi_score_good_link_speed_5" /> + <java-symbol type="bool" name="editable_voicemailnumber" /> <java-symbol type="bool" name="config_wifi_framework_cellular_handover_enable_user_triggered_adjustment" /> <java-symbol type="integer" name="config_wifi_framework_associated_full_scan_tx_packet_threshold" /> @@ -2064,4 +2065,5 @@ <java-symbol type="integer" name="config_cdma_3waycall_flash_delay"/> <java-symbol type="attr" name="windowBackgroundFallback" /> <java-symbol type="id" name="textSpacerNoButtons" /> + <java-symbol type="array" name="dial_string_replace" /> </resources> diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml index ebff9655b1c9..615ef52d3317 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -978,6 +978,7 @@ please see themes_device_defaults.xml. <item name="listViewStyle">@style/Widget.Material.ListView</item> <item name="windowAnimationStyle">@style/Animation.DropDownUp</item> <item name="background">@null</item> + <item name="windowElevation">@dimen/floating_window_z</item> </style> <style name="Theme.Material.Light.CompactMenu"> @@ -986,6 +987,7 @@ please see themes_device_defaults.xml. <item name="listViewStyle">@style/Widget.Material.Light.ListView</item> <item name="windowAnimationStyle">@style/Animation.DropDownUp</item> <item name="background">@null</item> + <item name="windowElevation">@dimen/floating_window_z</item> </style> <!-- Dialog themes for Material --> diff --git a/graphics/java/android/graphics/ColorMatrixColorFilter.java b/graphics/java/android/graphics/ColorMatrixColorFilter.java index 7822c411c9f0..291c8ff301f4 100644 --- a/graphics/java/android/graphics/ColorMatrixColorFilter.java +++ b/graphics/java/android/graphics/ColorMatrixColorFilter.java @@ -58,6 +58,8 @@ public class ColorMatrixColorFilter extends ColorFilter { * any effect until you call {@link #setColorMatrix(ColorMatrix)}. * * @see #setColorMatrix(ColorMatrix) + * + * @hide */ public ColorMatrix getColorMatrix() { return mMatrix; @@ -73,6 +75,8 @@ public class ColorMatrixColorFilter extends ColorFilter { * @see #getColorMatrix() * @see android.graphics.ColorMatrix#reset() * @see #setColorMatrix(float[]) + * + * @hide */ public void setColorMatrix(ColorMatrix matrix) { if (matrix == null) { @@ -98,6 +102,8 @@ public class ColorMatrixColorFilter extends ColorFilter { * * @throws ArrayIndexOutOfBoundsException if the specified array's * length is < 20 + * + * @hide */ public void setColorMatrix(float[] array) { if (array == null) { diff --git a/graphics/java/android/graphics/LightingColorFilter.java b/graphics/java/android/graphics/LightingColorFilter.java index 70a3fe83252c..ad78430e2472 100644 --- a/graphics/java/android/graphics/LightingColorFilter.java +++ b/graphics/java/android/graphics/LightingColorFilter.java @@ -44,9 +44,6 @@ public class LightingColorFilter extends ColorFilter { * Create a colorfilter that multiplies the RGB channels by one color, * and then adds a second color. The alpha components of the mul and add * arguments are ignored. - * - * @see #setColorMultiply(int) - * @see #setColorAdd(int) */ public LightingColorFilter(int mul, int add) { mMul = mul; @@ -59,6 +56,8 @@ public class LightingColorFilter extends ColorFilter { * color filter is applied. * * @see #setColorMultiply(int) + * + * @hide */ public int getColorMultiply() { return mMul; @@ -70,6 +69,8 @@ public class LightingColorFilter extends ColorFilter { * The alpha channel of this color is ignored. * * @see #getColorMultiply() + * + * @hide */ public void setColorMultiply(int mul) { mMul = mul; @@ -81,6 +82,8 @@ public class LightingColorFilter extends ColorFilter { * when the color filter is applied. * * @see #setColorAdd(int) + * + * @hide */ public int getColorAdd() { return mAdd; @@ -92,6 +95,8 @@ public class LightingColorFilter extends ColorFilter { * The alpha channel of this color is ignored. * * @see #getColorAdd() + * + * @hide */ public void setColorAdd(int add) { mAdd = add; diff --git a/graphics/java/android/graphics/PorterDuffColorFilter.java b/graphics/java/android/graphics/PorterDuffColorFilter.java index ff768b787a52..fe4f8b82c36b 100644 --- a/graphics/java/android/graphics/PorterDuffColorFilter.java +++ b/graphics/java/android/graphics/PorterDuffColorFilter.java @@ -46,6 +46,8 @@ public class PorterDuffColorFilter extends ColorFilter { * * @see Color * @see #setColor(int) + * + * @hide */ public int getColor() { return mColor; @@ -74,6 +76,8 @@ public class PorterDuffColorFilter extends ColorFilter { * * @see PorterDuff * @see #setMode(android.graphics.PorterDuff.Mode) + * + * @hide */ public PorterDuff.Mode getMode() { return mMode; diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index f3cfd97d58ee..fc33b7e67e34 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -113,6 +113,9 @@ public: /** return a new string corresponding to 'className' with all '.'s replaced by '/'s. */ static char* toSlashClassName(const char* className); + /** Create a Java string from an ASCII or Latin-1 string */ + static jstring NewStringLatin1(JNIEnv* env, const char* bytes); + private: static int startReg(JNIEnv* env); bool parseRuntimeOption(const char* property, diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h index c65efe4d4900..ac5eca08a4ff 100644 --- a/include/androidfw/ResourceTypes.h +++ b/include/androidfw/ResourceTypes.h @@ -1521,6 +1521,8 @@ public: bool getResourceName(uint32_t resID, bool allowUtf8, resource_name* outName) const; + bool getResourceFlags(uint32_t resID, uint32_t* outFlags) const; + /** * Retrieve the value of a resource. If the resource is found, returns a * value >= 0 indicating the table it is in (for use with diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 690b1d66f42c..8cef13765cc2 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -5393,6 +5393,44 @@ const char16_t* StringPoolRef::string16(size_t* outLen) const { return NULL; } +bool ResTable::getResourceFlags(uint32_t resID, uint32_t* outFlags) const { + if (mError != NO_ERROR) { + return false; + } + + const ssize_t p = getResourcePackageIndex(resID); + const int t = Res_GETTYPE(resID); + const int e = Res_GETENTRY(resID); + + if (p < 0) { + if (Res_GETPACKAGE(resID)+1 == 0) { + ALOGW("No package identifier when getting flags for resource number 0x%08x", resID); + } else { + ALOGW("No known package when getting flags for resource number 0x%08x", resID); + } + return false; + } + if (t < 0) { + ALOGW("No type identifier when getting flags for resource number 0x%08x", resID); + return false; + } + + const PackageGroup* const grp = mPackageGroups[p]; + if (grp == NULL) { + ALOGW("Bad identifier when getting flags for resource number 0x%08x", resID); + return false; + } + + Entry entry; + status_t err = getEntry(grp, t, e, NULL, &entry); + if (err != NO_ERROR) { + return false; + } + + *outFlags = entry.specFlags; + return true; +} + status_t ResTable::getEntry( const PackageGroup* packageGroup, int typeIndex, int entryIndex, const ResTable_config* config, diff --git a/libs/androidfw/tests/data/basic/build b/libs/androidfw/tests/data/basic/build index fa4a9fe0d8f2..036e46828189 100755 --- a/libs/androidfw/tests/data/basic/build +++ b/libs/androidfw/tests/data/basic/build @@ -1,6 +1,8 @@ #!/bin/bash -aapt package -M AndroidManifest.xml -S res --split fr,de -F bundle.apk -f && \ +PATH_TO_FRAMEWORK_RES=$(gettop)/prebuilts/sdk/current/android.jar + +aapt package -M AndroidManifest.xml -S res -I $PATH_TO_FRAMEWORK_RES --split fr,de -F bundle.apk -f && \ unzip bundle.apk resources.arsc && \ mv resources.arsc basic.arsc && \ xxd -i basic.arsc > basic_arsc.h && \ diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index 9b0025f3b846..f0bf7b22ff01 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -377,6 +377,7 @@ void Caches::flush(FlushMode mode) { } clearGarbage(); + glFinish(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 25ea72915057..ce1d09fe149a 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -134,6 +134,8 @@ OpenGLRenderer::OpenGLRenderer(RenderState& renderState) , mExtensions(Extensions::getInstance()) , mRenderState(renderState) , mScissorOptimizationDisabled(false) + , mSuppressTiling(false) + , mFirstFrameAfterResize(true) , mCountOverdraw(false) , mLightCenter((Vector3){FLT_MIN, FLT_MIN, FLT_MIN}) , mLightRadius(FLT_MIN) @@ -179,6 +181,7 @@ void OpenGLRenderer::onViewportInitialized() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glEnableVertexAttribArray(Program::kBindingPosition); + mFirstFrameAfterResize = true; } void OpenGLRenderer::setupFrameState(float left, float top, @@ -202,7 +205,9 @@ status_t OpenGLRenderer::startFrame() { // Functors break the tiling extension in pretty spectacular ways // This ensures we don't use tiling when a functor is going to be // invoked during the frame - mSuppressTiling = mCaches.hasRegisteredFunctors(); + mSuppressTiling = mCaches.hasRegisteredFunctors() + || mFirstFrameAfterResize; + mFirstFrameAfterResize = false; startTilingCurrentClip(true); diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index e295b1a8659b..47ef1a9bb703 100755 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -1013,6 +1013,7 @@ private: // No-ops start/endTiling when set bool mSuppressTiling; + bool mFirstFrameAfterResize; // If true, this renderer will setup drawing to emulate // an increment stencil buffer in the color buffer diff --git a/libs/hwui/StatefulBaseRenderer.cpp b/libs/hwui/StatefulBaseRenderer.cpp index 12b8c8db28ea..88d6f6802909 100644 --- a/libs/hwui/StatefulBaseRenderer.cpp +++ b/libs/hwui/StatefulBaseRenderer.cpp @@ -49,6 +49,13 @@ void StatefulBaseRenderer::setViewport(int width, int height) { mHeight = height; mFirstSnapshot->initializeViewport(width, height); onViewportInitialized(); + + // create a temporary 1st snapshot, so old snapshots are released, + // and viewport can be queried safely. + // TODO: remove, combine viewport + save stack initialization + mSnapshot = new Snapshot(mFirstSnapshot, + SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); + mSaveCount = 1; } /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 832d17013b02..1c416a7f4671 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -119,10 +119,10 @@ void CanvasContext::pauseSurface(ANativeWindow* window) { stopDrawing(); } +// TODO: don't pass viewport size, it's automatic via EGL void CanvasContext::setup(int width, int height, const Vector3& lightCenter, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { if (!mCanvas) return; - mCanvas->setViewport(width, height); mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha); } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java index 33cab8f2ce7a..2b40903d005f 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java @@ -146,7 +146,7 @@ public class KeyguardUpdateMonitorCallback { /** * Called when the emergency call button is pressed. */ - void onEmergencyCallAction() { } + public void onEmergencyCallAction() { } /** * Called when the transport background changes. diff --git a/packages/SettingsProvider/res/values-af/defaults.xml b/packages/SettingsProvider/res/values-af/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-af/defaults.xml +++ b/packages/SettingsProvider/res/values-af/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-am/defaults.xml b/packages/SettingsProvider/res/values-am/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-am/defaults.xml +++ b/packages/SettingsProvider/res/values-am/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-bg/defaults.xml b/packages/SettingsProvider/res/values-bg/defaults.xml index 5e46120eadaf..aee229efecc7 100644 --- a/packages/SettingsProvider/res/values-bg/defaults.xml +++ b/packages/SettingsProvider/res/values-bg/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s от %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-bn-rBD/defaults.xml b/packages/SettingsProvider/res/values-bn-rBD/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-bn-rBD/defaults.xml +++ b/packages/SettingsProvider/res/values-bn-rBD/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ca/defaults.xml b/packages/SettingsProvider/res/values-ca/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ca/defaults.xml +++ b/packages/SettingsProvider/res/values-ca/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-cs/defaults.xml b/packages/SettingsProvider/res/values-cs/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-cs/defaults.xml +++ b/packages/SettingsProvider/res/values-cs/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-da/defaults.xml b/packages/SettingsProvider/res/values-da/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-da/defaults.xml +++ b/packages/SettingsProvider/res/values-da/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-de/defaults.xml b/packages/SettingsProvider/res/values-de/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-de/defaults.xml +++ b/packages/SettingsProvider/res/values-de/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-el/defaults.xml b/packages/SettingsProvider/res/values-el/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-el/defaults.xml +++ b/packages/SettingsProvider/res/values-el/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-en-rGB/defaults.xml b/packages/SettingsProvider/res/values-en-rGB/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-en-rGB/defaults.xml +++ b/packages/SettingsProvider/res/values-en-rGB/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-en-rIN/defaults.xml b/packages/SettingsProvider/res/values-en-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-en-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-en-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-es-rUS/defaults.xml b/packages/SettingsProvider/res/values-es-rUS/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-es-rUS/defaults.xml +++ b/packages/SettingsProvider/res/values-es-rUS/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-es/defaults.xml b/packages/SettingsProvider/res/values-es/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-es/defaults.xml +++ b/packages/SettingsProvider/res/values-es/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-et-rEE/defaults.xml b/packages/SettingsProvider/res/values-et-rEE/defaults.xml index 790297a10dd6..71e91aec8cc5 100644 --- a/packages/SettingsProvider/res/values-et-rEE/defaults.xml +++ b/packages/SettingsProvider/res/values-et-rEE/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s, %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-eu-rES/defaults.xml b/packages/SettingsProvider/res/values-eu-rES/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-eu-rES/defaults.xml +++ b/packages/SettingsProvider/res/values-eu-rES/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-fi/defaults.xml b/packages/SettingsProvider/res/values-fi/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-fi/defaults.xml +++ b/packages/SettingsProvider/res/values-fi/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-fr-rCA/defaults.xml b/packages/SettingsProvider/res/values-fr-rCA/defaults.xml index 15da9d298256..beba56e52d67 100644 --- a/packages/SettingsProvider/res/values-fr-rCA/defaults.xml +++ b/packages/SettingsProvider/res/values-fr-rCA/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s de %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-fr/defaults.xml b/packages/SettingsProvider/res/values-fr/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-fr/defaults.xml +++ b/packages/SettingsProvider/res/values-fr/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-gl-rES/defaults.xml b/packages/SettingsProvider/res/values-gl-rES/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-gl-rES/defaults.xml +++ b/packages/SettingsProvider/res/values-gl-rES/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-hi/defaults.xml b/packages/SettingsProvider/res/values-hi/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-hi/defaults.xml +++ b/packages/SettingsProvider/res/values-hi/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-hr/defaults.xml b/packages/SettingsProvider/res/values-hr/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-hr/defaults.xml +++ b/packages/SettingsProvider/res/values-hr/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-hu/defaults.xml b/packages/SettingsProvider/res/values-hu/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-hu/defaults.xml +++ b/packages/SettingsProvider/res/values-hu/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-hy-rAM/defaults.xml b/packages/SettingsProvider/res/values-hy-rAM/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-hy-rAM/defaults.xml +++ b/packages/SettingsProvider/res/values-hy-rAM/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-in/defaults.xml b/packages/SettingsProvider/res/values-in/defaults.xml index 3627c9b0c196..012a65ff1ab3 100644 --- a/packages/SettingsProvider/res/values-in/defaults.xml +++ b/packages/SettingsProvider/res/values-in/defaults.xml @@ -20,6 +20,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> + <!-- String.format failed for translation --> <!-- no translation found for def_device_name_simple (9037785625140748221) --> <skip /> </resources> diff --git a/packages/SettingsProvider/res/values-is-rIS/defaults.xml b/packages/SettingsProvider/res/values-is-rIS/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-is-rIS/defaults.xml +++ b/packages/SettingsProvider/res/values-is-rIS/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-it/defaults.xml b/packages/SettingsProvider/res/values-it/defaults.xml index 18d0b9305630..3ea32a17dd0f 100644 --- a/packages/SettingsProvider/res/values-it/defaults.xml +++ b/packages/SettingsProvider/res/values-it/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ja/defaults.xml b/packages/SettingsProvider/res/values-ja/defaults.xml index 18d0b9305630..3ea32a17dd0f 100644 --- a/packages/SettingsProvider/res/values-ja/defaults.xml +++ b/packages/SettingsProvider/res/values-ja/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ka-rGE/defaults.xml b/packages/SettingsProvider/res/values-ka-rGE/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ka-rGE/defaults.xml +++ b/packages/SettingsProvider/res/values-ka-rGE/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml b/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml +++ b/packages/SettingsProvider/res/values-kk-rKZ/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-km-rKH/defaults.xml b/packages/SettingsProvider/res/values-km-rKH/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-km-rKH/defaults.xml +++ b/packages/SettingsProvider/res/values-km-rKH/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-kn-rIN/defaults.xml b/packages/SettingsProvider/res/values-kn-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-kn-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-kn-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ko/defaults.xml b/packages/SettingsProvider/res/values-ko/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ko/defaults.xml +++ b/packages/SettingsProvider/res/values-ko/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ky-rKG/defaults.xml b/packages/SettingsProvider/res/values-ky-rKG/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ky-rKG/defaults.xml +++ b/packages/SettingsProvider/res/values-ky-rKG/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-lo-rLA/defaults.xml b/packages/SettingsProvider/res/values-lo-rLA/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-lo-rLA/defaults.xml +++ b/packages/SettingsProvider/res/values-lo-rLA/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-lt/defaults.xml b/packages/SettingsProvider/res/values-lt/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-lt/defaults.xml +++ b/packages/SettingsProvider/res/values-lt/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-lv/defaults.xml b/packages/SettingsProvider/res/values-lv/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-lv/defaults.xml +++ b/packages/SettingsProvider/res/values-lv/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-mk-rMK/defaults.xml b/packages/SettingsProvider/res/values-mk-rMK/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-mk-rMK/defaults.xml +++ b/packages/SettingsProvider/res/values-mk-rMK/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ml-rIN/defaults.xml b/packages/SettingsProvider/res/values-ml-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ml-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-ml-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-mn-rMN/defaults.xml b/packages/SettingsProvider/res/values-mn-rMN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-mn-rMN/defaults.xml +++ b/packages/SettingsProvider/res/values-mn-rMN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-mr-rIN/defaults.xml b/packages/SettingsProvider/res/values-mr-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-mr-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-mr-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ms-rMY/defaults.xml b/packages/SettingsProvider/res/values-ms-rMY/defaults.xml index 3627c9b0c196..012a65ff1ab3 100644 --- a/packages/SettingsProvider/res/values-ms-rMY/defaults.xml +++ b/packages/SettingsProvider/res/values-ms-rMY/defaults.xml @@ -20,6 +20,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> + <!-- String.format failed for translation --> <!-- no translation found for def_device_name_simple (9037785625140748221) --> <skip /> </resources> diff --git a/packages/SettingsProvider/res/values-nb/defaults.xml b/packages/SettingsProvider/res/values-nb/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-nb/defaults.xml +++ b/packages/SettingsProvider/res/values-nb/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ne-rNP/defaults.xml b/packages/SettingsProvider/res/values-ne-rNP/defaults.xml index 3627c9b0c196..012a65ff1ab3 100644 --- a/packages/SettingsProvider/res/values-ne-rNP/defaults.xml +++ b/packages/SettingsProvider/res/values-ne-rNP/defaults.xml @@ -20,6 +20,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> + <!-- String.format failed for translation --> <!-- no translation found for def_device_name_simple (9037785625140748221) --> <skip /> </resources> diff --git a/packages/SettingsProvider/res/values-nl/defaults.xml b/packages/SettingsProvider/res/values-nl/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-nl/defaults.xml +++ b/packages/SettingsProvider/res/values-nl/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-pl/defaults.xml b/packages/SettingsProvider/res/values-pl/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-pl/defaults.xml +++ b/packages/SettingsProvider/res/values-pl/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-pt-rPT/defaults.xml b/packages/SettingsProvider/res/values-pt-rPT/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-pt-rPT/defaults.xml +++ b/packages/SettingsProvider/res/values-pt-rPT/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-pt/defaults.xml b/packages/SettingsProvider/res/values-pt/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-pt/defaults.xml +++ b/packages/SettingsProvider/res/values-pt/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ro/defaults.xml b/packages/SettingsProvider/res/values-ro/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ro/defaults.xml +++ b/packages/SettingsProvider/res/values-ro/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ru/defaults.xml b/packages/SettingsProvider/res/values-ru/defaults.xml index 18d0b9305630..3ea32a17dd0f 100644 --- a/packages/SettingsProvider/res/values-ru/defaults.xml +++ b/packages/SettingsProvider/res/values-ru/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-si-rLK/defaults.xml b/packages/SettingsProvider/res/values-si-rLK/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-si-rLK/defaults.xml +++ b/packages/SettingsProvider/res/values-si-rLK/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-sk/defaults.xml b/packages/SettingsProvider/res/values-sk/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-sk/defaults.xml +++ b/packages/SettingsProvider/res/values-sk/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-sl/defaults.xml b/packages/SettingsProvider/res/values-sl/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-sl/defaults.xml +++ b/packages/SettingsProvider/res/values-sl/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-sr/defaults.xml b/packages/SettingsProvider/res/values-sr/defaults.xml index 18d0b9305630..3ea32a17dd0f 100644 --- a/packages/SettingsProvider/res/values-sr/defaults.xml +++ b/packages/SettingsProvider/res/values-sr/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-sv/defaults.xml b/packages/SettingsProvider/res/values-sv/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-sv/defaults.xml +++ b/packages/SettingsProvider/res/values-sv/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-sw/defaults.xml b/packages/SettingsProvider/res/values-sw/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-sw/defaults.xml +++ b/packages/SettingsProvider/res/values-sw/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ta-rIN/defaults.xml b/packages/SettingsProvider/res/values-ta-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ta-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-ta-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-te-rIN/defaults.xml b/packages/SettingsProvider/res/values-te-rIN/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-te-rIN/defaults.xml +++ b/packages/SettingsProvider/res/values-te-rIN/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-th/defaults.xml b/packages/SettingsProvider/res/values-th/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-th/defaults.xml +++ b/packages/SettingsProvider/res/values-th/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-tl/defaults.xml b/packages/SettingsProvider/res/values-tl/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-tl/defaults.xml +++ b/packages/SettingsProvider/res/values-tl/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-tr/defaults.xml b/packages/SettingsProvider/res/values-tr/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-tr/defaults.xml +++ b/packages/SettingsProvider/res/values-tr/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-uk/defaults.xml b/packages/SettingsProvider/res/values-uk/defaults.xml index 7da1c93973ab..7655a19a182f 100644 --- a/packages/SettingsProvider/res/values-uk/defaults.xml +++ b/packages/SettingsProvider/res/values-uk/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%2$s о %1$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-ur-rPK/defaults.xml b/packages/SettingsProvider/res/values-ur-rPK/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-ur-rPK/defaults.xml +++ b/packages/SettingsProvider/res/values-ur-rPK/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml b/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml +++ b/packages/SettingsProvider/res/values-uz-rUZ/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-vi/defaults.xml b/packages/SettingsProvider/res/values-vi/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-vi/defaults.xml +++ b/packages/SettingsProvider/res/values-vi/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-zh-rHK/defaults.xml b/packages/SettingsProvider/res/values-zh-rHK/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-zh-rHK/defaults.xml +++ b/packages/SettingsProvider/res/values-zh-rHK/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SettingsProvider/res/values-zh-rTW/defaults.xml b/packages/SettingsProvider/res/values-zh-rTW/defaults.xml index 3627c9b0c196..22443a5673ea 100644 --- a/packages/SettingsProvider/res/values-zh-rTW/defaults.xml +++ b/packages/SettingsProvider/res/values-zh-rTW/defaults.xml @@ -20,6 +20,5 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="def_device_name" msgid="6309317409634339402">"%1$s %2$s"</string> - <!-- no translation found for def_device_name_simple (9037785625140748221) --> - <skip /> + <string name="def_device_name_simple" msgid="9037785625140748221">"%1$s"</string> </resources> diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index 29fec416c656..6d3f976a73e9 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -26,7 +26,7 @@ android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"> - <com.android.systemui.statusbar.AlphaOptimizedFrameLayout + <com.android.systemui.statusbar.BackDropView android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" @@ -41,9 +41,9 @@ android:layout_height="match_parent" android:scaleType="centerCrop" android:visibility="invisible" /> - </com.android.systemui.statusbar.AlphaOptimizedFrameLayout> + </com.android.systemui.statusbar.BackDropView> - <View android:id="@+id/scrim_behind" + <com.android.systemui.statusbar.ScrimView android:id="@+id/scrim_behind" android:layout_width="match_parent" android:layout_height="match_parent" /> @@ -80,7 +80,7 @@ android:visibility="gone" /> </com.android.systemui.statusbar.phone.PanelHolder> - <View android:id="@+id/scrim_in_front" + <com.android.systemui.statusbar.ScrimView android:id="@+id/scrim_in_front" android:layout_width="match_parent" android:layout_height="match_parent" /> diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java new file mode 100644 index 000000000000..3bf86a094941 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -0,0 +1,211 @@ +/* + * 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.doze; + +import android.content.Context; +import android.os.Build; +import android.util.Log; +import android.util.TimeUtils; + +import com.android.keyguard.KeyguardUpdateMonitor; +import com.android.keyguard.KeyguardUpdateMonitorCallback; + +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class DozeLog { + private static final String TAG = "DozeLog"; + private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); + private static final boolean ENABLED = true; + private static final int SIZE = Build.IS_DEBUGGABLE ? 400 : 50; + private static final SimpleDateFormat FORMAT = new SimpleDateFormat("MM-dd HH:mm:ss.SSS"); + + private static long[] sTimes; + private static String[] sMessages; + private static int sPosition; + private static int sCount; + private static boolean sPulsing; + + private static long sSince; + private static SummaryStats sPickupPulseNearVibrationStats; + private static SummaryStats sPickupPulseNotNearVibrationStats; + private static SummaryStats sNotificationPulseStats; + private static SummaryStats sScreenOnPulsingStats; + private static SummaryStats sScreenOnNotPulsingStats; + private static SummaryStats sEmergencyCallStats; + + public static void tracePickupPulse(boolean withinVibrationThreshold) { + if (!ENABLED) return; + log("pickupPulse withinVibrationThreshold=" + withinVibrationThreshold); + (withinVibrationThreshold ? sPickupPulseNearVibrationStats + : sPickupPulseNotNearVibrationStats).append(); + } + + public static void tracePulseStart() { + if (!ENABLED) return; + sPulsing = true; + log("pulseStart"); + } + + public static void tracePulseFinish() { + if (!ENABLED) return; + sPulsing = false; + log("pulseFinish"); + } + + public static void traceNotificationPulse(long instance) { + if (!ENABLED) return; + log("notificationPulse instance=" + instance); + sNotificationPulseStats.append(); + } + + public static void traceDozing(Context context, boolean dozing) { + if (!ENABLED) return; + sPulsing = false; + synchronized (DozeLog.class) { + if (dozing && sMessages == null) { + sTimes = new long[SIZE]; + sMessages = new String[SIZE]; + sSince = System.currentTimeMillis(); + sPickupPulseNearVibrationStats = new SummaryStats(); + sPickupPulseNotNearVibrationStats = new SummaryStats(); + sNotificationPulseStats = new SummaryStats(); + sScreenOnPulsingStats = new SummaryStats(); + sScreenOnNotPulsingStats = new SummaryStats(); + sEmergencyCallStats = new SummaryStats(); + log("init"); + KeyguardUpdateMonitor.getInstance(context) + .registerCallback(new KeyguardUpdateMonitorCallback() { + @Override + public void onEmergencyCallAction() { + traceEmergencyCall(); + } + @Override + public void onKeyguardBouncerChanged(boolean bouncer) { + traceKeyguardBouncerChanged(bouncer); + } + @Override + public void onScreenTurnedOn() { + traceScreenOn(); + } + @Override + public void onScreenTurnedOff(int why) { + traceScreenOff(why); + } + @Override + public void onKeyguardVisibilityChanged(boolean showing) { + traceKeyguard(showing); + } + }); + } + } + log("dozing " + dozing); + } + + public static void traceFling(boolean expand, boolean aboveThreshold, boolean thresholdNeeded) { + if (!ENABLED) return; + log("fling expand=" + expand + " aboveThreshold=" + aboveThreshold + " thresholdNeeded=" + + thresholdNeeded); + } + + public static void traceEmergencyCall() { + if (!ENABLED) return; + log("emergencyCall"); + } + + public static void traceKeyguardBouncerChanged(boolean showing) { + if (!ENABLED) return; + log("bouncer " + showing); + } + + public static void traceScreenOn() { + if (!ENABLED) return; + log("screenOn pulsing=" + sPulsing); + (sPulsing ? sScreenOnPulsingStats : sScreenOnNotPulsingStats).append(); + sPulsing = false; + } + + public static void traceScreenOff(int why) { + if (!ENABLED) return; + log("screenOff why=" + why); + } + + public static void traceKeyguard(boolean showing) { + if (!ENABLED) return; + log("keyguard " + showing); + if (!showing) { + sPulsing = false; + } + } + + public static void dump(PrintWriter pw) { + synchronized (DozeLog.class) { + if (sMessages == null) return; + pw.println(" Doze log:"); + final int start = (sPosition - sCount + SIZE) % SIZE; + for (int i = 0; i < sCount; i++) { + final int j = (start + i) % SIZE; + pw.print(" "); + pw.print(FORMAT.format(new Date(sTimes[j]))); + pw.print(' '); + pw.println(sMessages[j]); + } + pw.print(" Doze summary stats (for "); + TimeUtils.formatDuration(System.currentTimeMillis() - sSince, pw); + pw.println("):"); + sPickupPulseNearVibrationStats.dump(pw, "Pickup pulse (near vibration)"); + sPickupPulseNotNearVibrationStats.dump(pw, "Pickup pulse (not near vibration)"); + sNotificationPulseStats.dump(pw, "Notification pulse"); + sScreenOnPulsingStats.dump(pw, "Screen on (pulsing)"); + sScreenOnNotPulsingStats.dump(pw, "Screen on (not pulsing)"); + sEmergencyCallStats.dump(pw, "Emergency call"); + } + } + + private static void log(String msg) { + synchronized (DozeLog.class) { + if (sMessages == null) return; + sTimes[sPosition] = System.currentTimeMillis(); + sMessages[sPosition] = msg; + sPosition = (sPosition + 1) % SIZE; + sCount = Math.min(sCount + 1, SIZE); + } + if (DEBUG) Log.d(TAG, msg); + } + + private static class SummaryStats { + private int mCount; + + public void append() { + mCount++; + } + + public void dump(PrintWriter pw, String type) { + pw.print(" "); + pw.print(type); + pw.print(": n="); + pw.print(mCount); + pw.print(" ("); + final double perHr = (double) mCount / (System.currentTimeMillis() - sSince) + * 1000 * 60 * 60; + pw.print(perHr); + pw.print("/hr)"); + pw.println(); + } + } +} diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java index e2c8ff95ae17..e429801fc7ed 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java @@ -49,6 +49,7 @@ public class DozeService extends DreamService { private static final String ACTION_BASE = "com.android.systemui.doze"; private static final String PULSE_ACTION = ACTION_BASE + ".pulse"; private static final String NOTIFICATION_PULSE_ACTION = ACTION_BASE + ".notification_pulse"; + private static final String EXTRA_INSTANCE = "instance"; private final String mTag = String.format(TAG + ".%08x", hashCode()); private final Context mContext = this; @@ -67,7 +68,6 @@ public class DozeService extends DreamService { private boolean mDisplayStateSupported; private int mDisplayStateWhenOn; private boolean mNotificationLightOn; - private PendingIntent mNotificationPulseIntent; private boolean mPowerSaveActive; private long mNotificationPulseTime; private int mScheduleResetsRemaining; @@ -115,9 +115,6 @@ public class DozeService extends DreamService { mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, mTag); mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE); mDisplayStateSupported = mDozeParameters.getDisplayStateSupported(); - mNotificationPulseIntent = PendingIntent.getBroadcast(mContext, 0, - new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName()), - PendingIntent.FLAG_UPDATE_CURRENT); mDisplayStateWhenOn = mDisplayStateSupported ? Display.STATE_DOZE : Display.STATE_ON; mDisplayOff.run(); } @@ -257,9 +254,17 @@ public class DozeService extends DreamService { rescheduleNotificationPulse(true /*predicate*/); } + private PendingIntent notificationPulseIntent(long instance) { + return PendingIntent.getBroadcast(mContext, 0, + new Intent(NOTIFICATION_PULSE_ACTION).setPackage(getPackageName()) + .putExtra(EXTRA_INSTANCE, instance), + PendingIntent.FLAG_UPDATE_CURRENT); + } + private void rescheduleNotificationPulse(boolean predicate) { if (DEBUG) Log.d(TAG, "rescheduleNotificationPulse predicate=" + predicate); - mAlarmManager.cancel(mNotificationPulseIntent); + final PendingIntent notificationPulseIntent = notificationPulseIntent(0); + mAlarmManager.cancel(notificationPulseIntent); if (!predicate) { if (DEBUG) Log.d(TAG, " don't reschedule: predicate is false"); return; @@ -280,8 +285,10 @@ public class DozeService extends DreamService { if (DEBUG) Log.d(TAG, " don't reschedule: delta is " + delta); return; } - if (DEBUG) Log.d(TAG, "Scheduling pulse in " + delta + "ms for " + new Date(time)); - mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, time, mNotificationPulseIntent); + final long instance = time - mNotificationPulseTime; + if (DEBUG) Log.d(TAG, "Scheduling pulse " + instance + " in " + delta + "ms for " + + new Date(time)); + mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, time, notificationPulseIntent(instance)); } private static String triggerEventToString(TriggerEvent event) { @@ -313,7 +320,9 @@ public class DozeService extends DreamService { requestPulse(); } if (NOTIFICATION_PULSE_ACTION.equals(intent.getAction())) { - if (DEBUG) Log.d(mTag, "Received notification pulse intent"); + final long instance = intent.getLongExtra(EXTRA_INSTANCE, -1); + if (DEBUG) Log.d(mTag, "Received notification pulse intent instance=" + instance); + DozeLog.traceNotificationPulse(instance); requestPulse(); rescheduleNotificationPulse(mNotificationLightOn); } @@ -415,11 +424,16 @@ public class DozeService extends DreamService { // reset the notification pulse schedule, but only if we think we were not triggered // by a notification-related vibration final long timeSinceNotification = System.currentTimeMillis() - mNotificationPulseTime; - if (timeSinceNotification < mDozeParameters.getPickupVibrationThreshold()) { + final boolean withinVibrationThreshold = + timeSinceNotification < mDozeParameters.getPickupVibrationThreshold(); + if (withinVibrationThreshold) { if (DEBUG) Log.d(mTag, "Not resetting schedule, recent notification"); } else { resetNotificationResets(); } + if (mSensor.getType() == Sensor.TYPE_PICK_UP_GESTURE) { + DozeLog.tracePickupPulse(withinVibrationThreshold); + } } } } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java index 8d7edb9d38b2..3574877782a1 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileView.java @@ -298,10 +298,11 @@ public class QSTileView extends ViewGroup { if (mDual) { mDualLabel.setText(state.label); mDualLabel.setContentDescription(state.dualLabelContentDescription); + mTopBackgroundView.setContentDescription(state.contentDescription); } else { mLabel.setText(state.label); + setContentDescription(state.contentDescription); } - setContentDescription(state.contentDescription); } public void onStateChanged(QSTile.State state) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BackDropView.java b/packages/SystemUI/src/com/android/systemui/statusbar/BackDropView.java new file mode 100644 index 000000000000..f1eb9febfb33 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BackDropView.java @@ -0,0 +1,65 @@ +/* + * 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; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.widget.FrameLayout; + +/** + * A view who contains media artwork. + */ +public class BackDropView extends FrameLayout +{ + private Runnable mOnVisibilityChangedRunnable; + + public BackDropView(Context context) { + super(context); + } + + public BackDropView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public BackDropView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public BackDropView(Context context, AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + public boolean hasOverlappingRendering() { + return false; + } + + @Override + protected void onVisibilityChanged(View changedView, int visibility) { + super.onVisibilityChanged(changedView, visibility); + if (changedView == this && mOnVisibilityChangedRunnable != null) { + mOnVisibilityChangedRunnable.run(); + } + } + + public void setOnVisibilityChangedRunnable(Runnable runnable) { + mOnVisibilityChangedRunnable = runnable; + } + +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java new file mode 100644 index 000000000000..23534255db11 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ScrimView.java @@ -0,0 +1,123 @@ +/* + * 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; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ValueAnimator; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.PorterDuff; +import android.util.AttributeSet; +import android.view.View; +import android.view.animation.Interpolator; + +/** + * A view which can draw a scrim + */ +public class ScrimView extends View +{ + private int mScrimColor; + private boolean mIsEmpty; + private boolean mDrawAsSrc; + private float mViewAlpha = 1.0f; + private ValueAnimator mAlphaAnimator; + private ValueAnimator.AnimatorUpdateListener mAlphaUpdateListener + = new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + mViewAlpha = (float) animation.getAnimatedValue(); + invalidate(); + } + }; + private AnimatorListenerAdapter mClearAnimatorListener = new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mAlphaAnimator = null; + } + }; + + public ScrimView(Context context) { + this(context, null); + } + + public ScrimView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public ScrimView(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public ScrimView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + protected void onDraw(Canvas canvas) { + if (mDrawAsSrc || !mIsEmpty) { + PorterDuff.Mode mode = mDrawAsSrc ? PorterDuff.Mode.SRC : PorterDuff.Mode.SRC_OVER; + int color = mScrimColor; + color = Color.argb((int) (Color.alpha(color) * mViewAlpha), Color.red(color), + Color.green(color), Color.blue(color)); + canvas.drawColor(color, mode); + } + } + + public void setDrawAsSrc(boolean asSrc) { + mDrawAsSrc = asSrc; + invalidate(); + } + + public void setScrimColor(int color) { + if (color != mScrimColor) { + mIsEmpty = Color.alpha(color) == 0; + mScrimColor = color; + invalidate(); + } + } + + public int getScrimColor() { + return mScrimColor; + } + + @Override + public boolean hasOverlappingRendering() { + return false; + } + + public void setViewAlpha(float alpha) { + if (mAlphaAnimator != null) { + mAlphaAnimator.cancel(); + } + mViewAlpha = alpha; + invalidate(); + } + + public void animateViewAlpha(float alpha, long durationOut, Interpolator interpolator) { + if (mAlphaAnimator != null) { + mAlphaAnimator.cancel(); + } + mAlphaAnimator = ValueAnimator.ofFloat(mViewAlpha, alpha); + mAlphaAnimator.addUpdateListener(mAlphaUpdateListener); + mAlphaAnimator.addListener(mClearAnimatorListener); + mAlphaAnimator.setInterpolator(interpolator); + mAlphaAnimator.setDuration(durationOut); + mAlphaAnimator.start(); + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 873d528c8fe4..67c77236ba78 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -33,6 +33,7 @@ import android.view.animation.Interpolator; import android.widget.FrameLayout; import com.android.systemui.R; +import com.android.systemui.doze.DozeLog; import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.StatusBarState; @@ -347,6 +348,8 @@ public abstract class PanelView extends FrameLayout { if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD) { Log.i(TAG, "Flinging: expand=" + expand); } + DozeLog.traceFling(expand, mTouchAboveFalsingThreshold, + mStatusBar.isFalsingThresholdNeeded()); fling(vel, expand); mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown; if (mUpdateFlingOnLayout) { 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 353c8877d053..5e9a64ccc6ca 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -51,7 +51,9 @@ import android.graphics.ColorFilter; import android.graphics.PixelFormat; import android.graphics.Point; import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; import android.graphics.Rect; +import android.graphics.Xfermode; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.inputmethodservice.InputMethodService; @@ -115,10 +117,12 @@ import com.android.systemui.DemoMode; import com.android.systemui.EventLogTags; import com.android.systemui.FontSizeUtils; import com.android.systemui.R; +import com.android.systemui.doze.DozeLog; import com.android.systemui.doze.DozeService; import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.qs.QSPanel; import com.android.systemui.statusbar.ActivatableNotificationView; +import com.android.systemui.statusbar.BackDropView; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.DismissView; @@ -130,6 +134,7 @@ import com.android.systemui.statusbar.KeyguardIndicationController; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.NotificationOverflowContainer; +import com.android.systemui.statusbar.ScrimView; import com.android.systemui.statusbar.SignalClusterView; import com.android.systemui.statusbar.SpeedBumpView; import com.android.systemui.statusbar.StatusBarIconView; @@ -430,8 +435,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public static final Interpolator ALPHA_IN = new PathInterpolator(0.4f, 0f, 1f, 1f); public static final Interpolator ALPHA_OUT = new PathInterpolator(0f, 0f, 0.8f, 1f); - private FrameLayout mBackdrop; + private BackDropView mBackdrop; private ImageView mBackdropFront, mBackdropBack; + private PorterDuffXfermode mSrcXferMode = new PorterDuffXfermode(PorterDuff.Mode.SRC); + private PorterDuffXfermode mSrcOverXferMode = new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER); private MediaSessionManager mMediaSessionManager; private MediaController mMediaController; @@ -722,8 +729,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStackScroller.setDismissView(mDismissView); mExpandedContents = mStackScroller; - mScrimController = new ScrimController(mStatusBarWindow.findViewById(R.id.scrim_behind), - mStatusBarWindow.findViewById(R.id.scrim_in_front)); + mBackdrop = (BackDropView) mStatusBarWindow.findViewById(R.id.backdrop); + mBackdropFront = (ImageView) mBackdrop.findViewById(R.id.backdrop_front); + mBackdropBack = (ImageView) mBackdrop.findViewById(R.id.backdrop_back); + + ScrimView scrimBehind = (ScrimView) mStatusBarWindow.findViewById(R.id.scrim_behind); + ScrimView scrimInFront = (ScrimView) mStatusBarWindow.findViewById(R.id.scrim_in_front); + mScrimController = new ScrimController(scrimBehind, scrimInFront); + mScrimController.setBackDropView(mBackdrop); mStatusBarView.setScrimController(mScrimController); mHeader = (StatusBarHeaderView) mStatusBarWindow.findViewById(R.id.header); @@ -862,10 +875,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, }); } - mBackdrop = (FrameLayout) mStatusBarWindow.findViewById(R.id.backdrop); - mBackdropFront = (ImageView) mBackdrop.findViewById(R.id.backdrop_front); - mBackdropBack = (ImageView) mBackdrop.findViewById(R.id.backdrop_back); - // User info. Trigger first load. mHeader.setUserInfoController(mUserInfoController); mKeyguardStatusBar.setUserInfoController(mUserInfoController); @@ -1851,7 +1860,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } if (metaDataChanged) { if (mBackdropBack.getDrawable() != null) { - mBackdropFront.setImageDrawable(mBackdropBack.getDrawable()); + Drawable drawable = mBackdropBack.getDrawable(); + mBackdropFront.setImageDrawable(drawable); + mBackdropFront.getDrawable().mutate().setXfermode(mSrcOverXferMode); mBackdropFront.setAlpha(1f); mBackdropFront.setVisibility(View.VISIBLE); } else { @@ -1866,6 +1877,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } else { mBackdropBack.setImageBitmap(artworkBitmap); } + mBackdropBack.getDrawable().mutate().setXfermode(mSrcXferMode); if (mBackdropFront.getVisibility() == View.VISIBLE) { if (DEBUG_MEDIA) { @@ -2101,8 +2113,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public boolean isFalsingThresholdNeeded() { boolean onKeyguard = getBarState() == StatusBarState.KEYGUARD; - boolean isMethodInSecure = mUnlockMethodCache.isMethodInsecure(); - return onKeyguard && isMethodInSecure; + boolean isMethodInsecure = mUnlockMethodCache.isMethodInsecure(); + return onKeyguard && (isMethodInsecure || mDozing); } @Override // NotificationData.Environment @@ -2874,6 +2886,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNotificationPanel.dump(fd, pw, args); } + DozeLog.dump(pw); + if (DUMPTRUCK) { synchronized (mNotificationData) { mNotificationData.dump(pw, " "); @@ -4108,6 +4122,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mCurrentDozeService = dozeService; if (!mDozing) { mDozing = true; + DozeLog.traceDozing(mContext, mDozing); updateDozingState(); } mCurrentDozeService.startDozing(); @@ -4125,6 +4140,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } if (mDozing) { mDozing = false; + DozeLog.traceDozing(mContext, mDozing); updateDozingState(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 3ff11d271f8c..a502470480d5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -21,7 +21,6 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Color; -import android.graphics.drawable.ColorDrawable; import android.util.Log; import android.view.View; import android.view.ViewTreeObserver; @@ -30,6 +29,9 @@ import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import com.android.systemui.R; +import com.android.systemui.doze.DozeLog; +import com.android.systemui.statusbar.BackDropView; +import com.android.systemui.statusbar.ScrimView; /** * Controls both the scrim behind the notifications and in front of the notifications (when a @@ -47,8 +49,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { private static final float SCRIM_IN_FRONT_ALPHA = 0.75f; private static final int TAG_KEY_ANIM = R.id.scrim; - private final View mScrimBehind; - private final View mScrimInFront; + private final ScrimView mScrimBehind; + private final ScrimView mScrimInFront; private final UnlockMethodCache mUnlockMethodCache; private final DozeParameters mDozeParameters; @@ -69,8 +71,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { private long mPulseEndTime; private final Interpolator mInterpolator = new DecelerateInterpolator(); private final Interpolator mLinearOutSlowInInterpolator; + private BackDropView mBackDropView; - public ScrimController(View scrimBehind, View scrimInFront) { + public ScrimController(ScrimView scrimBehind, ScrimView scrimInFront) { mScrimBehind = scrimBehind; mScrimInFront = scrimInFront; final Context context = scrimBehind.getContext(); @@ -229,17 +232,17 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { } } - private void setScrimColor(View scrim, float alpha) { + private void setScrimColor(ScrimView scrim, float alpha) { int color = Color.argb((int) (alpha * 255), 0, 0, 0); if (mAnimateChange) { startScrimAnimation(scrim, color); } else { - scrim.setBackgroundColor(color); + scrim.setScrimColor(color); } } - private void startScrimAnimation(final View scrim, int targetColor) { - int current = getBackgroundAlpha(scrim); + private void startScrimAnimation(final ScrimView scrim, int targetColor) { + int current = Color.alpha(scrim.getScrimColor()); int target = Color.alpha(targetColor); if (current == targetColor) { return; @@ -253,7 +256,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { @Override public void onAnimationUpdate(ValueAnimator animation) { int value = (int) animation.getAnimatedValue(); - scrim.setBackgroundColor(Color.argb(value, 0, 0, 0)); + scrim.setScrimColor(Color.argb(value, 0, 0, 0)); } }); anim.setInterpolator(mAnimateKeyguardFadingOut @@ -277,15 +280,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { mAnimationStarted = true; } - private int getBackgroundAlpha(View scrim) { - if (scrim.getBackground() instanceof ColorDrawable) { - ColorDrawable drawable = (ColorDrawable) scrim.getBackground(); - return Color.alpha(drawable.getColor()); - } else { - return 0; - } - } - @Override public boolean onPreDraw() { mScrimBehind.getViewTreeObserver().removeOnPreDrawListener(this); @@ -309,6 +303,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { public void run() { if (DEBUG) Log.d(TAG, "Pulse in, mDozing=" + mDozing); if (!mDozing) return; + DozeLog.tracePulseStart(); mDurationOverride = mDozeParameters.getPulseInDuration(); mAnimationDelay = 0; mAnimateChange = true; @@ -343,7 +338,24 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener { @Override public void run() { if (DEBUG) Log.d(TAG, "Pulse out finished"); + DozeLog.tracePulseFinish(); mPulseEndTime = 0; } }; + + public void setBackDropView(BackDropView backDropView) { + mBackDropView = backDropView; + mBackDropView.setOnVisibilityChangedRunnable(new Runnable() { + @Override + public void run() { + updateScrimBehindDrawingMode(); + } + }); + updateScrimBehindDrawingMode(); + } + + private void updateScrimBehindDrawingMode() { + boolean asSrc = mBackDropView.getVisibility() != View.VISIBLE; + mScrimBehind.setDrawAsSrc(asSrc); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 78554525e720..89ce257cec08 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -20,12 +20,17 @@ import android.app.StatusBarManager; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; import android.graphics.Rect; +import android.os.IBinder; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewRootImpl; +import android.view.WindowManager; +import android.view.WindowManagerGlobal; import android.widget.FrameLayout; import com.android.systemui.R; @@ -45,11 +50,14 @@ public class StatusBarWindowView extends FrameLayout { private View mBrightnessMirror; PhoneStatusBar mService; + private final Paint mTransparentSrcPaint = new Paint(); public StatusBarWindowView(Context context, AttributeSet attrs) { super(context, attrs); setMotionEventSplittingEnabled(false); - setWillNotDraw(!DEBUG); + setWillNotDraw(false); + mTransparentSrcPaint.setColor(0); + mTransparentSrcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); } @Override @@ -93,6 +101,15 @@ public class StatusBarWindowView extends FrameLayout { if (root != null) { root.setDrawDuringWindowsAnimating(true); } + + // We need to ensure that our window doesn't suffer from overdraw which would normally + // occur if our window is translucent. Since we are drawing the whole window anyway with + // the scrim, we don't need the window to be cleared in the beginning. + IBinder windowToken = getWindowToken(); + WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams(); + lp.token = windowToken; + setLayoutParams(lp); + WindowManagerGlobal.getInstance().changeCanvasOpacity(windowToken, true); } @Override @@ -182,6 +199,24 @@ public class StatusBarWindowView extends FrameLayout { @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); + // We need to ensure that our window is always drawn fully even when we have paddings, + // since we simulate it to be opaque. + int paddedBottom = getHeight() - getPaddingBottom(); + int paddedRight = getWidth() - getPaddingRight(); + if (getPaddingTop() != 0) { + canvas.drawRect(0, 0, getWidth(), getPaddingTop(), mTransparentSrcPaint); + } + if (getPaddingBottom() != 0) { + canvas.drawRect(0, paddedBottom, getWidth(), getHeight(), mTransparentSrcPaint); + } + if (getPaddingLeft() != 0) { + canvas.drawRect(0, getPaddingTop(), getPaddingLeft(), paddedBottom, + mTransparentSrcPaint); + } + if (getPaddingRight() != 0) { + canvas.drawRect(paddedRight, getPaddingTop(), getWidth(), paddedBottom, + mTransparentSrcPaint); + } if (DEBUG) { Paint pt = new Paint(); pt.setColor(0x80FFFF00); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java index 7bd2e5c6df04..895af628e1d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java @@ -17,11 +17,11 @@ package com.android.systemui.statusbar.policy; import com.android.systemui.R; +import com.android.systemui.statusbar.ScrimView; import com.android.systemui.statusbar.phone.PhoneStatusBar; import com.android.systemui.statusbar.phone.StatusBarWindowView; import android.view.View; -import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.widget.FrameLayout; @@ -33,26 +33,26 @@ public class BrightnessMirrorController { public long TRANSITION_DURATION_OUT = 150; public long TRANSITION_DURATION_IN = 200; - private final View mScrimBehind; + private final ScrimView mScrimBehind; private final View mBrightnessMirror; private final View mPanelHolder; private final int[] mInt2Cache = new int[2]; public BrightnessMirrorController(StatusBarWindowView statusBarWindow) { - mScrimBehind = statusBarWindow.findViewById(R.id.scrim_behind); + mScrimBehind = (ScrimView) statusBarWindow.findViewById(R.id.scrim_behind); mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror); mPanelHolder = statusBarWindow.findViewById(R.id.panel_holder); } public void showMirror() { mBrightnessMirror.setVisibility(View.VISIBLE); - outAnimation(mScrimBehind.animate()); + mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, PhoneStatusBar.ALPHA_OUT); outAnimation(mPanelHolder.animate()) .withLayer(); } public void hideMirror() { - inAnimation(mScrimBehind.animate()); + mScrimBehind.animateViewAlpha(1.0f, TRANSITION_DURATION_IN, PhoneStatusBar.ALPHA_IN); inAnimation(mPanelHolder.animate()) .withLayer() .withEndAction(new Runnable() { diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 341911950e27..00026dc58338 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1241,6 +1241,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { st.decorView = new DecorView(getContext(), st.featureId); st.gravity = Gravity.CENTER | Gravity.BOTTOM; st.setStyle(getContext()); + TypedArray a = getContext().obtainStyledAttributes(null, + R.styleable.Window, 0, st.listPresenterTheme); + final float elevation = a.getDimension(R.styleable.Window_windowElevation, 0); + if (elevation != 0) { + st.decorView.setElevation(elevation); + } + a.recycle(); return true; } @@ -2887,32 +2894,35 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mActionModeView.getLayoutParams() instanceof MarginLayoutParams) { MarginLayoutParams mlp = (MarginLayoutParams) mActionModeView.getLayoutParams(); boolean mlpChanged = false; - final boolean nonOverlayShown = - (getLocalFeatures() & (1 << FEATURE_ACTION_MODE_OVERLAY)) == 0 - && mActionModeView.isShown(); - if (nonOverlayShown) { - // set top margin to top insets, show status guard + if (mActionModeView.isShown()) { + final boolean nonOverlay = (getLocalFeatures() + & (1 << FEATURE_ACTION_MODE_OVERLAY)) == 0; if (mlp.topMargin != insets.getSystemWindowInsetTop()) { mlpChanged = true; mlp.topMargin = insets.getSystemWindowInsetTop(); - if (mStatusGuard == null) { - mStatusGuard = new View(mContext); - mStatusGuard.setBackgroundColor(mContext.getResources() - .getColor(R.color.input_method_navigation_guard)); - addView(mStatusGuard, indexOfChild(mStatusColorView), - new LayoutParams(LayoutParams.MATCH_PARENT, mlp.topMargin, - Gravity.START | Gravity.TOP)); - } else { - LayoutParams lp = (LayoutParams) mStatusGuard.getLayoutParams(); - if (lp.height != mlp.topMargin) { - lp.height = mlp.topMargin; - mStatusGuard.setLayoutParams(lp); + + // Only show status guard for non-overlay modes. + if (nonOverlay) { + if (mStatusGuard == null) { + mStatusGuard = new View(mContext); + mStatusGuard.setBackgroundColor(mContext.getResources() + .getColor(R.color.input_method_navigation_guard)); + addView(mStatusGuard, indexOfChild(mStatusColorView), + new LayoutParams(LayoutParams.MATCH_PARENT, + mlp.topMargin, + Gravity.START | Gravity.TOP)); + } else { + LayoutParams lp = (LayoutParams) mStatusGuard.getLayoutParams(); + if (lp.height != mlp.topMargin) { + lp.height = mlp.topMargin; + mStatusGuard.setLayoutParams(lp); + } } } } insets = insets.consumeSystemWindowInsets( - false, true /* top */, false, false); - showStatusGuard = true; + false, nonOverlay /* top */, false, false); + showStatusGuard = nonOverlay; } else { // reset top margin if (mlp.topMargin != 0) { diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index d38074fb7496..3f83a0258884 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -24,6 +24,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import android.os.Build; import android.os.DeadObjectException; import android.os.Handler; import android.os.Looper; @@ -590,6 +591,8 @@ public final class ActiveServices { r.cancelNotification(); r.foregroundId = 0; r.foregroundNoti = null; + } else if (r.appInfo.targetSdkVersion >= Build.VERSION_CODES.L) { + r.stripForegroundServiceFlagFromNotification(); } } } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 741cffe8685a..190c16c06740 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -7528,8 +7528,8 @@ public final class ActivityManagerService extends ActivityManagerNative // Does the caller have this permission on the URI? if (!checkHoldingPermissionsLocked(pm, pi, grantUri, callingUid, modeFlags)) { - // Have they don't have direct access to the URI, then revoke any URI - // permissions that have been granted to them. + // If they don't have direct access to the URI, then revoke any + // ownerless URI permissions that have been granted to them. final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get(callingUid); if (perms != null) { boolean persistChanged = false; @@ -7538,10 +7538,10 @@ public final class ActivityManagerService extends ActivityManagerNative if (perm.uri.sourceUserId == grantUri.sourceUserId && perm.uri.uri.isPathPrefixMatch(grantUri.uri)) { if (DEBUG_URI_PERMISSION) - Slog.v(TAG, - "Revoking " + perm.targetUid + " permission to " + perm.uri); + Slog.v(TAG, "Revoking non-owned " + perm.targetUid + + " permission to " + perm.uri); persistChanged |= perm.revokeModes( - modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); + modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, false); if (perm.modeFlags == 0) { it.remove(); } @@ -7573,7 +7573,7 @@ public final class ActivityManagerService extends ActivityManagerNative Slog.v(TAG, "Revoking " + perm.targetUid + " permission to " + perm.uri); persistChanged |= perm.revokeModes( - modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); + modeFlags | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true); if (perm.modeFlags == 0) { it.remove(); } @@ -7661,8 +7661,8 @@ public final class ActivityManagerService extends ActivityManagerNative // Only inspect grants matching package if (packageName == null || perm.sourcePkg.equals(packageName) || perm.targetPkg.equals(packageName)) { - persistChanged |= perm.revokeModes( - persistable ? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); + persistChanged |= perm.revokeModes(persistable + ? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true); // Only remove when no modes remain; any persisted grants // will keep this alive. diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java index 0a66a5c8aab2..d4a378b5687d 100644 --- a/services/core/java/com/android/server/am/ServiceRecord.java +++ b/services/core/java/com/android/server/am/ServiceRecord.java @@ -517,6 +517,31 @@ final class ServiceRecord extends Binder { }); } } + + public void stripForegroundServiceFlagFromNotification() { + if (foregroundId == 0) { + return; + } + + final int localForegroundId = foregroundId; + final int localUserId = userId; + final String localPackageName = packageName; + + // Do asynchronous communication with notification manager to + // avoid deadlocks. + ams.mHandler.post(new Runnable() { + @Override + public void run() { + NotificationManagerInternal nmi = LocalServices.getService( + NotificationManagerInternal.class); + if (nmi == null) { + return; + } + nmi.removeForegroundServiceFlagFromNotification(localPackageName, localForegroundId, + localUserId); + } + }); + } public void clearDeliveredStartsLocked() { for (int i=deliveredStarts.size()-1; i>=0; i--) { diff --git a/services/core/java/com/android/server/am/UriPermission.java b/services/core/java/com/android/server/am/UriPermission.java index 284086dcbd79..91daf776a061 100644 --- a/services/core/java/com/android/server/am/UriPermission.java +++ b/services/core/java/com/android/server/am/UriPermission.java @@ -180,7 +180,7 @@ final class UriPermission { /** * @return if mode changes should trigger persisting. */ - boolean revokeModes(int modeFlags) { + boolean revokeModes(int modeFlags, boolean includingOwners) { final boolean persistable = (modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0; modeFlags &= (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); @@ -193,7 +193,7 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; - if (mReadOwners != null) { + if (mReadOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_READ_URI_PERMISSION; for (UriPermissionOwner r : mReadOwners) { r.removeReadPermission(this); @@ -207,7 +207,7 @@ final class UriPermission { persistedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } globalModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; - if (mWriteOwners != null) { + if (mWriteOwners != null && includingOwners) { ownedModeFlags &= ~Intent.FLAG_GRANT_WRITE_URI_PERMISSION; for (UriPermissionOwner r : mWriteOwners) { r.removeWritePermission(this); diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index fab064cdeaa4..fb98236ca4cc 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -82,10 +82,6 @@ public class NetworkMonitor extends StateMachine { private static final String PERMISSION_ACCESS_NETWORK_CONDITIONS = "android.permission.ACCESS_NETWORK_CONDITIONS"; - // Intent broadcast when user selects sign-in notification. - private static final String ACTION_SIGN_IN_REQUESTED = - "android.net.netmon.sign_in_requested"; - // Keep these in sync with CaptivePortalLoginActivity.java. // Intent broadcast from CaptivePortalLogin indicating sign-in is complete. // Extras: @@ -404,38 +400,42 @@ public class NetworkMonitor extends StateMachine { } } - private class UserPromptedState extends State { - private class UserRespondedBroadcastReceiver extends BroadcastReceiver { - private final int mToken; - UserRespondedBroadcastReceiver(int token) { - mToken = token; - } - @Override - public void onReceive(Context context, Intent intent) { - if (Integer.parseInt(intent.getStringExtra(Intent.EXTRA_TEXT)) == - mNetworkAgentInfo.network.netId) { - sendMessage(obtainMessage(CMD_USER_WANTS_SIGN_IN, mToken)); - } - } + // BroadcastReceiver that waits for a particular Intent and then posts a message. + private class CustomIntentReceiver extends BroadcastReceiver { + private final Message mMessage; + private final String mAction; + CustomIntentReceiver(String action, int token, int message) { + mMessage = obtainMessage(message, token); + mAction = action + "_" + mNetworkAgentInfo.network.netId + "_" + token; + mContext.registerReceiver(this, new IntentFilter(mAction)); + } + public PendingIntent getPendingIntent() { + return PendingIntent.getBroadcast(mContext, 0, new Intent(mAction), 0); + } + @Override + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals(mAction)) sendMessage(mMessage); } + } + + private class UserPromptedState extends State { + // Intent broadcast when user selects sign-in notification. + private static final String ACTION_SIGN_IN_REQUESTED = + "android.net.netmon.sign_in_requested"; - private UserRespondedBroadcastReceiver mUserRespondedBroadcastReceiver; + private CustomIntentReceiver mUserRespondedBroadcastReceiver; @Override public void enter() { mConnectivityServiceHandler.sendMessage(obtainMessage(EVENT_NETWORK_TESTED, NETWORK_TEST_RESULT_INVALID, 0, mNetworkAgentInfo)); // Wait for user to select sign-in notifcation. - mUserRespondedBroadcastReceiver = new UserRespondedBroadcastReceiver( - ++mUserPromptedToken); - IntentFilter filter = new IntentFilter(ACTION_SIGN_IN_REQUESTED); - mContext.registerReceiver(mUserRespondedBroadcastReceiver, filter); + mUserRespondedBroadcastReceiver = new CustomIntentReceiver(ACTION_SIGN_IN_REQUESTED, + ++mUserPromptedToken, CMD_USER_WANTS_SIGN_IN); // Initiate notification to sign-in. - Intent intent = new Intent(ACTION_SIGN_IN_REQUESTED); - intent.putExtra(Intent.EXTRA_TEXT, String.valueOf(mNetworkAgentInfo.network.netId)); Message message = obtainMessage(EVENT_PROVISIONING_NOTIFICATION, 1, mNetworkAgentInfo.network.netId, - PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); + mUserRespondedBroadcastReceiver.getPendingIntent()); mConnectivityServiceHandler.sendMessage(message); } @@ -530,33 +530,15 @@ public class NetworkMonitor extends StateMachine { private class LingeringState extends State { private static final String ACTION_LINGER_EXPIRED = "android.net.netmon.lingerExpired"; - private static final String EXTRA_NETID = "lingerExpiredNetId"; - private static final String EXTRA_TOKEN = "lingerExpiredToken"; - private class LingerExpiredBroadcastReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - if (intent.getAction().equals(ACTION_LINGER_EXPIRED) && - Integer.parseInt(intent.getStringExtra(EXTRA_NETID)) == - mNetworkAgentInfo.network.netId) { - sendMessage(CMD_LINGER_EXPIRED, - Integer.parseInt(intent.getStringExtra(EXTRA_TOKEN))); - } - } - } - - private BroadcastReceiver mBroadcastReceiver; + private CustomIntentReceiver mBroadcastReceiver; private PendingIntent mIntent; @Override public void enter() { - mBroadcastReceiver = new LingerExpiredBroadcastReceiver(); - mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(ACTION_LINGER_EXPIRED)); - - Intent intent = new Intent(ACTION_LINGER_EXPIRED, null); - intent.putExtra(EXTRA_NETID, String.valueOf(mNetworkAgentInfo.network.netId)); - intent.putExtra(EXTRA_TOKEN, String.valueOf(++mLingerToken)); - mIntent = PendingIntent.getBroadcast(mContext, 0, intent, 0); + mBroadcastReceiver = new CustomIntentReceiver(ACTION_LINGER_EXPIRED, ++mLingerToken, + CMD_LINGER_EXPIRED); + mIntent = mBroadcastReceiver.getPendingIntent(); long wakeupTime = SystemClock.elapsedRealtime() + mLingerDelayMs; mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP, wakeupTime, // Give a specific window so we aren't subject to unknown inexactitude. diff --git a/services/core/java/com/android/server/connectivity/PacManager.java b/services/core/java/com/android/server/connectivity/PacManager.java index 63178eb0e06b..07fe7ba79582 100644 --- a/services/core/java/com/android/server/connectivity/PacManager.java +++ b/services/core/java/com/android/server/connectivity/PacManager.java @@ -71,7 +71,7 @@ public class PacManager { public static final String KEY_PROXY = "keyProxy"; private String mCurrentPac; @GuardedBy("mProxyLock") - private Uri mPacUrl; + private Uri mPacUrl = Uri.EMPTY; private AlarmManager mAlarmManager; @GuardedBy("mProxyLock") @@ -175,7 +175,7 @@ public class PacManager { } else { getAlarmManager().cancel(mPacRefreshIntent); synchronized (mProxyLock) { - mPacUrl = null; + mPacUrl = Uri.EMPTY; mCurrentPac = null; if (mProxyService != null) { try { diff --git a/services/core/java/com/android/server/notification/NotificationManagerInternal.java b/services/core/java/com/android/server/notification/NotificationManagerInternal.java index b695b6819b4f..c6b0d369e4dd 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerInternal.java +++ b/services/core/java/com/android/server/notification/NotificationManagerInternal.java @@ -21,4 +21,6 @@ import android.app.Notification; public interface NotificationManagerInternal { void enqueueNotification(String pkg, String basePkg, int callingUid, int callingPid, String tag, int id, Notification notification, int[] idReceived, int userId); + + void removeForegroundServiceFlagFromNotification(String pkg, int notificationId, int userId); } diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 14587e63ace6..2829e2b7aa2c 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1610,6 +1610,30 @@ public class NotificationManagerService extends SystemService { enqueueNotificationInternal(pkg, opPkg, callingUid, callingPid, tag, id, notification, idReceived, userId); } + + @Override + public void removeForegroundServiceFlagFromNotification(String pkg, int notificationId, + int userId) { + checkCallerIsSystem(); + synchronized (mNotificationList) { + int i = indexOfNotificationLocked(pkg, null, notificationId, userId); + if (i < 0) { + Log.d(TAG, "stripForegroundServiceFlag: Could not find notification with " + + "pkg=" + pkg + " / id=" + notificationId + " / userId=" + userId); + return; + } + NotificationRecord r = mNotificationList.get(i); + StatusBarNotification sbn = r.sbn; + // NoMan adds flags FLAG_NO_CLEAR and FLAG_ONGOING_EVENT when it sees + // FLAG_FOREGROUND_SERVICE. Hence it's not enough to remove FLAG_FOREGROUND_SERVICE, + // we have to revert to the flags we received initially *and* force remove + // FLAG_FOREGROUND_SERVICE. + sbn.getNotification().flags = + (r.mOriginalFlags & ~Notification.FLAG_FOREGROUND_SERVICE); + mRankingHelper.sort(mNotificationList); + mListeners.notifyPostedLocked(sbn, sbn /* oldSbn */); + } + } }; void enqueueNotificationInternal(final String pkg, final String opPkg, final int callingUid, diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index fd34aa5fbcb3..ea6f2db0efc1 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -45,6 +45,8 @@ import java.util.Objects; */ public final class NotificationRecord { final StatusBarNotification sbn; + final int mOriginalFlags; + NotificationUsageStats.SingleNotificationStats stats; boolean isCanceled; int score; @@ -73,6 +75,7 @@ public final class NotificationRecord { { this.sbn = sbn; this.score = score; + mOriginalFlags = sbn.getNotification().flags; mRankingTimeMs = calculateRankingTimeMs(0L); } diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 79c9955cfa37..75fef27fb42c 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -2161,7 +2161,8 @@ public class PackageManagerService extends IPackageManager.Stub { userId); } if (mResolveComponentName.equals(component)) { - return mResolveActivity; + return PackageParser.generateActivityInfo(mResolveActivity, flags, + new PackageUserState(), userId); } } return null; diff --git a/services/core/jni/com_android_server_UsbHostManager.cpp b/services/core/jni/com_android_server_UsbHostManager.cpp index 65a28c0410f8..32c3f95636b7 100644 --- a/services/core/jni/com_android_server_UsbHostManager.cpp +++ b/services/core/jni/com_android_server_UsbHostManager.cpp @@ -74,9 +74,9 @@ static int usb_device_added(const char *devname, void* client_data) { char *serial = usb_device_get_serial(device); jstring deviceName = env->NewStringUTF(devname); - jstring manufacturerName = env->NewStringUTF(manufacturer); - jstring productName = env->NewStringUTF(product); - jstring serialNumber = env->NewStringUTF(serial); + jstring manufacturerName = AndroidRuntime::NewStringLatin1(env, manufacturer); + jstring productName = AndroidRuntime::NewStringLatin1(env, product); + jstring serialNumber = AndroidRuntime::NewStringLatin1(env, serial); jboolean result = env->CallBooleanMethod(thiz, method_beginUsbDeviceAdded, deviceName, usb_device_get_vendor_id(device), usb_device_get_product_id(device), @@ -99,7 +99,7 @@ static int usb_device_added(const char *devname, void* client_data) { if (desc->bDescriptorType == USB_DT_CONFIG) { struct usb_config_descriptor *config = (struct usb_config_descriptor *)desc; char *name = usb_device_get_string(device, config->iConfiguration); - jstring configName = env->NewStringUTF(name); + jstring configName = AndroidRuntime::NewStringLatin1(env, name); env->CallVoidMethod(thiz, method_addUsbConfiguration, config->bConfigurationValue, configName, config->bmAttributes, @@ -110,7 +110,7 @@ static int usb_device_added(const char *devname, void* client_data) { } else if (desc->bDescriptorType == USB_DT_INTERFACE) { struct usb_interface_descriptor *interface = (struct usb_interface_descriptor *)desc; char *name = usb_device_get_string(device, interface->iInterface); - jstring interfaceName = env->NewStringUTF(name); + jstring interfaceName = AndroidRuntime::NewStringLatin1(env, name); env->CallVoidMethod(thiz, method_addUsbInterface, interface->bInterfaceNumber, interfaceName, interface->bAlternateSetting, diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 95332bc60718..59d3dc801b10 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -17,6 +17,7 @@ package com.android.server.devicepolicy; import static android.Manifest.permission.MANAGE_CA_CERTIFICATES; +import static android.content.pm.PackageManager.GET_UNINSTALLED_PACKAGES; import android.accessibilityservice.AccessibilityServiceInfo; import android.accounts.AccountManager; @@ -4661,7 +4662,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { ActiveAdmin activeAdmin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); boolean isDeviceOwner = isDeviceOwner(activeAdmin.info.getPackageName()); - if (!isDeviceOwner && DEVICE_OWNER_USER_RESTRICTIONS.contains(key)) { + if (!isDeviceOwner && userHandle != UserHandle.USER_OWNER + && DEVICE_OWNER_USER_RESTRICTIONS.contains(key)) { throw new SecurityException("Profile owners cannot set user restriction " + key); } boolean alreadyRestricted = mUserManager.hasUserRestriction(key, user); @@ -4801,17 +4803,17 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { long id = Binder.clearCallingIdentity(); try { - UserManager um = UserManager.get(mContext); - if (!um.getUserInfo(userId).isManagedProfile()) { - throw new IllegalStateException( - "Only call this method from a managed profile."); + if (DBG) { + Slog.v(LOG_TAG, "installing " + packageName + " for " + + userId); } + UserManager um = UserManager.get(mContext); UserInfo primaryUser = um.getProfileParent(userId); - if (DBG) { - Slog.v(LOG_TAG, "installing " + packageName + " for " - + userId); + // Call did not come from a managed profile + if (primaryUser == null) { + primaryUser = um.getUserInfo(userId); } IPackageManager pm = AppGlobals.getPackageManager(); @@ -4847,13 +4849,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { try { UserManager um = UserManager.get(mContext); - if (!um.getUserInfo(userId).isManagedProfile()) { - throw new IllegalStateException( - "Only call this method from a managed profile."); - } - UserInfo primaryUser = um.getProfileParent(userId); + // Call did not come from a managed profile. + if (primaryUser == null) { + primaryUser = um.getUserInfo(userId); + } + IPackageManager pm = AppGlobals.getPackageManager(); List<ResolveInfo> activitiesToEnable = pm.queryIntentActivities(intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), @@ -4890,7 +4892,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { private boolean isSystemApp(IPackageManager pm, String packageName, int userId) throws RemoteException { - ApplicationInfo appInfo = pm.getApplicationInfo(packageName, 0, userId); + ApplicationInfo appInfo = pm.getApplicationInfo(packageName, GET_UNINSTALLED_PACKAGES, + userId); return (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) > 0; } diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index b0b6fb93dcfa..a71161adda37 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -161,7 +161,7 @@ public final class Call { /** * @return For a {@link #STATE_DISCONNECTED} {@code Call}, the disconnect cause expressed - * by {@link android.telecomm.DisconnectCause}. + * by {@link android.telecom.DisconnectCause}. */ public DisconnectCause getDisconnectCause() { return mDisconnectCause; diff --git a/telecomm/java/android/telecom/DisconnectCause.java b/telecomm/java/android/telecom/DisconnectCause.java index cae115db03a2..9be01380956a 100644 --- a/telecomm/java/android/telecom/DisconnectCause.java +++ b/telecomm/java/android/telecom/DisconnectCause.java @@ -85,6 +85,17 @@ public final class DisconnectCause implements Parcelable { /** * Creates a new DisconnectCause. + * @param label The localized label to show to the user to explain the disconnect. + * @param code The code for the disconnect cause. + * @param description The localized description to show to the user to explain the disconnect. + * @param reason The reason for the disconnect. + */ + public DisconnectCause(int code, CharSequence label, CharSequence description, String reason) { + this(code, label, description, reason, ToneGenerator.TONE_UNKNOWN); + } + + /** + * Creates a new DisconnectCause. * * @param code The code for the disconnect cause. * @param label The localized label to show to the user to explain the disconnect. diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index afec5edd3f0f..d60520284fa2 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -781,12 +781,18 @@ status_t massageManifest(Bundle* bundle, sp<XMLNode> root) if (!addTagAttribute(root, RESOURCES_ANDROID_NAMESPACE, "versionName", bundle->getVersionName(), errorOnFailedInsert, replaceVersion)) { return UNKNOWN_ERROR; + } else { + const XMLNode::attribute_entry* attr = root->getAttribute( + String16(RESOURCES_ANDROID_NAMESPACE), String16("versionName")); + if (attr != NULL) { + bundle->setVersionName(strdup(String8(attr->string).string())); + } } + sp<XMLNode> vers = root->getChildElement(String16(), String16("uses-sdk")); if (bundle->getMinSdkVersion() != NULL || bundle->getTargetSdkVersion() != NULL || bundle->getMaxSdkVersion() != NULL) { - sp<XMLNode> vers = root->getChildElement(String16(), String16("uses-sdk")); if (vers == NULL) { vers = XMLNode::newElement(root->getFilename(), String16(), String16("uses-sdk")); root->insertChildAt(vers, 0); @@ -806,6 +812,14 @@ status_t massageManifest(Bundle* bundle, sp<XMLNode> root) } } + if (vers != NULL) { + const XMLNode::attribute_entry* attr = vers->getAttribute( + String16(RESOURCES_ANDROID_NAMESPACE), String16("minSdkVersion")); + if (attr != NULL) { + bundle->setMinSdkVersion(strdup(String8(attr->string).string())); + } + } + if (bundle->getPlatformBuildVersionCode() != "") { if (!addTagAttribute(root, "", "platformBuildVersionCode", bundle->getPlatformBuildVersionCode(), errorOnFailedInsert, true)) { @@ -973,8 +987,8 @@ static ssize_t extractPlatformBuildVersion(ResXMLTree& tree, Bundle* bundle) { static ssize_t extractPlatformBuildVersion(AssetManager& assets, Bundle* bundle) { int32_t cookie = getPlatformAssetCookie(assets); if (cookie == 0) { - fprintf(stderr, "ERROR: Platform package not found\n"); - return UNKNOWN_ERROR; + // No platform was loaded. + return NO_ERROR; } ResXMLTree tree; @@ -1500,6 +1514,10 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets, sp<ApkBuil return err; } + if (table.modifyForCompat(bundle) != NO_ERROR) { + return UNKNOWN_ERROR; + } + //block.restart(); //printXMLBlock(&block); diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index 8341de6c4ba5..8c9efc94b0dd 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -12,6 +12,7 @@ #include <androidfw/ResourceTypes.h> #include <utils/ByteOrder.h> +#include <utils/TypeHelpers.h> #include <stdarg.h> #define NOISY(x) //x @@ -3287,6 +3288,18 @@ ResourceTable::Item::Item(const SourcePos& _sourcePos, } } +ResourceTable::Entry::Entry(const Entry& entry) + : RefBase() + , mName(entry.mName) + , mParent(entry.mParent) + , mType(entry.mType) + , mItem(entry.mItem) + , mItemFormat(entry.mItemFormat) + , mBag(entry.mBag) + , mNameIndex(entry.mNameIndex) + , mParentId(entry.mParentId) + , mPos(entry.mPos) {} + status_t ResourceTable::Entry::makeItABag(const SourcePos& sourcePos) { if (mType == TYPE_BAG) { @@ -3372,6 +3385,17 @@ status_t ResourceTable::Entry::addToBag(const SourcePos& sourcePos, return NO_ERROR; } +status_t ResourceTable::Entry::removeFromBag(const String16& key) { + if (mType != Entry::TYPE_BAG) { + return NO_ERROR; + } + + if (mBag.removeItem(key) >= 0) { + return NO_ERROR; + } + return UNKNOWN_ERROR; +} + status_t ResourceTable::Entry::emptyBag(const SourcePos& sourcePos) { status_t err = makeItABag(sourcePos); @@ -4113,3 +4137,175 @@ bool ResourceTable::getItemValue( } return res; } + +/** + * Returns true if the given attribute ID comes from + * a platform version from or after L. + */ +bool ResourceTable::isAttributeFromL(uint32_t attrId) { + const uint32_t baseAttrId = 0x010103f7; + if ((attrId & 0xffff0000) != (baseAttrId & 0xffff0000)) { + return false; + } + + uint32_t specFlags; + if (!mAssets->getIncludedResources().getResourceFlags(attrId, &specFlags)) { + return false; + } + + return (specFlags & ResTable_typeSpec::SPEC_PUBLIC) != 0 && + (attrId & 0x0000ffff) >= (baseAttrId & 0x0000ffff); +} + +/** + * Modifies the entries in the resource table to account for compatibility + * issues with older versions of Android. + * + * This primarily handles the issue of private/public attribute clashes + * in framework resources. + * + * AAPT has traditionally assigned resource IDs to public attributes, + * and then followed those public definitions with private attributes. + * + * --- PUBLIC --- + * | 0x01010234 | attr/color + * | 0x01010235 | attr/background + * + * --- PRIVATE --- + * | 0x01010236 | attr/secret + * | 0x01010237 | attr/shhh + * + * Each release, when attributes are added, they take the place of the private + * attributes and the private attributes are shifted down again. + * + * --- PUBLIC --- + * | 0x01010234 | attr/color + * | 0x01010235 | attr/background + * | 0x01010236 | attr/shinyNewAttr + * | 0x01010237 | attr/highlyValuedFeature + * + * --- PRIVATE --- + * | 0x01010238 | attr/secret + * | 0x01010239 | attr/shhh + * + * Platform code may look for private attributes set in a theme. If an app + * compiled against a newer version of the platform uses a new public + * attribute that happens to have the same ID as the private attribute + * the older platform is expecting, then the behavior is undefined. + * + * We get around this by detecting any newly defined attributes (in L), + * copy the resource into a -v21 qualified resource, and delete the + * attribute from the original resource. This ensures that older platforms + * don't see the new attribute, but when running on L+ platforms, the + * attribute will be respected. + */ +status_t ResourceTable::modifyForCompat(const Bundle* bundle) { + if (bundle->getMinSdkVersion() != NULL) { + // If this app will only ever run on L+ devices, + // we don't need to do any compatibility work. + + if (String8("L") == bundle->getMinSdkVersion()) { + // Code-name for the v21 release. + return NO_ERROR; + } + + const int minSdk = atoi(bundle->getMinSdkVersion()); + if (minSdk >= SDK_L) { + return NO_ERROR; + } + } + + const String16 attr16("attr"); + + const size_t packageCount = mOrderedPackages.size(); + for (size_t pi = 0; pi < packageCount; pi++) { + sp<Package> p = mOrderedPackages.itemAt(pi); + if (p == NULL || p->getTypes().size() == 0) { + // Empty, skip! + continue; + } + + const size_t typeCount = p->getOrderedTypes().size(); + for (size_t ti = 0; ti < typeCount; ti++) { + sp<Type> t = p->getOrderedTypes().itemAt(ti); + if (t == NULL) { + continue; + } + + const size_t configCount = t->getOrderedConfigs().size(); + for (size_t ci = 0; ci < configCount; ci++) { + sp<ConfigList> c = t->getOrderedConfigs().itemAt(ci); + if (c == NULL) { + continue; + } + + Vector<key_value_pair_t<ConfigDescription, sp<Entry> > > entriesToAdd; + const DefaultKeyedVector<ConfigDescription, sp<Entry> >& entries = + c->getEntries(); + const size_t entryCount = entries.size(); + for (size_t ei = 0; ei < entryCount; ei++) { + sp<Entry> e = entries.valueAt(ei); + if (e == NULL || e->getType() != Entry::TYPE_BAG) { + continue; + } + + const ConfigDescription& config = entries.keyAt(ei); + if (config.sdkVersion >= SDK_L) { + // We don't need to do anything if the resource is + // already qualified for version 21 or higher. + continue; + } + + Vector<String16> attributesToRemove; + const KeyedVector<String16, Item>& bag = e->getBag(); + const size_t bagCount = bag.size(); + for (size_t bi = 0; bi < bagCount; bi++) { + const Item& item = bag.valueAt(bi); + const uint32_t attrId = getResId(bag.keyAt(bi), &attr16); + if (isAttributeFromL(attrId)) { + attributesToRemove.add(bag.keyAt(bi)); + } + } + + if (attributesToRemove.isEmpty()) { + continue; + } + + // Duplicate the entry under the same configuration + // but with sdkVersion == SDK_L. + ConfigDescription newConfig(config); + newConfig.sdkVersion = SDK_L; + entriesToAdd.add(key_value_pair_t<ConfigDescription, sp<Entry> >( + newConfig, new Entry(*e))); + + // Remove the attribute from the original. + for (size_t i = 0; i < attributesToRemove.size(); i++) { + e->removeFromBag(attributesToRemove[i]); + } + } + + const size_t entriesToAddCount = entriesToAdd.size(); + for (size_t i = 0; i < entriesToAddCount; i++) { + if (entries.indexOfKey(entriesToAdd[i].key) >= 0) { + // An entry already exists for this config. + // That means that any attributes that were + // defined in L in the original bag will be overriden + // anyways on L devices, so we do nothing. + continue; + } + + entriesToAdd[i].value->getPos() + .printf("using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.", + SDK_L, + String8(p->getName()).string(), + String8(t->getName()).string(), + String8(entriesToAdd[i].value->getName()).string(), + entriesToAdd[i].key.toString().string()); + + c->addEntry(entriesToAdd[i].key, entriesToAdd[i].value); + } + } + } + } + return NO_ERROR; +} diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h index 3721de4af015..025a868254ee 100644 --- a/tools/aapt/ResourceTable.h +++ b/tools/aapt/ResourceTable.h @@ -165,6 +165,8 @@ public: size_t numLocalResources() const; bool hasResources() const; + status_t modifyForCompat(const Bundle* bundle); + sp<AaptFile> flatten(Bundle* bundle, const sp<const ResourceFilter>& filter, const bool isBase); @@ -281,6 +283,9 @@ public: : mName(name), mType(TYPE_UNKNOWN), mItemFormat(ResTable_map::TYPE_ANY), mNameIndex(-1), mPos(pos) { } + + Entry(const Entry& entry); + virtual ~Entry() { } enum type { @@ -311,6 +316,8 @@ public: bool replace=false, bool isId = false, int32_t format = ResTable_map::TYPE_ANY); + status_t removeFromBag(const String16& key); + // Index of the entry's name string in the key pool. int32_t getNameIndex() const { return mNameIndex; } void setNameIndex(int32_t index) { mNameIndex = index; } @@ -523,6 +530,7 @@ private: const Item* getItem(uint32_t resID, uint32_t attrID) const; bool getItemValue(uint32_t resID, uint32_t attrID, Res_value* outValue); + bool isAttributeFromL(uint32_t attrId); String16 mAssetsPackage; |