Skip to content

Commit

Permalink
Udpate instrumentation code
Browse files Browse the repository at this point in the history
Added changes to support new features in QSSP

Conflicts:
	services/core/java/com/android/server/am/ActivityManagerService.java

	modified:   core/java/android/accounts/AccountManager.java
	modified:   core/java/android/app/Instrumentation.java
	modified:   core/java/android/bluetooth/BluetoothAdapter.java
	modified:   core/java/android/content/ContentResolver.java
	modified:   core/java/android/hardware/Camera.java
	modified:   core/java/android/hardware/SensorManager.java
	modified:   core/java/android/hardware/SystemSensorManager.java
	modified:   core/java/android/provider/Browser.java
	modified:   core/java/android/provider/ContactsContract.java
	modified:   core/java/android/speech/SpeechRecognizer.java
	modified:   core/java/android/util/SeempLog.java
	modified:   core/java/android/view/WindowManagerImpl.java
	modified:   core/java/android/webkit/WebChromeClient.java
	modified:   location/java/android/location/LocationManager.java
	modified:   media/java/android/media/AudioRecord.java
	modified:   media/jni/android_media_MediaRecorder.cpp
	modified:   native/android/Android.mk
	modified:   native/android/sensor.cpp
	modified:   services/core/java/com/android/server/accounts/AccountManagerService.java
	modified:   services/core/java/com/android/server/am/ActivityManagerService.java
	modified:   services/core/java/com/android/server/am/ProcessRecord.java
	modified:   services/core/java/com/android/server/pm/PackageManagerService.java
	modified:   telephony/java/android/telephony/PhoneNumberUtils.java
	modified:   telephony/java/android/telephony/TelephonyManager.java
	modified:   telephony/java/com/android/internal/telephony/CallerInfo.java
	modified:   tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/view/WindowManagerImpl.java
	modified:   wifi/java/android/net/wifi/WifiManager.java

Change-Id: I92c0a4eb3cb5363fbf08185f25644a3202c38788
  • Loading branch information
William Clark authored and jsnweitzel committed Jan 2, 2016
1 parent aff4f81 commit ae3b10f
Show file tree
Hide file tree
Showing 27 changed files with 347 additions and 341 deletions.
50 changes: 22 additions & 28 deletions core/java/android/accounts/AccountManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public static AccountManager get(Context context) {
* @return The account's password, null if none or if the account doesn't exist
*/
public String getPassword(final Account account) {
android.util.SeempLog.record(25);
android.util.SeempLog.record(22);
if (account == null) throw new IllegalArgumentException("account is null");
try {
return mService.getPassword(account);
Expand Down Expand Up @@ -358,7 +358,7 @@ public String getPassword(final Account account) {
* @return The user data, null if the account or key doesn't exist
*/
public String getUserData(final Account account, final String key) {
android.util.SeempLog.record(26);
android.util.SeempLog.record(23);
if (account == null) throw new IllegalArgumentException("account is null");
if (key == null) throw new IllegalArgumentException("key is null");
try {
Expand Down Expand Up @@ -569,7 +569,7 @@ public AccountManagerFuture<String> getAuthTokenLabel(
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
return new Future2Task<String>(handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.getAuthTokenLabel(mResponse, accountType, authTokenType);
}

Expand Down Expand Up @@ -615,7 +615,7 @@ public AccountManagerFuture<Boolean> hasFeatures(final Account account,
if (features == null) throw new IllegalArgumentException("features is null");
return new Future2Task<Boolean>(handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.hasFeatures(mResponse, account, features, mContext.getOpPackageName());
}
public Boolean bundleToResult(Bundle bundle) throws AuthenticatorException {
Expand Down Expand Up @@ -668,7 +668,7 @@ public AccountManagerFuture<Account[]> getAccountsByTypeAndFeatures(
if (type == null) throw new IllegalArgumentException("type is null");
return new Future2Task<Account[]>(handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.getAccountsByFeatures(mResponse, type, features,
mContext.getOpPackageName());
}
Expand Down Expand Up @@ -712,7 +712,7 @@ public Account[] bundleToResult(Bundle bundle) throws AuthenticatorException {
* already exists, the account is null, or another error occurs.
*/
public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
android.util.SeempLog.record(27);
android.util.SeempLog.record(24);
if (account == null) throw new IllegalArgumentException("account is null");
try {
return mService.addAccountExplicitly(account, password, userdata);
Expand Down Expand Up @@ -783,7 +783,7 @@ public AccountManagerFuture<Account> renameAccount(
return new Future2Task<Account>(handler, callback) {
@Override
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.renameAccount(mResponse, account, newName);
}
@Override
Expand Down Expand Up @@ -844,12 +844,12 @@ public String getPreviousName(final Account account) {
@Deprecated
public AccountManagerFuture<Boolean> removeAccount(final Account account,
AccountManagerCallback<Boolean> callback, Handler handler) {
android.util.SeempLog.record(28);
android.util.SeempLog.record(25);
if (account == null) throw new IllegalArgumentException("account is null");
return new Future2Task<Boolean>(handler, callback) {
@Override
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.removeAccount(mResponse, account, false);
}
@Override
Expand Down Expand Up @@ -932,7 +932,7 @@ public AccountManagerFuture<Boolean> removeAccountAsUser(final Account account,
return new Future2Task<Boolean>(handler, callback) {
@Override
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.removeAccountAsUser(mResponse, account, false, userHandle.getIdentifier());
}
@Override
Expand Down Expand Up @@ -1011,7 +1011,6 @@ public boolean removeAccountExplicitly(Account account) {
* @param authToken The auth token to invalidate, may be null
*/
public void invalidateAuthToken(final String accountType, final String authToken) {
android.util.SeempLog.record(117);
if (accountType == null) throw new IllegalArgumentException("accountType is null");
try {
if (authToken != null) {
Expand Down Expand Up @@ -1045,7 +1044,6 @@ public void invalidateAuthToken(final String accountType, final String authToken
* @see #getAuthToken
*/
public String peekAuthToken(final Account account, final String authTokenType) {
android.util.SeempLog.record(121);
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
try {
Expand Down Expand Up @@ -1077,7 +1075,7 @@ public String peekAuthToken(final Account account, final String authTokenType) {
* @param password The password to set, null to clear the password
*/
public void setPassword(final Account account, final String password) {
android.util.SeempLog.record(29);
android.util.SeempLog.record(26);
if (account == null) throw new IllegalArgumentException("account is null");
try {
mService.setPassword(account, password);
Expand Down Expand Up @@ -1107,7 +1105,7 @@ public void setPassword(final Account account, final String password) {
* @param account The account whose password to clear
*/
public void clearPassword(final Account account) {
android.util.SeempLog.record(30);
android.util.SeempLog.record(27);
if (account == null) throw new IllegalArgumentException("account is null");
try {
mService.clearPassword(account);
Expand Down Expand Up @@ -1136,7 +1134,7 @@ public void clearPassword(final Account account) {
* @param value String value to set, {@code null} to clear this user data key
*/
public void setUserData(final Account account, final String key, final String value) {
android.util.SeempLog.record(31);
android.util.SeempLog.record(28);
if (account == null) throw new IllegalArgumentException("account is null");
if (key == null) throw new IllegalArgumentException("key is null");
try {
Expand Down Expand Up @@ -1167,7 +1165,6 @@ public void setUserData(final Account account, final String key, final String va
* @param authToken The auth token to add to the cache
*/
public void setAuthToken(Account account, final String authTokenType, final String authToken) {
android.util.SeempLog.record(122);
if (account == null) throw new IllegalArgumentException("account is null");
if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null");
try {
Expand Down Expand Up @@ -1289,7 +1286,7 @@ public AccountManagerFuture<Bundle> getAuthToken(
optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName());
return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.getAuthToken(mResponse, account, authTokenType,
false /* notifyOnAuthFailure */, true /* expectActivityLaunch */,
optionsIn);
Expand Down Expand Up @@ -1458,7 +1455,7 @@ public AccountManagerFuture<Bundle> getAuthToken(
optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName());
return new AmsTask(null, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.getAuthToken(mResponse, account, authTokenType,
notifyAuthFailure, false /* expectActivityLaunch */, optionsIn);
}
Expand Down Expand Up @@ -1519,7 +1516,7 @@ public AccountManagerFuture<Bundle> addAccount(final String accountType,
final String authTokenType, final String[] requiredFeatures,
final Bundle addAccountOptions,
final Activity activity, AccountManagerCallback<Bundle> callback, Handler handler) {
android.util.SeempLog.record(32);
android.util.SeempLog.record(29);
if (accountType == null) throw new IllegalArgumentException("accountType is null");
final Bundle optionsIn = new Bundle();
if (addAccountOptions != null) {
Expand All @@ -1529,7 +1526,7 @@ public AccountManagerFuture<Bundle> addAccount(final String accountType,

return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.addAccount(mResponse, accountType, authTokenType,
requiredFeatures, activity != null, optionsIn);
}
Expand All @@ -1554,7 +1551,7 @@ public AccountManagerFuture<Bundle> addAccountAsUser(final String accountType,

return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.addAccountAsUser(mResponse, accountType, authTokenType,
requiredFeatures, activity != null, optionsIn, userHandle.getIdentifier());
}
Expand Down Expand Up @@ -1712,7 +1709,6 @@ public AccountManagerFuture<Bundle> confirmCredentials(final Account account,
final Activity activity,
final AccountManagerCallback<Bundle> callback,
final Handler handler) {
android.util.SeempLog.record(116);
return confirmCredentialsAsUser(account, options, activity, callback, handler,
Process.myUserHandle());
}
Expand All @@ -1731,7 +1727,7 @@ public AccountManagerFuture<Bundle> confirmCredentialsAsUser(final Account accou
final int userId = userHandle.getIdentifier();
return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
userId);
}
Expand Down Expand Up @@ -1791,11 +1787,9 @@ public AccountManagerFuture<Bundle> updateCredentials(final Account account,
final Bundle options, final Activity activity,
final AccountManagerCallback<Bundle> callback,
final Handler handler) {
android.util.SeempLog.record(118);
if (account == null) throw new IllegalArgumentException("account is null");
return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
mService.updateCredentials(mResponse, account, authTokenType, activity != null,
options);
}
Expand Down Expand Up @@ -1846,11 +1840,11 @@ public void doWork() throws RemoteException {
public AccountManagerFuture<Bundle> editProperties(final String accountType,
final Activity activity, final AccountManagerCallback<Bundle> callback,
final Handler handler) {
android.util.SeempLog.record(33);
android.util.SeempLog.record(30);
if (accountType == null) throw new IllegalArgumentException("accountType is null");
return new AmsTask(activity, handler, callback) {
public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
mService.editProperties(mResponse, accountType, activity != null);
}
}.start();
Expand Down Expand Up @@ -2206,7 +2200,7 @@ private class GetAuthTokenByTypeAndFeaturesTask
private volatile int mNumAccounts = 0;

public void doWork() throws RemoteException {
android.util.SeempLog.record(34);
android.util.SeempLog.record(31);
getAccountsByTypeAndFeatures(mAccountType, mFeatures,
new AccountManagerCallback<Account[]>() {
public void run(AccountManagerFuture<Account[]> future) {
Expand Down
14 changes: 7 additions & 7 deletions core/java/android/app/Instrumentation.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public void runOnMainSync(Runnable runner) {
* @see Context#startActivity
*/
public Activity startActivitySync(Intent intent) {
android.util.SeempLog.record_str(406, intent.toString());
android.util.SeempLog.record_str(376, intent.toString());
validateNotAppThread();

synchronized (mSync) {
Expand Down Expand Up @@ -1482,7 +1482,7 @@ public Intent getResultData() {
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, Activity target,
Intent intent, int requestCode, Bundle options) {
android.util.SeempLog.record_str(407, intent.toString());
android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
Uri referrer = target != null ? target.onProvideReferrer() : null;
if (referrer != null) {
Expand Down Expand Up @@ -1543,7 +1543,7 @@ public void execStartActivities(Context who, IBinder contextThread,
public void execStartActivitiesAsUser(Context who, IBinder contextThread,
IBinder token, Activity target, Intent[] intents, Bundle options,
int userId) {
android.util.SeempLog.record_str(408, intents.toString());
android.util.SeempLog.record_str(378, intents.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
Expand Down Expand Up @@ -1607,7 +1607,7 @@ public void execStartActivitiesAsUser(Context who, IBinder contextThread,
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, String target,
Intent intent, int requestCode, Bundle options) {
android.util.SeempLog.record_str(407, intent.toString());
android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
Expand Down Expand Up @@ -1668,7 +1668,7 @@ public ActivityResult execStartActivity(
public ActivityResult execStartActivity(
Context who, IBinder contextThread, IBinder token, Activity target,
Intent intent, int requestCode, Bundle options, UserHandle user) {
android.util.SeempLog.record_str(407, intent.toString());
android.util.SeempLog.record_str(377, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
Expand Down Expand Up @@ -1708,7 +1708,7 @@ public ActivityResult execStartActivityAsCaller(
Context who, IBinder contextThread, IBinder token, Activity target,
Intent intent, int requestCode, Bundle options, boolean ignoreTargetSecurity,
int userId) {
android.util.SeempLog.record_str(409, intent.toString());
android.util.SeempLog.record_str(379, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
Expand Down Expand Up @@ -1747,7 +1747,7 @@ public ActivityResult execStartActivityAsCaller(
public void execStartActivityFromAppTask(
Context who, IBinder contextThread, IAppTask appTask,
Intent intent, Bundle options) {
android.util.SeempLog.record_str(410, intent.toString());
android.util.SeempLog.record_str(380, intent.toString());
IApplicationThread whoThread = (IApplicationThread) contextThread;
if (mActivityMonitors != null) {
synchronized (mSync) {
Expand Down
Loading

0 comments on commit ae3b10f

Please sign in to comment.