Back out "Automatically set Android devices into the permissive mode"

Summary:
Original commit changeset: 471470c5ca91

Original Phabricator Diff: D35356211 (501abc6b55)

Recently, bloks users reported that android emulators lost connection upon launching Flipper. (S270689)

Manual bisecting indicates that remote emulators won't crash on v0.142.362128844 (4/6) but crash on 0.143.365099607 (4/21).

Looking at https://www.internalfb.com/code/fbsource/[history]/xplat/scripts/.flipperversion.v2, and backing out D35356211 (501abc6b55) fixes the issue.

It's still unclear why setting `setIntoPermissiveMode` would crash/disconnect the android emulators, I'd defer Flipper team to investigate this further but this diff should unblock all the android bloks emulator + Flipper use case.

Reviewed By: lblasa

Differential Revision: D36263724

fbshipit-source-id: e8674730c0185457f6eda347ce7d9a41f9e1a2a4
This commit is contained in:
Mengke Ding
2022-05-09 16:04:14 -07:00
committed by Facebook GitHub Bot
parent 57e3253bb0
commit 0ee8f09fe5
3 changed files with 0 additions and 34 deletions

View File

@@ -120,37 +120,6 @@ export default class AndroidDevice extends ServerDevice {
}); });
} }
async setIntoPermissiveMode(): Promise<void> {
console.debug('AndroidDevice.setIntoPermissiveMode', this.serial);
try {
try {
await this.adb.root(this.serial);
} catch (e) {
if (
!(e instanceof Error) ||
e.message !== 'adbd is already running as root'
) {
throw e;
}
}
console.debug(
'AndroidDevice.setIntoPermissiveMode -> enabled root',
this.serial,
);
await this.executeShellOrDie('setenforce 0');
console.info(
'AndroidDevice.setIntoPermissiveMode -> success',
this.serial,
);
} catch (e) {
console.info(
'AndroidDevice.setIntoPermissiveMode -> failed',
this.serial,
e,
);
}
}
async screenRecordAvailable(): Promise<boolean> { async screenRecordAvailable(): Promise<boolean> {
try { try {
await this.executeShellOrDie( await this.executeShellOrDie(

View File

@@ -90,8 +90,6 @@ export class AndroidDeviceManager {
// The default way of capturing screenshots through adb does not seem to work // The default way of capturing screenshots through adb does not seem to work
// There is a way of getting a screenshot through KaiOS dev tools though // There is a way of getting a screenshot through KaiOS dev tools though
if (androidLikeDevice instanceof AndroidDevice) { if (androidLikeDevice instanceof AndroidDevice) {
await androidLikeDevice.setIntoPermissiveMode();
const screenRecordAvailable = const screenRecordAvailable =
await androidLikeDevice.screenRecordAvailable(); await androidLikeDevice.screenRecordAvailable();
androidLikeDevice.info.features.screenCaptureAvailable = androidLikeDevice.info.features.screenCaptureAvailable =

View File

@@ -57,7 +57,6 @@ declare module 'adbkit' {
serial: string, serial: string,
command: string | string[], command: string | string[],
) => Promise<NodeJS.ReadStream>; ) => Promise<NodeJS.ReadStream>;
root: (serial: string) => Promise<true>;
screencap: (serial: string) => Promise<NodeJS.WriteStream>; screencap: (serial: string) => Promise<NodeJS.WriteStream>;
pull: (serial: string, path: string) => Promise<PullTransfer>; pull: (serial: string, path: string) => Promise<PullTransfer>;
openLogcat: ( openLogcat: (