diff options
Diffstat (limited to 'packages')
14 files changed, 70 insertions, 48 deletions
diff --git a/packages/DocumentsUI/res/values/strings.xml b/packages/DocumentsUI/res/values/strings.xml index 943104d..a4e6ce7 100644 --- a/packages/DocumentsUI/res/values/strings.xml +++ b/packages/DocumentsUI/res/values/strings.xml @@ -68,9 +68,6 @@ <!-- Button label that copies files to the current directory [CHAR LIMIT=24] --> <string name="button_copy">Copy</string> - <!-- Action mode title summarizing the number of documents selected [CHAR LIMIT=32] --> - <string name="mode_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> selected</string> - <!-- Mode that sorts documents by their display name alphabetically [CHAR LIMIT=24] --> <string name="sort_name">By name</string> <!-- Mode that sorts documents by their last modified time in descending order; most recent first [CHAR LIMIT=24] --> diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index a789da8..f4be9c5 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -54,6 +54,7 @@ import android.os.OperationCanceledException; import android.os.Parcelable; import android.provider.DocumentsContract; import android.provider.DocumentsContract.Document; +import android.text.TextUtils; import android.text.format.DateUtils; import android.text.format.Formatter; import android.text.format.Time; @@ -474,8 +475,7 @@ public class DirectoryFragment extends Fragment { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { mode.getMenuInflater().inflate(R.menu.mode_directory, menu); - mode.setTitle(getResources() - .getString(R.string.mode_selected_count, mCurrentView.getCheckedItemCount())); + mode.setTitle(TextUtils.formatSelectedCount(mCurrentView.getCheckedItemCount())); return true; } @@ -571,8 +571,7 @@ public class DirectoryFragment extends Fragment { } } - mode.setTitle(getResources() - .getString(R.string.mode_selected_count, mCurrentView.getCheckedItemCount())); + mode.setTitle(TextUtils.formatSelectedCount(mCurrentView.getCheckedItemCount())); } }; diff --git a/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java b/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java index 3b59fd6..fe9b99a 100644 --- a/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java +++ b/packages/StatementService/src/com/android/statementservice/retriever/AbstractStatementRetriever.java @@ -90,7 +90,7 @@ public abstract class AbstractStatementRetriever { * Creates a new StatementRetriever that directly retrieves statements from the asset. * * <p> For web assets, {@link AbstractStatementRetriever} will try to retrieve the statement - * file from URL: {@code [webAsset.site]/.well-known/statements.json"} where {@code + * file from URL: {@code [webAsset.site]/.well-known/assetlinks.json"} where {@code * [webAsset.site]} is in the form {@code http{s}://[hostname]:[optional_port]}. The file * should contain one JSON array of statements. * diff --git a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java index 2ca85e9..e4feb90 100644 --- a/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java +++ b/packages/StatementService/src/com/android/statementservice/retriever/DirectStatementRetriever.java @@ -38,7 +38,7 @@ import java.util.List; private static final int HTTP_CONNECTION_TIMEOUT_MILLIS = 5000; private static final long HTTP_CONTENT_SIZE_LIMIT_IN_BYTES = 1024 * 1024; private static final int MAX_INCLUDE_LEVEL = 1; - private static final String WELL_KNOWN_STATEMENT_PATH = "/.well-known/statements.json"; + private static final String WELL_KNOWN_STATEMENT_PATH = "/.well-known/assetlinks.json"; private final URLFetcher mUrlFetcher; private final AndroidPackageInfoFetcher mAndroidFetcher; diff --git a/packages/StatementService/src/com/android/statementservice/retriever/Statement.java b/packages/StatementService/src/com/android/statementservice/retriever/Statement.java index da3c355..0f40a62 100644 --- a/packages/StatementService/src/com/android/statementservice/retriever/Statement.java +++ b/packages/StatementService/src/com/android/statementservice/retriever/Statement.java @@ -21,7 +21,7 @@ import android.annotation.NonNull; /** * An immutable value type representing a statement, consisting of a source, target, and relation. * This reflects an assertion that the relation holds for the source, target pair. For example, if a - * web site has the following in its statements.json file: + * web site has the following in its assetlinks.json file: * * <pre> * { diff --git a/packages/StatementService/src/com/android/statementservice/retriever/URLFetcher.java b/packages/StatementService/src/com/android/statementservice/retriever/URLFetcher.java index 969aa88..225e26c 100644 --- a/packages/StatementService/src/com/android/statementservice/retriever/URLFetcher.java +++ b/packages/StatementService/src/com/android/statementservice/retriever/URLFetcher.java @@ -60,33 +60,36 @@ public class URLFetcher { throw new IllegalArgumentException("The url protocol should be on http or https."); } - HttpURLConnection connection; - connection = (HttpURLConnection) url.openConnection(); - connection.setInstanceFollowRedirects(true); - connection.setConnectTimeout(connectionTimeoutMillis); - connection.setReadTimeout(connectionTimeoutMillis); - connection.setUseCaches(true); - connection.setInstanceFollowRedirects(false); - connection.addRequestProperty("Cache-Control", "max-stale=60"); - - if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { - Log.e(TAG, "The responses code is not 200 but " + connection.getResponseCode()); - return new WebContent("", DO_NOT_CACHE_RESULT); - } + HttpURLConnection connection = null; + try { + connection = (HttpURLConnection) url.openConnection(); + connection.setInstanceFollowRedirects(true); + connection.setConnectTimeout(connectionTimeoutMillis); + connection.setReadTimeout(connectionTimeoutMillis); + connection.setUseCaches(true); + connection.setInstanceFollowRedirects(false); + connection.addRequestProperty("Cache-Control", "max-stale=60"); + + if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { + Log.e(TAG, "The responses code is not 200 but " + connection.getResponseCode()); + return new WebContent("", DO_NOT_CACHE_RESULT); + } - if (connection.getContentLength() > fileSizeLimit) { - Log.e(TAG, "The content size of the url is larger than " + fileSizeLimit); - return new WebContent("", DO_NOT_CACHE_RESULT); - } + if (connection.getContentLength() > fileSizeLimit) { + Log.e(TAG, "The content size of the url is larger than " + fileSizeLimit); + return new WebContent("", DO_NOT_CACHE_RESULT); + } - Long expireTimeMillis = getExpirationTimeMillisFromHTTPHeader(connection.getHeaderFields()); + Long expireTimeMillis = getExpirationTimeMillisFromHTTPHeader( + connection.getHeaderFields()); - try { return new WebContent(inputStreamToString( connection.getInputStream(), connection.getContentLength(), fileSizeLimit), expireTimeMillis); } finally { - connection.disconnect(); + if (connection != null) { + connection.disconnect(); + } } } diff --git a/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml b/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml index a996260..38ea6e1 100644 --- a/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml +++ b/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml @@ -35,6 +35,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" + android:contentDescription="@string/accessibility_brightness" systemui:text="@string/status_bar_settings_auto_brightness_label" /> </LinearLayout> diff --git a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml index a5bf68e..062e6cb 100644 --- a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml +++ b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml @@ -45,7 +45,6 @@ android:paddingBottom="16dp" android:thumb="@drawable/ic_brightness_thumb" android:splitTrack="false" - android:contentDescription="@string/accessibility_brightness" /> <TextView android:id="@+id/label" diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 49eb9b2..c8212c2 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -404,7 +404,9 @@ public class QSPanel extends ViewGroup { ((TileRecord) r).openingDetail = true; } } else { - MetricsLogger.hidden(mContext, mDetailRecord.detailAdapter.getMetricsCategory()); + if (mDetailRecord != null) { + MetricsLogger.hidden(mContext, mDetailRecord.detailAdapter.getMetricsCategory()); + } mClosingDetail = true; setGridContentVisibility(true); listener = mTeardownDetailWhenDone; diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java index 7c378f0..915867b 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java @@ -73,6 +73,10 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { : mController.isRotationLocked(); final boolean userInitiated = arg != null ? ((UserBoolean) arg).userInitiated : false; state.visible = mController.isRotationLockAffordanceVisible(); + if (state.value == rotationLocked) { + // No change, no need to update all the values. + return; + } state.value = rotationLocked; final boolean portrait = mContext.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE; diff --git a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java index 8abfe03..cdb8e69 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java +++ b/packages/SystemUI/src/com/android/systemui/settings/ToggleSlider.java @@ -74,6 +74,8 @@ public class ToggleSlider extends RelativeLayout { mLabel = (TextView) findViewById(R.id.label); mLabel.setText(a.getString(R.styleable.ToggleSlider_text)); + setLabelFor(R.id.slider); // use our a11y text to annotate, not replace, the slider's + a.recycle(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java index 03d0482..296538c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java @@ -134,6 +134,14 @@ public abstract class ExpandableView extends FrameLayout { } @Override + public boolean dispatchGenericMotionEvent(MotionEvent ev) { + if (filterMotionEvent(ev)) { + return super.dispatchGenericMotionEvent(ev); + } + return false; + } + + @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (filterMotionEvent(ev)) { return super.dispatchTouchEvent(ev); @@ -143,6 +151,8 @@ public abstract class ExpandableView extends FrameLayout { protected boolean filterMotionEvent(MotionEvent event) { return event.getActionMasked() != MotionEvent.ACTION_DOWN + && event.getActionMasked() != MotionEvent.ACTION_HOVER_ENTER + && event.getActionMasked() != MotionEvent.ACTION_HOVER_MOVE || event.getY() > mClipTopAmount && event.getY() < mActualHeight; } @@ -344,6 +354,7 @@ public abstract class ExpandableView extends FrameLayout { public void getBoundsOnScreen(Rect outRect, boolean clipToParent) { super.getBoundsOnScreen(outRect, clipToParent); outRect.bottom = (int) (outRect.top + getActualHeight()); + outRect.top += getClipTopAmount(); } public int getContentHeight() { 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 7f1fea1..634270c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -83,6 +83,10 @@ public class StatusBarWindowView extends FrameLayout { insets.top = 0; insets.right = 0; } else { + if (mRightInset != 0) { + mRightInset = 0; + applyMargins(); + } boolean changed = getPaddingLeft() != 0 || getPaddingRight() != 0 || getPaddingTop() != 0 diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java index 49278c5..aa891b6 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java @@ -17,6 +17,7 @@ package com.android.systemui.volume; import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK; +import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_GENERIC; import android.accessibilityservice.AccessibilityServiceInfo; import android.animation.LayoutTransition; @@ -422,17 +423,15 @@ public class VolumeDialog { protected void rescheduleTimeoutH() { mHandler.removeMessages(H.DISMISS); - int timeout = -1; - if (!mAccessibility.mFeedbackEnabled) { - timeout = computeTimeoutH(); - mHandler.sendMessageDelayed(mHandler - .obtainMessage(H.DISMISS, Events.DISMISS_REASON_TIMEOUT, 0), timeout); - } + final int timeout = computeTimeoutH(); + mHandler.sendMessageDelayed(mHandler + .obtainMessage(H.DISMISS, Events.DISMISS_REASON_TIMEOUT, 0), timeout); if (D.BUG) Log.d(TAG, "rescheduleTimeout " + timeout + " " + Debug.getCaller()); mController.userActivity(); } private int computeTimeoutH() { + if (mAccessibility.mFeedbackEnabled) return 20000; if (mSafetyWarning != null) return 5000; if (mExpanded || mExpanding) return 5000; if (mActiveStream == AudioManager.STREAM_MUSIC) return 1500; @@ -959,7 +958,7 @@ public class VolumeDialog { } } - private final class Accessibility { + private final class Accessibility extends AccessibilityDelegate { private AccessibilityManager mMgr; private boolean mFeedbackEnabled; @@ -976,14 +975,7 @@ public class VolumeDialog { updateFeedbackEnabled(); } }); - mDialogView.setAccessibilityDelegate(new AccessibilityDelegate() { - @Override - public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child, - AccessibilityEvent event) { - rescheduleTimeoutH(); - return super.onRequestSendAccessibilityEvent(host, child, event); - } - }); + mDialogView.setAccessibilityDelegate(this); mMgr.addAccessibilityStateChangeListener(new AccessibilityStateChangeListener() { @Override public void onAccessibilityStateChanged(boolean enabled) { @@ -993,15 +985,23 @@ public class VolumeDialog { updateFeedbackEnabled(); } + @Override + public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child, + AccessibilityEvent event) { + rescheduleTimeoutH(); + return super.onRequestSendAccessibilityEvent(host, child, event); + } + private void updateFeedbackEnabled() { mFeedbackEnabled = computeFeedbackEnabled(); } private boolean computeFeedbackEnabled() { + // are there any enabled non-generic a11y services? final List<AccessibilityServiceInfo> services = mMgr.getEnabledAccessibilityServiceList(FEEDBACK_ALL_MASK); for (AccessibilityServiceInfo asi : services) { - if ((asi.feedbackType & FEEDBACK_ALL_MASK) != 0) { + if (asi.feedbackType != 0 && asi.feedbackType != FEEDBACK_GENERIC) { return true; } } |