...
 
Commits (2257)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

stages:
- update-from-upstream
include:
- project: 'e/priv/os/build'
ref: master
file: '/templates/.gitlab-ci-update-from-upstream.yml'
......@@ -126,6 +126,7 @@ LOCAL_SRC_FILES += \
core/java/android/bluetooth/IBluetoothGatt.aidl \
core/java/android/bluetooth/IBluetoothGattCallback.aidl \
core/java/android/bluetooth/IBluetoothGattServerCallback.aidl \
core/java/android/bluetooth/IBluetoothDun.aidl \
core/java/android/content/IClipboard.aidl \
core/java/android/content/IContentService.aidl \
core/java/android/content/IIntentReceiver.aidl \
......@@ -275,6 +276,7 @@ LOCAL_SRC_FILES += \
core/java/android/service/voice/IVoiceInteractionService.aidl \
core/java/android/service/voice/IVoiceInteractionSession.aidl \
core/java/android/service/voice/IVoiceInteractionSessionService.aidl \
core/java/android/service/gesture/IGestureService.aidl \
core/java/android/service/wallpaper/IWallpaperConnection.aidl \
core/java/android/service/wallpaper/IWallpaperEngine.aidl \
core/java/android/service/wallpaper/IWallpaperService.aidl \
......@@ -329,6 +331,7 @@ LOCAL_SRC_FILES += \
core/java/com/android/internal/policy/IShortcutService.aidl \
core/java/com/android/internal/os/IDropBoxManagerService.aidl \
core/java/com/android/internal/os/IParcelFileDescriptorFactory.aidl \
core/java/com/android/internal/os/IRegionalizationService.aidl \
core/java/com/android/internal/os/IResultReceiver.aidl \
core/java/com/android/internal/statusbar/IStatusBar.aidl \
core/java/com/android/internal/statusbar/IStatusBarService.aidl \
......@@ -465,6 +468,8 @@ LOCAL_SRC_FILES += \
packages/services/Proxy/com/android/net/IProxyPortListener.aidl \
core/java/android/service/quicksettings/IQSService.aidl \
core/java/android/service/quicksettings/IQSTileService.aidl \
telephony/java/com/android/internal/telephony/ISmsSecurityService.aidl \
telephony/java/com/android/internal/telephony/ISmsSecurityAgent.aidl \
# The following are native binders that need to go with the native component
# at system/update_engine/binder_bindings/. Use relative path to refer to them.
......@@ -651,6 +656,7 @@ aidl_files := \
frameworks/base/core/java/android/app/usage/UsageEvents.aidl \
frameworks/base/core/java/android/app/Notification.aidl \
frameworks/base/core/java/android/app/NotificationManager.aidl \
frameworks/base/core/java/android/app/NotificationGroup.aidl \
frameworks/base/core/java/android/app/WallpaperInfo.aidl \
frameworks/base/core/java/android/app/AppOpsManager.aidl \
frameworks/base/core/java/android/app/ActivityManager.aidl \
......
......@@ -112,6 +112,7 @@ package android {
field public static final java.lang.String GRANT_RUNTIME_PERMISSIONS = "android.permission.GRANT_RUNTIME_PERMISSIONS";
field public static final java.lang.String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
field public static final java.lang.String HDMI_CEC = "android.permission.HDMI_CEC";
field public static final java.lang.String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
field public static final java.lang.String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
field public static final java.lang.String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
field public static final java.lang.String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
......@@ -202,38 +202,56 @@ int idmap_scan(const char *target_package_name, const char *target_apk_path,
struct stat st;
char overlay_apk_path[PATH_MAX + 1];
snprintf(overlay_apk_path, PATH_MAX, "%s/%s", overlay_dir, dirent->d_name);
if (stat(overlay_apk_path, &st) < 0) {
continue;
}
if (!S_ISREG(st.st_mode)) {
continue;
}
int priority = parse_apk(overlay_apk_path, target_package_name);
if (priority < 0) {
if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode)) {
continue;
}
String8 idmap_path(idmap_dir);
idmap_path.appendPath(flatten_path(overlay_apk_path + 1));
idmap_path.append("@idmap");
if (S_ISDIR(st.st_mode)) {
String8 dir_name = String8(overlay_apk_path).getPathLeaf();
if (dir_name == "." || dir_name == "..") {
// Skip the "." and ".." dir.
continue;
}
android::Vector<const char *> ovector;
ovector.push(overlay_apk_path);
idmap_scan(target_package_name, target_apk_path, idmap_dir, &ovector);
}else{
int priority = parse_apk(overlay_apk_path, target_package_name);
if (priority < 0) {
continue;
}
if (idmap_create_path(target_apk_path, overlay_apk_path, idmap_path.string()) != 0) {
ALOGE("error: failed to create idmap for target=%s overlay=%s idmap=%s\n",
target_apk_path, overlay_apk_path, idmap_path.string());
continue;
}
String8 filename = String8(idmap_dir);
filename.appendPath("overlays.list");
if (unlink(filename.string()) != 0 && errno != ENOENT) {
return EXIT_FAILURE;
}
Overlay overlay(String8(overlay_apk_path), idmap_path, priority);
overlayVector.add(overlay);
String8 idmap_path(idmap_dir);
idmap_path.appendPath(flatten_path(overlay_apk_path + 1));
idmap_path.append("@idmap");
if (idmap_create_path(target_apk_path, overlay_apk_path, idmap_path.string()) != 0) {
ALOGE("error: failed to create idmap for target=%s overlay=%s idmap=%s\n",
target_apk_path, overlay_apk_path, idmap_path.string());
continue;
}
Overlay overlay(String8(overlay_apk_path), idmap_path, priority);
overlayVector.add(overlay);
if (!writePackagesList(filename.string(), overlayVector)) {
return EXIT_FAILURE;
}
}
}
closedir(dir);
}
if (!writePackagesList(filename.string(), overlayVector)) {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
......@@ -47,6 +47,7 @@ public class Input {
put("touchpad", InputDevice.SOURCE_TOUCHPAD);
put("touchnavigation", InputDevice.SOURCE_TOUCH_NAVIGATION);
put("joystick", InputDevice.SOURCE_JOYSTICK);
put("gesture", InputDevice.SOURCE_GESTURE_SENSOR);
}};
......
......@@ -222,6 +222,26 @@ public class Media extends BaseCommand {
System.out.println("onVolumeInfoChanged " + info);
}
@Override
public void onPlayItemResponse(boolean success) throws RemoteException {
System.out.println("onPlayItemResponse ");
}
@Override
public void onUpdateNowPlayingEntries(long[] playList) throws RemoteException {
System.out.println("onUpdateNowPlayingEntries ");
}
@Override
public void onUpdateFolderInfoBrowsedPlayer(String stringUri) throws RemoteException {
System.out.println("onUpdateFolderInfoBrowsedPlayer ");
}
@Override
public void onUpdateNowPlayingContentChange() throws RemoteException {
System.out.println("onUpdateNowPlayingContentChange ");
}
void printUsageMessage() {
try {
System.out.println("V2Monitoring session " + mController.getTag()
......
#!/system/bin/sh
# Script to start "pm" on the device, which has a very rudimentary
# shell.
#
......
......@@ -50,6 +50,7 @@ static void usage(const char* pname)
"usage: %s [-hp] [-d display-id] [FILENAME]\n"
" -h: this message\n"
" -p: save the file as a png.\n"
" -j: save the file as a jpeg.\n"
" -d: specify the display id to capture, default %d.\n"
"If FILENAME ends with .png it will be saved as a png.\n"
"If FILENAME is not given, the results will be printed to stdout.\n",
......@@ -88,13 +89,17 @@ int main(int argc, char** argv)
const char* pname = argv[0];
bool png = false;
bool jpeg = false;
int32_t displayId = DEFAULT_DISPLAY_ID;
int c;
while ((c = getopt(argc, argv, "phd:")) != -1) {
while ((c = getopt(argc, argv, "pjhd:")) != -1) {
switch (c) {
case 'p':
png = true;
break;
case 'j':
jpeg = true;
break;
case 'd':
displayId = atoi(optarg);
break;
......@@ -119,8 +124,14 @@ int main(int argc, char** argv)
return 1;
}
const int len = strlen(fn);
if (len >= 4 && 0 == strcmp(fn+len-4, ".png")) {
png = true;
if (len >= 4) {
if (0 == strcmp(fn+len-4, ".png")) {
png = true;
} else if (0 == strcmp(fn+len-4, ".jpg")) {
jpeg = true;
} else if (len > 4 && 0 == strcmp(fn+len-5, ".jpeg")) {
jpeg = true;
}
}
}
......@@ -174,11 +185,12 @@ int main(int argc, char** argv)
}
if (base != NULL) {
if (png) {
if (png || jpeg) {
const SkImageInfo info = SkImageInfo::Make(w, h, flinger2skia(f),
kPremul_SkAlphaType);
SkAutoTUnref<SkData> data(SkImageEncoder::EncodeData(info, base, s*bytesPerPixel(f),
SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality));
(png ? SkImageEncoder::kPNG_Type : SkImageEncoder::kJPEG_Type),
SkImageEncoder::kDefaultQuality));
if (data.get()) {
write(fd, data->data(), data->size());
}
......
......@@ -3,6 +3,8 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := org.cyanogenmod.platform.internal
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_MODULE := settings
LOCAL_MODULE_TAGS := optional
......
......@@ -30,6 +30,8 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import cyanogenmod.providers.CMSettings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
......@@ -51,6 +53,7 @@ public final class SettingsCmd {
String mTable = null;
String mKey = null;
String mValue = null;
boolean mUseCMSettingsProvider = false;
public static void main(String[] args) {
if (args == null || args.length < 2) {
......@@ -82,6 +85,8 @@ public final class SettingsCmd {
} else {
mUser = Integer.parseInt(arg);
}
} else if ("--cm".equals(arg)) {
mUseCMSettingsProvider = true;
} else if (mVerb == CommandVerb.UNSPECIFIED) {
if ("get".equalsIgnoreCase(arg)) {
mVerb = CommandVerb.GET;
......@@ -146,7 +151,8 @@ public final class SettingsCmd {
IBinder token = new Binder();
try {
ContentProviderHolder holder = activityManager.getContentProviderExternal(
"settings", UserHandle.USER_SYSTEM, token);
mUseCMSettingsProvider ? CMSettings.AUTHORITY : Settings.AUTHORITY,
UserHandle.USER_SYSTEM, token);
if (holder == null) {
throw new IllegalStateException("Could not find settings provider");
}
......@@ -189,9 +195,15 @@ public final class SettingsCmd {
}
private List<String> listForUser(IContentProvider provider, int userHandle, String table) {
final Uri uri = "system".equals(table) ? Settings.System.CONTENT_URI
: "secure".equals(table) ? Settings.Secure.CONTENT_URI
: "global".equals(table) ? Settings.Global.CONTENT_URI
final Uri systemUri = mUseCMSettingsProvider ?
CMSettings.System.CONTENT_URI : Settings.System.CONTENT_URI;
final Uri secureUri = mUseCMSettingsProvider ?
CMSettings.Secure.CONTENT_URI : Settings.Secure.CONTENT_URI;
final Uri globalUri = mUseCMSettingsProvider ?
CMSettings.Global.CONTENT_URI : Settings.Global.CONTENT_URI;
final Uri uri = "system".equals(table) ? systemUri
: "secure".equals(table) ? secureUri
: "global".equals(table) ? globalUri
: null;
final ArrayList<String> lines = new ArrayList<String>();
if (uri == null) {
......@@ -227,10 +239,16 @@ public final class SettingsCmd {
String getForUser(IContentProvider provider, int userHandle,
final String table, final String key) {
final String systemGetCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_GET_SYSTEM : Settings.CALL_METHOD_GET_SYSTEM;
final String secureGetCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_GET_SECURE : Settings.CALL_METHOD_GET_SECURE;
final String globalGetCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_GET_GLOBAL : Settings.CALL_METHOD_GET_GLOBAL;
final String callGetCommand;
if ("system".equals(table)) callGetCommand = Settings.CALL_METHOD_GET_SYSTEM;
else if ("secure".equals(table)) callGetCommand = Settings.CALL_METHOD_GET_SECURE;
else if ("global".equals(table)) callGetCommand = Settings.CALL_METHOD_GET_GLOBAL;
if ("system".equals(table)) callGetCommand = systemGetCommand;
else if ("secure".equals(table)) callGetCommand = secureGetCommand;
else if ("global".equals(table)) callGetCommand = globalGetCommand;
else {
System.err.println("Invalid table; no put performed");
throw new IllegalArgumentException("Invalid table " + table);
......@@ -239,7 +257,8 @@ public final class SettingsCmd {
String result = null;
try {
Bundle arg = new Bundle();
arg.putInt(Settings.CALL_METHOD_USER_KEY, userHandle);
arg.putInt(mUseCMSettingsProvider ? CMSettings.CALL_METHOD_USER_KEY
: Settings.CALL_METHOD_USER_KEY, userHandle);
Bundle b = provider.call(resolveCallingPackage(), callGetCommand, key, arg);
if (b != null) {
result = b.getPairValue();
......@@ -252,10 +271,16 @@ public final class SettingsCmd {
void putForUser(IContentProvider provider, int userHandle,
final String table, final String key, final String value) {
final String systemPutCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_PUT_SYSTEM : Settings.CALL_METHOD_PUT_SYSTEM;
final String securePutCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_PUT_SECURE : Settings.CALL_METHOD_PUT_SECURE;
final String globalPutCommand = mUseCMSettingsProvider ?
CMSettings.CALL_METHOD_PUT_GLOBAL : Settings.CALL_METHOD_PUT_GLOBAL;
final String callPutCommand;
if ("system".equals(table)) callPutCommand = Settings.CALL_METHOD_PUT_SYSTEM;
else if ("secure".equals(table)) callPutCommand = Settings.CALL_METHOD_PUT_SECURE;
else if ("global".equals(table)) callPutCommand = Settings.CALL_METHOD_PUT_GLOBAL;
if ("system".equals(table)) callPutCommand = systemPutCommand;
else if ("secure".equals(table)) callPutCommand = securePutCommand;
else if ("global".equals(table)) callPutCommand = globalPutCommand;
else {
System.err.println("Invalid table; no put performed");
return;
......@@ -264,7 +289,8 @@ public final class SettingsCmd {
try {
Bundle arg = new Bundle();
arg.putString(Settings.NameValueTable.VALUE, value);
arg.putInt(Settings.CALL_METHOD_USER_KEY, userHandle);
arg.putInt(mUseCMSettingsProvider ? CMSettings.CALL_METHOD_USER_KEY
: Settings.CALL_METHOD_USER_KEY, userHandle);
provider.call(resolveCallingPackage(), callPutCommand, key, arg);
} catch (RemoteException e) {
System.err.println("Can't set key " + key + " in " + table + " for user " + userHandle);
......@@ -273,10 +299,16 @@ public final class SettingsCmd {
int deleteForUser(IContentProvider provider, int userHandle,
final String table, final String key) {
final Uri systemUri = mUseCMSettingsProvider ?
CMSettings.System.getUriFor(key) : Settings.System.getUriFor(key);
final Uri secureUri = mUseCMSettingsProvider ?
CMSettings.Secure.getUriFor(key) : Settings.Secure.getUriFor(key);
final Uri globalUri = mUseCMSettingsProvider ?
CMSettings.Global.getUriFor(key) : Settings.Global.getUriFor(key);
Uri targetUri;
if ("system".equals(table)) targetUri = Settings.System.getUriFor(key);
else if ("secure".equals(table)) targetUri = Settings.Secure.getUriFor(key);
else if ("global".equals(table)) targetUri = Settings.Global.getUriFor(key);
if ("system".equals(table)) targetUri = systemUri;
else if ("secure".equals(table)) targetUri = secureUri;
else if ("global".equals(table)) targetUri = globalUri;
else {
System.err.println("Invalid table; no delete performed");
throw new IllegalArgumentException("Invalid table " + table);
......@@ -293,13 +325,14 @@ public final class SettingsCmd {
}
private static void printUsage() {
System.err.println("usage: settings [--user <USER_ID> | current] get namespace key");
System.err.println(" settings [--user <USER_ID> | current] put namespace key value");
System.err.println(" settings [--user <USER_ID> | current] delete namespace key");
System.err.println(" settings [--user <USER_ID> | current] list namespace");
System.err.println("usage: settings [--user <USER_ID> | current] [--cm] get namespace key");
System.err.println(" settings [--user <USER_ID> | current] [--cm] put namespace key value");
System.err.println(" settings [--user <USER_ID> | current] [--cm] delete namespace key");
System.err.println(" settings [--user <USER_ID> | current] [--cm] list namespace");
System.err.println("\n'namespace' is one of {system, secure, global}, case-insensitive");
System.err.println("If '--user <USER_ID> | current' is not given, the operations are "
+ "performed on the system user.");
System.err.println("If '--cm' is given, the operations are performed on the CMSettings provider.");
}
public static String resolveCallingPackage() {
......
......@@ -367,6 +367,7 @@ public class AccountManager {
* @return The account's password, null if none or if the account doesn't exist