-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roberto Viola
committed
Jun 24, 2024
1 parent
03176b2
commit 815a422
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
server/src/main/aidl/android/content/IOnPrimaryClipChangedListener.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright (c) 2008, The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package android.content; | ||
|
||
/** | ||
* {@hide} | ||
*/ | ||
oneway interface IOnPrimaryClipChangedListener { | ||
void dispatchPrimaryClipChanged(); | ||
} |
26 changes: 26 additions & 0 deletions
26
server/src/main/aidl/android/view/IDisplayFoldListener.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (C) 2019 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package android.view; | ||
|
||
/** | ||
* {@hide} | ||
*/ | ||
oneway interface IDisplayFoldListener | ||
{ | ||
/** Called when the foldedness of a display changes */ | ||
void onDisplayFoldChanged(int displayId, boolean folded); | ||
} |
43 changes: 43 additions & 0 deletions
43
server/src/main/java/org/cagnulein/android_remote/Command.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.cagnulein.android_remote; | ||
|
||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.Scanner; | ||
|
||
public final class Command { | ||
private Command() { | ||
// not instantiable | ||
} | ||
|
||
public static void exec(String... cmd) throws IOException, InterruptedException { | ||
Process process = Runtime.getRuntime().exec(cmd); | ||
int exitCode = process.waitFor(); | ||
if (exitCode != 0) { | ||
throw new IOException("Command " + Arrays.toString(cmd) + " returned with value " + exitCode); | ||
} | ||
} | ||
|
||
public static String execReadLine(String... cmd) throws IOException, InterruptedException { | ||
String result = null; | ||
Process process = Runtime.getRuntime().exec(cmd); | ||
Scanner scanner = new Scanner(process.getInputStream()); | ||
if (scanner.hasNextLine()) { | ||
result = scanner.nextLine(); | ||
} | ||
int exitCode = process.waitFor(); | ||
if (exitCode != 0) { | ||
throw new IOException("Command " + Arrays.toString(cmd) + " returned with value " + exitCode); | ||
} | ||
return result; | ||
} | ||
|
||
public static String execReadOutput(String... cmd) throws IOException, InterruptedException { | ||
Process process = Runtime.getRuntime().exec(cmd); | ||
String output = IO.toString(process.getInputStream()); | ||
int exitCode = process.waitFor(); | ||
if (exitCode != 0) { | ||
throw new IOException("Command " + Arrays.toString(cmd) + " returned with value " + exitCode); | ||
} | ||
return output; | ||
} | ||
} |