summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActivityThread.java3
-rw-r--r--core/java/android/app/AppOpsManager.java42
-rw-r--r--core/java/android/content/Context.java14
-rw-r--r--core/java/android/content/res/Resources.java13
-rw-r--r--core/java/android/hardware/camera2/CameraCaptureSession.java5
-rw-r--r--core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java14
-rw-r--r--core/java/android/hardware/fingerprint/FingerprintManager.java14
-rw-r--r--core/java/android/hardware/fingerprint/IFingerprintService.aidl12
-rw-r--r--core/java/android/os/Process.java3
-rw-r--r--core/java/android/widget/SearchView.java69
10 files changed, 123 insertions, 66 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 9bad9bb..2e45b79 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -114,7 +114,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.net.InetAddress;
-import java.security.Security;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.List;
@@ -5338,7 +5337,7 @@ public final class ActivityThread {
// Set the reporter for event logging in libcore
EventLogger.setReporter(new EventLoggingReporter());
- Security.addProvider(new AndroidKeyStoreProvider());
+ AndroidKeyStoreProvider.install();
// Make sure TrustedCertificateStore looks in the right place for CA certificates
final File configDir = Environment.getUserConfigDirectory(UserHandle.myUserId());
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 1127436..8a3c9c8 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -217,8 +217,14 @@ public class AppOpsManager {
public static final int OP_READ_PHONE_STATE = 51;
/** @hide Add voicemail messages to the voicemail content provider. */
public static final int OP_ADD_VOICEMAIL = 52;
+ /** @hide Access APIs for SIP calling over VOIP or WiFi. */
+ public static final int OP_USE_SIP = 53;
+ /** @hide Intercept outgoing calls. */
+ public static final int OP_PROCESS_OUTGOING_CALLS = 54;
+ /** @hide User the fingerprint API. */
+ public static final int OP_USE_FINGERPRINT = 55;
/** @hide */
- public static final int _NUM_OP = 53;
+ public static final int _NUM_OP = 56;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -351,7 +357,10 @@ public class AppOpsManager {
OP_ASSIST_STRUCTURE,
OP_ASSIST_SCREENSHOT,
OP_READ_PHONE_STATE,
- OP_ADD_VOICEMAIL
+ OP_ADD_VOICEMAIL,
+ OP_USE_SIP,
+ OP_PROCESS_OUTGOING_CALLS,
+ OP_USE_FINGERPRINT
};
/**
@@ -411,6 +420,9 @@ public class AppOpsManager {
null,
null,
null,
+ null,
+ null,
+ null,
null
};
@@ -471,7 +483,10 @@ public class AppOpsManager {
"ASSIST_STRUCTURE",
"ASSIST_SCREENSHOT",
"OP_READ_PHONE_STATE",
- "ADD_VOICEMAIL"
+ "ADD_VOICEMAIL",
+ "USE_SIP",
+ "PROCESS_OUTGOING_CALLS",
+ "USE_FINGERPRINT"
};
/**
@@ -531,7 +546,10 @@ public class AppOpsManager {
null, // no permission for receiving assist structure
null, // no permission for receiving assist screenshot
Manifest.permission.READ_PHONE_STATE,
- Manifest.permission.ADD_VOICEMAIL
+ Manifest.permission.ADD_VOICEMAIL,
+ Manifest.permission.USE_SIP,
+ Manifest.permission.PROCESS_OUTGOING_CALLS,
+ Manifest.permission.USE_FINGERPRINT
};
/**
@@ -592,7 +610,10 @@ public class AppOpsManager {
null, // ASSIST_STRUCTURE
null, // ASSIST_SCREENSHOT
null, // READ_PHONE_STATE
- null // ADD_VOICEMAIL
+ null, // ADD_VOICEMAIL
+ null, // USE_SIP
+ null, // PROCESS_OUTGOING_CALLS
+ null // USE_FINGERPRINT
};
/**
@@ -652,7 +673,10 @@ public class AppOpsManager {
false, //ASSIST_STRUCTURE
false, //ASSIST_SCREENSHOT
false, //READ_PHONE_STATE
- false //ADD_VOICEMAIL
+ false, //ADD_VOICEMAIL
+ false, // USE_SIP
+ false, // PROCESS_OUTGOING_CALLS
+ false // USE_FINGERPRINT
};
/**
@@ -711,6 +735,9 @@ public class AppOpsManager {
AppOpsManager.MODE_ALLOWED,
AppOpsManager.MODE_ALLOWED,
AppOpsManager.MODE_ALLOWED,
+ AppOpsManager.MODE_ALLOWED,
+ AppOpsManager.MODE_ALLOWED,
+ AppOpsManager.MODE_ALLOWED,
AppOpsManager.MODE_ALLOWED
};
@@ -774,6 +801,9 @@ public class AppOpsManager {
false,
false,
false,
+ false,
+ false,
+ false,
false
};
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 0bd60ef..8687c6b 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -389,24 +389,30 @@ public abstract class Context {
}
/**
- * Return a localized string from the application's package's
+ * Returns a localized string from the application's package's
* default string table.
*
* @param resId Resource id for the string
+ * @return The string data associated with the resource, stripped of styled
+ * text information.
*/
+ @NonNull
public final String getString(@StringRes int resId) {
return getResources().getString(resId);
}
/**
- * Return a localized formatted string from the application's package's
+ * Returns a localized formatted string from the application's package's
* default string table, substituting the format arguments as defined in
* {@link java.util.Formatter} and {@link java.lang.String#format}.
*
* @param resId Resource id for the format string
- * @param formatArgs The format arguments that will be used for substitution.
+ * @param formatArgs The format arguments that will be used for
+ * substitution.
+ * @return The string data associated with the resource, formatted and
+ * stripped of styled text information.
*/
-
+ @NonNull
public final String getString(@StringRes int resId, Object... formatArgs) {
return getResources().getString(resId, formatArgs);
}
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 334d180..6e77e33 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -393,10 +393,11 @@ public class Resources {
* @throws NotFoundException Throws NotFoundException if the given ID does not exist.
*
* @return String The string data associated with the resource,
- * stripped of styled text information.
+ * stripped of styled text information.
*/
+ @NonNull
public String getString(@StringRes int id) throws NotFoundException {
- CharSequence res = getText(id);
+ final CharSequence res = getText(id);
if (res != null) {
return res.toString();
}
@@ -421,11 +422,11 @@ public class Resources {
* @throws NotFoundException Throws NotFoundException if the given ID does not exist.
*
* @return String The string data associated with the resource,
- * stripped of styled text information.
+ * stripped of styled text information.
*/
- public String getString(@StringRes int id, Object... formatArgs)
- throws NotFoundException {
- String raw = getString(id);
+ @NonNull
+ public String getString(@StringRes int id, Object... formatArgs) throws NotFoundException {
+ final String raw = getString(id);
return String.format(mConfiguration.locale, raw, formatArgs);
}
diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java
index 0cf8df1..aeddf03 100644
--- a/core/java/android/hardware/camera2/CameraCaptureSession.java
+++ b/core/java/android/hardware/camera2/CameraCaptureSession.java
@@ -114,6 +114,11 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* the Surface provided to prepare must not be used as a target of a CaptureRequest submitted
* to this session.</p>
*
+ * <p>{@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}
+ * devices cannot pre-allocate output buffers; for those devices,
+ * {@link StateCallback#onSurfacePrepared} will be immediately called, and no preallocation is
+ * done.</p>
+ *
* @param surface the output Surface for which buffers should be pre-allocated. Must be one of
* the output Surfaces used to create this session.
*
diff --git a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
index abe26ea..edad00f 100644
--- a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
+++ b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java
@@ -202,6 +202,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
private static final int CAMERA_IDLE = 1;
private static final int CAPTURE_STARTED = 2;
private static final int RESULT_RECEIVED = 3;
+ private static final int PREPARED = 4;
private final HandlerThread mHandlerThread;
private Handler mHandler;
@@ -253,7 +254,9 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
@Override
public void onPrepared(int streamId) {
- // TODO
+ Message msg = getHandler().obtainMessage(PREPARED,
+ /*arg1*/ streamId, /*arg2*/ 0);
+ getHandler().sendMessage(msg);
}
@Override
@@ -301,6 +304,11 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
mCallbacks.onResultReceived(result, resultExtras);
break;
}
+ case PREPARED: {
+ int streamId = msg.arg1;
+ mCallbacks.onPrepared(streamId);
+ break;
+ }
default:
throw new IllegalArgumentException(
"Unknown callback message " + msg.what);
@@ -631,7 +639,9 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
return CameraBinderDecorator.ENODEV;
}
- // TODO: Implement and fire callback
+ // LEGACY doesn't support actual prepare, just signal success right away
+ mCameraCallbacks.onPrepared(streamId);
+
return CameraBinderDecorator.NO_ERROR;
}
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index 9f344ad..779448b 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -434,7 +434,8 @@ public class FingerprintManager {
mAuthenticationCallback = callback;
mCryptoObject = crypto;
long sessionId = crypto != null ? crypto.getOpId() : 0;
- mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags);
+ mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags,
+ mContext.getOpPackageName());
} catch (RemoteException e) {
Log.w(TAG, "Remote exception while authenticating: ", e);
if (callback != null) {
@@ -555,7 +556,7 @@ public class FingerprintManager {
*/
public List<Fingerprint> getEnrolledFingerprints(int userId) {
if (mService != null) try {
- return mService.getEnrolledFingerprints(userId);
+ return mService.getEnrolledFingerprints(userId, mContext.getOpPackageName());
} catch (RemoteException e) {
Log.v(TAG, "Remote exception in getEnrolledFingerprints: ", e);
}
@@ -579,7 +580,8 @@ public class FingerprintManager {
*/
public boolean hasEnrolledFingerprints() {
if (mService != null) try {
- return mService.hasEnrolledFingerprints(UserHandle.myUserId());
+ return mService.hasEnrolledFingerprints(UserHandle.myUserId(),
+ mContext.getOpPackageName());
} catch (RemoteException e) {
Log.v(TAG, "Remote exception in getEnrolledFingerprints: ", e);
}
@@ -595,7 +597,7 @@ public class FingerprintManager {
if (mService != null) {
try {
long deviceId = 0; /* TODO: plumb hardware id to FPMS */
- return mService.isHardwareDetected(deviceId);
+ return mService.isHardwareDetected(deviceId, mContext.getOpPackageName());
} catch (RemoteException e) {
Log.v(TAG, "Remote exception in isFingerprintHardwareDetected(): ", e);
}
@@ -614,7 +616,7 @@ public class FingerprintManager {
public long getAuthenticatorId() {
if (mService != null) {
try {
- return mService.getAuthenticatorId();
+ return mService.getAuthenticatorId(mContext.getOpPackageName());
} catch (RemoteException e) {
Log.v(TAG, "Remote exception in getAuthenticatorId(): ", e);
}
@@ -736,7 +738,7 @@ public class FingerprintManager {
private void cancelAuthentication(CryptoObject cryptoObject) {
if (mService != null) try {
- mService.cancelAuthentication(mToken);
+ mService.cancelAuthentication(mToken, mContext.getOpPackageName());
} catch (RemoteException e) {
if (DEBUG) Log.w(TAG, "Remote exception while canceling enrollment");
}
diff --git a/core/java/android/hardware/fingerprint/IFingerprintService.aidl b/core/java/android/hardware/fingerprint/IFingerprintService.aidl
index c5ec08c..0484806 100644
--- a/core/java/android/hardware/fingerprint/IFingerprintService.aidl
+++ b/core/java/android/hardware/fingerprint/IFingerprintService.aidl
@@ -27,10 +27,10 @@ import java.util.List;
interface IFingerprintService {
// Authenticate the given sessionId with a fingerprint
void authenticate(IBinder token, long sessionId, int groupId,
- IFingerprintServiceReceiver receiver, int flags);
+ IFingerprintServiceReceiver receiver, int flags, String opPackageName);
// Cancel authentication for the given sessionId
- void cancelAuthentication(IBinder token);
+ void cancelAuthentication(IBinder token, String opPackageName);
// Start fingerprint enrollment
void enroll(IBinder token, in byte [] cryptoToken, int groupId, IFingerprintServiceReceiver receiver,
@@ -46,16 +46,16 @@ interface IFingerprintService {
void rename(int fingerId, int groupId, String name);
// Get a list of enrolled fingerprints in the given group.
- List<Fingerprint> getEnrolledFingerprints(int groupId);
+ List<Fingerprint> getEnrolledFingerprints(int groupId, String opPackageName);
// Determine if HAL is loaded and ready
- boolean isHardwareDetected(long deviceId);
+ boolean isHardwareDetected(long deviceId, String opPackageName);
// Get a pre-enrollment authentication token
long preEnroll(IBinder token);
// Determine if a user has at least one enrolled fingerprint
- boolean hasEnrolledFingerprints(int groupId);
+ boolean hasEnrolledFingerprints(int groupId, String opPackageName);
// Gets the number of hardware devices
// int getHardwareDeviceCount();
@@ -64,5 +64,5 @@ interface IFingerprintService {
// long getHardwareDevice(int i);
// Gets the authenticator ID for fingerprint
- long getAuthenticatorId();
+ long getAuthenticatorId(String opPackageName);
}
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 355ec8c..009649f 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -634,6 +634,9 @@ public class Process {
if ((debugFlags & Zygote.DEBUG_ENABLE_JIT) != 0) {
argsForZygote.add("--enable-jit");
}
+ if ((debugFlags & Zygote.DEBUG_GENERATE_CFI) != 0) {
+ argsForZygote.add("--generate-cfi");
+ }
if ((debugFlags & Zygote.DEBUG_ENABLE_ASSERT) != 0) {
argsForZygote.add("--enable-assert");
}
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index bbf120a..088adbb 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -18,6 +18,7 @@ package android.widget;
import static android.widget.SuggestionsAdapter.getColumnString;
+import android.annotation.Nullable;
import android.app.PendingIntent;
import android.app.SearchManager;
import android.app.SearchableInfo;
@@ -120,6 +121,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
private final Intent mVoiceWebSearchIntent;
private final Intent mVoiceAppSearchIntent;
+ private final CharSequence mDefaultQueryHint;
+
private OnQueryTextListener mOnQueryChangeListener;
private OnCloseListener mOnCloseListener;
private OnFocusChangeListener mOnQueryTextFocusChangeListener;
@@ -329,10 +332,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
setMaxWidth(maxWidth);
}
- final CharSequence queryHint = a.getText(R.styleable.SearchView_queryHint);
- if (!TextUtils.isEmpty(queryHint)) {
- setQueryHint(queryHint);
- }
+ mDefaultQueryHint = a.getText(R.styleable.SearchView_defaultQueryHint);
+ mQueryHint = a.getText(R.styleable.SearchView_queryHint);
final int imeOptions = a.getInt(R.styleable.SearchView_imeOptions, -1);
if (imeOptions != -1) {
@@ -570,36 +571,48 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
}
/**
- * Sets the hint text to display in the query text field. This overrides any hint specified
- * in the SearchableInfo.
- *
- * @param hint the hint text to display
+ * Sets the hint text to display in the query text field. This overrides
+ * any hint specified in the {@link SearchableInfo}.
+ * <p>
+ * This value may be specified as an empty string to prevent any query hint
+ * from being displayed.
*
+ * @param hint the hint text to display or {@code null} to clear
* @attr ref android.R.styleable#SearchView_queryHint
*/
- public void setQueryHint(CharSequence hint) {
+ public void setQueryHint(@Nullable CharSequence hint) {
mQueryHint = hint;
updateQueryHint();
}
/**
- * Gets the hint text to display in the query text field.
- * @return the query hint text, if specified, null otherwise.
+ * Returns the hint text that will be displayed in the query text field.
+ * <p>
+ * The displayed query hint is chosen in the following order:
+ * <ol>
+ * <li>Non-null value set with {@link #setQueryHint(CharSequence)}
+ * <li>Value specified in XML using
+ * {@link android.R.styleable#SearchView_queryHint android:queryHint}
+ * <li>Valid string resource ID exposed by the {@link SearchableInfo} via
+ * {@link SearchableInfo#getHintId()}
+ * <li>Default hint provided by the theme against which the view was
+ * inflated
+ * </ol>
*
+ * @return the displayed query hint text, or {@code null} if none set
* @attr ref android.R.styleable#SearchView_queryHint
*/
+ @Nullable
public CharSequence getQueryHint() {
+ final CharSequence hint;
if (mQueryHint != null) {
- return mQueryHint;
- } else if (mSearchable != null) {
- CharSequence hint = null;
- int hintId = mSearchable.getHintId();
- if (hintId != 0) {
- hint = getContext().getString(hintId);
- }
- return hint;
+ hint = mQueryHint;
+ } else if (mSearchable != null && mSearchable.getHintId() != 0) {
+ hint = getContext().getText(mSearchable.getHintId());
+ } else {
+ hint = mDefaultQueryHint;
}
- return null;
+ return hint;
}
/**
@@ -1113,20 +1126,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
}
private void updateQueryHint() {
- if (mQueryHint != null) {
- mSearchSrcTextView.setHint(getDecoratedHint(mQueryHint));
- } else if (mSearchable != null) {
- CharSequence hint = null;
- int hintId = mSearchable.getHintId();
- if (hintId != 0) {
- hint = getContext().getString(hintId);
- }
- if (hint != null) {
- mSearchSrcTextView.setHint(getDecoratedHint(hint));
- }
- } else {
- mSearchSrcTextView.setHint(getDecoratedHint(""));
- }
+ final CharSequence hint = getQueryHint();
+ mSearchSrcTextView.setHint(getDecoratedHint(hint == null ? "" : hint));
}
/**