mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
Moved getCurrentActivity to android-common.js
This commit is contained in:
@@ -283,5 +283,19 @@ androidCommon.getLogTypes = function(cb) {
|
||||
});
|
||||
};
|
||||
|
||||
androidCommon.getCurrentActivity = function(cb) {
|
||||
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
|
||||
if (err) {
|
||||
return cb(null, {
|
||||
status: status.codes.UnknownError.code
|
||||
, value: err.message
|
||||
});
|
||||
}
|
||||
cb(null, {
|
||||
status: status.codes.Success.code
|
||||
, value: activity
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = androidCommon;
|
||||
|
||||
@@ -608,21 +608,6 @@ androidController.deleteCookies = function(cb) {
|
||||
cb(new NotYetImplementedError(), null);
|
||||
};
|
||||
|
||||
androidController.getCurrentActivity = function(cb) {
|
||||
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
|
||||
if (err) {
|
||||
return cb(null, {
|
||||
status: status.codes.UnknownError.code
|
||||
, value: err.message
|
||||
});
|
||||
}
|
||||
cb(null, {
|
||||
status: status.codes.Success.code
|
||||
, value: activity
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
androidController.fastReset = function(cb) {
|
||||
async.series([
|
||||
function(cb) { this.adb.stopAndClear(this.appPackage, cb); }.bind(this),
|
||||
|
||||
@@ -270,21 +270,6 @@ Selendroid.prototype.insertSelendroidManifest = function(serverPath, cb) {
|
||||
], cb);
|
||||
};
|
||||
|
||||
Selendroid.prototype.getCurrentActivity = function(cb) {
|
||||
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
|
||||
if (err) {
|
||||
return cb(null, {
|
||||
status: status.codes.UnknownError.code
|
||||
, value: err.message
|
||||
});
|
||||
}
|
||||
cb(null, {
|
||||
status: status.codes.Success.code
|
||||
, value: activity
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Selendroid.prototype = _.extend(Selendroid.prototype, androidCommon);
|
||||
|
||||
module.exports = function(opts) {
|
||||
|
||||
Reference in New Issue
Block a user