diff options
author | Justin Klaassen <justinklaassen@google.com> | 2017-09-18 17:38:50 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2017-09-18 17:38:50 -0400 |
commit | bc81c7ada5aab3806dd0b17498f5c9672c9b33c4 (patch) | |
tree | 7fdcc541a9ac9e92134f1a80cec557fee772bcf8 /android/app | |
parent | 10d07c88d69cc64f73a069163e7ea5ba2519a099 (diff) | |
download | android-28-bc81c7ada5aab3806dd0b17498f5c9672c9b33c4.tar.gz |
Import Android SDK Platform P [4344336]
/google/data/ro/projects/android/fetch_artifact \
--bid 4344336 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4344336.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: If482fcd4cfaf6c5e544e5574926be25a293e9a6d
Diffstat (limited to 'android/app')
-rw-r--r-- | android/app/FragmentManager.java | 9 | ||||
-rw-r--r-- | android/app/LoadedApk.java | 20 | ||||
-rw-r--r-- | android/app/Notification.java | 36 | ||||
-rw-r--r-- | android/app/RemoteInput.java | 4 |
4 files changed, 60 insertions, 9 deletions
diff --git a/android/app/FragmentManager.java b/android/app/FragmentManager.java index ba5ea218..0d5cd021 100644 --- a/android/app/FragmentManager.java +++ b/android/app/FragmentManager.java @@ -1380,8 +1380,13 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate @Override public void onAnimationEnd(Animator anim) { container.endViewTransition(view); - if (fragment.getAnimatingAway() != null) { - fragment.setAnimatingAway(null); + Animator animator = f.getAnimatingAway(); + f.setAnimatingAway(null); + // If the animation finished immediately, the fragment's + // view will still be there. If so, we can just pretend + // there was no animation and skip the moveToState() + if (container.indexOfChild(view) == -1 + && animator != null) { moveToState(fragment, fragment.getStateAfterAnimating(), 0, 0, false); } diff --git a/android/app/LoadedApk.java b/android/app/LoadedApk.java index b38be662..f6d9710d 100644 --- a/android/app/LoadedApk.java +++ b/android/app/LoadedApk.java @@ -625,17 +625,31 @@ public final class LoadedApk { final List<String> zipPaths = new ArrayList<>(10); final List<String> libPaths = new ArrayList<>(10); - final boolean isBundledApp = mApplicationInfo.isSystemApp() + boolean isBundledApp = mApplicationInfo.isSystemApp() && !mApplicationInfo.isUpdatedSystemApp(); + // Vendor apks are treated as bundled only when /vendor/lib is in the default search + // paths. If not, they are treated as unbundled; access to system libs is limited. + // Having /vendor/lib in the default search paths means that all system processes + // are allowed to use any vendor library, which in turn means that system is dependent + // on vendor partition. In the contrary, not having /vendor/lib in the default search + // paths mean that the two partitions are separated and thus we can treat vendor apks + // as unbundled. + final String defaultSearchPaths = System.getProperty("java.library.path"); + final boolean treatVendorApkAsUnbundled = !defaultSearchPaths.contains("/vendor/lib"); + if (mApplicationInfo.getCodePath() != null + && mApplicationInfo.getCodePath().startsWith("/vendor/") + && treatVendorApkAsUnbundled) { + isBundledApp = false; + } + makePaths(mActivityThread, isBundledApp, mApplicationInfo, zipPaths, libPaths); String libraryPermittedPath = mDataDir; if (isBundledApp) { // This is necessary to grant bundled apps access to // libraries located in subdirectories of /system/lib - libraryPermittedPath += File.pathSeparator + - System.getProperty("java.library.path"); + libraryPermittedPath += File.pathSeparator + defaultSearchPaths; } final String librarySearchPath = TextUtils.join(File.pathSeparator, libPaths); diff --git a/android/app/Notification.java b/android/app/Notification.java index 841b9611..ee6c1cba 100644 --- a/android/app/Notification.java +++ b/android/app/Notification.java @@ -67,6 +67,7 @@ import android.text.style.TextAppearanceSpan; import android.util.ArraySet; import android.util.Log; import android.util.SparseArray; +import android.util.TypedValue; import android.view.Gravity; import android.view.NotificationHeaderView; import android.view.View; @@ -3905,6 +3906,7 @@ public class Notification implements Parcelable if (p.title != null) { contentView.setViewVisibility(R.id.title, View.VISIBLE); contentView.setTextViewText(R.id.title, processTextSpans(p.title)); + updateTextSizePrimary(contentView, R.id.title); if (!p.ambient) { setTextViewColorPrimary(contentView, R.id.title); } @@ -3916,6 +3918,7 @@ public class Notification implements Parcelable int textId = showProgress ? com.android.internal.R.id.text_line_1 : com.android.internal.R.id.text; contentView.setTextViewText(textId, processTextSpans(p.text)); + updateTextSizeSecondary(contentView, textId); if (!p.ambient) { setTextViewColorSecondary(contentView, textId); } @@ -3927,6 +3930,25 @@ public class Notification implements Parcelable return contentView; } + private void updateTextSizeSecondary(RemoteViews contentView, int textId) { + updateTextSizeColorized(contentView, textId, + com.android.internal.R.dimen.notification_text_size_colorized, + com.android.internal.R.dimen.notification_text_size); + } + + private void updateTextSizePrimary(RemoteViews contentView, int textId) { + updateTextSizeColorized(contentView, textId, + com.android.internal.R.dimen.notification_title_text_size_colorized, + com.android.internal.R.dimen.notification_title_text_size); + } + + private void updateTextSizeColorized(RemoteViews contentView, int textId, + int colorizedDimen, int normalDimen) { + int size = mContext.getResources().getDimensionPixelSize(isColorized() + ? colorizedDimen : normalDimen); + contentView.setTextViewTextSize(textId, TypedValue.COMPLEX_UNIT_PX, size); + } + private CharSequence processTextSpans(CharSequence text) { if (hasForegroundColor()) { return NotificationColorUtil.clearColorSpans(text); @@ -5852,6 +5874,7 @@ public class Notification implements Parcelable builder.setTextViewColorSecondary(contentView, R.id.big_text); contentView.setViewVisibility(R.id.big_text, TextUtils.isEmpty(bigTextText) ? View.GONE : View.VISIBLE); + builder.updateTextSizeSecondary(contentView, R.id.big_text); contentView.setBoolean(R.id.big_text, "setHasImage", builder.mN.hasLargeIcon()); } } @@ -6185,6 +6208,7 @@ public class Notification implements Parcelable contentView.setViewVisibility(rowId, View.VISIBLE); contentView.setTextViewText(rowId, mBuilder.processTextSpans( makeMessageLine(m, mBuilder))); + mBuilder.updateTextSizeSecondary(contentView, rowId); mBuilder.setTextViewColorSecondary(contentView, rowId); if (contractedMessage == m) { @@ -6552,6 +6576,7 @@ public class Notification implements Parcelable contentView.setViewVisibility(rowIds[i], View.VISIBLE); contentView.setTextViewText(rowIds[i], mBuilder.processTextSpans(mBuilder.processLegacyText(str))); + mBuilder.updateTextSizeSecondary(contentView, rowIds[i]); mBuilder.setTextViewColorSecondary(contentView, rowIds[i]); contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0); handleInboxImageMargin(contentView, rowIds[i], first); @@ -8522,8 +8547,15 @@ public class Notification implements Parcelable final StandardTemplateParams fillTextsFrom(Builder b) { Bundle extras = b.mN.extras; - title = b.processLegacyText(extras.getCharSequence(EXTRA_TITLE), ambient); - text = b.processLegacyText(extras.getCharSequence(EXTRA_TEXT), ambient); + this.title = b.processLegacyText(extras.getCharSequence(EXTRA_TITLE), ambient); + + // Big text notifications should contain their content when viewed in ambient mode. + CharSequence text = extras.getCharSequence(EXTRA_BIG_TEXT); + if (!ambient || TextUtils.isEmpty(text)) { + text = extras.getCharSequence(EXTRA_TEXT); + } + this.text = b.processLegacyText(text, ambient); + return this; } } diff --git a/android/app/RemoteInput.java b/android/app/RemoteInput.java index 8ab19c06..02a01242 100644 --- a/android/app/RemoteInput.java +++ b/android/app/RemoteInput.java @@ -33,8 +33,8 @@ import java.util.Set; * an intent inside a {@link android.app.PendingIntent} that is sent. * Always use {@link RemoteInput.Builder} to create instances of this class. * <p class="note"> See - * <a href="{@docRoot}wear/notifications/remote-input.html">Receiving Voice Input from - * a Notification</a> for more information on how to use this class. + * <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#direct">Replying + * to notifications</a> for more information on how to use this class. * * <p>The following example adds a {@code RemoteInput} to a {@link Notification.Action}, * sets the result key as {@code quick_reply}, and sets the label as {@code Quick reply}. |