diff --git a/Android.mk b/Android.mk index 99e0c464bc9..fb9c5ac5a4d 100644 --- a/Android.mk +++ b/Android.mk @@ -103,7 +103,6 @@ LOCAL_SRC_FILES += \ core/java/android/bluetooth/IBluetoothA2dpSink.aidl \ core/java/android/bluetooth/IBluetoothAvrcpController.aidl \ core/java/android/bluetooth/IBluetoothCallback.aidl \ - core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl \ core/java/android/bluetooth/IBluetoothHeadset.aidl \ core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \ core/java/android/bluetooth/IBluetoothHealth.aidl \ @@ -117,9 +116,12 @@ LOCAL_SRC_FILES += \ core/java/android/bluetooth/IBluetoothSap.aidl \ core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \ core/java/android/bluetooth/IBluetoothHeadsetClient.aidl \ + core/java/android/bluetooth/IBluetoothHidDevice.aidl \ + core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl \ 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 \ @@ -322,6 +324,8 @@ LOCAL_SRC_FILES += \ location/java/android/location/IGeofenceProvider.aidl \ location/java/android/location/IGpsMeasurementsListener.aidl \ location/java/android/location/IGpsNavigationMessageListener.aidl \ + location/java/android/location/IGeoFencer.aidl \ + location/java/android/location/IGeoFenceListener.aidl \ location/java/android/location/IGpsStatusListener.aidl \ location/java/android/location/IGpsStatusProvider.aidl \ location/java/android/location/ILocationListener.aidl \ @@ -405,6 +409,7 @@ LOCAL_SRC_FILES += \ telephony/java/com/android/internal/telephony/ITelephony.aidl \ telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \ telephony/java/com/android/internal/telephony/IWapPushManager.aidl \ + telephony/java/com/android/internal/telephony/IExtTelephony.aidl \ wifi/java/android/net/wifi/IWifiManager.aidl \ wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl \ wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \ diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 8f361ce1a77..985a8856b64 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -238,6 +238,16 @@ status_t BootAnimation::readyToRun() { if (status) return -1; + char value[PROPERTY_VALUE_MAX]; + property_get("persist.panel.orientation", value, "0"); + int orient = atoi(value)/90; + if (orient == eOrientation90 || orient == eOrientation270) { + int temp = dinfo.h; + dinfo.h = dinfo.w; + dinfo.w = temp; + } + Rect destRect(dinfo.w, dinfo.h); + mSession->setDisplayProjection(dtoken, orient, destRect, destRect); // create the native surface sp control = session()->createSurface(String8("BootAnimation"), dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565); diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h index f968b255d37..b2f9f1f59ed 100644 --- a/cmds/bootanimation/BootAnimation.h +++ b/cmds/bootanimation/BootAnimation.h @@ -51,6 +51,12 @@ class BootAnimation : public Thread, public IBinder::DeathRecipient virtual void onFirstRef(); virtual void binderDied(const wp& who); + enum { + eOrientationDefault = 0, + eOrientation90 = 1, + eOrientation180 = 2, + eOrientation270 = 3, + }; struct Texture { GLint w; GLint h; diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp index 41395f13ce5..929f0475f9a 100644 --- a/cmds/idmap/create.cpp +++ b/cmds/idmap/create.cpp @@ -33,6 +33,7 @@ namespace { int open_idmap(const char *path) { int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)); + bool needUnlink = true; if (fd == -1) { ALOGD("error: open %s: %s\n", path, strerror(errno)); goto fail; @@ -43,6 +44,8 @@ namespace { } if (TEMP_FAILURE_RETRY(flock(fd, LOCK_EX | LOCK_NB)) != 0) { ALOGD("error: flock %s: %s\n", path, strerror(errno)); + // If the file is locked by another process, then we needn't unlink the file. + needUnlink = false; goto fail; } @@ -50,7 +53,7 @@ namespace { fail: if (fd != -1) { close(fd); - unlink(path); + if (needUnlink) unlink(path); } return -1; } diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp index 612a7ebb548..3f61b625052 100644 --- a/cmds/idmap/scan.cpp +++ b/cmds/idmap/scan.cpp @@ -25,8 +25,7 @@ namespace { bool operator<(Overlay const& rhs) const { - // Note: order is reversed by design - return rhs.priority < priority; + return rhs.priority > priority; } String8 apk_path; @@ -165,6 +164,62 @@ namespace { delete dataMap; return priority; } + + int idmap_scan(const char *overlay_dir, const char *target_package_name, + const char *target_apk_path, const char *idmap_dir, + SortedVector& overlayVector) + { + DIR *dir = opendir(overlay_dir); + if (dir == NULL) { + return EXIT_FAILURE; + } + + struct dirent *dirent; + while ((dirent = readdir(dir)) != NULL) { + 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) && !S_ISDIR(st.st_mode)) { + continue; + } + + if (S_ISDIR(st.st_mode)) { + String8 dir_name = String8(overlay_apk_path).getPathLeaf(); + if (dir_name == "." || dir_name == "..") { + // Skip the "." and ".." dir. + continue; + } + idmap_scan(overlay_apk_path, target_package_name, target_apk_path, idmap_dir, + overlayVector); + } else { + int priority = parse_apk(overlay_apk_path, target_package_name); + if (priority < 0) { + continue; + } + + 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); + } + } + + closedir(dir); + + return EXIT_SUCCESS; + } } int idmap_scan(const char *overlay_dir, const char *target_package_name, @@ -176,48 +231,13 @@ int idmap_scan(const char *overlay_dir, const char *target_package_name, return EXIT_FAILURE; } - DIR *dir = opendir(overlay_dir); - if (dir == NULL) { - return EXIT_FAILURE; - } - SortedVector overlayVector; - struct dirent *dirent; - while ((dirent = readdir(dir)) != NULL) { - 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) { - continue; - } - - 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); - } - - closedir(dir); + int res = idmap_scan(overlay_dir, target_package_name, target_apk_path, idmap_dir, + overlayVector); - if (!writePackagesList(filename.string(), overlayVector)) { + if (res == EXIT_FAILURE || !writePackagesList(filename.string(), overlayVector)) { return EXIT_FAILURE; } - return EXIT_SUCCESS; + return res; } diff --git a/cmds/media/src/com/android/commands/media/Media.java b/cmds/media/src/com/android/commands/media/Media.java index d7f23cb4409..d185b5625d4 100644 --- a/cmds/media/src/com/android/commands/media/Media.java +++ b/cmds/media/src/com/android/commands/media/Media.java @@ -222,6 +222,26 @@ public void onVolumeInfoChanged(ParcelableVolumeInfo info) throws RemoteExceptio 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() diff --git a/core/java/android/accounts/AccountManager.java b/core/java/android/accounts/AccountManager.java index 9ef13de6d44..eb59f6bd037 100644 --- a/core/java/android/accounts/AccountManager.java +++ b/core/java/android/accounts/AccountManager.java @@ -329,6 +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(22); if (account == null) throw new IllegalArgumentException("account is null"); try { return mService.getPassword(account); @@ -357,6 +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(23); if (account == null) throw new IllegalArgumentException("account is null"); if (key == null) throw new IllegalArgumentException("key is null"); try { @@ -567,6 +569,7 @@ public AccountManagerFuture getAuthTokenLabel( if (authTokenType == null) throw new IllegalArgumentException("authTokenType is null"); return new Future2Task(handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.getAuthTokenLabel(mResponse, accountType, authTokenType); } @@ -612,6 +615,7 @@ public AccountManagerFuture hasFeatures(final Account account, if (features == null) throw new IllegalArgumentException("features is null"); return new Future2Task(handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.hasFeatures(mResponse, account, features, mContext.getOpPackageName()); } public Boolean bundleToResult(Bundle bundle) throws AuthenticatorException { @@ -664,6 +668,7 @@ public AccountManagerFuture getAccountsByTypeAndFeatures( if (type == null) throw new IllegalArgumentException("type is null"); return new Future2Task(handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.getAccountsByFeatures(mResponse, type, features, mContext.getOpPackageName()); } @@ -707,6 +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(24); if (account == null) throw new IllegalArgumentException("account is null"); try { return mService.addAccountExplicitly(account, password, userdata); @@ -777,6 +783,7 @@ public AccountManagerFuture renameAccount( return new Future2Task(handler, callback) { @Override public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.renameAccount(mResponse, account, newName); } @Override @@ -837,10 +844,12 @@ public String getPreviousName(final Account account) { @Deprecated public AccountManagerFuture removeAccount(final Account account, AccountManagerCallback callback, Handler handler) { + android.util.SeempLog.record(25); if (account == null) throw new IllegalArgumentException("account is null"); return new Future2Task(handler, callback) { @Override public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.removeAccount(mResponse, account, false); } @Override @@ -896,10 +905,12 @@ public Boolean bundleToResult(Bundle bundle) throws AuthenticatorException { */ public AccountManagerFuture removeAccount(final Account account, final Activity activity, AccountManagerCallback callback, Handler handler) { + android.util.SeempLog.record(28); if (account == null) throw new IllegalArgumentException("account is null"); return new AmsTask(activity, handler, callback) { @Override public void doWork() throws RemoteException { + android.util.SeempLog.record(34); mService.removeAccount(mResponse, account, activity != null); } }.start(); @@ -921,6 +932,7 @@ public AccountManagerFuture removeAccountAsUser(final Account account, return new Future2Task(handler, callback) { @Override public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.removeAccountAsUser(mResponse, account, false, userHandle.getIdentifier()); } @Override @@ -946,6 +958,7 @@ public AccountManagerFuture removeAccountAsUser(final Account account, throw new IllegalArgumentException("userHandle is null"); return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(34); mService.removeAccountAsUser(mResponse, account, activity != null, userHandle.getIdentifier()); } @@ -1062,6 +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(26); if (account == null) throw new IllegalArgumentException("account is null"); try { mService.setPassword(account, password); @@ -1091,6 +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(27); if (account == null) throw new IllegalArgumentException("account is null"); try { mService.clearPassword(account); @@ -1119,6 +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(28); if (account == null) throw new IllegalArgumentException("account is null"); if (key == null) throw new IllegalArgumentException("key is null"); try { @@ -1270,6 +1286,7 @@ public AccountManagerFuture getAuthToken( optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.getAuthToken(mResponse, account, authTokenType, false /* notifyOnAuthFailure */, true /* expectActivityLaunch */, optionsIn); @@ -1438,6 +1455,7 @@ public AccountManagerFuture getAuthToken( optionsIn.putString(KEY_ANDROID_PACKAGE_NAME, mContext.getPackageName()); return new AmsTask(null, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.getAuthToken(mResponse, account, authTokenType, notifyAuthFailure, false /* expectActivityLaunch */, optionsIn); } @@ -1498,6 +1516,7 @@ public AccountManagerFuture addAccount(final String accountType, final String authTokenType, final String[] requiredFeatures, final Bundle addAccountOptions, final Activity activity, AccountManagerCallback callback, Handler handler) { + android.util.SeempLog.record(29); if (accountType == null) throw new IllegalArgumentException("accountType is null"); final Bundle optionsIn = new Bundle(); if (addAccountOptions != null) { @@ -1507,6 +1526,7 @@ public AccountManagerFuture addAccount(final String accountType, return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.addAccount(mResponse, accountType, authTokenType, requiredFeatures, activity != null, optionsIn); } @@ -1531,6 +1551,7 @@ public AccountManagerFuture addAccountAsUser(final String accountType, return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.addAccountAsUser(mResponse, accountType, authTokenType, requiredFeatures, activity != null, optionsIn, userHandle.getIdentifier()); } @@ -1578,6 +1599,7 @@ public AccountManagerFuture copyAccountToUser( return new Future2Task(handler, callback) { @Override public void doWork() throws RemoteException { + android.util.SeempLog.record(34); mService.copyAccountToUser( mResponse, account, UserHandle.USER_OWNER, user.getIdentifier()); } @@ -1705,6 +1727,7 @@ public AccountManagerFuture confirmCredentialsAsUser(final Account accou final int userId = userHandle.getIdentifier(); return new AmsTask(activity, handler, callback) { public void doWork() throws RemoteException { + android.util.SeempLog.record(31); mService.confirmCredentialsAsUser(mResponse, account, options, activity != null, userId); } @@ -1817,9 +1840,11 @@ public void doWork() throws RemoteException { public AccountManagerFuture editProperties(final String accountType, final Activity activity, final AccountManagerCallback callback, final Handler handler) { + 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(31); mService.editProperties(mResponse, accountType, activity != null); } }.start(); @@ -2175,6 +2200,7 @@ private class GetAuthTokenByTypeAndFeaturesTask private volatile int mNumAccounts = 0; public void doWork() throws RemoteException { + android.util.SeempLog.record(31); getAccountsByTypeAndFeatures(mAccountType, mFeatures, new AccountManagerCallback() { public void run(AccountManagerFuture future) { diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java index 330d730b89c..b0afe7c2a75 100644 --- a/core/java/android/app/AlarmManager.java +++ b/core/java/android/app/AlarmManager.java @@ -100,6 +100,14 @@ public class AlarmManager { */ public static final int ELAPSED_REALTIME = 3; + /** @hide + * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()} + * (wall clock time in UTC), which will wake up the device when + * it goes off. And it will power on the devices when it shuts down. + * Set as 5 to make it be compatible with android_alarm_type. + */ + public static final int RTC_POWEROFF_WAKEUP = 5; + /** * Broadcast Action: Sent after the value returned by * {@link #getNextAlarmClock()} has changed. diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index 09c0a6e3ae4..6d8144d897b 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,6 +31,7 @@ import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; +import android.os.SystemProperties; import android.os.UserManager; import android.util.ArrayMap; @@ -69,6 +73,10 @@ public class AppOpsManager { * will do this for you). */ + /** {@hide */ + public static final String ACTION_SU_SESSION_CHANGED = + "android.intent.action.SU_SESSION_CHANGED"; + final Context mContext; final IAppOpsService mService; final ArrayMap mModeWatchers @@ -103,9 +111,18 @@ public class AppOpsManager { */ public static final int MODE_DEFAULT = 3; + /** + * @hide Result from {@link #checkOp}, {@link #noteOp}, {@link #startOp}: + * AppOps Service should show a dialog box on screen to get user + * permission. + */ + public static final int MODE_ASK = 4; + // when adding one of these: // - increment _NUM_OP - // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode + // - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode, + // sOpDefaultStrictMode, sOpToOpString, sOpStrictMode. + // - add descriptive strings to frameworks/base/core/res/res/values/config.xml // - add descriptive strings to Settings/res/values/arrays.xml // - add the op to the appropriate template in AppOpsState.OpsTemplate (settings app) @@ -237,8 +254,20 @@ public class AppOpsManager { public static final int OP_TURN_SCREEN_ON = 61; /** @hide Get device accounts. */ public static final int OP_GET_ACCOUNTS = 62; + /** @hide Wifi state change **/ + public static final int OP_WIFI_CHANGE = 63; + /** @hide */ + public static final int OP_BLUETOOTH_CHANGE = 64; /** @hide */ - public static final int _NUM_OP = 63; + public static final int OP_BOOT_COMPLETED = 65; + /** @hide */ + public static final int OP_NFC_CHANGE = 66; + /** @hide */ + public static final int OP_DATA_CONNECT_CHANGE = 67; + /** @hide */ + public static final int OP_SU = 68; + /** @hide */ + public static final int _NUM_OP = 69; /** Access to coarse location information. */ public static final String OPSTR_COARSE_LOCATION = "android:coarse_location"; @@ -336,6 +365,19 @@ public class AppOpsManager { /** @hide Get device accounts. */ public static final String OPSTR_GET_ACCOUNTS = "android:get_accounts"; + /** @hide **/ + private static final String OPSTR_WIFI_CHANGE = + "android:wifi_change"; + private static final String OPSTR_BLUETOOTH_CHANGE = + "android:bluetooth_change"; + private static final String OPSTR_BOOT_COMPLETED = + "android:boot_completed"; + private static final String OPSTR_NFC_CHANGE = + "android:nfc_change"; + private static final String OPSTR_DATA_CONNECT_CHANGE = + "android:data_connect_change"; + private static final String OPSTR_SU = + "android:su"; /** * This maps each operation to the operation that serves as the @@ -356,7 +398,7 @@ public class AppOpsManager { OP_WRITE_CALL_LOG, OP_READ_CALENDAR, OP_WRITE_CALENDAR, - OP_COARSE_LOCATION, + OP_WIFI_SCAN, OP_POST_NOTIFICATION, OP_COARSE_LOCATION, OP_CALL_PHONE, @@ -409,6 +451,12 @@ public class AppOpsManager { OP_WRITE_EXTERNAL_STORAGE, OP_TURN_SCREEN_ON, OP_GET_ACCOUNTS, + OP_WIFI_CHANGE, + OP_BLUETOOTH_CHANGE, + OP_BOOT_COMPLETED, + OP_NFC_CHANGE, + OP_DATA_CONNECT_CHANGE, + OP_SU }; /** @@ -478,7 +526,13 @@ public class AppOpsManager { OPSTR_READ_EXTERNAL_STORAGE, OPSTR_WRITE_EXTERNAL_STORAGE, null, - OPSTR_GET_ACCOUNTS + OPSTR_GET_ACCOUNTS, + OPSTR_WIFI_CHANGE, + OPSTR_BLUETOOTH_CHANGE, + OPSTR_BOOT_COMPLETED, + OPSTR_NFC_CHANGE, + OPSTR_DATA_CONNECT_CHANGE, + OPSTR_SU, }; /** @@ -549,6 +603,12 @@ public class AppOpsManager { "WRITE_EXTERNAL_STORAGE", "TURN_ON_SCREEN", "GET_ACCOUNTS", + "WIFI_CHANGE", + "BLUETOOTH_CHANGE", + "BOOT_COMPLETED", + "NFC_CHANGE", + "DATA_CONNECT_CHANGE", + "SU", }; /** @@ -566,7 +626,7 @@ public class AppOpsManager { android.Manifest.permission.WRITE_CALL_LOG, android.Manifest.permission.READ_CALENDAR, android.Manifest.permission.WRITE_CALENDAR, - android.Manifest.permission.ACCESS_WIFI_STATE, + null, // no permission for wifi scan available null, // no permission required for notifications null, // neighboring cells shares the coarse location perm android.Manifest.permission.CALL_PHONE, @@ -618,7 +678,13 @@ public class AppOpsManager { Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, null, // no permission for turning the screen on - Manifest.permission.GET_ACCOUNTS + Manifest.permission.GET_ACCOUNTS, + Manifest.permission.CHANGE_WIFI_STATE, + null, + Manifest.permission.RECEIVE_BOOT_COMPLETED, + Manifest.permission.NFC, + Manifest.permission.MODIFY_PHONE_STATE, + null, }; /** @@ -690,6 +756,12 @@ public class AppOpsManager { null, // WRITE_EXTERNAL_STORAGE null, // TURN_ON_SCREEN null, // GET_ACCOUNTS + null, //WIFI_CHANGE + null, //BLUETOOTH_CHANGE + null, //BOOT_COMPLETED + null, //NFC_CHANGE + null, //DATA_CONNECT_CHANGE + UserManager.DISALLOW_SU, //SU TODO: this should really be investigated. }; /** @@ -760,6 +832,12 @@ public class AppOpsManager { false, // WRITE_EXTERNAL_STORAGE false, // TURN_ON_SCREEN false, // GET_ACCOUNTS + true, // WIFI_CHANGE + true, // BLUETOOTH_CHANGE + true, // BOOT_COMPLETED + true, // NFC_CHANGE + true, //DATA_CONNECT_CHANGE + false, //SU }; /** @@ -829,6 +907,163 @@ public class AppOpsManager { AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ALLOWED, // OP_TURN_ON_SCREEN AppOpsManager.MODE_ALLOWED, + AppOpsManager.MODE_ALLOWED, // OP_WIFI_CHANGE + AppOpsManager.MODE_ALLOWED, // OP_BLUETOOTH_CHANGE + AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED + AppOpsManager.MODE_ALLOWED, // OP_NFC_CHANGE + AppOpsManager.MODE_ALLOWED, + AppOpsManager.MODE_ASK, // OP_SU + }; + + /** + * This specifies the default mode for each strict operation. + */ + + private static int[] sOpDefaultStrictMode = new int[] { + AppOpsManager.MODE_ASK, // OP_COARSE_LOCATION + AppOpsManager.MODE_ASK, // OP_FINE_LOCATION + AppOpsManager.MODE_ASK, // OP_GPS + AppOpsManager.MODE_ALLOWED, // OP_VIBRATE + AppOpsManager.MODE_ASK, // OP_READ_CONTACTS + AppOpsManager.MODE_ASK, // OP_WRITE_CONTACTS + AppOpsManager.MODE_ASK, // OP_READ_CALL_LOG + AppOpsManager.MODE_ASK, // OP_WRITE_CALL_LOG + AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR + AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR + AppOpsManager.MODE_ASK, // OP_WIFI_SCAN + AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION + AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS + AppOpsManager.MODE_ASK, // OP_CALL_PHONE + AppOpsManager.MODE_ASK, // OP_READ_SMS + AppOpsManager.MODE_ASK, // OP_WRITE_SMS + AppOpsManager.MODE_ASK, // OP_RECEIVE_SMS + AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS + AppOpsManager.MODE_ASK, // OP_RECEIVE_MMS + AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH + AppOpsManager.MODE_ASK, // OP_SEND_SMS + AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS + AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS + AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS + AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW + AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS + AppOpsManager.MODE_ASK, // OP_CAMERA + AppOpsManager.MODE_ASK, // OP_RECORD_AUDIO + AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO + AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD + AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD + AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS + AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME + AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK + AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION + AppOpsManager.MODE_ASK, // OP_MONITOR_HIGH_POWER_LOCATION + AppOpsManager.MODE_DEFAULT, // OP_GET_USAGE_STATS + AppOpsManager.MODE_ALLOWED, // OP_MUTE_MICROPHONE + AppOpsManager.MODE_ALLOWED, // OP_TOAST_WINDOW + AppOpsManager.MODE_IGNORED, // OP_PROJECT_MEDIA + AppOpsManager.MODE_IGNORED, // OP_ACTIVATE_VPN + AppOpsManager.MODE_ALLOWED, // OP WALLPAPER + AppOpsManager.MODE_ALLOWED, // OP_ASSIST_STRUCTURE + AppOpsManager.MODE_ALLOWED, // OP_ASSIST_SCREENSHOT + AppOpsManager.MODE_ALLOWED, // OP_READ_PHONE_STATE + AppOpsManager.MODE_ALLOWED, // OP_ADD_VOICEMAIL + AppOpsManager.MODE_ALLOWED, // OP_USE_SIP + AppOpsManager.MODE_ALLOWED, // OP_PROCESS_OUTGOING_CALLS + AppOpsManager.MODE_ALLOWED, // OP_USE_FINGERPRINT + AppOpsManager.MODE_ALLOWED, // OP_BODY_SENSORS + AppOpsManager.MODE_ALLOWED, // OP_READ_CELL_BROADCASTS + AppOpsManager.MODE_ERRORED, // OP_MOCK_LOCATION + AppOpsManager.MODE_ALLOWED, // OP_READ_EXTERNAL_STORAGE + AppOpsManager.MODE_ALLOWED, // OP_WRITE_EXTERNAL_STORAGE + AppOpsManager.MODE_ALLOWED, // OP_TURN_ON_SCREEN + AppOpsManager.MODE_ALLOWED, // OP_GET_ACCOUNTS + AppOpsManager.MODE_ASK, // OP_WIFI_CHANGE + AppOpsManager.MODE_ASK, // OP_BLUETOOTH_CHANGE + AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED + AppOpsManager.MODE_ASK, // OP_NFC_CHANGE + AppOpsManager.MODE_ASK, // OP_DATA_CONNECT_CHANGE + AppOpsManager.MODE_ASK, // OP_SU + }; + + /** + * This specifies if operation is in strict mode. + */ + private final static boolean[] sOpStrictMode = new boolean[] { + true, // OP_COARSE_LOCATION + true, // OP_FINE_LOCATION + true, // OP_GPS + false, // OP_VIBRATE + true, // OP_READ_CONTACTS + true, // OP_WRITE_CONTACTS + true, // OP_READ_CALL_LOG + true, // OP_WRITE_CALL_LOG + false, // OP_READ_CALENDAR + false, // OP_WRITE_CALENDAR + true, // OP_WIFI_SCAN + false, // OP_POST_NOTIFICATION + false, // OP_NEIGHBORING_CELLS + true, // OP_CALL_PHONE + true, // OP_READ_SMS + true, // OP_WRITE_SMS + false, // OP_RECEIVE_SMS + false, // OP_RECEIVE_EMERGECY_SMS + true, // OP_RECEIVE_MMS + false, // OP_RECEIVE_WAP_PUSH + true, // OP_SEND_SMS + false, // OP_READ_ICC_SMS + false, // OP_WRITE_ICC_SMS + false, // OP_WRITE_SETTINGS + false, // OP_SYSTEM_ALERT_WINDOW + false, // OP_ACCESS_NOTIFICATIONS + true, // OP_CAMERA + true, // OP_RECORD_AUDIO + false, // OP_PLAY_AUDIO + false, // OP_READ_CLIPBOARD + false, // OP_WRITE_CLIPBOARD + false, // OP_TAKE_MEDIA_BUTTONS + false, // OP_TAKE_AUDIO_FOCUS + false, // OP_AUDIO_MASTER_VOLUME + false, // OP_AUDIO_VOICE_VOLUME + false, // OP_AUDIO_RING_VOLUME + false, // OP_AUDIO_MEDIA_VOLUME + false, // OP_AUDIO_ALARM_VOLUME + false, // OP_AUDIO_NOTIFICATION_VOLUME + false, // OP_AUDIO_BLUETOOTH_VOLUME + false, // OP_WAKE_LOCK + false, // OP_MONITOR_LOCATION + true, // OP_MONITOR_HIGH_POWER_LOCATION + false, // OP_GET_USAGE_STATS + false, // OP_MUTE_MICROPHONE + false, // OP_TOAST_WINDOW + false, // OP_PROJECT_MEDIA + false, // OP_ACTIVATE_VPN + true, // OP WALLPAPER + false, //ASSIST_STRUCTURE + false, //ASSIST_SCREENSHOT + false, //READ_PHONE_STATE + false, //ADD_VOICEMAIL + false, // USE_SIP + false, // PROCESS_OUTGOING_CALLS + false, // USE_FINGERPRINT + false, // BODY_SENSORS + false, // READ_CELL_BROADCASTS + false, // MOCK_LOCATION + true, // READ_EXTERNAL_STORAGE + true, // WRITE_EXTERNAL_STORAGE + false, // TURN_ON_SCREEN + false, // GET_ACCOUNTS + true, // OP_WIFI_CHANGE + true, // OP_BLUETOOTH_CHANGE + false, // OP_BOOT_COMPLETED + true, // OP_NFC_CHANGE + true, // OP_DATA_CONNECT_CHANGE + true, // OP_SU }; /** @@ -901,7 +1136,13 @@ public class AppOpsManager { false, false, false, - false + false, + false, // OP_WIFI_CHANGE + false, // OP_BLUETOOTH_CHANGE + false, // OP_BOOT_COMPLETED + false, // OP_NFC_CHANGE + false, // OP_DATA_CONNECT_CHANGE + false, // OP_SU }; /** @@ -914,6 +1155,8 @@ public class AppOpsManager { */ private static HashMap sPermToOp = new HashMap<>(); + private static HashMap sNameToOp = new HashMap(); + static { if (sOpToSwitch.length != _NUM_OP) { throw new IllegalStateException("sOpToSwitch length " + sOpToSwitch.length @@ -935,6 +1178,10 @@ public class AppOpsManager { throw new IllegalStateException("sOpDefaultMode length " + sOpDefaultMode.length + " should be " + _NUM_OP); } + if (sOpDefaultStrictMode.length != _NUM_OP) { + throw new IllegalStateException("sOpDefaultStrictMode length " + + sOpDefaultStrictMode.length + " should be " + _NUM_OP); + } if (sOpDisableReset.length != _NUM_OP) { throw new IllegalStateException("sOpDisableReset length " + sOpDisableReset.length + " should be " + _NUM_OP); @@ -947,6 +1194,10 @@ public class AppOpsManager { throw new IllegalStateException("sOpAllowSYstemRestrictionsBypass length " + sOpRestrictions.length + " should be " + _NUM_OP); } + if (sOpStrictMode.length != _NUM_OP) { + throw new IllegalStateException("sOpStrictMode length " + + sOpStrictMode.length + " should be " + _NUM_OP); + } for (int i=0; i<_NUM_OP; i++) { if (sOpToString[i] != null) { sOpStrToOp.put(sOpToString[i], i); @@ -957,6 +1208,9 @@ public class AppOpsManager { sPermToOp.put(sOpPerms[i], i); } } + for (int i=0; i<_NUM_OP; i++) { + sNameToOp.put(sOpNames[i], i); + } } /** @@ -988,6 +1242,15 @@ public static int strDebugOpToOp(String op) { throw new IllegalArgumentException("Unknown operation string: " + op); } + /** + * Map a non-localized name for the operation back to the Op number + * @hide + */ + public static int nameToOp(String name) { + Integer val = sNameToOp.get(name); + return val != null ? val : OP_NONE; + } + /** * Retrieve the permission associated with an operation, or null if there is not one. * @hide @@ -1026,7 +1289,9 @@ public static boolean opAllowSystemBypassRestriction(int op) { * Retrieve the default mode for the operation. * @hide */ - public static int opToDefaultMode(int op) { + public static int opToDefaultMode(int op, boolean isStrict) { + if (isStrict) + return sOpDefaultStrictMode[op]; return sOpDefaultMode[op]; } @@ -1113,9 +1378,16 @@ public static class OpEntry implements Parcelable { private final int mDuration; private final int mProxyUid; private final String mProxyPackageName; + private final int mAllowedCount; + private final int mIgnoredCount; public OpEntry(int op, int mode, long time, long rejectTime, int duration, - int proxyUid, String proxyPackage) { + int proxyUid, String proxyPackage) { + this(op, mode, time, rejectTime, duration, proxyUid, proxyPackage, 0, 0); + } + + public OpEntry(int op, int mode, long time, long rejectTime, int duration, + int proxyUid, String proxyPackage, int allowedCount, int ignoredCount) { mOp = op; mMode = mode; mTime = time; @@ -1123,6 +1395,8 @@ public OpEntry(int op, int mode, long time, long rejectTime, int duration, mDuration = duration; mProxyUid = proxyUid; mProxyPackageName = proxyPackage; + mAllowedCount = allowedCount; + mIgnoredCount = ignoredCount; } public int getOp() { @@ -1157,6 +1431,14 @@ public String getProxyPackageName() { return mProxyPackageName; } + public int getAllowedCount() { + return mAllowedCount; + } + + public int getIgnoredCount() { + return mIgnoredCount; + } + @Override public int describeContents() { return 0; @@ -1171,6 +1453,8 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mDuration); dest.writeInt(mProxyUid); dest.writeString(mProxyPackageName); + dest.writeInt(mAllowedCount); + dest.writeInt(mIgnoredCount); } OpEntry(Parcel source) { @@ -1181,6 +1465,8 @@ public void writeToParcel(Parcel dest, int flags) { mDuration = source.readInt(); mProxyUid = source.readInt(); mProxyPackageName = source.readString(); + mAllowedCount = source.readInt(); + mIgnoredCount = source.readInt(); } public static final Creator CREATOR = new Creator() { @@ -1753,4 +2039,75 @@ public void finishOp(int op, int uid, String packageName) { public void finishOp(int op) { finishOp(op, Process.myUid(), mContext.getOpPackageName()); } + + /** @hide */ + public static boolean isStrictEnable() { + return SystemProperties.getBoolean("persist.sys.strict_op_enable", false); + } + + /** + * Check if op in strict mode + * @hide + */ + public static boolean isStrictOp(int code) { + return sOpStrictMode[code]; + } + + + /** @hide */ + public static int stringToMode(String permission) { + if ("allowed".equalsIgnoreCase(permission)) { + return AppOpsManager.MODE_ALLOWED; + } else if ("ignored".equalsIgnoreCase(permission)) { + return AppOpsManager.MODE_IGNORED; + } else if ("ask".equalsIgnoreCase(permission)) { + return AppOpsManager.MODE_ASK; + } + return AppOpsManager.MODE_ERRORED; + } + + /** @hide */ + public static int stringOpToOp (String op) { + Integer val = sOpStrToOp.get(op); + if (val == null) { + val = OP_NONE; + } + return val; + } + + /** @hide */ + public boolean isControlAllowed(int op, String packageName) { + boolean isShow = true; + try { + isShow = mService.isControlAllowed(op, packageName); + } catch (RemoteException e) { + } + return isShow; + } + + /** @hide */ + public boolean getPrivacyGuardSettingForPackage(int uid, String packageName) { + try { + return mService.getPrivacyGuardSettingForPackage(uid, packageName); + } catch (RemoteException e) { + } + return false; + } + + /** @hide */ + public void setPrivacyGuardSettingForPackage(int uid, String packageName, + boolean state) { + try { + mService.setPrivacyGuardSettingForPackage(uid, packageName, state); + } catch (RemoteException e) { + } + } + + /** @hide */ + public void resetCounters() { + try { + mService.resetCounters(); + } catch (RemoteException e) { + } + } } diff --git a/core/java/android/app/IAlarmManager.aidl b/core/java/android/app/IAlarmManager.aidl index 327c00b8f65..4fdbfaa2b80 100644 --- a/core/java/android/app/IAlarmManager.aidl +++ b/core/java/android/app/IAlarmManager.aidl @@ -35,6 +35,8 @@ interface IAlarmManager { void remove(in PendingIntent operation); long getNextWakeFromIdleTime(); AlarmManager.AlarmClockInfo getNextAlarmClock(int userId); + // update the uids being synchronized by network socket request manager + void updateBlockedUids(int uid, boolean isBlocked); } diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index 69b8b9510b3..cddcd9fe459 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -374,6 +374,7 @@ public void runOnMainSync(Runnable runner) { * @see Context#startActivity */ public Activity startActivitySync(Intent intent) { + android.util.SeempLog.record_str(376, intent.toString()); validateNotAppThread(); synchronized (mSync) { @@ -1481,6 +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(377, intent.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; Uri referrer = target != null ? target.onProvideReferrer() : null; if (referrer != null) { @@ -1541,6 +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(378, intents.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; if (mActivityMonitors != null) { synchronized (mSync) { @@ -1604,6 +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(377, intent.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; if (mActivityMonitors != null) { synchronized (mSync) { @@ -1664,6 +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(377, intent.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; if (mActivityMonitors != null) { synchronized (mSync) { @@ -1703,6 +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(379, intent.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; if (mActivityMonitors != null) { synchronized (mSync) { @@ -1741,6 +1747,7 @@ public ActivityResult execStartActivityAsCaller( public void execStartActivityFromAppTask( Context who, IBinder contextThread, IAppTask appTask, Intent intent, Bundle options) { + android.util.SeempLog.record_str(380, intent.toString()); IApplicationThread whoThread = (IApplicationThread) contextThread; if (mActivityMonitors != null) { synchronized (mSync) { diff --git a/core/java/android/bluetooth/BluetoothA2dpSink.java b/core/java/android/bluetooth/BluetoothA2dpSink.java old mode 100644 new mode 100755 index 2e273459add..74302f27ec1 --- a/core/java/android/bluetooth/BluetoothA2dpSink.java +++ b/core/java/android/bluetooth/BluetoothA2dpSink.java @@ -370,6 +370,89 @@ && isValidDevice(device)) { return null; } + /** + * Set priority of the profile + * + *

The device should already be paired. + * Priority can be one of {@link #PRIORITY_ON} orgetBluetoothManager + * {@link #PRIORITY_OFF}, + * + *

Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. + * + * @param device Paired bluetooth device + * @param priority + * @return true if priority is set, false on error + * @hide + */ + public boolean setPriority(BluetoothDevice device, int priority) { + if (DBG) log("setPriority(" + device + ", " + priority + ")"); + if (mService != null && isEnabled() + && isValidDevice(device)) { + if (priority != BluetoothProfile.PRIORITY_OFF && + priority != BluetoothProfile.PRIORITY_ON){ + return false; + } + try { + return mService.setPriority(device, priority); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + + /** + * Get the priority of the profile. + * + *

The priority can be any of: + * {@link #PRIORITY_AUTO_CONNECT}, {@link #PRIORITY_OFF}, + * {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED} + * + *

Requires {@link android.Manifest.permission#BLUETOOTH} permission. + * + * @param device Bluetooth device + * @return priority of the device + * @hide + */ + public int getPriority(BluetoothDevice device) { + if (VDBG) log("getPriority(" + device + ")"); + if (mService != null && isEnabled() + && isValidDevice(device)) { + try { + return mService.getPriority(device); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return BluetoothProfile.PRIORITY_OFF; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return BluetoothProfile.PRIORITY_OFF; + } + + /** + * Check if A2DP profile is streaming music. + * + *

Requires {@link android.Manifest.permission#BLUETOOTH} permission. + * + * @param device BluetoothDevice device + */ + public boolean isA2dpPlaying(BluetoothDevice device) { + if (mService != null && isEnabled() + && isValidDevice(device)) { + try { + return mService.isA2dpPlaying(device); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + /** * Helper for converting a state to a string. * diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 1f3ff514871..24beba60a9f 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1,6 +1,8 @@ /* * Copyright (C) 2009-2015 The Android Open Source Project * Copyright (C) 2015 Samsung LSI + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +25,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; +import android.app.ActivityThread; import android.bluetooth.le.BluetoothLeAdvertiser; import android.bluetooth.le.BluetoothLeScanner; import android.bluetooth.le.ScanCallback; @@ -538,6 +541,7 @@ public static synchronized BluetoothAdapter getDefaultAdapter() { * @throws IllegalArgumentException if address is invalid */ public BluetoothDevice getRemoteDevice(String address) { + android.util.SeempLog.record(62); return new BluetoothDevice(address); } @@ -553,6 +557,7 @@ public BluetoothDevice getRemoteDevice(String address) { * @throws IllegalArgumentException if address is invalid */ public BluetoothDevice getRemoteDevice(byte[] address) { + android.util.SeempLog.record(62); if (address == null || address.length != 6) { throw new IllegalArgumentException("Bluetooth address must have 6 bytes"); } @@ -762,7 +767,7 @@ public boolean enableBLE() { try { if (DBG) Log.d(TAG, "Calling enableBLE"); mManagerService.updateBleAppCount(mToken, true); - return mManagerService.enable(); + return mManagerService.enable(ActivityThread.currentPackageName()); } catch (RemoteException e) { Log.e(TAG, "", e); } @@ -784,6 +789,7 @@ public boolean enableBLE() { @RequiresPermission(Manifest.permission.BLUETOOTH) @AdapterState public int getState() { + android.util.SeempLog.record(63); try { synchronized(mManagerCallback) { if (mService != null) @@ -880,6 +886,7 @@ else if (getLeState() == STATE_BLE_ON) */ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean enable() { + android.util.SeempLog.record(56); int state = STATE_OFF; if (isEnabled() == true){ if (DBG) Log.d(TAG, "enable(): BT is already enabled..!"); @@ -898,7 +905,7 @@ public boolean enable() { return true; } try { - return mManagerService.enable(); + return mManagerService.enable(ActivityThread.currentPackageName()); } catch (RemoteException e) {Log.e(TAG, "", e);} return false; } @@ -929,6 +936,7 @@ public boolean enable() { */ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean disable() { + android.util.SeempLog.record(57); try { return mManagerService.disable(true); } catch (RemoteException e) {Log.e(TAG, "", e);} @@ -946,6 +954,7 @@ public boolean disable() { * @hide */ public boolean disable(boolean persist) { + android.util.SeempLog.record(57); try { return mManagerService.disable(persist); @@ -1190,6 +1199,7 @@ public void setDiscoverableTimeout(int timeout) { */ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean startDiscovery() { + android.util.SeempLog.record(58); if (getState() != STATE_ON) return false; try { synchronized(mManagerCallback) { @@ -1408,6 +1418,7 @@ record = mService.reportActivityInfo(); */ @RequiresPermission(Manifest.permission.BLUETOOTH) public Set getBondedDevices() { + android.util.SeempLog.record(61); if (getState() != STATE_ON) { return toDeviceSet(new BluetoothDevice[0]); } @@ -1460,6 +1471,7 @@ public int getConnectionState() { */ @RequiresPermission(Manifest.permission.BLUETOOTH) public int getProfileConnectionState(int profile) { + android.util.SeempLog.record(64); if (getState() != STATE_ON) return BluetoothProfile.STATE_DISCONNECTED; try { synchronized(mManagerCallback) { @@ -1582,6 +1594,7 @@ public BluetoothServerSocket listenUsingRfcommWithServiceRecord(String name, UUI @RequiresPermission(Manifest.permission.BLUETOOTH) public BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String name, UUID uuid) throws IOException { + android.util.SeempLog.record(59); return createNewRfcommSocketAndRecord(name, uuid, false, false); } @@ -1754,6 +1767,117 @@ public BluetoothServerSocket listenUsingL2capOn(int port) throws IOException { return listenUsingL2capOn(port, false, false); } + + /** + * Construct an insecure L2CAP server socket. + * Call #accept to retrieve connections to this socket. + *

To auto assign a port without creating a SDP record use + * {@link SOCKET_CHANNEL_AUTO_STATIC_NO_SDP} as port number. + * @param port the PSM to listen on + * @return An L2CAP BluetoothServerSocket + * @throws IOException On error, for example Bluetooth not available, or + * insufficient permissions. + * @hide + */ + public BluetoothServerSocket listenUsingInsecureL2capOn(int port) throws IOException { + BluetoothServerSocket socket = new BluetoothServerSocket( + BluetoothSocket.TYPE_L2CAP, false, false, port, false, false); + int errno = socket.mSocket.bindListen(); + if(port == SOCKET_CHANNEL_AUTO_STATIC_NO_SDP) { + socket.setChannel(socket.mSocket.getPort()); + } + if (errno != 0) { + //TODO(BT): Throw the same exception error code + // that the previous code was using. + //socket.mSocket.throwErrnoNative(errno); + throw new IOException("Error: " + errno); + } + return socket; + + } + + /** + * Create a client side Message Access Profile Service Record. + * Create the record once, and reuse it for all connections. + * If changes to a record is needed remove the old record using {@link removeSdpRecord} + * and then create a new one. + * WARNING: This API requires removeSdpRecord() to be called, to avoid leaking resources! + * A second call to this function - either from two different apps or from the + * same app, without first calling removeSdpRecord() - will make the device + * break the Bluetooth spec, which could lead to severe IOP issues. + * @param serviceName The textual name of the service + * @param rfcommChannel The RFCOMM channel that clients can connect to + * (obtain from BluetoothServerSocket) + * @param l2capPsm The L2CAP PSM channel that clients can connect to + * (obtain from BluetoothServerSocket) + * Supply -1 to omit the L2CAP PSM from the record. + * @param version The Profile version number (As specified in the Bluetooth + * MAP specification) + * @param features The feature bit mask (As specified in the Bluetooth + * MAP specification) + * @return a handle to the record created. The record can be removed again + * using {@link removeSdpRecord}(). The record is not linked to the + * creation/destruction of BluetoothSockets, hence SDP record cleanup + * is a separate process. + * returns -1 if an error occure and the record was not created. + * @hide + */ + public int createMapMnsSdpRecord(String serviceName, int rfcommChannel, + int l2capPsm, int version, int features) { + try { + return mService.createMapMnsSdpRecord(serviceName, rfcommChannel, + l2capPsm, version, features); + } catch (RemoteException e) { + Log.e(TAG, "createMapMnsSdpRecord: ", e); + } + return -1; + } + + /** + * Create a client side Phonebook Access Profile Service Record. + * Create the record once, and reuse it for all connections. + * If changes to a record is needed remove the old record using {@link removeSdpRecord} + * and then create a new one. + * WARNING: This API requires removeSdpRecord() to be called, to avoid leaking resources! + * A second call to this function - either from two different apps or from the + * same app, without first calling removeSdpRecord() - will make the device + * break the Bluetooth spec, which could lead to severe IOP issues. + * @param serviceName The textual name of the service + * @param version The Profile version number (As specified in the Bluetooth + * PBAP specification) + * @return a handle to the record created. The record can be removed again + * using {@link removeSdpRecord}(). The record is not linked to the + * creation/destruction of BluetoothSockets, hence SDP record cleanup + * is a separate process. + * returns -1 if an error occure and the record was not created. + * @hide + */ + public int createPbapPceSdpRecord(String serviceName, int version) { + try { + return mService.createPbapPceSdpRecord(serviceName, version); + } catch (RemoteException e) { + Log.e(TAG, "createPbapPceSdpRecord: ", e); + } + return -1; + } + + /** + * Remove a SDP record created using createSdpRecord(). + * This function shall be called before a new call to createSdpRecord for the same record + * type can be made, unless the record type created supports multiple instances. + * @param recordHandle handle of the record to remove - provided by createSdpRecord() + * @return true if success + * @hide + */ + public boolean removeSdpRecord(int recordHandle){ + try { + return mService.removeSdpRecord(recordHandle); + } catch (RemoteException e) { + Log.e(TAG, "removeSdpRecord: ", e); + } + return false; + } + /** * Read the local Out of Band Pairing Data *

Requires {@link android.Manifest.permission#BLUETOOTH} @@ -1825,6 +1949,9 @@ public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener } else if (profile == BluetoothProfile.PAN) { BluetoothPan pan = new BluetoothPan(context, listener); return true; + } else if (profile == BluetoothProfile.DUN) { + BluetoothDun dun = new BluetoothDun(context, listener); + return true; } else if (profile == BluetoothProfile.HEALTH) { BluetoothHealth health = new BluetoothHealth(context, listener); return true; @@ -1837,6 +1964,9 @@ public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener } else if (profile == BluetoothProfile.SAP) { BluetoothSap sap = new BluetoothSap(context, listener); return true; + } else if (profile == BluetoothProfile.HID_DEVICE) { + BluetoothHidDevice hidd = new BluetoothHidDevice(context, listener); + return true; } else { return false; } @@ -1881,6 +2011,10 @@ public void closeProfileProxy(int profile, BluetoothProfile proxy) { BluetoothPan pan = (BluetoothPan)proxy; pan.close(); break; + case BluetoothProfile.DUN: + BluetoothDun dun = (BluetoothDun)proxy; + dun.close(); + break; case BluetoothProfile.HEALTH: BluetoothHealth health = (BluetoothHealth)proxy; health.close(); @@ -1905,6 +2039,10 @@ public void closeProfileProxy(int profile, BluetoothProfile proxy) { BluetoothSap sap = (BluetoothSap)proxy; sap.close(); break; + case BluetoothProfile.HID_DEVICE: + BluetoothHidDevice hidd = (BluetoothHidDevice) proxy; + hidd.close(); + break; } } diff --git a/core/java/android/bluetooth/BluetoothAvrcpController.java b/core/java/android/bluetooth/BluetoothAvrcpController.java index b53a8fc0f6f..48510876d04 100644 --- a/core/java/android/bluetooth/BluetoothAvrcpController.java +++ b/core/java/android/bluetooth/BluetoothAvrcpController.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -210,7 +211,7 @@ && isValidDevice(device)) { } public void sendPassThroughCmd(BluetoothDevice device, int keyCode, int keyState) { - if (DBG) Log.d(TAG, "sendPassThroughCmd"); + if (DBG) Log.d(TAG, "sendPassThroughCmd dev = " + device + " key " + keyCode + " State = " + keyState); if (mService != null && isEnabled()) { try { mService.sendPassThroughCmd(device, keyCode, keyState); @@ -223,6 +224,90 @@ public void sendPassThroughCmd(BluetoothDevice device, int keyCode, int keyState if (mService == null) Log.w(TAG, "Proxy not attached to service"); } + public void getMetaData(int[] attributeIds) { + if (DBG) Log.d(TAG, "getMetaData num requested Ids = " + attributeIds.length); + if (mService != null && isEnabled()) { + try { + mService.getMetaData(attributeIds); + return; + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in getMetaData", e); + return; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + } + + public void getPlayStatus(int[] playStatusIds) { + if (DBG) Log.d(TAG, "getPlayStatus num requested Ids = "+ playStatusIds.length); + if (mService != null && isEnabled()) { + try { + mService.getPlayStatus(playStatusIds); + return; + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in getPlayStatus()", e); + return; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + } + + public void getPlayerApplicationSetting() { + if (DBG) Log.d(TAG, "getPlayerApplicationSetting"); + if (mService != null && isEnabled()) { + try { + mService.getPlayerApplicationSetting(); + return; + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in getPlayerApplicationSetting()", e); + return; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + } + + public void setPlayerApplicationSetting(int attributeId, int attributeVal) { + if (DBG) Log.d(TAG, "setPlayerApplicationSetting attribId = " + attributeId + " attribVal = " + attributeVal); + if (mService != null && isEnabled()) { + try { + mService.setPlayerApplicationSetting(attributeId, attributeVal); + return; + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in setPlayerApplicationSetting()", e); + return; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + } + + public BluetoothAvrcpInfo getSupportedPlayerAppSetting(BluetoothDevice device) { + if (DBG) Log.d(TAG, "getSupportedPlayerAppSetting dev = " + device); + if (mService != null && isEnabled()) { + try { + return mService.getSupportedPlayerAppSetting(device); + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in getSupportedPlayerAppSetting()", e); + return null; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return null; + } + + public int getSupportedFeatures(BluetoothDevice device) { + if (DBG) Log.d(TAG, "getSupportedFeatures dev = " + device); + if (mService != null && isEnabled()) { + try { + return mService.getSupportedFeatures(device); + } catch (RemoteException e) { + Log.e(TAG, "Error talking to BT service in getSupportedFeatures()", e); + return 0; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return 0; + } + private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); diff --git a/core/java/android/bluetooth/BluetoothAvrcpInfo.aidl b/core/java/android/bluetooth/BluetoothAvrcpInfo.aidl new file mode 100644 index 00000000000..9b85c80717d --- /dev/null +++ b/core/java/android/bluetooth/BluetoothAvrcpInfo.aidl @@ -0,0 +1,34 @@ +/* +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +package android.bluetooth; + +parcelable BluetoothAvrcpInfo; diff --git a/core/java/android/bluetooth/BluetoothAvrcpInfo.java b/core/java/android/bluetooth/BluetoothAvrcpInfo.java new file mode 100644 index 00000000000..a815d101830 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothAvrcpInfo.java @@ -0,0 +1,306 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +package android.bluetooth; + +import java.util.ArrayList; +import android.util.Log; + +import android.os.Parcel; +import android.os.Parcelable; +import android.provider.BaseColumns; +import android.net.Uri; + +/** + * Represents the AVRCP Metadata of remote Bluetooth Device. + * + * {@see BluetoothAvrcpController} + * + * {@hide} + */ +public final class BluetoothAvrcpInfo implements Parcelable, BaseColumns{ + + private byte[] supportedPlayerAttributes;// attributes supported + private byte[] numSupportedPlayerAttribValues; // number of values of each attribute + private String TAG = "BluetoothAvrcpInfo"; + /* + * This would a list of values of all AttributeIds + */ + private byte[] supportedPlayerAtribValues; // actual values lies here. + + /* Default Constructor */ + public BluetoothAvrcpInfo() { + supportedPlayerAttributes = null; + numSupportedPlayerAttribValues = null; + supportedPlayerAtribValues = null; + } + public BluetoothAvrcpInfo(byte[] attribIds, byte[] numValueSupported, byte[] valuesSupported) { + int numAttributes = attribIds.length; + int zz = 0; + supportedPlayerAttributes = new byte[numAttributes]; + numSupportedPlayerAttribValues = new byte[numAttributes]; + supportedPlayerAtribValues = new byte[valuesSupported.length]; + for (zz = 0; zz < numAttributes; zz++) { + supportedPlayerAttributes[zz] = attribIds[zz]; + numSupportedPlayerAttribValues[zz] = numValueSupported[zz]; + } + for (zz = 0; zz < supportedPlayerAtribValues.length; zz++) + supportedPlayerAtribValues[zz] = valuesSupported[zz]; + } + /* + * Reading Structure back from Paracel + */ + public BluetoothAvrcpInfo(Parcel source){ + ArrayList attribs = new ArrayList(); + ArrayList numAttribVal = new ArrayList(); + ArrayList attribVals = new ArrayList(); + Byte numAttributes = source.readByte(); + /* + * Read from Source + */ + for(int xx = 0; xx < numAttributes ; xx++) { + attribs.add(source.readByte()); + numAttribVal.add(source.readByte()); + for (int zz = 0; zz < numAttribVal.get(xx); zz++) { + attribVals.add(source.readByte()); + } + } + + /* + * Write Back to Private Data Structures + */ + supportedPlayerAttributes = new byte[attribs.size()]; + for (int zz = 0; zz< attribs.size(); zz++) { + supportedPlayerAttributes[zz] = attribs.get(zz); + } + + numSupportedPlayerAttribValues = new byte[numAttribVal.size()]; + for (int zz = 0; zz< numAttribVal.size(); zz++) { + numSupportedPlayerAttribValues[zz] = numAttribVal.get(zz); + } + + supportedPlayerAtribValues = new byte[attribVals.size()]; + for (int zz = 0; zz< attribVals.size(); zz++) { + supportedPlayerAtribValues[zz] = attribVals.get(zz); + } + } + + public int describeContents() { + return 0; + } + + /* While flatenning the structure we would use the follwing way + * NumAttributes,ID, numValues, Values + */ + public void writeToParcel(Parcel out, int flags) { + byte numSuppAttributes = (byte)supportedPlayerAttributes.length; + out.writeByte(numSuppAttributes); + for (int xx = 0; xx < numSuppAttributes; xx++) { + out.writeByte(supportedPlayerAttributes[xx]); + out.writeByte(numSupportedPlayerAttribValues[xx]); + for (int zz = 0; zz < numSupportedPlayerAttribValues[xx]; zz++) { + out.writeByte(supportedPlayerAtribValues[zz]); + } + } + } + + public byte[] getSupportedPlayerAttributes() { + return supportedPlayerAttributes; + } + + public byte getNumSupportedPlayerAttributeVal(byte playerAttributeId) { + for (int zz = 0; zz < supportedPlayerAttributes.length; zz++) { + if (playerAttributeId == supportedPlayerAttributes[zz]) { + return numSupportedPlayerAttribValues[zz]; + } + } + return 0; + } + + public byte[] getSupportedPlayerAttributeVlaues (byte playerAttributeId) { + int index = 0; + int zz = 0; + boolean attributeFound = false; + for (zz = 0; zz < supportedPlayerAttributes.length; zz++) { + if (playerAttributeId == supportedPlayerAttributes[zz]) { + attributeFound = true; + break; + } + else + index = index + numSupportedPlayerAttribValues[zz]; + } + if (attributeFound) { + byte[] supportedValues = new byte[numSupportedPlayerAttribValues[zz]]; + for (int xx = 0; xx < numSupportedPlayerAttribValues[zz]; xx++) + supportedValues[xx] = supportedPlayerAtribValues[xx + index]; + return supportedValues; + } + else + return new byte[0]; + } + public void putPlayerSettingAttributes(byte[] attribIds, byte[] numValueSupported, byte[] valuesSupported) { + int numAttributes = attribIds.length; + int zz = 0; + supportedPlayerAttributes = new byte[numAttributes]; + numSupportedPlayerAttribValues = new byte[numAttributes]; + supportedPlayerAtribValues = new byte[valuesSupported.length]; + for (zz = 0; zz < numAttributes; zz++) { + supportedPlayerAttributes[zz] = attribIds[zz]; + numSupportedPlayerAttribValues[zz] = numValueSupported[zz]; + } + for (zz = 0; zz < supportedPlayerAtribValues.length; zz++) + supportedPlayerAtribValues[zz] = valuesSupported[zz]; + } + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + public BluetoothAvrcpInfo createFromParcel(Parcel in) { + return new BluetoothAvrcpInfo(in); + } + public BluetoothAvrcpInfo[] newArray(int size) { + return new BluetoothAvrcpInfo[size]; + } + }; + + public static final String PERMISSION_ACCESS = "android.permission.ACCESS_BLUETOOTH_AVRCP_CT_DATA"; + public static final Uri CONTENT_URI = Uri.parse("content://com.android.bluetooth.avrcp/btavrcp_ct"); + + /* + * BaseColumns already has _ID and COUNT values + * Below mentioned strings are used to implement different columns + * of AVRCP MetaData table. + * TRACK_NUM : Ineteger value containing the order number of + * the audio-file on its original recording. + * Numeric ASCII string converted to Integer + * TITLE : Text field representing the title, song name + * ARTIST_NAME : Text field representing artist(s), performer(s) + * ALBUM_NAME : Text field representing the title of the recording + * (source) from which the audio in the file is taken. + * TOTAL_TRACKS : Integet value containing the total number of tracks + * or elements on the original recording. + * GENRE : Text field representing the category of the composition + * characterized by a particular style. + * PLAYING_TIME : Integer containing the length of the audio file in + * milliseconds for eg 02:30 = 150000 + * PLAY_STATUS : Text feild showing current state of track. Possible + * values would be Playing, Stopped, Paused, Forward_Seek + * REV_SEEK + * REPEAT_STATUS : String describing Repeat mode status on remote Media Player + * Posible values "NOT SUPPORTED", "OFF" "Single Track Repeat" + * "All Track Repeat" "Group Repeat" + * SHUFFLE_STATUS : String describing Shuffle mode status on remote Media Player + * Posible values "NOT SUPPORTED", "OFF" "All Track Shuffle" + * "Group Shuffle" + * SCAN_STAUS : String describing SCAN mode status on remote Media Player + * Possible values "NOT SUPPORTED", "OFF","ALL Tracks Scan" + * "Group Scan" + * + * EQUALIZER_STATUS: String describing EQUALIZER mode status on remote Media Player + * Possible values "NOT SUPPORTED", "OFF","ON" + */ + public static final String TRACK_NUM = "track_num"; + public static final String TITLE = "title"; + public static final String ARTIST_NAME = "artist_name"; + public static final String ALBUM_NAME = "album_name"; + public static final String TOTAL_TRACKS = "total_tracks"; + public static final String GENRE = "genre"; + public static final String PLAYING_TIME = "playing_time"; + public static final String TOTAL_TRACK_TIME = "total_track_time"; + public static final String PLAY_STATUS = "play_status"; + public static final String REPEAT_STATUS = "repeat_status"; + public static final String SHUFFLE_STATUS = "shuffle_status"; + public static final String SCAN_STATUS = "scan_status"; + public static final String EQUALIZER_STATUS = "equalizer_status"; + + /* + * Default values for each of the items + */ + public static final int TRACK_NUM_INVALID = 0xFF; + public static final String TITLE_INVALID = "NOT_SUPPORTED"; + public static final String ARTIST_NAME_INVALID = "NOT_SUPPORTED"; + public static final String ALBUM_NAME_INVALID = "NOT_SUPPORTED"; + public static final int TOTAL_TRACKS_INVALID = 0xFF; + public static final String GENRE_INVALID = "NOT_SUPPORTED"; + public static final int PLAYING_TIME_INVALID = 0xFF; + public static final int TOTAL_TRACK_TIME_INVALID = 0xFF; + public static final String PLAY_STATUS_INVALID = "NOT_SUPPORTED"; + public static final String REPEAT_STATUS_INVALID = "NOT_SUPPORTED"; + public static final String SHUFFLE_STATUS_INVALID = "NOT_SUPPORTED"; + public static final String SCAN_STATUS_INVALID = "NOT_SUPPORTED"; + public static final String EQUALIZER_STATUS_INVALID = "NOT_SUPPORTED"; + + /* + *Element Id Values for GetMetaData + */ + public static final int MEDIA_ATTRIBUTE_ALL = 0x00; + public static final int MEDIA_ATTRIBUTE_TITLE = 0x01; + public static final int MEDIA_ATTRIBUTE_ARTIST_NAME = 0x02; + public static final int MEDIA_ATTRIBUTE_ALBUM_NAME = 0x03; + public static final int MEDIA_ATTRIBUTE_TRACK_NUMBER = 0x04; + public static final int MEDIA_ATTRIBUTE_TOTAL_TRACK_NUMBER = 0x05; + public static final int MEDIA_ATTRIBUTE_GENRE = 0x06; + public static final int MEDIA_ATTRIBUTE_PLAYING_TIME = 0x07; + + /* + *PlayStatusId Values for GetPlayStatus + */ + public static final int MEDIA_PLAYSTATUS_ALL = 0x08; + public static final int MEDIA_PLAYSTATUS_SONG_TOTAL_LEN = 0x09; + public static final int MEDIA_PLAYSTATUS_SONG_CUR_POS = 0x0a; + public static final int MEDIA_PLAYSTATUS_SONG_PLAY_STATUS = 0x0b; + + /* + * Values for SetPlayerApplicationSettings + */ + public static final byte ATTRIB_EQUALIZER_STATUS = 0x01; + public static final byte ATTRIB_REPEAT_STATUS = 0x02; + public static final byte ATTRIB_SHUFFLE_STATUS = 0x03; + public static final byte ATTRIB_SCAN_STATUS = 0x04; + + public static final byte EQUALIZER_STATUS_OFF = 0x01; + public static final byte EQUALIZER_STATUS_ON = 0x02; + + public static final byte REPEAT_STATUS_OFF = 0x01; + public static final byte REPEAT_STATUS_SINGLE_TRACK_REPEAT = 0x02; + public static final byte REPEAT_STATUS_ALL_TRACK_REPEAT = 0x03; + public static final byte REPEAT_STATUS_GROUP_REPEAT = 0x04; + + public static final byte SHUFFLE_STATUS_OFF = 0x01; + public static final byte SHUFFLE_STATUS_ALL_TRACK_SHUFFLE = 0x02; + public static final byte SHUFFLE_STATUS_GROUP_SHUFFLE = 0x03; + + public static final byte SCAN_STATUS_OFF = 0x01; + public static final byte SCAN_STATUS_ALL_TRACK_SCAN = 0x02; + public static final byte SCAN_STATUS_GROUP_SCAN = 0x03; + + public static final int BTRC_FEAT_METADATA = 0x01; + public static final int BTRC_FEAT_ABSOLUTE_VOLUME = 0x02; + public static final int BTRC_FEAT_BROWSE = 0x04; + +} diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java old mode 100644 new mode 100755 index 54bf4afa93f..4a38287e7ca --- a/core/java/android/bluetooth/BluetoothClass.java +++ b/core/java/android/bluetooth/BluetoothClass.java @@ -283,6 +283,8 @@ public int getDeviceClass() { public static final int PROFILE_PANU = 4; /** @hide */ public static final int PROFILE_NAP = 5; + /** @hide */ + public static final int PROFILE_A2DP_SINK = 6; /** * Check class bits for possible bluetooth profile support. @@ -310,6 +312,21 @@ public boolean doesClassMatch(int profile) { default: return false; } + } else if (profile == PROFILE_A2DP_SINK) { + if (hasService(Service.CAPTURE)) { + return true; + } + // By the A2DP spec, srcs must indicate the CAPTURE service. + // However if some device that do not, we try to + // match on some other class bits. + switch (getDeviceClass()) { + case Device.AUDIO_VIDEO_HIFI_AUDIO: + case Device.AUDIO_VIDEO_SET_TOP_BOX: + case Device.AUDIO_VIDEO_VCR : + return true; + default: + return false; + } } else if (profile == PROFILE_HEADSET) { // The render service class is required by the spec for HFP, so is a // pretty good signal diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index cd5c205d14d..b4006de1e6b 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1402,6 +1402,27 @@ public BluetoothSocket createL2capSocket(int channel) throws IOException { null); } + /** + * Create an L2cap {@link BluetoothSocket} ready to start an insecure + * outgoing connection to this remote device on given channel. + *

The remote device will be not authenticated and communication on this + * socket will not be encrypted. + *

Use {@link BluetoothSocket#connect} to initiate the outgoing + * connection. + *

Valid L2CAP PSM channels are in range 1 to 2^16. + *

Requires {@link android.Manifest.permission#BLUETOOTH} + * + * @param channel L2cap PSM/channel to connect to + * @return a RFCOMM BluetoothServerSocket ready for an outgoing connection + * @throws IOException on error, for example Bluetooth not available, or + * insufficient permissions + * @hide + */ + public BluetoothSocket createInsecureL2capSocket(int channel) throws IOException { + return new BluetoothSocket(BluetoothSocket.TYPE_L2CAP, -1, false, false, this, channel, + null); + } + /** * Create an RFCOMM {@link BluetoothSocket} ready to start a secure * outgoing connection to this remote device using SDP lookup of uuid. diff --git a/core/java/android/bluetooth/BluetoothDevicePicker.java b/core/java/android/bluetooth/BluetoothDevicePicker.java index c794be2e2c9..51d14cc0a11 100644 --- a/core/java/android/bluetooth/BluetoothDevicePicker.java +++ b/core/java/android/bluetooth/BluetoothDevicePicker.java @@ -43,6 +43,14 @@ public interface BluetoothDevicePicker { public static final String ACTION_DEVICE_SELECTED = "android.bluetooth.devicepicker.action.DEVICE_SELECTED"; + /** + * Broadcast when no BT device is selected from BT device picker screen. + * This happens when user presses back button. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_DEVICE_NOT_SELECTED = + "org.codeaurora.bluetooth.devicepicker.action.DEVICE_NOT_SELECTED"; + /** * Broadcast when someone want to select one BT device from devices list. * This intent contains below extra data: diff --git a/core/java/android/bluetooth/BluetoothDun.java b/core/java/android/bluetooth/BluetoothDun.java new file mode 100644 index 00000000000..09120610caa --- /dev/null +++ b/core/java/android/bluetooth/BluetoothDun.java @@ -0,0 +1,296 @@ +/* +*Copyright (c) 2013, The Linux Foundation. All rights reserved. +* +*Redistribution and use in source and binary forms, with or without +*modification, are permitted provided that the following conditions are +*met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +*THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +*WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +*ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +*BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +*CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +*SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +*WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +*OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +*IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +package android.bluetooth; + +import android.annotation.SdkConstant; +import android.annotation.SdkConstant.SdkConstantType; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; + +import java.util.ArrayList; +import java.util.List; + +/** + * This class provides the APIs to control the Bluetooth Dun + * Profile. + * + *

BluetoothDun is a proxy object for controlling the Bluetooth DUN + * Service via IPC. Use {@link BluetoothAdapter#getProfileProxy} to get + * the BluetoothDun proxy object. + * + *

Each method is protected with its appropriate permission. + *@hide + */ +public final class BluetoothDun implements BluetoothProfile { + private static final String TAG = "BluetoothDun"; + private static final boolean DBG = false; + private static final boolean VDBG = false; + + /** + * Intent used to broadcast the change in connection state of the Dun + * profile. + * + *

This intent will have 3 extras: + *

    + *
  • {@link #EXTRA_STATE} - The current state of the profile.
  • + *
  • {@link #EXTRA_PREVIOUS_STATE}- The previous state of the profile.
  • + *
  • {@link BluetoothDevice#EXTRA_DEVICE} - The remote device.
  • + *
+ * + *

{@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} can be any of + * {@link #STATE_DISCONNECTED}, {@link #STATE_CONNECTED}. + * + *

Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_CONNECTION_STATE_CHANGED = + "codeaurora.bluetooth.dun.profile.action.CONNECTION_STATE_CHANGED"; + + private Context mContext; + private ServiceListener mServiceListener; + private BluetoothAdapter mAdapter; + private IBluetoothDun mDunService; + + /** + * Create a BluetoothDun proxy object for interacting with the local + * Bluetooth Service which handles the Dun profile + * + */ + /*package*/ BluetoothDun(Context context, ServiceListener l) { + mContext = context; + mServiceListener = l; + mAdapter = BluetoothAdapter.getDefaultAdapter(); + try { + mAdapter.getBluetoothManager().registerStateChangeCallback(mStateChangeCallback); + } catch (RemoteException re) { + Log.w(TAG,"Unable to register BluetoothStateChangeCallback",re); + } + Log.d(TAG, "BluetoothDun() call bindService"); + doBind(); + } + + boolean doBind() { + Intent intent = new Intent(IBluetoothDun.class.getName()); + ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); + intent.setComponent(comp); + if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, + android.os.Process.myUserHandle())) { + Log.e(TAG, "Could not bind to Bluetooth Dun Service with " + intent); + return false; + } + return true; + } + + + /*package*/ void close() { + if (VDBG) log("close()"); + mServiceListener = null; + IBluetoothManager mgr = mAdapter.getBluetoothManager(); + if (mgr != null) { + try { + mgr.unregisterStateChangeCallback(mStateChangeCallback); + } catch (RemoteException re) { + Log.w(TAG,"Unable to unregister BluetoothStateChangeCallback",re); + } + } + + synchronized (mConnection) { + if ( mDunService != null) { + try { + mDunService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } + } + + protected void finalize() { + close(); + } + + private IBluetoothStateChangeCallback mStateChangeCallback = + new IBluetoothStateChangeCallback.Stub() { + + @Override + public void onBluetoothStateChange(boolean on) { + //Handle enable request to bind again. + Log.d(TAG, "onBluetoothStateChange on: " + on); + if (on) { + try { + if (mDunService == null) { + Log.d(TAG, "onBluetoothStateChange call bindService"); + doBind(); + } + } catch (IllegalStateException e) { + Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); + } catch (SecurityException e) { + Log.e(TAG,"onBluetoothStateChange: could not bind to DUN service: ", e); + } + } else { + if (VDBG) Log.d(TAG,"Unbinding service..."); + synchronized (mConnection) { + if ( mDunService != null) { + try { + mDunService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } + } + } + }; + + /** + * Initiate disconnection from DUN server. + * + *

Once the disconnection is initiated by any device either local host + * or remote device, the state will transition from {@link #STATE_CONNECTED} + * to {@link #STATE_DISCONNECTED}. + * + *

Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} + * permission. + * + * @param device Remote Bluetooth Device + * @return false on immediate error, + * true otherwise + * @hide + */ + public boolean disconnect(BluetoothDevice device) { + if (DBG) log("disconnect(" + device + ")"); + if (mDunService != null && isEnabled() && + isValidDevice(device)) { + try { + return mDunService.disconnect(device); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mDunService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + /** + * {@inheritDoc} + */ + public List getConnectedDevices() { + if (VDBG) log("getConnectedDevices()"); + if (mDunService != null && isEnabled()) { + try { + return mDunService.getConnectedDevices(); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return new ArrayList(); + } + } + if (mDunService == null) Log.w(TAG, "Proxy not attached to service"); + return new ArrayList(); + } + + /** + * {@inheritDoc} + */ + public List getDevicesMatchingConnectionStates(int[] states) { + if (VDBG) log("getDevicesMatchingStates()"); + if (mDunService != null && isEnabled()) { + try { + return mDunService.getDevicesMatchingConnectionStates(states); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return new ArrayList(); + } + } + if (mDunService == null) Log.w(TAG, "Proxy not attached to service"); + return new ArrayList(); + } + + /** + * {@inheritDoc} + */ + public int getConnectionState(BluetoothDevice device) { + if (VDBG) log("getState(" + device + ")"); + if (mDunService != null && isEnabled() + && isValidDevice(device)) { + try { + return mDunService.getConnectionState(device); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return BluetoothProfile.STATE_DISCONNECTED; + } + } + if (mDunService == null) Log.w(TAG, "Proxy not attached to service"); + return BluetoothProfile.STATE_DISCONNECTED; + } + + private ServiceConnection mConnection = new ServiceConnection() { + public void onServiceConnected(ComponentName className, IBinder service) { + if (DBG) Log.d(TAG, "BluetoothDUN Proxy object connected"); + mDunService = IBluetoothDun.Stub.asInterface(service); + + if (mServiceListener != null) { + mServiceListener.onServiceConnected(BluetoothProfile.DUN, + BluetoothDun.this); + } + } + public void onServiceDisconnected(ComponentName className) { + if (DBG) Log.d(TAG, "BluetoothDUN Proxy object disconnected"); + mDunService = null; + if (mServiceListener != null) { + mServiceListener.onServiceDisconnected(BluetoothProfile.DUN); + } + } + }; + + private boolean isEnabled() { + if (mAdapter.getState() == BluetoothAdapter.STATE_ON) return true; + return false; + } + + private boolean isValidDevice(BluetoothDevice device) { + if (device == null) return false; + + if (BluetoothAdapter.checkBluetoothAddress(device.getAddress())) return true; + return false; + } + + private static void log(String msg) { + Log.d(TAG, msg); + } +} diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 09a15de8778..4a1f1289805 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -20,10 +20,9 @@ import android.annotation.SdkConstant.SdkConstantType; import android.content.ComponentName; import android.content.Context; -import android.os.Handler; +import android.content.Intent; +import android.content.ServiceConnection; import android.os.IBinder; -import android.os.Looper; -import android.os.Message; import android.os.RemoteException; import android.util.Log; @@ -47,7 +46,7 @@ public final class BluetoothHeadset implements BluetoothProfile { private static final String TAG = "BluetoothHeadset"; private static final boolean DBG = true; - private static final boolean VDBG = false; + private static final boolean VDBG = true; /** * Intent used to broadcast the change in connection state of the Headset @@ -128,6 +127,13 @@ public final class BluetoothHeadset implements BluetoothProfile { public static final String ACTION_VENDOR_SPECIFIC_HEADSET_EVENT = "android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT"; + /** + * @hide Broadcast intent when HF indicator value changed is updated by HS. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_HF_INDICATOR_VALUE_CHANGED = + "codeaurora.bluetooth.headset.action.ACTION_HF_INDICATOR_VALUE_CHANGED"; + /** * A String extra field in {@link #ACTION_VENDOR_SPECIFIC_HEADSET_EVENT} * intents that contains the name of the vendor-specific command. @@ -198,6 +204,20 @@ public final class BluetoothHeadset implements BluetoothProfile { */ public static final String VENDOR_RESULT_CODE_COMMAND_ANDROID = "+ANDROID"; + /** + * @hide Used for sharing the HF indicator assigned number. + */ + public static final String HF_INDICATOR_ASSIGNED_NUMBER = + "codeaurora.bluetooth.headset.intent.category.anum"; + + + /** + * @hide Used for sharing the HF indicator assigned number's value. + */ + public static final String HF_INDICATOR_ASSIGNED_NUMBER_VALUE = + "codeaurora.bluetooth.headset.intent.category.anumvalue"; + + /** * Headset state when SCO audio is not connected. * This state can be one of @@ -222,8 +242,6 @@ public final class BluetoothHeadset implements BluetoothProfile { */ public static final int STATE_AUDIO_CONNECTED = 12; - private static final int MESSAGE_HEADSET_SERVICE_CONNECTED = 100; - private static final int MESSAGE_HEADSET_SERVICE_DISCONNECTED = 101; private Context mContext; private ServiceListener mServiceListener; @@ -236,7 +254,14 @@ public void onBluetoothStateChange(boolean up) { if (DBG) Log.d(TAG, "onBluetoothStateChange: up=" + up); if (!up) { if (VDBG) Log.d(TAG,"Unbinding service..."); - doUnbind(); + synchronized (mConnection) { + try { + mService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } } else { synchronized (mConnection) { try { @@ -273,26 +298,15 @@ public void onBluetoothStateChange(boolean up) { } boolean doBind() { - try { - return mAdapter.getBluetoothManager().bindBluetoothProfileService( - BluetoothProfile.HEADSET, mConnection); - } catch (RemoteException e) { - Log.e(TAG, "Unable to bind HeadsetService", e); - } - return false; - } - - void doUnbind() { - synchronized (mConnection) { - if (mService != null) { - try { - mAdapter.getBluetoothManager().unbindBluetoothProfileService( - BluetoothProfile.HEADSET, mConnection); - } catch (RemoteException e) { - Log.e(TAG,"Unable to unbind HeadsetService", e); - } - } + Intent intent = new Intent(IBluetoothHeadset.class.getName()); + ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); + intent.setComponent(comp); + if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, + android.os.Process.myUserHandle())) { + Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent); + return false; } + return true; } /** @@ -312,8 +326,18 @@ void doUnbind() { Log.e(TAG,"",e); } } + + synchronized (mConnection) { + if (mService != null) { + try { + mService = null; + mContext.unbindService(mConnection); + } catch (Exception re) { + Log.e(TAG,"",re); + } + } + } mServiceListener = null; - doUnbind(); } /** @@ -969,21 +993,21 @@ public boolean disableWBS() { return false; } - private final IBluetoothProfileServiceConnection mConnection - = new IBluetoothProfileServiceConnection.Stub() { - @Override + private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); mService = IBluetoothHeadset.Stub.asInterface(service); - mHandler.sendMessage(mHandler.obtainMessage( - MESSAGE_HEADSET_SERVICE_CONNECTED)); + + if (mServiceListener != null) { + mServiceListener.onServiceConnected(BluetoothProfile.HEADSET, BluetoothHeadset.this); + } } - @Override public void onServiceDisconnected(ComponentName className) { if (DBG) Log.d(TAG, "Proxy object disconnected"); mService = null; - mHandler.sendMessage(mHandler.obtainMessage( - MESSAGE_HEADSET_SERVICE_DISCONNECTED)); + if (mServiceListener != null) { + mServiceListener.onServiceDisconnected(BluetoothProfile.HEADSET); + } } }; @@ -1007,25 +1031,4 @@ private boolean isValidDevice(BluetoothDevice device) { private static void log(String msg) { Log.d(TAG, msg); } - - private final Handler mHandler = new Handler(Looper.getMainLooper()) { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case MESSAGE_HEADSET_SERVICE_CONNECTED: { - if (mServiceListener != null) { - mServiceListener.onServiceConnected(BluetoothProfile.HEADSET, - BluetoothHeadset.this); - } - break; - } - case MESSAGE_HEADSET_SERVICE_DISCONNECTED: { - if (mServiceListener != null) { - mServiceListener.onServiceDisconnected(BluetoothProfile.HEADSET); - } - break; - } - } - } - }; } diff --git a/core/java/android/bluetooth/BluetoothHeadsetClient.java b/core/java/android/bluetooth/BluetoothHeadsetClient.java index 874026fb157..484a856539b 100644 --- a/core/java/android/bluetooth/BluetoothHeadsetClient.java +++ b/core/java/android/bluetooth/BluetoothHeadsetClient.java @@ -100,7 +100,9 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * {@link #EXTRA_BATTERY_LEVEL}, * {@link #EXTRA_OPERATOR_NAME}, * {@link #EXTRA_VOICE_RECOGNITION}, - * {@link #EXTRA_IN_BAND_RING}

+ * {@link #EXTRA_IN_BAND_RING} + * {@link #EXTRA_MANF_ID} + * {@link #EXTRA_MANF_MODEL}

*/ public static final String ACTION_AG_EVENT = "android.bluetooth.headsetclient.profile.action.AG_EVENT"; @@ -205,6 +207,21 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { public static final String EXTRA_SUBSCRIBER_INFO = "android.bluetooth.headsetclient.extra.SUBSCRIBER_INFO"; + /** + * Extra for AG_EVENT intent indicates manufacturer identification. + *

Value: String containing manufacturer identification.

+ */ + public static final String EXTRA_MANF_ID = + "android.bluetooth.headsetclient.extra.MANF_ID"; + + /** + * Extra for AG_EVENT intent indicates manufacturer model. + *

Value: String containing manufacturer model.

+ */ + public static final String EXTRA_MANF_MODEL = + "android.bluetooth.headsetclient.extra.MANF_MODEL"; + + /** * Extra for AG_CALL_CHANGED intent indicates the * {@link BluetoothHeadsetClientCall} object that has changed. diff --git a/core/java/android/bluetooth/BluetoothHidDevice.java b/core/java/android/bluetooth/BluetoothHidDevice.java new file mode 100644 index 00000000000..468df4db8b9 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDevice.java @@ -0,0 +1,502 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011 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.bluetooth; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; + +import java.util.Arrays; +import java.util.List; + +/** + * @hide + */ +public final class BluetoothHidDevice implements BluetoothProfile { + + private static final String TAG = BluetoothHidDevice.class.getSimpleName(); + + public static final String ACTION_CONNECTION_STATE_CHANGED = + "codeaurora.bluetooth.hid.profile.action.CONNECTION_STATE_CHANGED"; + + /** + * Constants representing device subclass. + * + * @see #registerApp(String, String, String, byte, byte[], + * BluetoothHidDeviceCallback) + */ + public static final byte SUBCLASS1_NONE = (byte) 0x00; + public static final byte SUBCLASS1_KEYBOARD = (byte) 0x40; + public static final byte SUBCLASS1_MOUSE = (byte) 0x80; + public static final byte SUBCLASS1_COMBO = (byte) 0xC0; + + public static final byte SUBCLASS2_UNCATEGORIZED = (byte) 0x00; + public static final byte SUBCLASS2_JOYSTICK = (byte) 0x01; + public static final byte SUBCLASS2_GAMEPAD = (byte) 0x02; + public static final byte SUBCLASS2_REMOTE_CONTROL = (byte) 0x03; + public static final byte SUBCLASS2_SENSING_DEVICE = (byte) 0x04; + public static final byte SUBCLASS2_DIGITIZER_TABLED = (byte) 0x05; + public static final byte SUBCLASS2_CARD_READER = (byte) 0x06; + + /** + * Constants representing report types. + * + * @see BluetoothHidDeviceCallback#onGetReport(byte, byte, int) + * @see BluetoothHidDeviceCallback#onSetReport(byte, byte, byte[]) + * @see BluetoothHidDeviceCallback#onIntrData(byte, byte[]) + */ + public static final byte REPORT_TYPE_INPUT = (byte) 1; + public static final byte REPORT_TYPE_OUTPUT = (byte) 2; + public static final byte REPORT_TYPE_FEATURE = (byte) 3; + + /** + * Constants representing error response for Set Report. + * + * @see BluetoothHidDeviceCallback#onSetReport(byte, byte, byte[]) + */ + public static final byte ERROR_RSP_SUCCESS = (byte) 0; + public static final byte ERROR_RSP_NOT_READY = (byte) 1; + public static final byte ERROR_RSP_INVALID_RPT_ID = (byte) 2; + public static final byte ERROR_RSP_UNSUPPORTED_REQ = (byte) 3; + public static final byte ERROR_RSP_INVALID_PARAM = (byte) 4; + public static final byte ERROR_RSP_UNKNOWN = (byte) 14; + + /** + * Constants representing protocol mode used set by host. Default is always + * {@link #PROTOCOL_REPORT_MODE} unless notified otherwise. + * + * @see BluetoothHidDeviceCallback#onSetProtocol(byte) + */ + public static final byte PROTOCOL_BOOT_MODE = (byte) 0; + public static final byte PROTOCOL_REPORT_MODE = (byte) 1; + + private Context mContext; + + private ServiceListener mServiceListener; + + private IBluetoothHidDevice mService; + + private BluetoothAdapter mAdapter; + + private static class BluetoothHidDeviceCallbackWrapper extends IBluetoothHidDeviceCallback.Stub { + + private BluetoothHidDeviceCallback mCallback; + + public BluetoothHidDeviceCallbackWrapper(BluetoothHidDeviceCallback callback) { + mCallback = callback; + } + + @Override + public void onAppStatusChanged(BluetoothDevice pluggedDevice, + BluetoothHidDeviceAppConfiguration config, boolean registered) { + mCallback.onAppStatusChanged(pluggedDevice, config, registered); + } + + @Override + public void onConnectionStateChanged(BluetoothDevice device, int state) { + mCallback.onConnectionStateChanged(device, state); + } + + @Override + public void onGetReport(byte type, byte id, int bufferSize) { + mCallback.onGetReport(type, id, bufferSize); + } + + @Override + public void onSetReport(byte type, byte id, byte[] data) { + mCallback.onSetReport(type, id, data); + } + + @Override + public void onSetProtocol(byte protocol) { + mCallback.onSetProtocol(protocol); + } + + @Override + public void onIntrData(byte reportId, byte[] data) { + mCallback.onIntrData(reportId, data); + } + + @Override + public void onVirtualCableUnplug() { + mCallback.onVirtualCableUnplug(); + } + } + + final private IBluetoothStateChangeCallback mBluetoothStateChangeCallback = + new IBluetoothStateChangeCallback.Stub() { + + public void onBluetoothStateChange(boolean up) { + Log.d(TAG, "onBluetoothStateChange: up=" + up); + synchronized (mConnection) { + if (!up) { + Log.d(TAG,"Unbinding service..."); + if (mService != null) { + mService = null; + try { + mContext.unbindService(mConnection); + } catch (IllegalArgumentException e) { + Log.e(TAG,"onBluetoothStateChange: could not unbind service:", e); + } + } + } else { + try { + if (mService == null) { + Log.d(TAG,"Binding HID Device service..."); + doBind(); + } + } catch (IllegalStateException e) { + Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); + } catch (SecurityException e) { + Log.e(TAG,"onBluetoothStateChange: could not bind to HID Dev service: ", e); + } + } + } + } + }; + + private ServiceConnection mConnection = new ServiceConnection() { + + public void onServiceConnected(ComponentName className, IBinder service) { + Log.d(TAG, "onServiceConnected()"); + + mService = IBluetoothHidDevice.Stub.asInterface(service); + + if (mServiceListener != null) { + mServiceListener.onServiceConnected(BluetoothProfile.HID_DEVICE, + BluetoothHidDevice.this); + } + } + + public void onServiceDisconnected(ComponentName className) { + Log.d(TAG, "onServiceDisconnected()"); + + mService = null; + + if (mServiceListener != null) { + mServiceListener.onServiceDisconnected(BluetoothProfile.HID_DEVICE); + } + } + }; + + BluetoothHidDevice(Context context, ServiceListener listener) { + Log.v(TAG, "BluetoothHidDevice"); + + mContext = context; + mServiceListener = listener; + mAdapter = BluetoothAdapter.getDefaultAdapter(); + + IBluetoothManager mgr = mAdapter.getBluetoothManager(); + if (mgr != null) { + try { + mgr.registerStateChangeCallback(mBluetoothStateChangeCallback); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + + doBind(); + } + + boolean doBind() { + Intent intent = new Intent(IBluetoothHidDevice.class.getName()); + ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); + intent.setComponent(comp); + if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0, + android.os.Process.myUserHandle())) { + Log.e(TAG, "Could not bind to Bluetooth HID Device Service with " + intent); + return false; + } + Log.d(TAG, "Bound to HID Device Service"); + return true; + } + + void close() { + Log.v(TAG, "close()"); + + IBluetoothManager mgr = mAdapter.getBluetoothManager(); + if (mgr != null) { + try { + mgr.unregisterStateChangeCallback(mBluetoothStateChangeCallback); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + + synchronized (mConnection) { + if (mService != null) { + mService = null; + try { + mContext.unbindService(mConnection); + } catch (IllegalArgumentException e) { + Log.e(TAG,"close: could not unbind HID Dev service: ", e); + } + } + } + + mServiceListener = null; + } + + @Override + public List getConnectedDevices() { + Log.v(TAG, "getConnectedDevices()"); + return null; + } + + @Override + public List getDevicesMatchingConnectionStates(int[] states) { + Log.v(TAG, "getDevicesMatchingConnectionStates(): states=" + Arrays.toString(states)); + return null; + } + + @Override + public int getConnectionState(BluetoothDevice device) { + Log.v(TAG, "getConnectionState(): device=" + device.getAddress()); + + return STATE_DISCONNECTED; + } + + /** + * Registers application to be used for HID device. Connections to HID + * Device are only possible when application is registered. Only one + * application can be registered at time. When no longer used, application + * should be unregistered using + * {@link #unregisterApp(BluetoothHidDeviceAppConfiguration)}. + * + * @param sdp {@link BluetoothHidDeviceAppSdpSettings} object of + * HID Device SDP record. + * @param inQos {@link BluetoothHidDeviceAppQosSettings} object of + * Incoming QoS Settings. + * @param outQos {@link BluetoothHidDeviceAppQosSettings} object of + * Outgoing QoS Settings. + * @param callback {@link BluetoothHidDeviceCallback} object to which + * callback messages will be sent. + * @return + */ + public boolean registerApp(BluetoothHidDeviceAppSdpSettings sdp, + BluetoothHidDeviceAppQosSettings inQos, BluetoothHidDeviceAppQosSettings outQos, + BluetoothHidDeviceCallback callback) { + Log.v(TAG, "registerApp(): sdp=" + sdp + " inQos=" + inQos + " outQos=" + outQos + + " callback=" + callback); + + boolean result = false; + + if (sdp == null || callback == null) { + return false; + } + + if (mService != null) { + try { + BluetoothHidDeviceAppConfiguration config = + new BluetoothHidDeviceAppConfiguration(); + BluetoothHidDeviceCallbackWrapper cbw = + new BluetoothHidDeviceCallbackWrapper(callback); + result = mService.registerApp(config, sdp, inQos, outQos, cbw); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Unregisters application. Active connection will be disconnected and no + * new connections will be allowed until registered again using + * {@link #registerApp(String, String, String, byte, byte[], BluetoothHidDeviceCallback)} + * + * @param config {@link BluetoothHidDeviceAppConfiguration} object as + * obtained from + * {@link BluetoothHidDeviceCallback#onAppStatusChanged(BluetoothDevice, + * BluetoothHidDeviceAppConfiguration, boolean)} + * + * @return + */ + public boolean unregisterApp(BluetoothHidDeviceAppConfiguration config) { + Log.v(TAG, "unregisterApp()"); + + boolean result = false; + + if (mService != null) { + try { + result = mService.unregisterApp(config); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Sends report to remote host using interrupt channel. + * + * @param id Report Id, as defined in descriptor. Can be 0 in case Report Id + * are not defined in descriptor. + * @param data Report data, not including Report Id. + * @return + */ + public boolean sendReport(int id, byte[] data) { + Log.v(TAG, "sendReport(): id=" + id); + + boolean result = false; + + if (mService != null) { + try { + result = mService.sendReport(id, data); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Sends report to remote host as reply for GET_REPORT request from + * {@link BluetoothHidDeviceCallback#onGetReport(byte, byte, int)}. + * + * @param type Report Type, as in request. + * @param id Report Id, as in request. + * @param data Report data, not including Report Id. + * @return + */ + public boolean replyReport(byte type, byte id, byte[] data) { + Log.v(TAG, "replyReport(): type=" + type + " id=" + id); + + boolean result = false; + + if (mService != null) { + try { + result = mService.replyReport(type, id, data); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Sends error handshake message as reply for invalid SET_REPORT request + * from {@link BluetoothHidDeviceCallback#onSetReport(byte, byte, byte[])}. + * + * @param error Error to be sent for SET_REPORT via HANDSHAKE. + * @return + */ + public boolean reportError(byte error) { + Log.v(TAG, "reportError(): error = " + error); + + boolean result = false; + + if (mService != null) { + try { + result = mService.reportError(error); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Sends Virtual Cable Unplug to currently connected host. + * + * @return + */ + public boolean unplug() { + Log.v(TAG, "unplug()"); + + boolean result = false; + + if (mService != null) { + try { + result = mService.unplug(); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Initiates connection to host which currently has Virtual Cable + * established with device. + * + * @return + */ + public boolean connect() { + Log.v(TAG, "connect()"); + + boolean result = false; + + if (mService != null) { + try { + result = mService.connect(); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } + + /** + * Disconnects from currently connected host. + * + * @return + */ + public boolean disconnect() { + Log.v(TAG, "disconnect()"); + + boolean result = false; + + if (mService != null) { + try { + result = mService.disconnect(); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + } + + return result; + } +} diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl new file mode 100644 index 00000000000..1af309c67ca --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.aidl @@ -0,0 +1,21 @@ +/* +** Copyright (C) 2013 The Linux Foundation. All rights reserved +** Not a Contribution. +** Copyright 2011, 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.bluetooth; + +parcelable BluetoothHidDeviceAppConfiguration; diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.java b/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.java new file mode 100644 index 00000000000..9f3cd3c5371 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppConfiguration.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011 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.bluetooth; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Random; + +/** @hide */ +public final class BluetoothHidDeviceAppConfiguration implements Parcelable { + private final long mHash; + + BluetoothHidDeviceAppConfiguration() { + Random rnd = new Random(); + mHash = rnd.nextLong(); + } + + BluetoothHidDeviceAppConfiguration(long hash) { + mHash = hash; + } + + @Override + public boolean equals(Object o) { + if (o instanceof BluetoothHidDeviceAppConfiguration) { + BluetoothHidDeviceAppConfiguration config = (BluetoothHidDeviceAppConfiguration) o; + return mHash == config.mHash; + } + return false; + } + + @Override + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + + @Override + public BluetoothHidDeviceAppConfiguration createFromParcel(Parcel in) { + long hash = in.readLong(); + return new BluetoothHidDeviceAppConfiguration(hash); + } + + @Override + public BluetoothHidDeviceAppConfiguration[] newArray(int size) { + return new BluetoothHidDeviceAppConfiguration[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeLong(mHash); + } +} diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl new file mode 100644 index 00000000000..ae93235cc8b --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.aidl @@ -0,0 +1,21 @@ +/* +** Copyright (C) 2013 The Linux Foundation. All rights reserved +** Not a Contribution. +** Copyright 2011, 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.bluetooth; + +parcelable BluetoothHidDeviceAppQosSettings; diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.java b/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.java new file mode 100644 index 00000000000..a4044d93533 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppQosSettings.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011 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.bluetooth; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Random; + +/** @hide */ +public final class BluetoothHidDeviceAppQosSettings implements Parcelable { + + final public int serviceType; + final public int tokenRate; + final public int tokenBucketSize; + final public int peakBandwidth; + final public int latency; + final public int delayVariation; + + final static public int SERVICE_NO_TRAFFIC = 0x00; + final static public int SERVICE_BEST_EFFORT = 0x01; + final static public int SERVICE_GUARANTEED = 0x02; + + final static public int MAX = (int) 0xffffffff; + + public BluetoothHidDeviceAppQosSettings(int serviceType, int tokenRate, int tokenBucketSize, + int peakBandwidth, + int latency, int delayVariation) { + this.serviceType = serviceType; + this.tokenRate = tokenRate; + this.tokenBucketSize = tokenBucketSize; + this.peakBandwidth = peakBandwidth; + this.latency = latency; + this.delayVariation = delayVariation; + } + + @Override + public boolean equals(Object o) { + if (o instanceof BluetoothHidDeviceAppQosSettings) { + BluetoothHidDeviceAppQosSettings qos = (BluetoothHidDeviceAppQosSettings) o; + return false; + } + return false; + } + + @Override + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + + @Override + public BluetoothHidDeviceAppQosSettings createFromParcel(Parcel in) { + + return new BluetoothHidDeviceAppQosSettings(in.readInt(), in.readInt(), in.readInt(), + in.readInt(), + in.readInt(), in.readInt()); + } + + @Override + public BluetoothHidDeviceAppQosSettings[] newArray(int size) { + return new BluetoothHidDeviceAppQosSettings[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeInt(serviceType); + out.writeInt(tokenRate); + out.writeInt(tokenBucketSize); + out.writeInt(peakBandwidth); + out.writeInt(latency); + out.writeInt(delayVariation); + } + + public int[] toArray() { + return new int[] { + serviceType, tokenRate, tokenBucketSize, peakBandwidth, latency, delayVariation + }; + } +} diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl b/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl new file mode 100644 index 00000000000..38ac1ec6950 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.aidl @@ -0,0 +1,21 @@ +/* +** Copyright (C) 2013 The Linux Foundation. All rights reserved +** Not a Contribution. +** Copyright 2011, 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.bluetooth; + +parcelable BluetoothHidDeviceAppSdpSettings; diff --git a/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java b/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java new file mode 100644 index 00000000000..db88f0d74c0 --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011 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.bluetooth; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Random; + +/** @hide */ +public final class BluetoothHidDeviceAppSdpSettings implements Parcelable { + + final public String name; + final public String description; + final public String provider; + final public byte subclass; + final public byte[] descriptors; + + public BluetoothHidDeviceAppSdpSettings(String name, String description, String provider, + byte subclass, byte[] descriptors) { + this.name = name; + this.description = description; + this.provider = provider; + this.subclass = subclass; + this.descriptors = descriptors.clone(); + } + + @Override + public boolean equals(Object o) { + if (o instanceof BluetoothHidDeviceAppSdpSettings) { + BluetoothHidDeviceAppSdpSettings sdp = (BluetoothHidDeviceAppSdpSettings) o; + return false; + } + return false; + } + + @Override + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + + @Override + public BluetoothHidDeviceAppSdpSettings createFromParcel(Parcel in) { + + return new BluetoothHidDeviceAppSdpSettings(in.readString(), in.readString(), + in.readString(), in.readByte(), in.createByteArray()); + } + + @Override + public BluetoothHidDeviceAppSdpSettings[] newArray(int size) { + return new BluetoothHidDeviceAppSdpSettings[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(name); + out.writeString(description); + out.writeString(provider); + out.writeByte(subclass); + out.writeByteArray(descriptors); + } +} diff --git a/core/java/android/bluetooth/BluetoothHidDeviceCallback.java b/core/java/android/bluetooth/BluetoothHidDeviceCallback.java new file mode 100644 index 00000000000..cc608339b4e --- /dev/null +++ b/core/java/android/bluetooth/BluetoothHidDeviceCallback.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011 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.bluetooth; + +import android.util.Log; + +/** @hide */ +public abstract class BluetoothHidDeviceCallback { + + private static final String TAG = BluetoothHidDeviceCallback.class.getSimpleName(); + + /** + * Callback called when application registration state changes. Usually it's + * called due to either + * {@link BluetoothHidDevice#registerApp(String, String, String, byte, byte[], + * BluetoothHidDeviceCallback)} + * or + * {@link BluetoothHidDevice#unregisterApp(BluetoothHidDeviceAppConfiguration)} + * , but can be also unsolicited in case e.g. Bluetooth was turned off in + * which case application is unregistered automatically. + * + * @param pluggedDevice {@link BluetoothDevice} object which represents host + * that currently has Virtual Cable established with device. Only + * valid when application is registered, can be null + * . + * @param config {@link BluetoothHidDeviceAppConfiguration} object which + * represents token required to unregister application using + * {@link BluetoothHidDevice#unregisterApp(BluetoothHidDeviceAppConfiguration)} + * . + * @param registered true if application is registered, + * false otherwise. + */ + public void onAppStatusChanged(BluetoothDevice pluggedDevice, + BluetoothHidDeviceAppConfiguration config, boolean registered) { + Log.d(TAG, "onAppStatusChanged: pluggedDevice=" + (pluggedDevice == null ? + null : pluggedDevice.toString()) + " registered=" + registered); + } + + /** + * Callback called when connection state with remote host was changed. + * Application can assume than Virtual Cable is established when called with + * {@link BluetoothProfile#STATE_CONNECTED} state. + * + * @param device {@link BluetoothDevice} object representing host device + * which connection state was changed. + * @param state Connection state as defined in {@link BluetoothProfile}. + */ + public void onConnectionStateChanged(BluetoothDevice device, int state) { + Log.d(TAG, "onConnectionStateChanged: device=" + device.toString() + " state=" + state); + } + + /** + * Callback called when GET_REPORT is received from remote host. Should be + * replied by application using + * {@link BluetoothHidDevice#replyReport(byte, byte, byte[])}. + * + * @param type Requested Report Type. + * @param id Requested Report Id, can be 0 if no Report Id are defined in + * descriptor. + * @param bufferSize Requested buffer size, application shall respond with + * at least given number of bytes. + */ + public void onGetReport(byte type, byte id, int bufferSize) { + Log.d(TAG, "onGetReport: type=" + type + " id=" + id + " bufferSize=" + bufferSize); + } + + /** + * Callback called when SET_REPORT is received from remote host. In case + * received data are invalid, application shall respond with + * {@link BluetoothHidDevice#reportError()}. + * + * @param type Report Type. + * @param id Report Id. + * @param data Report data. + */ + public void onSetReport(byte type, byte id, byte[] data) { + Log.d(TAG, "onSetReport: type=" + type + " id=" + id); + } + + /** + * Callback called when SET_PROTOCOL is received from remote host. + * Application shall use this information to send only reports valid for + * given protocol mode. By default, + * {@link BluetoothHidDevice#PROTOCOL_REPORT_MODE} shall be assumed. + * + * @param protocol Protocol Mode. + */ + public void onSetProtocol(byte protocol) { + Log.d(TAG, "onSetProtocol: protocol=" + protocol); + } + + /** + * Callback called when report data is received over interrupt channel. + * Report Type is assumed to be + * {@link BluetoothHidDevice#REPORT_TYPE_OUTPUT}. + * + * @param reportId Report Id. + * @param data Report data. + */ + public void onIntrData(byte reportId, byte[] data) { + Log.d(TAG, "onIntrData: reportId=" + reportId); + } + + /** + * Callback called when Virtual Cable is removed. This can be either due to + * {@link BluetoothHidDevice#unplug()} or request from remote side. After + * this callback is received connection will be disconnected automatically. + */ + public void onVirtualCableUnplug() { + Log.d(TAG, "onVirtualCableUnplug"); + } +} diff --git a/core/java/android/bluetooth/BluetoothInputDevice.java b/core/java/android/bluetooth/BluetoothInputDevice.java index 252e3d28a25..db23ef54899 100644 --- a/core/java/android/bluetooth/BluetoothInputDevice.java +++ b/core/java/android/bluetooth/BluetoothInputDevice.java @@ -96,6 +96,12 @@ public final class BluetoothInputDevice implements BluetoothProfile { public static final String ACTION_VIRTUAL_UNPLUG_STATUS = "android.bluetooth.input.profile.action.VIRTUAL_UNPLUG_STATUS"; + /** + * @hide + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_IDLE_TIME_CHANGED = + "codeaurora.bluetooth.input.profile.action.IDLE_TIME_CHANGED"; /** * Return codes for the connect and disconnect Bluez / Dbus calls. @@ -199,6 +205,11 @@ public final class BluetoothInputDevice implements BluetoothProfile { */ public static final String EXTRA_VIRTUAL_UNPLUG_STATUS = "android.bluetooth.BluetoothInputDevice.extra.VIRTUAL_UNPLUG_STATUS"; + /** + * @hide + */ + public static final String EXTRA_IDLE_TIME = "codeaurora.bluetooth.BluetoothInputDevice.extra.IDLE_TIME"; + private Context mContext; private ServiceListener mServiceListener; private BluetoothAdapter mAdapter; @@ -658,6 +669,56 @@ public boolean sendData(BluetoothDevice device, String report) { if (mService == null) Log.w(TAG, "Proxy not attached to service"); return false; } + + /** + * Send Get_Idle_Time command to the connected HID input device. + * + *

Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission. + * + * @param device Remote Bluetooth Device + * @return false on immediate error, + * true otherwise + * @hide + */ + public boolean getIdleTime(BluetoothDevice device) { + if (DBG) log("getIdletime(" + device + ")"); + if (mService != null && isEnabled() && isValidDevice(device)) { + try { + return mService.getIdleTime(device); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + + /** + * Send Set_Idle_Time command to the connected HID input device. + * + *

Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN} permission. + * + * @param device Remote Bluetooth Device + * @param idleTime Idle time to be set on HID Device + * @return false on immediate error, + * true otherwise + * @hide + */ + public boolean setIdleTime(BluetoothDevice device, byte idleTime) { + if (DBG) log("setIdletime(" + device + "), idleTime=" + idleTime); + if (mService != null && isEnabled() && isValidDevice(device)) { + try { + return mService.setIdleTime(device, idleTime); + } catch (RemoteException e) { + Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); + return false; + } + } + if (mService == null) Log.w(TAG, "Proxy not attached to service"); + return false; + } + private static void log(String msg) { Log.d(TAG, msg); } diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index cbce22cdea6..9ef931ea26e 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -130,6 +130,18 @@ public interface BluetoothProfile { */ public static final int HEADSET_CLIENT = 16; + /** + * HID device + * @hide + */ + public static final int HID_DEVICE = 17; + + /** + * DUN + * @hide + */ + public static final int DUN = 21; + /** * Default priority for devices that we try to auto-connect to and * and allow incoming connections for the profile diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index fb81fd1ea9d..2eb49531b59 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -247,6 +247,7 @@ private BluetoothSocket acceptSocket(String RemoteAddr) throws IOException { as.mSocketOS = as.mSocket.getOutputStream(); as.mAddress = RemoteAddr; as.mDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(RemoteAddr); + as.mPort = mPort; return as; } /** @@ -468,6 +469,61 @@ public void connect() throws IOException { return acceptedSocket; } + /** + * setSocketOpt for the Buetooth Socket. + * + * @param optionName socket option name + * @param optionVal socket option value + * @param optionLen socket option length + * @return -1 on immediate error, + * 0 otherwise + * @hide + */ + public int setSocketOpt(int optionName, byte [] optionVal, int optionLen) throws IOException { + int ret = 0; + if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed"); + IBluetooth bluetoothProxy = BluetoothAdapter.getDefaultAdapter().getBluetoothService(null); + if (bluetoothProxy == null) { + Log.e(TAG, "setSocketOpt fail, reason: bluetooth is off"); + return -1; + } + try { + if(VDBG) Log.d(TAG, "setSocketOpt(), mType: " + mType + " mPort: " + mPort); + ret = bluetoothProxy.setSocketOpt(mType, mPort, optionName, optionVal, optionLen); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return -1; + } + return ret; + } + + /** + * getSocketOpt for the Buetooth Socket. + * + * @param optionName socket option name + * @param optionVal socket option value + * @return -1 on immediate error, + * length of returned socket option otherwise + * @hide + */ + public int getSocketOpt(int optionName, byte [] optionVal) throws IOException { + int ret = 0; + if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed"); + IBluetooth bluetoothProxy = BluetoothAdapter.getDefaultAdapter().getBluetoothService(null); + if (bluetoothProxy == null) { + Log.e(TAG, "getSocketOpt fail, reason: bluetooth is off"); + return -1; + } + try { + if(VDBG) Log.d(TAG, "getSocketOpt(), mType: " + mType + " mPort: " + mPort); + ret = bluetoothProxy.getSocketOpt(mType, mPort, optionName, optionVal); + } catch (RemoteException e) { + Log.e(TAG, Log.getStackTraceString(new Throwable())); + return -1; + } + return ret; + } + /*package*/ int available() throws IOException { if (VDBG) Log.d(TAG, "available: " + mSocketIS); return mSocketIS.available(); diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl index 66f3418c620..2f1e8b4b680 100644 --- a/core/java/android/bluetooth/IBluetooth.aidl +++ b/core/java/android/bluetooth/IBluetooth.aidl @@ -70,6 +70,11 @@ interface IBluetooth boolean fetchRemoteUuids(in BluetoothDevice device); boolean sdpSearch(in BluetoothDevice device, in ParcelUuid uuid); + int createMapMnsSdpRecord(in String serviceName, in int rfcommChannel, + in int l2capPsm, in int version, in int features); + int createPbapPceSdpRecord(in String serviceName, in int version); + boolean removeSdpRecord(in int recordHandle); + boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode); boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] passkey); @@ -106,4 +111,7 @@ interface IBluetooth void dump(in ParcelFileDescriptor fd); void onLeServiceUp(); void onBrEdrDown(); + + int setSocketOpt(int type, int port, int optionName, in byte [] optionVal, int optionLen); + int getSocketOpt(int type, int port, int optionName, out byte [] optionVal); } diff --git a/core/java/android/bluetooth/IBluetoothA2dpSink.aidl b/core/java/android/bluetooth/IBluetoothA2dpSink.aidl old mode 100644 new mode 100755 index b7c64767700..774a1ecd541 --- a/core/java/android/bluetooth/IBluetoothA2dpSink.aidl +++ b/core/java/android/bluetooth/IBluetoothA2dpSink.aidl @@ -30,5 +30,8 @@ interface IBluetoothA2dpSink { List getConnectedDevices(); List getDevicesMatchingConnectionStates(in int[] states); int getConnectionState(in BluetoothDevice device); + boolean setPriority(in BluetoothDevice device, int priority); + int getPriority(in BluetoothDevice device); + boolean isA2dpPlaying(in BluetoothDevice device); BluetoothAudioConfig getAudioConfig(in BluetoothDevice device); } diff --git a/core/java/android/bluetooth/IBluetoothAvrcpController.aidl b/core/java/android/bluetooth/IBluetoothAvrcpController.aidl index f917a50860b..fb61c98d27e 100644 --- a/core/java/android/bluetooth/IBluetoothAvrcpController.aidl +++ b/core/java/android/bluetooth/IBluetoothAvrcpController.aidl @@ -1,4 +1,5 @@ /* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +18,7 @@ package android.bluetooth; import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothAvrcpInfo; /** * APIs for Bluetooth AVRCP controller service @@ -28,4 +30,10 @@ interface IBluetoothAvrcpController { List getDevicesMatchingConnectionStates(in int[] states); int getConnectionState(in BluetoothDevice device); void sendPassThroughCmd(in BluetoothDevice device, int keyCode, int keyState); + void getMetaData(in int[] attributeIds); + void getPlayStatus(in int[] playStatusIds); + void getPlayerApplicationSetting(); + void setPlayerApplicationSetting(in int attributeId, in int attribVal); + BluetoothAvrcpInfo getSupportedPlayerAppSetting(in BluetoothDevice device); + int getSupportedFeatures(in BluetoothDevice device); } diff --git a/core/java/android/bluetooth/IBluetoothDun.aidl b/core/java/android/bluetooth/IBluetoothDun.aidl new file mode 100644 index 00000000000..a4f2017cc81 --- /dev/null +++ b/core/java/android/bluetooth/IBluetoothDun.aidl @@ -0,0 +1,45 @@ +/* +*Copyright (c) 2013, The Linux Foundation. All rights reserved. +* +*Redistribution and use in source and binary forms, with or without +*modification, are permitted provided that the following conditions are +*met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +*THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +*WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +*ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +*BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +*CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +*SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +*WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +*OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +*IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package android.bluetooth; + +import android.bluetooth.BluetoothDevice; + +/** + * API for Bluetooth Dun service + * + * {@hide} + */ +interface IBluetoothDun { + // Public API + boolean disconnect(in BluetoothDevice device); + int getConnectionState(in BluetoothDevice device); + List getConnectedDevices(); + List getDevicesMatchingConnectionStates(in int[] states); +} diff --git a/core/java/android/bluetooth/IBluetoothHidDevice.aidl b/core/java/android/bluetooth/IBluetoothHidDevice.aidl new file mode 100644 index 00000000000..60358c55031 --- /dev/null +++ b/core/java/android/bluetooth/IBluetoothHidDevice.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2012 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.bluetooth; + +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothHidDeviceAppConfiguration; +import android.bluetooth.IBluetoothHidDeviceCallback; +import android.bluetooth.BluetoothHidDeviceAppSdpSettings; +import android.bluetooth.BluetoothHidDeviceAppQosSettings; + +/** @hide */ +interface IBluetoothHidDevice { + boolean registerApp(in BluetoothHidDeviceAppConfiguration config, + in BluetoothHidDeviceAppSdpSettings sdp, in BluetoothHidDeviceAppQosSettings inQos, + in BluetoothHidDeviceAppQosSettings outQos, in IBluetoothHidDeviceCallback callback); + boolean unregisterApp(in BluetoothHidDeviceAppConfiguration config); + boolean sendReport(in int id, in byte[] data); + boolean replyReport(in byte type, in byte id, in byte[] data); + boolean reportError(byte error); + boolean unplug(); + boolean connect(); + boolean disconnect(); +} diff --git a/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl b/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl new file mode 100644 index 00000000000..7c71a1799c2 --- /dev/null +++ b/core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 The Linux Foundation. All rights reserved + * Not a Contribution. + * Copyright (C) 2011, 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.bluetooth; + +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothHidDeviceAppConfiguration; + +/** @hide */ +interface IBluetoothHidDeviceCallback { + void onAppStatusChanged(in BluetoothDevice device, in BluetoothHidDeviceAppConfiguration config, boolean registered); + void onConnectionStateChanged(in BluetoothDevice device, in int state); + void onGetReport(in byte type, in byte id, in int bufferSize); + void onSetReport(in byte type, in byte id, in byte[] data); + void onSetProtocol(in byte protocol); + void onIntrData(in byte reportId, in byte[] data); + void onVirtualCableUnplug(); +} diff --git a/core/java/android/bluetooth/IBluetoothInputDevice.aidl b/core/java/android/bluetooth/IBluetoothInputDevice.aidl index 1ebb9ca6eb1..5bd3f781932 100644 --- a/core/java/android/bluetooth/IBluetoothInputDevice.aidl +++ b/core/java/android/bluetooth/IBluetoothInputDevice.aidl @@ -56,4 +56,12 @@ interface IBluetoothInputDevice { * @hide */ boolean sendData(in BluetoothDevice device, String report); + /** + * @hide + */ + boolean getIdleTime(in BluetoothDevice device); + /** + * @hide + */ + boolean setIdleTime(in BluetoothDevice device, byte idleTime); } diff --git a/core/java/android/bluetooth/IBluetoothManager.aidl b/core/java/android/bluetooth/IBluetoothManager.aidl index 0b81ee8c547..bd8c6c9687f 100644 --- a/core/java/android/bluetooth/IBluetoothManager.aidl +++ b/core/java/android/bluetooth/IBluetoothManager.aidl @@ -19,7 +19,6 @@ package android.bluetooth; import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothGatt; import android.bluetooth.IBluetoothManagerCallback; -import android.bluetooth.IBluetoothProfileServiceConnection; import android.bluetooth.IBluetoothStateChangeCallback; /** @@ -34,14 +33,11 @@ interface IBluetoothManager void registerStateChangeCallback(in IBluetoothStateChangeCallback callback); void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback); boolean isEnabled(); - boolean enable(); + boolean enable(String callingPackage); boolean enableNoAutoConnect(); boolean disable(boolean persist); IBluetoothGatt getBluetoothGatt(); - boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); - void unbindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy); - String getAddress(); String getName(); diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index 6ede29b9ba1..600e5a1c007 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -431,6 +431,7 @@ public void appNotRespondingViaProvider(IContentProvider icp) { public final @Nullable Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) { + android.util.SeempLog.record_uri(13, uri); return query(uri, projection, selection, selectionArgs, sortOrder, null); } @@ -471,6 +472,7 @@ public void appNotRespondingViaProvider(IContentProvider icp) { public final @Nullable Cursor query(final @NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder, @Nullable CancellationSignal cancellationSignal) { + android.util.SeempLog.record_uri(13, uri); Preconditions.checkNotNull(uri, "uri"); IContentProvider unstableProvider = acquireUnstableProvider(uri); if (unstableProvider == null) { @@ -1221,6 +1223,7 @@ public OpenResourceIdResult getResourceId(Uri uri) throws FileNotFoundException * @return the URL of the newly created row. */ public final @Nullable Uri insert(@NonNull Uri url, @Nullable ContentValues values) { + android.util.SeempLog.record_uri(37, url); Preconditions.checkNotNull(url, "url"); IContentProvider provider = acquireProvider(url); if (provider == null) { diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java index 8d96f5c2a9c..17b662a516b 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -612,7 +612,9 @@ protected void finalize() throws Throwable public final int addAssetPath(String path) { synchronized (this) { int res = addAssetPathNative(path); - makeStringBlocks(mStringBlocks); + if (mStringBlocks != null) { + makeStringBlocks(mStringBlocks); + } return res; } } @@ -627,11 +629,12 @@ public final int addAssetPath(String path) { * * {@hide} */ - public final int addOverlayPath(String idmapPath) { synchronized (this) { int res = addOverlayPathNative(idmapPath); - makeStringBlocks(mStringBlocks); + if (mStringBlocks != null) { + makeStringBlocks(mStringBlocks); + } return res; } } diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index 73bb4266e64..c76fbb737ff 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -153,6 +153,10 @@ public class Camera { private static final int CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x200; private static final int CAMERA_MSG_PREVIEW_METADATA = 0x400; private static final int CAMERA_MSG_FOCUS_MOVE = 0x800; + /* ### QC ADD-ONS: START */ + private static final int CAMERA_MSG_STATS_DATA = 0x1000; + private static final int CAMERA_MSG_META_DATA = 0x2000; + /* ### QC ADD-ONS: END */ private long mNativeContext; // accessed by native methods private EventHandler mEventHandler; @@ -180,6 +184,10 @@ public class Camera { private static final int ENOSYS = -38; private static final int EUSERS = -87; private static final int EOPNOTSUPP = -95; + /* ### QC ADD-ONS: START */ + private CameraDataCallback mCameraDataCallback; + private CameraMetaDataCallback mCameraMetaDataCallback; + /* ### QC ADD-ONS: END */ /** * Broadcast Action: A new picture is taken by the camera, and the entry of @@ -266,6 +274,17 @@ public static class CameraInfo { */ public static final int CAMERA_FACING_FRONT = 1; + /* ### QC ADD-ONS: START TBD*/ + /** @hide + * camera is in ZSL mode. + */ + public static final int CAMERA_SUPPORT_MODE_ZSL = 2; + + /** @hide + * camera is in non-ZSL mode. + */ + public static final int CAMERA_SUPPORT_MODE_NONZSL = 3; + /* ### QC ADD-ONS: END */ /** * The direction that the camera faces. It should be * CAMERA_FACING_BACK or CAMERA_FACING_FRONT. @@ -450,6 +469,10 @@ private int cameraInitVersion(int cameraId, int halVersion) { mPostviewCallback = null; mUsingPreviewAllocation = false; mZoomListener = null; + /* ### QC ADD-ONS: START */ + mCameraDataCallback = null; + mCameraMetaDataCallback = null; + /* ### QC ADD-ONS: END */ Looper looper; if ((looper = Looper.myLooper()) != null) { @@ -766,6 +789,7 @@ public final void stopPreview() { * @see android.media.MediaActionSound */ public final void setPreviewCallback(PreviewCallback cb) { + android.util.SeempLog.record(66); mPreviewCallback = cb; mOneShot = false; mWithBuffer = false; @@ -792,6 +816,7 @@ public final void setPreviewCallback(PreviewCallback cb) { * @see android.media.MediaActionSound */ public final void setOneShotPreviewCallback(PreviewCallback cb) { + android.util.SeempLog.record(68); mPreviewCallback = cb; mOneShot = true; mWithBuffer = false; @@ -830,6 +855,7 @@ public final void setOneShotPreviewCallback(PreviewCallback cb) { * @see android.media.MediaActionSound */ public final void setPreviewCallbackWithBuffer(PreviewCallback cb) { + android.util.SeempLog.record(67); mPreviewCallback = cb; mOneShot = false; mWithBuffer = true; @@ -1152,7 +1178,23 @@ public void handleMessage(Message msg) { mAutoFocusMoveCallback.onAutoFocusMoving(msg.arg1 == 0 ? false : true, mCamera); } return; + /* ### QC ADD-ONS: START */ + case CAMERA_MSG_STATS_DATA: + int statsdata[] = new int[257]; + for(int i =0; i<257; i++ ) { + statsdata[i] = byteToInt( (byte[])msg.obj, i*4); + } + if (mCameraDataCallback != null) { + mCameraDataCallback.onCameraData(statsdata, mCamera); + } + return; + case CAMERA_MSG_META_DATA: + if (mCameraMetaDataCallback != null) { + mCameraMetaDataCallback.onCameraMetaData((byte[])msg.obj, mCamera); + } + return; + /* ### QC ADD-ONS: END */ default: Log.e(TAG, "Unknown message type " + msg.what); return; @@ -1376,6 +1418,7 @@ public interface PictureCallback { */ public final void takePicture(ShutterCallback shutter, PictureCallback raw, PictureCallback jpeg) { + android.util.SeempLog.record(65); takePicture(shutter, raw, null, jpeg); } private native final void native_takePicture(int msgType); @@ -1411,6 +1454,7 @@ public final void takePicture(ShutterCallback shutter, PictureCallback raw, */ public final void takePicture(ShutterCallback shutter, PictureCallback raw, PictureCallback postview, PictureCallback jpeg) { + android.util.SeempLog.record(65); mShutterCallback = shutter; mRawImageCallback = raw; mPostviewCallback = postview; @@ -1800,6 +1844,23 @@ public Face() { * as a set. Either they are all valid, or none of them are. */ public Point mouth = null; + + /** + * {@hide} + */ + public int smileDegree = 0; + /** + * {@hide} + */ + public int smileScore = 0; + /** + * {@hide} + */ + public int blinkDetected = 0; + /** + * {@hide} + */ + public int faceRecognised = 0; } /** @@ -1892,6 +1953,27 @@ public Parameters getParameters() { return p; } + /** @hide + * Returns the current cct value of white balance. + * + * If it's in AWB mode, cct is determined by stats/awb module. + * + * If it's in Manual WB mode, it actually returns cct value + * set by user via {@link #setParameters(Camera.Parameters)}. + */ + public int getWBCurrentCCT() { + Parameters p = new Parameters(); + String s = native_getParameters(); + p.unflatten(s); + + int cct = 0; + if (p.getWBCurrentCCT() != null) { + cct = Integer.parseInt(p.getWBCurrentCCT()); + } + + return cct; + } + /** * Returns an empty {@link Parameters} for testing purpose. * @@ -1904,6 +1986,157 @@ public static Parameters getEmptyParameters() { return camera.new Parameters(); } + /* ### QC ADD-ONS: START */ + private static int byteToInt(byte[] b, int offset) { + int value = 0; + for (int i = 0; i < 4; i++) { + int shift = (4 - 1 - i) * 8; + value += (b[(3-i) + offset] & 0x000000FF) << shift; + } + return value; + } + /** @hide + * Handles the callback for when Camera Data is available. + * data is read from the camera. + */ + public interface CameraDataCallback { + /** + * Callback for when camera data is available. + * + * @param data a int array of the camera data + * @param camera the Camera service object + */ + void onCameraData(int[] data, Camera camera); + }; + + /** @hide + * Set camera histogram mode and registers a callback function to run. + * Only valid after startPreview() has been called. + * + * @param cb the callback to run + */ + public final void setHistogramMode(CameraDataCallback cb) + { + mCameraDataCallback = cb; + native_setHistogramMode(cb!=null); + } + private native final void native_setHistogramMode(boolean mode); + + /** @hide + * Set camera histogram command to send data. + * + */ + public final void sendHistogramData() + { + native_sendHistogramData(); + } + private native final void native_sendHistogramData(); + + /** @hide + * Handles the callback for when Camera Meta Data is available. + * Meta data is read from the camera. + */ + public interface CameraMetaDataCallback { + /** + * Callback for when camera meta data is available. + * + * @param data a byte array of the camera meta data + * @param camera the Camera service object + */ + void onCameraMetaData(byte[] data, Camera camera); + }; + + /** @hide + * Set camera meta data and registers a callback function to run. + * Only valid after startPreview() has been called. + * + * @param cb the callback to run + */ + public final void setMetadataCb(CameraMetaDataCallback cb) + { + mCameraMetaDataCallback = cb; + native_setMetadataCb(cb!=null); + } + private native final void native_setMetadataCb(boolean mode); + + /** @hide + * Set camera face detection command to send meta data. + */ + public final void sendMetaData() + { + native_sendMetaData(); + } + private native final void native_sendMetaData(); + + /** @hide + * Configure longshot mode. Available only in ZSL. + * + * @param enable enable/disable this mode + */ + public final void setLongshot(boolean enable) + { + native_setLongshot(enable); + } + private native final void native_setLongshot(boolean enable); + + /** @hide + * Handles the Touch Co-ordinate. + */ + public class Coordinate { + /** + * Sets the x,y co-ordinates for a touch event + * + * @param x the x co-ordinate (pixels) + * @param y the y co-ordinate (pixels) + */ + public Coordinate(int x, int y) { + xCoordinate = x; + yCoordinate = y; + } + /** + * Compares {@code obj} to this co-ordinate. + * + * @param obj the object to compare this co-ordinate with. + * @return {@code true} if the xCoordinate and yCoordinate of {@code obj} is the + * same as those of this coordinate. {@code false} otherwise. + */ + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Coordinate)) { + return false; + } + Coordinate c = (Coordinate) obj; + return xCoordinate == c.xCoordinate && yCoordinate == c.yCoordinate; + } + + /** x co-ordinate for the touch event*/ + public int xCoordinate; + + /** y co-ordinate for the touch event */ + public int yCoordinate; + }; + + /** @hide + * Returns the current focus position. + * + * If it's in AF mode, it's the lens position after af is done. + * + * If it's in Manual Focus mode, it actually returns the value + * set by user via {@link #setParameters(Camera.Parameters)}. + */ + public int getCurrentFocusPosition() { + Parameters p = new Parameters(); + String s = native_getParameters(); + p.unflatten(s); + + int focus_pos = -1; + if (p.getCurrentFocusPosition() != null) { + focus_pos = Integer.parseInt(p.getCurrentFocusPosition()); + } + return focus_pos; + } + + /* ### QC ADD-ONS: END */ /** * Returns a copied {@link Parameters}; for shim use only. * @@ -2151,6 +2384,10 @@ public class Parameters { public static final String WHITE_BALANCE_CLOUDY_DAYLIGHT = "cloudy-daylight"; public static final String WHITE_BALANCE_TWILIGHT = "twilight"; public static final String WHITE_BALANCE_SHADE = "shade"; + /** @hide + * wb manual cct mode. + */ + public static final String WHITE_BALANCE_MANUAL_CCT = "manual-cct"; // Values for color effect settings. public static final String EFFECT_NONE = "none"; @@ -2198,6 +2435,11 @@ public class Parameters { */ public static final String FLASH_MODE_TORCH = "torch"; + /** @hide + * Scene mode is off. + */ + public static final String SCENE_MODE_ASD = "asd"; + /** * Scene mode is off. */ @@ -2274,6 +2516,14 @@ public class Parameters { * Capture the naturally warm color of scenes lit by candles. */ public static final String SCENE_MODE_CANDLELIGHT = "candlelight"; + /** @hide + * SCENE_MODE_BACKLIGHT + **/ + public static final String SCENE_MODE_BACKLIGHT = "backlight"; + /** @hide + * SCENE_MODE_FLOWERS + **/ + public static final String SCENE_MODE_FLOWERS = "flowers"; /** * Applications are looking for a barcode. Camera driver will be @@ -2316,6 +2566,13 @@ public class Parameters { */ public static final String FOCUS_MODE_FIXED = "fixed"; + /** @hide + * Normal focus mode. Applications should call + * {@link #autoFocus(AutoFocusCallback)} to start the focus in this + * mode. + */ + public static final String FOCUS_MODE_NORMAL = "normal"; + /** * Extended depth of field (EDOF). Focusing is done digitally and * continuously. Applications should not call {@link @@ -2368,6 +2625,11 @@ public class Parameters { */ public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture"; + /** @hide + * manual focus mode + */ + public static final String FOCUS_MODE_MANUAL_POSITION = "manual"; + // Indices for focus distance array. /** * The array index of near focus distance for use with @@ -2404,11 +2666,15 @@ public class Parameters { // Formats for setPreviewFormat and setPictureFormat. private static final String PIXEL_FORMAT_YUV422SP = "yuv422sp"; private static final String PIXEL_FORMAT_YUV420SP = "yuv420sp"; + private static final String PIXEL_FORMAT_YUV420SP_ADRENO = "yuv420sp-adreno"; private static final String PIXEL_FORMAT_YUV422I = "yuv422i-yuyv"; private static final String PIXEL_FORMAT_YUV420P = "yuv420p"; private static final String PIXEL_FORMAT_RGB565 = "rgb565"; private static final String PIXEL_FORMAT_JPEG = "jpeg"; private static final String PIXEL_FORMAT_BAYER_RGGB = "bayer-rggb"; + private static final String PIXEL_FORMAT_RAW = "raw"; + private static final String PIXEL_FORMAT_YV12 = "yv12"; + private static final String PIXEL_FORMAT_NV12 = "nv12"; /** * Order matters: Keys that are {@link #set(String, String) set} later @@ -3196,8 +3462,11 @@ public void setGpsProcessingMethod(String processing_method) { * parameters. */ public void removeGpsData() { + remove(KEY_QC_GPS_LATITUDE_REF); remove(KEY_GPS_LATITUDE); + remove(KEY_QC_GPS_LONGITUDE_REF); remove(KEY_GPS_LONGITUDE); + remove(KEY_QC_GPS_ALTITUDE_REF); remove(KEY_GPS_ALTITUDE); remove(KEY_GPS_TIMESTAMP); remove(KEY_GPS_PROCESSING_METHOD); @@ -4220,5 +4489,1231 @@ private boolean same(String s1, String s2) { if (s1 != null && s1.equals(s2)) return true; return false; } + /* ### QC ADD-ONS: START */ + + /* ### QC ADDED PARAMETER KEYS*/ + private static final String KEY_QC_HFR_SIZE = "hfr-size"; + private static final String KEY_QC_PREVIEW_FRAME_RATE_MODE = "preview-frame-rate-mode"; + private static final String KEY_QC_PREVIEW_FRAME_RATE_AUTO_MODE = "frame-rate-auto"; + private static final String KEY_QC_PREVIEW_FRAME_RATE_FIXED_MODE = "frame-rate-fixed"; + private static final String KEY_QC_GPS_LATITUDE_REF = "gps-latitude-ref"; + private static final String KEY_QC_GPS_LONGITUDE_REF = "gps-longitude-ref"; + private static final String KEY_QC_GPS_ALTITUDE_REF = "gps-altitude-ref"; + private static final String KEY_QC_GPS_STATUS = "gps-status"; + private static final String KEY_QC_EXIF_DATETIME = "exif-datetime"; + private static final String KEY_QC_TOUCH_AF_AEC = "touch-af-aec"; + private static final String KEY_QC_TOUCH_INDEX_AEC = "touch-index-aec"; + private static final String KEY_QC_TOUCH_INDEX_AF = "touch-index-af"; + private static final String KEY_QC_MANUAL_FOCUS_POSITION = "manual-focus-position"; + private static final String KEY_QC_MANUAL_FOCUS_POS_TYPE = "manual-focus-pos-type"; + private static final String KEY_QC_SCENE_DETECT = "scene-detect"; + private static final String KEY_QC_ISO_MODE = "iso"; + private static final String KEY_QC_EXPOSURE_TIME = "exposure-time"; + private static final String KEY_QC_MIN_EXPOSURE_TIME = "min-exposure-time"; + private static final String KEY_QC_MAX_EXPOSURE_TIME = "max-exposure-time"; + private static final String KEY_QC_LENSSHADE = "lensshade"; + private static final String KEY_QC_HISTOGRAM = "histogram"; + private static final String KEY_QC_SKIN_TONE_ENHANCEMENT = "skinToneEnhancement"; + private static final String KEY_QC_AUTO_EXPOSURE = "auto-exposure"; + private static final String KEY_QC_SHARPNESS = "sharpness"; + private static final String KEY_QC_MAX_SHARPNESS = "max-sharpness"; + private static final String KEY_QC_CONTRAST = "contrast"; + private static final String KEY_QC_MAX_CONTRAST = "max-contrast"; + private static final String KEY_QC_SATURATION = "saturation"; + private static final String KEY_QC_MAX_SATURATION = "max-saturation"; + private static final String KEY_QC_DENOISE = "denoise"; + private static final String KEY_QC_CONTINUOUS_AF = "continuous-af"; + private static final String KEY_QC_SELECTABLE_ZONE_AF = "selectable-zone-af"; + private static final String KEY_QC_FACE_DETECTION = "face-detection"; + private static final String KEY_QC_MEMORY_COLOR_ENHANCEMENT = "mce"; + private static final String KEY_QC_REDEYE_REDUCTION = "redeye-reduction"; + private static final String KEY_QC_ZSL = "zsl"; + private static final String KEY_QC_CAMERA_MODE = "camera-mode"; + private static final String KEY_QC_VIDEO_HIGH_FRAME_RATE = "video-hfr"; + private static final String KEY_QC_VIDEO_HDR = "video-hdr"; + private static final String KEY_QC_POWER_MODE = "power-mode"; + private static final String KEY_QC_POWER_MODE_SUPPORTED = "power-mode-supported"; + private static final String KEY_QC_WB_MANUAL_CCT = "wb-manual-cct"; + private static final String KEY_QC_MIN_WB_CCT = "min-wb-cct"; + private static final String KEY_QC_MAX_WB_CCT = "max-wb-cct"; + private static final String KEY_QC_AUTO_HDR_ENABLE = "auto-hdr-enable"; + private static final String KEY_QC_VIDEO_ROTATION = "video-rotation"; + + /** @hide + * KEY_QC_AE_BRACKET_HDR + **/ + public static final String KEY_QC_AE_BRACKET_HDR = "ae-bracket-hdr"; + + /* ### QC ADDED PARAMETER VALUES*/ + + // Values for touch af/aec settings. + /** @hide + * TOUCH_AF_AEC_OFF + **/ + public static final String TOUCH_AF_AEC_OFF = "touch-off"; + /** @hide + * TOUCH_AF_AEC_ON + **/ + public static final String TOUCH_AF_AEC_ON = "touch-on"; + + // Values for auto exposure settings. + /** @hide + * Auto exposure frame-avg + **/ + public static final String AUTO_EXPOSURE_FRAME_AVG = "frame-average"; + /** @hide + * Auto exposure center weighted + **/ + public static final String AUTO_EXPOSURE_CENTER_WEIGHTED = "center-weighted"; + /** @hide + * Auto exposure spot metering + **/ + public static final String AUTO_EXPOSURE_SPOT_METERING = "spot-metering"; + + //Values for ISO settings + /** @hide + * ISO_AUTO + **/ + public static final String ISO_AUTO = "auto"; + /** @hide + * ISO_HJR + **/ + public static final String ISO_HJR = "ISO_HJR"; + /** @hide + * ISO_100 + **/ + public static final String ISO_100 = "ISO100"; + /** @hide + * ISO_200 + **/ + public static final String ISO_200 = "ISO200"; + /** @hide + * ISO_400 + **/ + public static final String ISO_400 = "ISO400"; + /** @hide + * ISO_800 + **/ + public static final String ISO_800 = "ISO800"; + /** @hide + * ISO_1600 + **/ + public static final String ISO_1600 = "ISO1600"; + + /** @hide + * ISO_3200 + **/ + public static final String ISO_3200 = "ISO3200"; + + //Values for Lens Shading + /** @hide + * LENSSHADE_ENABLE + **/ + public static final String LENSSHADE_ENABLE = "enable"; + /** @hide + * LENSSHADE_DISABLE + **/ + public static final String LENSSHADE_DISABLE= "disable"; + + //Values for Histogram + /** @hide + * Histogram enable + **/ + public static final String HISTOGRAM_ENABLE = "enable"; + /** @hide + * Histogram disable + **/ + public static final String HISTOGRAM_DISABLE= "disable"; + + //Values for Skin Tone Enhancement + /** @hide + * SKIN_TONE_ENHANCEMENT_ENABLE + **/ + public static final String SKIN_TONE_ENHANCEMENT_ENABLE = "enable"; + /** @hide + * SKIN_TONE_ENHANCEMENT_DISABLE + **/ + public static final String SKIN_TONE_ENHANCEMENT_DISABLE= "disable"; + + // Values for MCE settings. + /** @hide + * MCE_ENaBLE + **/ + public static final String MCE_ENABLE = "enable"; + /** @hide + * MCE_DISABLE + **/ + public static final String MCE_DISABLE = "disable"; + + // Values for ZSL settings. + /** @hide + * ZSL_ON + **/ + public static final String ZSL_ON = "on"; + /** @hide + * ZSL_OFF + **/ + public static final String ZSL_OFF = "off"; + + // Values for HDR Bracketing settings. + + /** @hide + * AEC bracketing off + **/ + public static final String AE_BRACKET_HDR_OFF = "Off"; + /** @hide + * AEC bracketing hdr + **/ + public static final String AE_BRACKET_HDR = "HDR"; + /** @hide + * AEC bracketing aec-bracket + **/ + public static final String AE_BRACKET = "AE-Bracket"; + + // Values for Power mode. + /** @hide + * LOW_POWER + **/ + public static final String LOW_POWER = "Low_Power"; + /** @hide + * NORMAL_POWER + **/ + public static final String NORMAL_POWER = "Normal_Power"; + + // Values for HFR settings. + /** @hide + * VIDEO_HFR_OFF + **/ + public static final String VIDEO_HFR_OFF = "off"; + /** @hide + * VIDEO_HFR_2X + **/ + public static final String VIDEO_HFR_2X = "60"; + /** @hide + * VIDEO_HFR_3X + **/ + public static final String VIDEO_HFR_3X = "90"; + /** @hide + * VIDEO_HFR_4X + **/ + public static final String VIDEO_HFR_4X = "120"; + + // Values for auto scene detection settings. + /** @hide + * SCENE_DETECT_OFF + **/ + public static final String SCENE_DETECT_OFF = "off"; + /** @hide + * SCENE_DETECT_ON + **/ + public static final String SCENE_DETECT_ON = "on"; + + //Values for Continuous AF + + /** @hide + * CAF off + **/ + public static final String CONTINUOUS_AF_OFF = "caf-off"; + /** @hide + * CAF on + **/ + public static final String CONTINUOUS_AF_ON = "caf-on"; + /** @hide + * Denoise off + **/ + public static final String DENOISE_OFF = "denoise-off"; + /** @hide + * Denoise on + **/ + public static final String DENOISE_ON = "denoise-on"; + + // Values for Redeye Reduction settings. + /** @hide + * REDEYE_REDUCTION_ENABLE + **/ + public static final String REDEYE_REDUCTION_ENABLE = "enable"; + /** @hide + * REDEYE_REDUCTION_DISABLE + **/ + public static final String REDEYE_REDUCTION_DISABLE = "disable"; + + // Values for selectable zone af settings. + /** @hide + * SELECTABLE_ZONE_AF_AUTO + **/ + public static final String SELECTABLE_ZONE_AF_AUTO = "auto"; + /** @hide + * SELECTABLE_ZONE_AF_SPOTMETERING + **/ + public static final String SELECTABLE_ZONE_AF_SPOTMETERING = "spot-metering"; + /** @hide + * SELECTABLE_ZONE_AF_CENTER_WEIGHTED + **/ + public static final String SELECTABLE_ZONE_AF_CENTER_WEIGHTED = "center-weighted"; + /** @hide + * SELECTABLE_ZONE_AF_FRAME_AVERAGE + **/ + public static final String SELECTABLE_ZONE_AF_FRAME_AVERAGE = "frame-average"; + + // Values for Face Detection settings. + /** @hide + * Face Detection off + **/ + public static final String FACE_DETECTION_OFF = "off"; + /** @hide + * Face Detction on + **/ + public static final String FACE_DETECTION_ON = "on"; + + // Values for video rotation settings. + + /** @hide + * VIDEO_ROTATION_0 + **/ + public static final String VIDEO_ROTATION_0 = "0"; + /** @hide + * VIDEO_ROTATION_90 + **/ + public static final String VIDEO_ROTATION_90 = "90"; + /** @hide + * VIDEO_ROTATION_180 + **/ + public static final String VIDEO_ROTATION_180 = "180"; + /** @hide + * VIDEO_ROTATION_270 + **/ + public static final String VIDEO_ROTATION_270 = "270"; + + /* ### QC ADDED PARAMETER APIS*/ + /** @hide + * Gets the supported preview sizes in high frame rate recording mode. + * + * @return a list of Size object. This method will always return a list + * with at least one element. + */ + public List getSupportedHfrSizes() { + String str = get(KEY_QC_HFR_SIZE + SUPPORTED_VALUES_SUFFIX); + return splitSize(str); + } + + /** @hide + * Gets the supported Touch AF/AEC setting. + * + * @return a List of TOUCH_AF_AEC_XXX string constants. null if TOUCH AF/AEC + * setting is not supported. + * + */ + public List getSupportedTouchAfAec() { + String str = get(KEY_QC_TOUCH_AF_AEC + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** + * Gets the supported Touch AF/AEC setting. + * + * @return a List of TOUCH_AF_AEC_XXX string constants. null if TOUCH AF/AEC + * setting is not supported. + * + */ + + /** @hide + * Gets the supported frame rate modes. + * + * @return a List of FRAME_RATE_XXX_MODE string constant. null if this + * setting is not supported. + */ + public List getSupportedPreviewFrameRateModes() { + String str = get(KEY_QC_PREVIEW_FRAME_RATE_MODE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported auto scene detection modes. + * + * @return a List of SCENE_DETECT_XXX string constant. null if scene detection + * setting is not supported. + * + */ + public List getSupportedSceneDetectModes() { + String str = get(KEY_QC_SCENE_DETECT + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported ISO values. + * + * @return a List of FLASH_MODE_XXX string constants. null if flash mode + * setting is not supported. + */ + public List getSupportedIsoValues() { + String str = get(KEY_QC_ISO_MODE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported Lensshade modes. + * + * @return a List of LENS_MODE_XXX string constants. null if lens mode + * setting is not supported. + */ + public List getSupportedLensShadeModes() { + String str = get(KEY_QC_LENSSHADE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported Histogram modes. + * + * @return a List of HISTOGRAM_XXX string constants. null if histogram mode + * setting is not supported. + */ + public List getSupportedHistogramModes() { + String str = get(KEY_QC_HISTOGRAM + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported Skin Tone Enhancement modes. + * + * @return a List of SKIN_TONE_ENHANCEMENT_XXX string constants. null if skin tone enhancement + * setting is not supported. + */ + public List getSupportedSkinToneEnhancementModes() { + String str = get(KEY_QC_SKIN_TONE_ENHANCEMENT + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported auto exposure setting. + * + * @return a List of AUTO_EXPOSURE_XXX string constants. null if auto exposure + * setting is not supported. + */ + public List getSupportedAutoexposure() { + String str = get(KEY_QC_AUTO_EXPOSURE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported MCE modes. + * + * @return a List of MCE_ENABLE/DISABLE string constants. null if MCE mode + * setting is not supported. + */ + public List getSupportedMemColorEnhanceModes() { + String str = get(KEY_QC_MEMORY_COLOR_ENHANCEMENT + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported ZSL modes. + * + * @return a List of ZSL_OFF/OFF string constants. null if ZSL mode + * setting is not supported. + */ + public List getSupportedZSLModes() { + String str = get(KEY_QC_ZSL + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported Video HDR modes. + * + * @return a List of Video HDR_OFF/OFF string constants. null if + * Video HDR mode setting is not supported. + */ + public List getSupportedVideoHDRModes() { + String str = get(KEY_QC_VIDEO_HDR + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported HFR modes. + * + * @return a List of VIDEO_HFR_XXX string constants. null if hfr mode + * setting is not supported. + */ + public List getSupportedVideoHighFrameRateModes() { + String str = get(KEY_QC_VIDEO_HIGH_FRAME_RATE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported Continuous AF modes. + * + * @return a List of CONTINUOUS_AF_XXX string constant. null if continuous AF + * setting is not supported. + * + */ + public List getSupportedContinuousAfModes() { + String str = get(KEY_QC_CONTINUOUS_AF + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported DENOISE modes. + * + * @return a List of DENOISE_XXX string constant. null if DENOISE + * setting is not supported. + * + */ + public List getSupportedDenoiseModes() { + String str = get(KEY_QC_DENOISE + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported selectable zone af setting. + * + * @return a List of SELECTABLE_ZONE_AF_XXX string constants. null if selectable zone af + * setting is not supported. + */ + public List getSupportedSelectableZoneAf() { + String str = get(KEY_QC_SELECTABLE_ZONE_AF + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported face detection modes. + * + * @return a List of FACE_DETECTION_XXX string constant. null if face detection + * setting is not supported. + * + */ + public List getSupportedFaceDetectionModes() { + String str = get(KEY_QC_FACE_DETECTION + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Gets the supported redeye reduction modes. + * + * @return a List of REDEYE_REDUCTION_XXX string constant. null if redeye reduction + * setting is not supported. + * + */ + public List getSupportedRedeyeReductionModes() { + String str = get(KEY_QC_REDEYE_REDUCTION + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + /** @hide + * Sets GPS altitude reference. This will be stored in JPEG EXIF header. + * @param altRef reference GPS altitude in meters. + */ + public void setGpsAltitudeRef(double altRef) { + set(KEY_QC_GPS_ALTITUDE_REF, Double.toString(altRef)); + } + + /** @hide + * Sets GPS Status. This will be stored in JPEG EXIF header. + * + * @param status GPS status (UTC in seconds since January 1, + * 1970). + */ + public void setGpsStatus(double status) { + set(KEY_QC_GPS_STATUS, Double.toString(status)); + } + + /** @hide + * Sets the touch co-ordinate for Touch AEC. + * + * @param x the x co-ordinate of the touch event + * @param y the y co-ordinate of the touch event + * + */ + public void setTouchIndexAec(int x, int y) { + String v = Integer.toString(x) + "x" + Integer.toString(y); + set(KEY_QC_TOUCH_INDEX_AEC, v); + } + + /** @hide + * Returns the touch co-ordinates of the touch event. + * + * @return a Index object with the x and y co-ordinated + * for the touch event + * + */ + public Coordinate getTouchIndexAec() { + String pair = get(KEY_QC_TOUCH_INDEX_AEC); + return strToCoordinate(pair); + } + + /** @hide + * Sets the touch co-ordinate for Touch AF. + * + * @param x the x co-ordinate of the touch event + * @param y the y co-ordinate of the touch event + * + */ + public void setTouchIndexAf(int x, int y) { + String v = Integer.toString(x) + "x" + Integer.toString(y); + set(KEY_QC_TOUCH_INDEX_AF, v); + } + + /** @hide + * Returns the touch co-ordinates of the touch event. + * + * @return a Index object with the x and y co-ordinated + * for the touch event + * + */ + public Coordinate getTouchIndexAf() { + String pair = get(KEY_QC_TOUCH_INDEX_AF); + return strToCoordinate(pair); + } + /** @hide + * Set Sharpness Level + * + * @param sharpness level + */ + public void setSharpness(int sharpness){ + if((sharpness < 0) || (sharpness > getMaxSharpness()) ) + throw new IllegalArgumentException( + "Invalid Sharpness " + sharpness); + + set(KEY_QC_SHARPNESS, String.valueOf(sharpness)); + } + + /** @hide + * Set Contrast Level + * + * @param contrast level + */ + public void setContrast(int contrast){ + if((contrast < 0 ) || (contrast > getMaxContrast())) + throw new IllegalArgumentException( + "Invalid Contrast " + contrast); + + set(KEY_QC_CONTRAST, String.valueOf(contrast)); + } + + /** @hide + * Set Saturation Level + * + * @param saturation level + */ + public void setSaturation(int saturation){ + if((saturation < 0 ) || (saturation > getMaxSaturation())) + throw new IllegalArgumentException( + "Invalid Saturation " + saturation); + + set(KEY_QC_SATURATION, String.valueOf(saturation)); + } + + /** @hide + * @return true if full size video snapshot is supported. + */ + public boolean isPowerModeSupported() { + String str = get(KEY_QC_POWER_MODE_SUPPORTED); + return TRUE.equals(str); + } + + /** @hide + * Get Sharpness level + * + * @return sharpness level + */ + public int getSharpness(){ + return getInt(KEY_QC_SHARPNESS); + } + + /** @hide + * Get Max Sharpness Level + * + * @return max sharpness level + */ + public int getMaxSharpness(){ + return getInt(KEY_QC_MAX_SHARPNESS); + } + + /** @hide + * Get Contrast level + * + * @return contrast level + */ + public int getContrast(){ + return getInt(KEY_QC_CONTRAST); + } + + /** @hide + * Get Max Contrast Level + * + * @return max contrast level + */ + public int getMaxContrast(){ + return getInt(KEY_QC_MAX_CONTRAST); + } + + /** @hide + * Get Saturation level + * + * @return saturation level + */ + public int getSaturation(){ + return getInt(KEY_QC_SATURATION); + } + + /** @hide + * Get Max Saturation Level + * + * @return max contrast level + */ + public int getMaxSaturation(){ + return getInt(KEY_QC_MAX_SATURATION); + } + + /** @hide + * Sets GPS latitude reference coordinate. This will be stored in JPEG EXIF + * header. + * @param latRef GPS latitude reference coordinate. + */ + public void setGpsLatitudeRef(String latRef) { + set(KEY_QC_GPS_LATITUDE_REF, latRef); + } + + /** @hide + * Sets GPS longitude reference coordinate. This will be stored in JPEG EXIF + * header. + * @param lonRef GPS longitude reference coordinate. + */ + public void setGpsLongitudeRef(String lonRef) { + set(KEY_QC_GPS_LONGITUDE_REF, lonRef); + } + + /** @hide + * Sets system timestamp. This will be stored in JPEG EXIF header. + * + * @param dateTime current timestamp (UTC in seconds since January 1, + * 1970). + */ + public void setExifDateTime(String dateTime) { + set(KEY_QC_EXIF_DATETIME, dateTime); + } + + /** @hide + * Gets the current Touch AF/AEC setting. + * + * @return one of TOUCH_AF_AEC_XXX string constant. null if Touch AF/AEC + * setting is not supported. + * + */ + public String getTouchAfAec() { + return get(KEY_QC_TOUCH_AF_AEC); + } + + /** @hide + * Sets the current TOUCH AF/AEC setting. + * + * @param value TOUCH_AF_AEC_XXX string constants. + * + */ + public void setTouchAfAec(String value) { + set(KEY_QC_TOUCH_AF_AEC, value); + } + + /** @hide + * Gets the current redeye reduction setting. + * + * @return one of REDEYE_REDUCTION_XXX string constant. null if redeye reduction + * setting is not supported. + * + */ + public String getRedeyeReductionMode() { + return get(KEY_QC_REDEYE_REDUCTION); + } + + /** @hide + * Sets the redeye reduction. Other parameters may be changed after changing + * redeye reduction. After setting redeye reduction, + * applications should call getParameters to know if some parameters are + * changed. + * + * @param value REDEYE_REDUCTION_XXX string constants. + * + */ + public void setRedeyeReductionMode(String value) { + set(KEY_QC_REDEYE_REDUCTION, value); + } + + /** @hide + * Gets the frame rate mode setting. + * + * @return one of FRAME_RATE_XXX_MODE string constant. null if this + * setting is not supported. + */ + public String getPreviewFrameRateMode() { + return get(KEY_QC_PREVIEW_FRAME_RATE_MODE); + } + + /** @hide + * Sets the frame rate mode. + * + * @param value FRAME_RATE_XXX_MODE string constants. + */ + public void setPreviewFrameRateMode(String value) { + set(KEY_QC_PREVIEW_FRAME_RATE_MODE, value); + } + + /** @hide + * Gets the current auto scene detection setting. + * + * @return one of SCENE_DETECT_XXX string constant. null if auto scene detection + * setting is not supported. + * + */ + public String getSceneDetectMode() { + return get(KEY_QC_SCENE_DETECT); + } + + /** @hide + * Sets the auto scene detect. Other parameters may be changed after changing + * scene detect. After setting auto scene detection, + * applications should call getParameters to know if some parameters are + * changed. + * + * @param value SCENE_DETECT_XXX string constants. + * + */ + public void setSceneDetectMode(String value) { + set(KEY_QC_SCENE_DETECT, value); + } + + /** @hide + * Gets the current hdr bracketing mode setting. + * + * @return current hdr bracketing mode. + * @see #KEY_AE_BRACKET_OFF + * @see #KEY_AE_BRACKET_HDR + * @see #KEY_AE_BRACKET_BRACKATING + */ + public String getAEBracket() { + return get(KEY_QC_AE_BRACKET_HDR); + } + + /** @hide + * Sets the Power mode. + * + * @param value Power mode. + * @see #getPowerMode() + */ + public void setPowerMode(String value) { + set(KEY_QC_POWER_MODE, value); + } + + /** @hide + * Gets the current power mode setting. + * + * @return current power mode. null if power mode setting is not + * supported. + * @see #POWER_MODE_LOW + * @see #POWER_MODE_NORMAL + */ + public String getPowerMode() { + return get(KEY_QC_POWER_MODE); + } + + /** @hide + * Set HDR-Bracketing Level + * + * @param value HDR-Bracketing + */ + public void setAEBracket(String value){ + set(KEY_QC_AE_BRACKET_HDR, value); + } + + /** @hide + * Gets the current ISO setting. + * + * @return one of ISO_XXX string constant. null if ISO + * setting is not supported. + */ + public String getISOValue() { + return get(KEY_QC_ISO_MODE); + } + + /** @hide + * Sets the ISO. + * + * @param iso ISO_XXX string constant. + */ + public void setISOValue(String iso) { + set(KEY_QC_ISO_MODE, iso); + } + + /** @hide + * Sets the exposure time. + * + * @param value exposure time. + */ + public void setExposureTime(int value) { + set(KEY_QC_EXPOSURE_TIME, Integer.toString(value)); + } + + /** @hide + * Gets the current exposure time. + * + * @return exposure time. + */ + public String getExposureTime() { + return get(KEY_QC_EXPOSURE_TIME); + } + + /** @hide + * Gets the min supported exposure time. + * + * @return min supported exposure time. + */ + public String getMinExposureTime() { + return get(KEY_QC_MIN_EXPOSURE_TIME); + } + + /** @hide + * Gets the max supported exposure time. + * + * @return max supported exposure time. + */ + public String getMaxExposureTime() { + return get(KEY_QC_MAX_EXPOSURE_TIME); + } + + /** @hide + * Gets the current LensShade Mode. + * + * @return LensShade Mode + */ + public String getLensShade() { + return get(KEY_QC_LENSSHADE); + } + + /** @hide + * Sets the current LensShade Mode. + * + * @return LensShade Mode + */ + public void setLensShade(String lensshade) { + set(KEY_QC_LENSSHADE, lensshade); + } + + /** @hide + * Gets the current auto exposure setting. + * + * @return one of AUTO_EXPOSURE_XXX string constant. null if auto exposure + * setting is not supported. + */ + public String getAutoExposure() { + return get(KEY_QC_AUTO_EXPOSURE); + } + + /** @hide + * Sets the current auto exposure setting. + * + * @param value AUTO_EXPOSURE_XXX string constants. + */ + public void setAutoExposure(String value) { + set(KEY_QC_AUTO_EXPOSURE, value); + } + + /** @hide + * Gets the current MCE Mode. + * + * @return MCE value + */ + public String getMemColorEnhance() { + return get(KEY_QC_MEMORY_COLOR_ENHANCEMENT); + } + + /** @hide + * Sets the current MCE Mode. + * + * @return MCE Mode + */ + public void setMemColorEnhance(String mce) { + set(KEY_QC_MEMORY_COLOR_ENHANCEMENT, mce); + } + + /** @hide + * Set white balance manual cct value. + * + * @param cct user CCT setting. + */ + public void setWBManualCCT(int cct) { + set(KEY_QC_WB_MANUAL_CCT, Integer.toString(cct)); + } + + /** @hide + * Gets the WB min supported CCT. + * + * @return min cct value. + */ + public String getWBMinCCT() { + return get(KEY_QC_MIN_WB_CCT); + } + + /** @hide + * Gets the WB max supported CCT. + * + * @return max cct value. + */ + public String getMaxWBCCT() { + return get(KEY_QC_MAX_WB_CCT); + } + + /** @hide + * Gets the current WB CCT. + * + * @return CCT value + */ + public String getWBCurrentCCT() { + return get(KEY_QC_WB_MANUAL_CCT); + } + + /** @hide + * Gets the current ZSL Mode. + * + * @return ZSL mode value + */ + public String getZSLMode() { + return get(KEY_QC_ZSL); + } + + /** @hide + * Sets the current ZSL Mode. ZSL mode is set as a 0th bit in KEY_CAMERA_MODE. + * + * @return null + */ + public void setZSLMode(String zsl) { + set(KEY_QC_ZSL, zsl); + } + + /** @hide + * Sets the current Auto HDR Mode. + * @ auto_hdr auto hdr string for enable/disable + * @return null + */ + public void setAutoHDRMode(String auto_hdr){ + set(KEY_QC_AUTO_HDR_ENABLE,auto_hdr); + } + + /** @hide + * Gets the current Camera Mode Flag. Camera mode includes a + * flag(byte) which indicates different camera modes. + * For now support for ZSL added at bit0 + * + * @return Camera Mode. + */ + public String getCameraMode() { + return get(KEY_QC_CAMERA_MODE); + } + + /** @hide + * Sets the current Camera Mode. + * + * @return null + */ + public void setCameraMode(int cameraMode) { + set(KEY_QC_CAMERA_MODE, cameraMode); + } + + private static final int MANUAL_FOCUS_POS_TYPE_INDEX = 0; + private static final int MANUAL_FOCUS_POS_TYPE_DAC = 1; + /** @hide + * Set focus position. + * + * @param pos user setting of focus position. + */ + public void setFocusPosition(int type, int pos) { + set(KEY_QC_MANUAL_FOCUS_POS_TYPE, Integer.toString(type)); + set(KEY_QC_MANUAL_FOCUS_POSITION, Integer.toString(pos)); + } + + /** @hide + * Gets the current focus position. + * + * @return current focus position + */ + public String getCurrentFocusPosition() { + return get(KEY_QC_MANUAL_FOCUS_POSITION); + } + + + /** @hide + * Gets the current HFR Mode. + * + * @return VIDEO_HFR_XXX string constants + */ + public String getVideoHighFrameRate() { + return get(KEY_QC_VIDEO_HIGH_FRAME_RATE); + } + + /** @hide + * Sets the current HFR Mode. + * + * @param hfr VIDEO_HFR_XXX string constants + */ + public void setVideoHighFrameRate(String hfr) { + set(KEY_QC_VIDEO_HIGH_FRAME_RATE, hfr); + } + + /** @hide + * Gets the current Video HDR Mode. + * + * @return Video HDR mode value + */ + public String getVideoHDRMode() { + return get(KEY_QC_VIDEO_HDR); + } + + /** @hide + * Sets the current Video HDR Mode. + * + * @return null + */ + public void setVideoHDRMode(String videohdr) { + set(KEY_QC_VIDEO_HDR, videohdr); + } + + /** @hide + * Gets the current DENOISE setting. + * + * @return one of DENOISE_XXX string constant. null if Denoise + * setting is not supported. + * + */ + public String getDenoise() { + return get(KEY_QC_DENOISE); + } + + /** @hide + * Gets the current Continuous AF setting. + * + * @return one of CONTINUOUS_AF_XXX string constant. null if continuous AF + * setting is not supported. + * + */ + public String getContinuousAf() { + return get(KEY_QC_CONTINUOUS_AF); + } + + /** @hide + * Sets the current Denoise mode. + * @param value DENOISE_XXX string constants. + * + */ + + public void setDenoise(String value) { + set(KEY_QC_DENOISE, value); + } + + /** @hide + * Sets the current Continuous AF mode. + * @param value CONTINUOUS_AF_XXX string constants. + * + */ + public void setContinuousAf(String value) { + set(KEY_QC_CONTINUOUS_AF, value); + } + + /** @hide + * Gets the current selectable zone af setting. + * + * @return one of SELECTABLE_ZONE_AF_XXX string constant. null if selectable zone af + * setting is not supported. + */ + public String getSelectableZoneAf() { + return get(KEY_QC_SELECTABLE_ZONE_AF); + } + + /** @hide + * Sets the current selectable zone af setting. + * + * @param value SELECTABLE_ZONE_AF_XXX string constants. + */ + public void setSelectableZoneAf(String value) { + set(KEY_QC_SELECTABLE_ZONE_AF, value); + } + + /** @hide + * Gets the current face detection setting. + * + * @return one of FACE_DETECTION_XXX string constant. null if face detection + * setting is not supported. + * + */ + public String getFaceDetectionMode() { + return get(KEY_QC_FACE_DETECTION); + } + + /** @hide + * Sets the auto scene detect. Other settings like Touch AF/AEC might be + * changed after setting face detection. + * + * @param value FACE_DETECTION_XXX string constants. + * + */ + public void setFaceDetectionMode(String value) { + set(KEY_QC_FACE_DETECTION, value); + } + + /** @hide + * Gets the current video rotation setting. + * + * @return one of VIDEO_QC_ROTATION_XXX string constant. null if video rotation + * setting is not supported. + */ + public String getVideoRotation() { + return get(KEY_QC_VIDEO_ROTATION); + } + + /** @hide + * Sets the current video rotation setting. + * + * @param value VIDEO_QC_ROTATION_XXX string constants. + */ + public void setVideoRotation(String value) { + set(KEY_QC_VIDEO_ROTATION, value); + } + /** @hide + * Gets the supported video rotation modes. + * + * @return a List of VIDEO_QC_ROTATION_XXX string constant. null if this + * setting is not supported. + */ + public List getSupportedVideoRotationValues() { + String str = get(KEY_QC_VIDEO_ROTATION + SUPPORTED_VALUES_SUFFIX); + return split(str); + } + + // Splits a comma delimited string to an ArrayList of Coordinate. + // Return null if the passing string is null or the Coordinate is 0. + private ArrayList splitCoordinate(String str) { + if (str == null) return null; + TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(','); + splitter.setString(str); + ArrayList coordinateList = new ArrayList(); + for (String s : splitter) { + Coordinate coordinate = strToCoordinate(s); + if (coordinate != null) coordinateList.add(coordinate); + } + if (coordinateList.size() == 0) return null; + return coordinateList; + } + + // Parses a string (ex: "500x500") to Coordinate object. + // Return null if the passing string is null. + private Coordinate strToCoordinate(String str) { + if (str == null) return null; + + int pos = str.indexOf('x'); + if (pos != -1) { + String x = str.substring(0, pos); + String y = str.substring(pos + 1); + return new Coordinate(Integer.parseInt(x), + Integer.parseInt(y)); + } + Log.e(TAG, "Invalid Coordinate parameter string=" + str); + return null; + } + /* ### QC ADD-ONS: END */ }; } diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java index 2fe8fb6f71c..ba0d5bec61a 100644 --- a/core/java/android/hardware/SystemSensorManager.java +++ b/core/java/android/hardware/SystemSensorManager.java @@ -101,6 +101,7 @@ protected List getFullSensorList() { @Override protected boolean registerListenerImpl(SensorEventListener listener, Sensor sensor, int delayUs, Handler handler, int maxBatchReportLatencyUs, int reservedFlags) { + android.util.SeempLog.record_sensor_rate(381, sensor, delayUs); if (listener == null || sensor == null) { Log.e(TAG, "sensor or listener is null"); return false; @@ -142,6 +143,7 @@ protected boolean registerListenerImpl(SensorEventListener listener, Sensor sens /** @hide */ @Override protected void unregisterListenerImpl(SensorEventListener listener, Sensor sensor) { + android.util.SeempLog.record_sensor(382, sensor); // Trigger Sensors should use the cancelTriggerSensor call. if (sensor != null && sensor.getReportingMode() == Sensor.REPORTING_MODE_ONE_SHOT) { return; diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 4d9b759eeac..8af9bf44506 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -24,6 +24,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.net.NetworkUtils; +import android.net.wifi.WifiDevice; import android.os.Binder; import android.os.Build.VERSION_CODES; import android.os.Handler; @@ -49,6 +50,7 @@ import java.net.InetAddress; import java.util.concurrent.atomic.AtomicInteger; import java.util.HashMap; +import java.util.List; import libcore.net.event.NetworkEventDispatcher; @@ -282,6 +284,15 @@ public class ConnectivityManager { public static final String ACTION_TETHER_STATE_CHANGED = "android.net.conn.TETHER_STATE_CHANGED"; + /** + * Broadcast intent action indicating that a Station is connected + * or disconnected. + * + * @hide + */ + public static final String TETHER_CONNECT_STATE_CHANGED = + "codeaurora.net.conn.TETHER_CONNECT_STATE_CHANGED"; + /** * @hide * gives a String[] listing all the interfaces configured for @@ -1056,13 +1067,11 @@ private int inferLegacyTypeForNetworkCapabilities(NetworkCapabilities netCap) { type = "enableDUN"; result = TYPE_MOBILE_DUN; } else if (netCap.hasCapability(NetworkCapabilities.NET_CAPABILITY_SUPL)) { - type = "enableSUPL"; + type = "enableSUPL"; result = TYPE_MOBILE_SUPL; - // back out this hack for mms as they no longer need this and it's causing - // device slowdowns - b/23350688 (note, supl still needs this) - //} else if (netCap.hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)) { - // type = "enableMMS"; - // result = TYPE_MOBILE_MMS; + } else if (netCap.hasCapability(NetworkCapabilities.NET_CAPABILITY_MMS)) { + type = "enableMMS"; + result = TYPE_MOBILE_MMS; } else if (netCap.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) { type = "enableHIPRI"; result = TYPE_MOBILE_HIPRI; @@ -1838,6 +1847,20 @@ public int setUsbTethering(boolean enable) { } } + /** + * Get the list of Stations connected to Hotspot. + * + * @return a list of {@link WifiDevice} objects. + * {@hide} + */ + public List getTetherConnectedSta() { + try { + return mService.getTetherConnectedSta(); + } catch (RemoteException e) { + return null; + } + } + /** {@hide} */ public static final int TETHER_ERROR_NO_ERROR = 0; /** {@hide} */ diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index d4dd6692110..c6de7a545fd 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -26,6 +26,7 @@ import android.net.NetworkQuotaInfo; import android.net.NetworkRequest; import android.net.NetworkState; import android.net.ProxyInfo; +import android.net.wifi.WifiDevice; import android.os.IBinder; import android.os.Messenger; import android.os.ParcelFileDescriptor; @@ -36,6 +37,8 @@ import com.android.internal.net.VpnConfig; import com.android.internal.net.VpnInfo; import com.android.internal.net.VpnProfile; +import java.util.List; + /** * Interface that answers queries about, and allows changing, the * state of network connectivity. @@ -92,6 +95,8 @@ interface IConnectivityManager int setUsbTethering(boolean enable); + List getTetherConnectedSta(); + void reportInetCondition(int networkType, int percentage); void reportNetworkConnectivity(in Network network, boolean hasConnectivity); diff --git a/core/java/android/net/INetworkManagementEventObserver.aidl b/core/java/android/net/INetworkManagementEventObserver.aidl index b7af3747430..5a70ff1f37e 100644 --- a/core/java/android/net/INetworkManagementEventObserver.aidl +++ b/core/java/android/net/INetworkManagementEventObserver.aidl @@ -91,6 +91,13 @@ interface INetworkManagementEventObserver { */ void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos); + /** + * Message is received from network interface. + * + * @param message The message + */ + void interfaceMessageRecevied(String message); + /** * Information about available DNS servers has been received. * diff --git a/core/java/android/nfc/INfcAdapter.aidl b/core/java/android/nfc/INfcAdapter.aidl index 961a3f41cd5..0107d93c3cf 100644 --- a/core/java/android/nfc/INfcAdapter.aidl +++ b/core/java/android/nfc/INfcAdapter.aidl @@ -1,4 +1,7 @@ /* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,6 +31,7 @@ import android.nfc.INfcTag; import android.nfc.INfcCardEmulation; import android.nfc.INfcUnlockHandler; import android.os.Bundle; +import android.os.IBinder; /** * @hide @@ -37,6 +41,7 @@ interface INfcAdapter INfcTag getNfcTagInterface(); INfcCardEmulation getNfcCardEmulationInterface(); INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg); + IBinder getNfcAdapterVendorInterface(in String vendor); int getState(); boolean disable(boolean saveState); diff --git a/core/java/android/nfc/cardemulation/AidGroup.java b/core/java/android/nfc/cardemulation/AidGroup.java index 78a9401a2ab..ce67061a084 100644 --- a/core/java/android/nfc/cardemulation/AidGroup.java +++ b/core/java/android/nfc/cardemulation/AidGroup.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,7 +40,7 @@ * * @hide */ -public final class AidGroup implements Parcelable { +public class AidGroup implements Parcelable { /** * The maximum number of AIDs that can be present in any one group. */ @@ -45,9 +48,9 @@ public final class AidGroup implements Parcelable { static final String TAG = "AidGroup"; - final List aids; - final String category; - final String description; + protected List aids; + protected String category; + protected String description; /** * Creates a new AidGroup object. diff --git a/core/java/android/nfc/cardemulation/ApduServiceInfo.java b/core/java/android/nfc/cardemulation/ApduServiceInfo.java index 7678678f351..09487d79cec 100644 --- a/core/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/core/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -48,53 +48,53 @@ /** * @hide */ -public final class ApduServiceInfo implements Parcelable { +public class ApduServiceInfo implements Parcelable { static final String TAG = "ApduServiceInfo"; /** * The service that implements this */ - final ResolveInfo mService; + protected ResolveInfo mService; /** * Description of the service */ - final String mDescription; + protected String mDescription; /** * Whether this service represents AIDs running on the host CPU */ - final boolean mOnHost; + protected boolean mOnHost; /** * Mapping from category to static AID group */ - final HashMap mStaticAidGroups; + protected HashMap mStaticAidGroups; /** * Mapping from category to dynamic AID group */ - final HashMap mDynamicAidGroups; + protected HashMap mDynamicAidGroups; /** * Whether this service should only be started when the device is unlocked. */ - final boolean mRequiresDeviceUnlock; + protected boolean mRequiresDeviceUnlock; /** * The id of the service banner specified in XML. */ - final int mBannerResourceId; + protected int mBannerResourceId; /** * The uid of the package the service belongs to */ - final int mUid; + protected int mUid; /** * Settings Activity for this service */ - final String mSettingsActivityName; + protected String mSettingsActivityName; /** * @hide diff --git a/core/java/android/nfc/tech/MifareClassic.java b/core/java/android/nfc/tech/MifareClassic.java index 8c92288d004..302c02daa63 100644 --- a/core/java/android/nfc/tech/MifareClassic.java +++ b/core/java/android/nfc/tech/MifareClassic.java @@ -1,4 +1,6 @@ /* + * Copyright (C) 2015 NXP Semiconductors + * The original Work has been changed by NXP Semiconductors. * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -173,6 +175,10 @@ public MifareClassic(Tag tag) throws RemoteException { mType = TYPE_CLASSIC; mSize = SIZE_4K; break; + case 0x19: + mType = TYPE_CLASSIC; + mSize = SIZE_2K; + break; case 0x28: mType = TYPE_CLASSIC; mSize = SIZE_1K; diff --git a/core/java/android/nfc/tech/NfcA.java b/core/java/android/nfc/tech/NfcA.java index 88730f9af3d..b7fa455e388 100644 --- a/core/java/android/nfc/tech/NfcA.java +++ b/core/java/android/nfc/tech/NfcA.java @@ -1,4 +1,6 @@ /* + * Copyright (C) 2015 NXP Semiconductors + * The original Work has been changed by NXP Semiconductors. * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -66,8 +68,15 @@ public static NfcA get(Tag tag) { /** @hide */ public NfcA(Tag tag) throws RemoteException { super(tag, TagTechnology.NFC_A); - Bundle extras = tag.getTechExtras(TagTechnology.NFC_A); - mSak = extras.getShort(EXTRA_SAK); + Bundle extras; + mSak = 0; + if(tag.hasTech(TagTechnology.MIFARE_CLASSIC)) + { + extras = tag.getTechExtras(TagTechnology.MIFARE_CLASSIC); + mSak = extras.getShort(EXTRA_SAK); + } + extras = tag.getTechExtras(TagTechnology.NFC_A); + mSak |= extras.getShort(EXTRA_SAK); mAtqa = extras.getByteArray(EXTRA_ATQA); } diff --git a/core/java/android/os/IDeviceIdleController.aidl b/core/java/android/os/IDeviceIdleController.aidl index f55883ae7a7..6c7cd6dd18c 100644 --- a/core/java/android/os/IDeviceIdleController.aidl +++ b/core/java/android/os/IDeviceIdleController.aidl @@ -35,4 +35,5 @@ interface IDeviceIdleController { long addPowerSaveTempWhitelistAppForMms(String name, int userId, String reason); long addPowerSaveTempWhitelistAppForSms(String name, int userId, String reason); void exitIdle(String reason); + int getIdleStateDetailed(); } diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 0f37ac720bc..9d7da1a7f12 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -60,4 +60,6 @@ interface IPowerManager // sets the attention light (used by phone app only) void setAttentionLight(boolean on, int color); + // update the uids being synchronized by network socket request manager + void updateBlockedUids(int uid, boolean isBlocked); } diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index 045c1e88ec0..5b532a360dd 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -489,6 +489,18 @@ public class UserManager { */ public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending"; + /** + * Specifies if the user is not allowed to use SU commands. + * The default value is false. + * + *

Key for user restrictions. + *

Type: Boolean + * @see #setUserRestrictions(Bundle) + * @see #getUserRestrictions() + * @hide + */ + public static final String DISALLOW_SU = "no_su"; + /** @hide */ public static final int PIN_VERIFICATION_FAILED_INCORRECT = -3; /** @hide */ @@ -853,6 +865,7 @@ public UserInfo createGuest(Context context, String name) { Bundle guestRestrictions = mService.getDefaultGuestRestrictions(); guestRestrictions.putBoolean(DISALLOW_SMS, true); guestRestrictions.putBoolean(DISALLOW_INSTALL_UNKNOWN_SOURCES, true); + guestRestrictions.putBoolean(DISALLOW_SU, true); mService.setUserRestrictions(guestRestrictions, guest.id); } catch (RemoteException re) { Log.w(TAG, "Could not update guest restrictions"); @@ -892,6 +905,7 @@ public UserInfo createSecondaryUser(String name, int flags) { private static void addDefaultUserRestrictions(Bundle restrictions) { restrictions.putBoolean(DISALLOW_OUTGOING_CALLS, true); restrictions.putBoolean(DISALLOW_SMS, true); + restrictions.putBoolean(DISALLOW_SU, true); } /** diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java index 9f71ce149ae..3f35c994402 100644 --- a/core/java/android/os/storage/IMountService.java +++ b/core/java/android/os/storage/IMountService.java @@ -645,6 +645,24 @@ public int encryptStorage(int type, String password) throws RemoteException { return _result; } + public int encryptWipeStorage(int type, String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeInt(type); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_encryptWipeStorage, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } + public int changeEncryptionPassword(int type, String password) throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); @@ -1326,6 +1344,7 @@ public void deleteUserKey(int userHandle) throws RemoteException { static final int TRANSACTION_benchmark = IBinder.FIRST_CALL_TRANSACTION + 59; static final int TRANSACTION_setDebugFlags = IBinder.FIRST_CALL_TRANSACTION + 60; + static final int TRANSACTION_encryptWipeStorage = IBinder.FIRST_CALL_TRANSACTION + 61; static final int TRANSACTION_createNewUserDir = IBinder.FIRST_CALL_TRANSACTION + 62; static final int TRANSACTION_deleteUserKey = IBinder.FIRST_CALL_TRANSACTION + 63; @@ -1631,6 +1650,15 @@ public boolean onTransact(int code, Parcel data, Parcel reply, reply.writeInt(result); return true; } + case TRANSACTION_encryptWipeStorage: { + data.enforceInterface(DESCRIPTOR); + int type = data.readInt(); + String password = data.readString(); + int result = encryptWipeStorage(type, password); + reply.writeNoException(); + reply.writeInt(result); + return true; + } case TRANSACTION_changeEncryptionPassword: { data.enforceInterface(DESCRIPTOR); int type = data.readInt(); @@ -2065,7 +2093,8 @@ public void unmountVolume(String mountPoint, boolean force, boolean removeEncryp * Returns whether or not the external storage is emulated. */ public boolean isExternalStorageEmulated() throws RemoteException; - + /** The volume has been encrypted succesfully and MDTP state is 'activated'. */ + static final int ENCRYPTION_STATE_OK_MDTP_ACTIVATED = 2; /** The volume is not encrypted. */ static final int ENCRYPTION_STATE_NONE = 1; /** The volume has been encrypted succesfully. */ @@ -2078,6 +2107,8 @@ public void unmountVolume(String mountPoint, boolean force, boolean removeEncryp static final int ENCRYPTION_STATE_ERROR_INCONSISTENT = -3; /** Underlying data is corrupt */ static final int ENCRYPTION_STATE_ERROR_CORRUPT = -4; + /** The volume is in a bad state and MDTP state is 'activated'.*/ + static final int ENCRYPTION_STATE_ERROR_MDTP_ACTIVATED = -5; /** * Determines the encryption state of the volume. @@ -2095,6 +2126,11 @@ public void unmountVolume(String mountPoint, boolean force, boolean removeEncryp */ public int encryptStorage(int type, String password) throws RemoteException; + /** + * Encrypts and wipes storage. + */ + public int encryptWipeStorage(int type, String password) throws RemoteException; + /** * Changes the encryption password. */ diff --git a/core/java/android/provider/Browser.java b/core/java/android/provider/Browser.java index 7d05522cf5c..299a95c8e9e 100644 --- a/core/java/android/provider/Browser.java +++ b/core/java/android/provider/Browser.java @@ -244,6 +244,7 @@ public static final void sendString(Context c, */ public static final Cursor getAllBookmarks(ContentResolver cr) throws IllegalStateException { + android.util.SeempLog.record(32); return new MatrixCursor(new String[]{Bookmarks.URL}, 0); } @@ -256,6 +257,7 @@ public static final Cursor getAllBookmarks(ContentResolver cr) throws */ public static final Cursor getAllVisitedUrls(ContentResolver cr) throws IllegalStateException { + android.util.SeempLog.record(33); return new MatrixCursor(new String[]{Combined.URL}, 0); } @@ -264,6 +266,7 @@ private static final void addOrUrlEquals(StringBuilder sb) { } private static final Cursor getVisitedLike(ContentResolver cr, String url) { + android.util.SeempLog.record(34); boolean secure = false; String compareString = url; if (compareString.startsWith("http://")) { @@ -324,6 +327,7 @@ public static final void updateVisitedHistory(ContentResolver cr, */ @Deprecated public static final String[] getVisitedHistory(ContentResolver cr) { + android.util.SeempLog.record(35); return new String[0]; } @@ -359,6 +363,7 @@ public static final boolean canClearHistory(ContentResolver cr) { * @removed */ public static final void clearHistory(ContentResolver cr) { + android.util.SeempLog.record(37); } @@ -420,6 +425,7 @@ public static final void clearSearches(ContentResolver cr) { */ public static final void requestAllIcons(ContentResolver cr, String where, WebIconDatabase.IconListener listener) { + android.util.SeempLog.record(36); // Do nothing: this is no longer used. } diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index aa22041d277..2ede026b586 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -871,6 +871,7 @@ private Attendees() {} * @return A Cursor containing all attendees for the event */ public static final Cursor query(ContentResolver cr, long eventId, String[] projection) { + android.util.SeempLog.record(54); String[] attArgs = {Long.toString(eventId)}; return cr.query(CONTENT_URI, projection, ATTENDEES_WHERE, attArgs /* selection args */, null /* sort order */); @@ -1750,6 +1751,7 @@ private Instances() {} */ public static final Cursor query(ContentResolver cr, String[] projection, long begin, long end) { + android.util.SeempLog.record(54); Uri.Builder builder = CONTENT_URI.buildUpon(); ContentUris.appendId(builder, begin); ContentUris.appendId(builder, end); @@ -1779,6 +1781,7 @@ public static final Cursor query(ContentResolver cr, String[] projection, */ public static final Cursor query(ContentResolver cr, String[] projection, long begin, long end, String searchQuery) { + android.util.SeempLog.record(54); Uri.Builder builder = CONTENT_SEARCH_URI.buildUpon(); ContentUris.appendId(builder, begin); ContentUris.appendId(builder, end); @@ -2029,6 +2032,7 @@ private EventDays() {} */ public static final Cursor query(ContentResolver cr, int startDay, int numDays, String[] projection) { + android.util.SeempLog.record(54); if (numDays < 1) { return null; } @@ -2112,6 +2116,7 @@ private Reminders() {} * @return A Cursor containing all reminders for the event */ public static final Cursor query(ContentResolver cr, long eventId, String[] projection) { + android.util.SeempLog.record(54); String[] remArgs = {Long.toString(eventId)}; return cr.query(CONTENT_URI, projection, REMINDERS_WHERE, remArgs /*selection args*/, null /* sort order */); @@ -2262,6 +2267,7 @@ private CalendarAlerts() {} */ public static final Uri insert(ContentResolver cr, long eventId, long begin, long end, long alarmTime, int minutes) { + android.util.SeempLog.record(51); ContentValues values = new ContentValues(); values.put(CalendarAlerts.EVENT_ID, eventId); values.put(CalendarAlerts.BEGIN, begin); @@ -2289,6 +2295,7 @@ public static final Uri insert(ContentResolver cr, long eventId, * @hide */ public static final long findNextAlarmTime(ContentResolver cr, long millis) { + android.util.SeempLog.record(53); String selection = ALARM_TIME + ">=" + millis; // TODO: construct an explicit SQL query so that we can add // "LIMIT 1" to the end and get just one result. @@ -2412,6 +2419,7 @@ public static void scheduleAlarm(Context context, AlarmManager manager, long ala */ public static final boolean alarmExists(ContentResolver cr, long eventId, long begin, long alarmTime) { + android.util.SeempLog.record(52); // TODO: construct an explicit SQL query so that we can add // "LIMIT 1" to the end and get just one result. String[] projection = new String[] { ALARM_TIME }; diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 8ce1cbf43f7..c9712def6f3 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -1497,6 +1497,7 @@ private Contacts() {} * {@link #CONTENT_LOOKUP_URI} to attempt refreshing. */ public static Uri getLookupUri(ContentResolver resolver, Uri contactUri) { + android.util.SeempLog.record(86); final Cursor c = resolver.query(contactUri, new String[] { Contacts.LOOKUP_KEY, Contacts._ID }, null, null, null); @@ -1524,6 +1525,7 @@ public static Uri getLookupUri(ContentResolver resolver, Uri contactUri) { * provided parameters. */ public static Uri getLookupUri(long contactId, String lookupKey) { + android.util.SeempLog.record(86); if (TextUtils.isEmpty(lookupKey)) { return null; } @@ -1537,6 +1539,7 @@ public static Uri getLookupUri(long contactId, String lookupKey) { * Returns null if the contact cannot be found. */ public static Uri lookupContact(ContentResolver resolver, Uri lookupUri) { + android.util.SeempLog.record(87); if (lookupUri == null) { return null; } @@ -1999,6 +2002,7 @@ private Photo() {} */ public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri, boolean preferHighres) { + android.util.SeempLog.record(88); if (preferHighres) { final Uri displayPhotoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO); @@ -2046,6 +2050,7 @@ public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri co * of the thumbnail the high-res picture is preferred */ public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri contactUri) { + android.util.SeempLog.record(88); return openContactPhotoInputStream(cr, contactUri, false); } } @@ -2738,6 +2743,7 @@ private RawContacts() { * entry of the given {@link RawContacts} entry. */ public static Uri getContactLookupUri(ContentResolver resolver, Uri rawContactUri) { + android.util.SeempLog.record(89); // TODO: use a lighter query by joining rawcontacts with contacts in provider final Uri dataUri = Uri.withAppendedPath(rawContactUri, Data.CONTENT_DIRECTORY); final Cursor cursor = resolver.query(dataUri, new String[] { @@ -4684,6 +4690,7 @@ private Data() {} *

*/ public static Uri getContactLookupUri(ContentResolver resolver, Uri dataUri) { + android.util.SeempLog.record(89); final Cursor cursor = resolver.query(dataUri, new String[] { RawContacts.CONTACT_ID, Contacts.LOOKUP_KEY }, null, null, null); diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 87922b06711..9b3e369409c 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -1612,6 +1612,7 @@ public static String getString(ContentResolver resolver, String name) { /** @hide */ public static String getStringForUser(ContentResolver resolver, String name, int userHandle) { + android.util.SeempLog.record(android.util.SeempLog.getSeempGetApiIdFromValue(name)); if (MOVED_TO_SECURE.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" + " to android.provider.Settings.Secure, returning read-only value."); @@ -1639,6 +1640,7 @@ public static boolean putString(ContentResolver resolver, String name, String va /** @hide */ public static boolean putStringForUser(ContentResolver resolver, String name, String value, int userHandle) { + android.util.SeempLog.record(android.util.SeempLog.getSeempPutApiIdFromValue(name)); if (MOVED_TO_SECURE.contains(name)) { Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System" + " to android.provider.Settings.Secure, value is unchanged."); @@ -2722,6 +2724,15 @@ public boolean validate(String value) { private static final Validator TEXT_AUTO_CAPS_VALIDATOR = sBooleanValidator; + /** + * Setting to show if system is in power off alarm mode. 1 = true, 0 = false + * @hide + */ + public static final String POWER_OFF_ALARM_MODE = "power_off_alarm_mode"; + + /** Validator for POWER_OFF_ALARM_MODE */ + private static final Validator POWER_OFF_ALARM_MODE_VALIDATOR = sBooleanValidator; + /** * Setting to enable Auto Punctuate in text editors. 1 = On, 0 = Off. This * feature converts two spaces to a "." and space. @@ -3219,6 +3230,14 @@ public boolean validate(String value) { * the setting value. See an example above. */ + /** + * Whether wifi settings will connect to access point automatically + * 0 = automatically + * 1 = manually + * @hide + */ + public static final String WIFI_AUTO_CONNECT_TYPE = "wifi_auto_connect_type"; + /** * Settings to backup. This is here so that it's in the same place as the settings * keys and easy to update. @@ -3270,7 +3289,8 @@ public boolean validate(String value) { VIBRATE_WHEN_RINGING, RINGTONE, LOCK_TO_APP_ENABLED, - NOTIFICATION_SOUND + NOTIFICATION_SOUND, + WIFI_AUTO_CONNECT_TYPE }; /** @@ -3323,6 +3343,7 @@ public boolean validate(String value) { PUBLIC_SETTINGS.add(SOUND_EFFECTS_ENABLED); PUBLIC_SETTINGS.add(HAPTIC_FEEDBACK_ENABLED); PUBLIC_SETTINGS.add(SHOW_WEB_SUGGESTIONS); + PUBLIC_SETTINGS.add(POWER_OFF_ALARM_MODE); } /** @@ -3448,6 +3469,7 @@ public boolean validate(String value) { VALIDATORS.put(WIFI_STATIC_NETMASK, WIFI_STATIC_NETMASK_VALIDATOR); VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR); VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR); + VALIDATORS.put(POWER_OFF_ALARM_MODE, POWER_OFF_ALARM_MODE_VALIDATOR); } /** @@ -5676,6 +5698,12 @@ public static boolean putFloatForUser(ContentResolver cr, String name, float val */ public static final String SLEEP_TIMEOUT = "sleep_timeout"; + /** + * Whether newly installed apps should run with privacy guard by default + * @hide + */ + public static final String PRIVACY_GUARD_DEFAULT = "privacy_guard_default"; + /** * Controls whether double tap to wake is enabled. * @hide @@ -5764,6 +5792,7 @@ public static boolean putFloatForUser(ContentResolver cr, String name, float val SLEEP_TIMEOUT, DOUBLE_TAP_TO_WAKE, CAMERA_GESTURE_DISABLED, + PRIVACY_GUARD_DEFAULT, }; /** @@ -7233,6 +7262,9 @@ public static final class Global extends NameValueTable { public static final String BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_"; /** {@hide} */ + public static final String + BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_"; + /** {@hide} */ public static final String BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_"; /** {@hide} */ @@ -7335,6 +7367,14 @@ public static final String getBluetoothA2dpSinkPriorityKey(String address) { return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); } + /** + * Get the key that retrieves a bluetooth a2dp src's priority. + * @hide + */ + public static final String getBluetoothA2dpSrcPriorityKey(String address) { + return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT); + } + /** * Get the key that retrieves a bluetooth Input Device's priority. * @hide @@ -7662,13 +7702,22 @@ public static final String getBluetoothSapPriorityKey(String address) { public static final String REQUIRE_PASSWORD_TO_DECRYPT = "require_password_to_decrypt"; /** - * Whether the Volte/VT is enabled + * Whether the Volte is enabled *

* Type: int (0 for false, 1 for true) * @hide */ public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled"; + /** + * Whether VT (Video Telephony over IMS) is enabled + *

+ * Type: int (0 for false, 1 for true) + * + * @hide + */ + public static final String VT_IMS_ENABLED = "vt_ims_enabled"; + /** * Whether WFC is enabled *

diff --git a/core/java/android/speech/SpeechRecognizer.java b/core/java/android/speech/SpeechRecognizer.java index 88e2edeee55..3eb24e499a9 100644 --- a/core/java/android/speech/SpeechRecognizer.java +++ b/core/java/android/speech/SpeechRecognizer.java @@ -260,6 +260,7 @@ public void setRecognitionListener(RecognitionListener listener) { * not set explicitly, default values will be used by the recognizer. */ public void startListening(final Intent recognizerIntent) { + android.util.SeempLog.record(72); if (recognizerIntent == null) { throw new IllegalArgumentException("intent must not be null"); } diff --git a/core/java/android/util/NativeTextHelper.java b/core/java/android/util/NativeTextHelper.java new file mode 100644 index 00000000000..eb380e95c39 --- /dev/null +++ b/core/java/android/util/NativeTextHelper.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package android.util; + +import android.content.Context; + +/** + *@hide + */ +public class NativeTextHelper { + + /** + * parse the string to current language. + * + * @param context base context of the application + * @param originalString original string + * @param defPackage the target package where the local language strings + * defined + * @param originNamesId the id of the original string array. + * @param localNamesId the id of the local string keys. + * @return local language string + */ + private static final String getLocalString(Context context, String originalString, + String defPackage, int originNamesId, int localNamesId) { + String[] origNames = context.getResources().getStringArray(originNamesId); + String[] localNames = context.getResources().getStringArray(localNamesId); + for (int i = 0; i < origNames.length; i++) { + if (origNames[i].equalsIgnoreCase(originalString)) { + return context.getString(context.getResources().getIdentifier(localNames[i], + "string", defPackage)); + } + } + return originalString; + } + + /** + * parse the string to current language string in public resources. + * + * @param context base context of the application + * @param originalString original string + * @param originNamesId the id of the original string array. + * @param localNamesId the id of the local string keys. + * @return local language string + */ + public static final String getLocalString(Context context, String originalString, + int originNamesId, int localNamesId) { + return getLocalString(context, originalString, "android", originNamesId, localNamesId); + } + + /** + * parse the string to current language string in current resources. + * + * @param context base context of the application + * @param originalString original string + * @param originNamesId the id of the original string array. + * @param localNamesId the id of the local string keys. + * @return local language string + */ + public static final String getInternalLocalString(Context context, String originalString, + int originNamesId, + int localNamesId) { + return getLocalString(context, originalString, context.getPackageName(), originNamesId, + localNamesId); + } + +} diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java index 2cc91b9dfe9..6fc8ae54191 100644 --- a/core/java/android/util/Patterns.java +++ b/core/java/android/util/Patterns.java @@ -124,16 +124,36 @@ public class Patterns { + "[0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}" + "|[1-9][0-9]|[0-9]))"); + /** + * Match the characters without containing chinese characters + * @hide + */ + private static final String GOOD_IRI_HOST_CHAR = + "a-zA-Z0-9\u00A0-\u2FFF\u3040-\u4DFF\u9FA6-\uD7FF" + + "\uF900-\uFDCF\uFDF0-\uFEFF"; + /** * RFC 1035 Section 2.3.4 limits the labels to a maximum 63 octets. */ - private static final String IRI - = "[" + GOOD_IRI_CHAR + "]([" + GOOD_IRI_CHAR + "\\-]{0,61}[" + GOOD_IRI_CHAR + "]){0,1}"; + private static final String IRI = + "[" + GOOD_IRI_HOST_CHAR + "]([" + GOOD_IRI_HOST_CHAR + "\\-]{0,61}[" + + GOOD_IRI_HOST_CHAR + "]){0,1}"; private static final String GOOD_GTLD_CHAR = - "a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF"; + "a-zA-Z\u00A0-\u2FFF\u3040-\u4DFF\u9FA6-\uD7FF" + + "\uF900-\uFDCF\uFDF0-\uFEFF"; private static final String GTLD = "[" + GOOD_GTLD_CHAR + "]{2,63}"; private static final String HOST_NAME = "(" + IRI + "\\.)+" + GTLD; + // Halfwidth and fullwidth forms + private static final String HALF_FULL_WIDTH_CHAR = "\uFF00-\uFFEF"; + // Symbols and punctuation + private static final String SYMBOLS_PUNCTUATION_CHAR = "\u3000-\u303F"; + // Chinese characters + private static final String CHINESE_CHAR = "\u4E00-\u9FA5"; + // Forbidden characters, should remove from URL, + private static final String FORBIDDEN_CHAR = + "[" + SYMBOLS_PUNCTUATION_CHAR + CHINESE_CHAR + + HALF_FULL_WIDTH_CHAR + "]"; public static final Pattern DOMAIN_NAME = Pattern.compile("(" + HOST_NAME + "|" + IP_ADDRESS + ")"); @@ -149,11 +169,15 @@ public class Patterns { + "\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?" + "(?:" + DOMAIN_NAME + ")" + "(?:\\:\\d{1,5})?)" // plus option port number - + "(\\/(?:(?:[" + GOOD_IRI_CHAR + "\\;\\/\\?\\:\\@\\&\\=\\#\\~" // plus option query params - + "\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?" - + "(?:\\b|$)"); // and finally, a word boundary or end of - // input. This is to stop foo.sure from - // matching as foo.su + + "(\\/(?:(?:[" + GOOD_IRI_HOST_CHAR + + "\\;\\/\\?\\:\\@\\&\\=\\#\\~" // plus option query params + + "\\-\\.\\+\\!\\*\\'\\(\\)\\_])|(?:\\,[" + GOOD_IRI_HOST_CHAR + + "])|(?:\\%[a-fA-F0-9]{2}))*)?" + + "(?:(?=" + FORBIDDEN_CHAR + + ")|\\b|$)"); + // and finally, a word boundary or end of input. This is to stop + // foo.sure from matching as foo.su + // also should remove forbidden characters from end of URL. public static final Pattern EMAIL_ADDRESS = Pattern.compile( diff --git a/core/java/android/util/SeempLog.java b/core/java/android/util/SeempLog.java new file mode 100644 index 00000000000..6e6cce67864 --- /dev/null +++ b/core/java/android/util/SeempLog.java @@ -0,0 +1,758 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package android.util; + +import com.android.internal.os.RuntimeInit; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.UnknownHostException; +import java.util.Hashtable; +import java.util.Map; +import java.util.List; +import java.util.Iterator; +import android.util.Log; +import android.provider.Settings; + +/** + * SeempLog + * + * @hide + */ +public final class SeempLog { + private SeempLog() { + } + + /** + * Send a log message to the seemp log. + * @param api The api triggering this message. + */ + public static int record(int api) { + return seemp_println_native(api, ""); + } + + /** + * Send a log message to the seemp log. + * @param api The api triggering this message. + * @param msg The message you would like logged. + */ + public static int record_str(int api, String msg) { + if ( msg != null ) { + return seemp_println_native(api, msg); + } + else { + return seemp_println_native(api, ""); + } + } + + public static int record_sensor(int api, + android.hardware.Sensor sensor) { + if ( sensor != null ) { + return seemp_println_native(api, "sensor="+sensor.getType()); + } + else { + return seemp_println_native(api, "sensor=-1"); + } + } + + public static int record_sensor_rate(int api, + android.hardware.Sensor sensor, int rate) { + if ( sensor != null ) { + return seemp_println_native(api, + "sensor="+sensor.getType() + ",rate="+rate); + } + else { + return seemp_println_native(api, "sensor=-1,rate=" + rate); + } + } + + public static int record_uri(int api, android.net.Uri uri) { + if ( uri != null ) { + return seemp_println_native(api, "uri, " + uri.toString()); + } + else { + return seemp_println_native(api, "uri, null" ); + } + } + + public static int record_vg_layout(int api, + android.view.ViewGroup.LayoutParams params) { + try { + android.view.WindowManager.LayoutParams p = + (android.view.WindowManager.LayoutParams) params; + if ( p != null ) { + return seemp_println_native(api, + "window_type=" + p.type + ",window_flag=" + p.flags); + } + else { + return seemp_println_native(api, ""); + } + } catch (ClassCastException cce) { + return seemp_println_native(api, ""); + } + } + + /** @hide */ public static native int seemp_println_native(int api, String msg); + + public static final int SEEMP_API_android_provider_Settings__get_ANDROID_ID_ = 7; + public static final int SEEMP_API_android_provider_Settings__get_ACCELEROMETER_ROTATION_ = 96; + public static final int SEEMP_API_android_provider_Settings__get_USER_ROTATION_ = 97; + public static final int SEEMP_API_android_provider_Settings__get_ADB_ENABLED_ = 98; + public static final int SEEMP_API_android_provider_Settings__get_DEBUG_APP_ = 99; + public static final int SEEMP_API_android_provider_Settings__get_WAIT_FOR_DEBUGGER_ = 100; + public static final int SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_ON_ = 101; + public static final int SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_RADIOS_ = 102; + public static final int SEEMP_API_android_provider_Settings__get_ALARM_ALERT_ = 103; + public static final int SEEMP_API_android_provider_Settings__get_NEXT_ALARM_FORMATTED_ = 104; + public static final int SEEMP_API_android_provider_Settings__get_ALWAYS_FINISH_ACTIVITIES_ = 105; + public static final int SEEMP_API_android_provider_Settings__get_LOGGING_ID_ = 106; + public static final int SEEMP_API_android_provider_Settings__get_ANIMATOR_DURATION_SCALE_ = 107; + public static final int SEEMP_API_android_provider_Settings__get_WINDOW_ANIMATION_SCALE_ = 108; + public static final int SEEMP_API_android_provider_Settings__get_FONT_SCALE_ = 109; + public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_ = 110; + public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_ = 111; + public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ = 112; + public static final int SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_MANUAL_ = 113; + public static final int SEEMP_API_android_provider_Settings__get_SCREEN_OFF_TIMEOUT_ = 114; + public static final int SEEMP_API_android_provider_Settings__get_DIM_SCREEN_ = 115; + public static final int SEEMP_API_android_provider_Settings__get_TRANSITION_ANIMATION_SCALE_ = 116; + public static final int SEEMP_API_android_provider_Settings__get_STAY_ON_WHILE_PLUGGED_IN_ = 117; + public static final int SEEMP_API_android_provider_Settings__get_WALLPAPER_ACTIVITY_ = 118; + public static final int SEEMP_API_android_provider_Settings__get_SHOW_PROCESSES_ = 119; + public static final int SEEMP_API_android_provider_Settings__get_SHOW_WEB_SUGGESTIONS_ = 120; + public static final int SEEMP_API_android_provider_Settings__get_SHOW_GTALK_SERVICE_STATUS_ = 121; + public static final int SEEMP_API_android_provider_Settings__get_USE_GOOGLE_MAIL_ = 122; + public static final int SEEMP_API_android_provider_Settings__get_AUTO_TIME_ = 123; + public static final int SEEMP_API_android_provider_Settings__get_AUTO_TIME_ZONE_ = 124; + public static final int SEEMP_API_android_provider_Settings__get_DATE_FORMAT_ = 125; + public static final int SEEMP_API_android_provider_Settings__get_TIME_12_24_ = 126; + public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_ = 127; + public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ = 128; + public static final int SEEMP_API_android_provider_Settings__get_BLUETOOTH_ON_ = 129; + public static final int SEEMP_API_android_provider_Settings__get_DEVICE_PROVISIONED_ = 130; + public static final int SEEMP_API_android_provider_Settings__get_SETUP_WIZARD_HAS_RUN_ = 131; + public static final int SEEMP_API_android_provider_Settings__get_DTMF_TONE_WHEN_DIALING_ = 132; + public static final int SEEMP_API_android_provider_Settings__get_END_BUTTON_BEHAVIOR_ = 133; + public static final int SEEMP_API_android_provider_Settings__get_RINGTONE_ = 134; + public static final int SEEMP_API_android_provider_Settings__get_MODE_RINGER_ = 135; + public static final int SEEMP_API_android_provider_Settings__get_INSTALL_NON_MARKET_APPS_ = 136; + public static final int SEEMP_API_android_provider_Settings__get_LOCATION_PROVIDERS_ALLOWED_ = 137; + public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_ENABLED_ = 138; + public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ = 139; + public static final int SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_VISIBLE_ = 140; + public static final int SEEMP_API_android_provider_Settings__get_NETWORK_PREFERENCE_ = 141; + public static final int SEEMP_API_android_provider_Settings__get_DATA_ROAMING_ = 142; + public static final int SEEMP_API_android_provider_Settings__get_HTTP_PROXY_ = 143; + public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_ENABLED_ = 144; + public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_LAST_UPDATE_ = 145; + public static final int SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_REDIRECT_URL_ = 146; + public static final int SEEMP_API_android_provider_Settings__get_RADIO_BLUETOOTH_ = 147; + public static final int SEEMP_API_android_provider_Settings__get_RADIO_CELL_ = 148; + public static final int SEEMP_API_android_provider_Settings__get_RADIO_NFC_ = 149; + public static final int SEEMP_API_android_provider_Settings__get_RADIO_WIFI_ = 150; + public static final int SEEMP_API_android_provider_Settings__get_SYS_PROP_SETTING_VERSION_ = 151; + public static final int SEEMP_API_android_provider_Settings__get_SETTINGS_CLASSNAME_ = 152; + public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_CAPS_ = 153; + public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_PUNCTUATE_ = 154; + public static final int SEEMP_API_android_provider_Settings__get_TEXT_AUTO_REPLACE_ = 155; + public static final int SEEMP_API_android_provider_Settings__get_TEXT_SHOW_PASSWORD_ = 156; + public static final int SEEMP_API_android_provider_Settings__get_USB_MASS_STORAGE_ENABLED_ = 157; + public static final int SEEMP_API_android_provider_Settings__get_VIBRATE_ON_ = 158; + public static final int SEEMP_API_android_provider_Settings__get_HAPTIC_FEEDBACK_ENABLED_ = 159; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_ALARM_ = 160; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_BLUETOOTH_SCO_ = 161; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_MUSIC_ = 162; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_NOTIFICATION_ = 163; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_RING_ = 164; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_SYSTEM_ = 165; + public static final int SEEMP_API_android_provider_Settings__get_VOLUME_VOICE_ = 166; + public static final int SEEMP_API_android_provider_Settings__get_SOUND_EFFECTS_ENABLED_ = 167; + public static final int SEEMP_API_android_provider_Settings__get_MODE_RINGER_STREAMS_AFFECTED_ = 168; + public static final int SEEMP_API_android_provider_Settings__get_MUTE_STREAMS_AFFECTED_ = 169; + public static final int SEEMP_API_android_provider_Settings__get_NOTIFICATION_SOUND_ = 170; + public static final int SEEMP_API_android_provider_Settings__get_APPEND_FOR_LAST_AUDIBLE_ = 171; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_MAX_DHCP_RETRY_COUNT_ = 172; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_ = 173; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ = 174; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ = 175; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_NUM_OPEN_NETWORKS_KEPT_ = 176; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_ON_ = 177; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_ = 178; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_DEFAULT_ = 179; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_NEVER_ = 180; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ = 181; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS1_ = 182; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS2_ = 183; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_GATEWAY_ = 184; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_IP_ = 185; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_STATIC_NETMASK_ = 186; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_USE_STATIC_IP_ = 187; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_ = 188; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_AP_COUNT_ = 189; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ = 190; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ = 191; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ = 192; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ = 193; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_MAX_AP_CHECKS_ = 194; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ON_ = 195; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_COUNT_ = 196; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_DELAY_MS_ = 197; + public static final int SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_TIMEOUT_MS_ = 198; + public static final int SEEMP_API_android_provider_Settings__put_ACCELEROMETER_ROTATION_ = 199; + public static final int SEEMP_API_android_provider_Settings__put_USER_ROTATION_ = 200; + public static final int SEEMP_API_android_provider_Settings__put_ADB_ENABLED_ = 201; + public static final int SEEMP_API_android_provider_Settings__put_DEBUG_APP_ = 202; + public static final int SEEMP_API_android_provider_Settings__put_WAIT_FOR_DEBUGGER_ = 203; + public static final int SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_ON_ = 204; + public static final int SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_RADIOS_ = 205; + public static final int SEEMP_API_android_provider_Settings__put_ALARM_ALERT_ = 206; + public static final int SEEMP_API_android_provider_Settings__put_NEXT_ALARM_FORMATTED_ = 207; + public static final int SEEMP_API_android_provider_Settings__put_ALWAYS_FINISH_ACTIVITIES_ = 208; + public static final int SEEMP_API_android_provider_Settings__put_ANDROID_ID_ = 209; + public static final int SEEMP_API_android_provider_Settings__put_LOGGING_ID_ = 210; + public static final int SEEMP_API_android_provider_Settings__put_ANIMATOR_DURATION_SCALE_ = 211; + public static final int SEEMP_API_android_provider_Settings__put_WINDOW_ANIMATION_SCALE_ = 212; + public static final int SEEMP_API_android_provider_Settings__put_FONT_SCALE_ = 213; + public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_ = 214; + public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_ = 215; + public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_AUTOMATIC_ = 216; + public static final int SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_MANUAL_ = 217; + public static final int SEEMP_API_android_provider_Settings__put_SCREEN_OFF_TIMEOUT_ = 218; + public static final int SEEMP_API_android_provider_Settings__put_DIM_SCREEN_ = 219; + public static final int SEEMP_API_android_provider_Settings__put_TRANSITION_ANIMATION_SCALE_ = 220; + public static final int SEEMP_API_android_provider_Settings__put_STAY_ON_WHILE_PLUGGED_IN_ = 221; + public static final int SEEMP_API_android_provider_Settings__put_WALLPAPER_ACTIVITY_ = 222; + public static final int SEEMP_API_android_provider_Settings__put_SHOW_PROCESSES_ = 223; + public static final int SEEMP_API_android_provider_Settings__put_SHOW_WEB_SUGGESTIONS_ = 224; + public static final int SEEMP_API_android_provider_Settings__put_SHOW_GTALK_SERVICE_STATUS_ = 225; + public static final int SEEMP_API_android_provider_Settings__put_USE_GOOGLE_MAIL_ = 226; + public static final int SEEMP_API_android_provider_Settings__put_AUTO_TIME_ = 227; + public static final int SEEMP_API_android_provider_Settings__put_AUTO_TIME_ZONE_ = 228; + public static final int SEEMP_API_android_provider_Settings__put_DATE_FORMAT_ = 229; + public static final int SEEMP_API_android_provider_Settings__put_TIME_12_24_ = 230; + public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_ = 231; + public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_TIMEOUT_ = 232; + public static final int SEEMP_API_android_provider_Settings__put_BLUETOOTH_ON_ = 233; + public static final int SEEMP_API_android_provider_Settings__put_DEVICE_PROVISIONED_ = 234; + public static final int SEEMP_API_android_provider_Settings__put_SETUP_WIZARD_HAS_RUN_ = 235; + public static final int SEEMP_API_android_provider_Settings__put_DTMF_TONE_WHEN_DIALING_ = 236; + public static final int SEEMP_API_android_provider_Settings__put_END_BUTTON_BEHAVIOR_ = 237; + public static final int SEEMP_API_android_provider_Settings__put_RINGTONE_ = 238; + public static final int SEEMP_API_android_provider_Settings__put_MODE_RINGER_ = 239; + public static final int SEEMP_API_android_provider_Settings__put_INSTALL_NON_MARKET_APPS_ = 240; + public static final int SEEMP_API_android_provider_Settings__put_LOCATION_PROVIDERS_ALLOWED_ = 241; + public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_ENABLED_ = 242; + public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_ = 243; + public static final int SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_VISIBLE_ = 244; + public static final int SEEMP_API_android_provider_Settings__put_NETWORK_PREFERENCE_ = 245; + public static final int SEEMP_API_android_provider_Settings__put_DATA_ROAMING_ = 246; + public static final int SEEMP_API_android_provider_Settings__put_HTTP_PROXY_ = 247; + public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_ENABLED_ = 248; + public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_LAST_UPDATE_ = 249; + public static final int SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_REDIRECT_URL_ = 250; + public static final int SEEMP_API_android_provider_Settings__put_RADIO_BLUETOOTH_ = 251; + public static final int SEEMP_API_android_provider_Settings__put_RADIO_CELL_ = 252; + public static final int SEEMP_API_android_provider_Settings__put_RADIO_NFC_ = 253; + public static final int SEEMP_API_android_provider_Settings__put_RADIO_WIFI_ = 254; + public static final int SEEMP_API_android_provider_Settings__put_SYS_PROP_SETTING_VERSION_ = 255; + public static final int SEEMP_API_android_provider_Settings__put_SETTINGS_CLASSNAME_ = 256; + public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_CAPS_ = 257; + public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_PUNCTUATE_ = 258; + public static final int SEEMP_API_android_provider_Settings__put_TEXT_AUTO_REPLACE_ = 259; + public static final int SEEMP_API_android_provider_Settings__put_TEXT_SHOW_PASSWORD_ = 260; + public static final int SEEMP_API_android_provider_Settings__put_USB_MASS_STORAGE_ENABLED_ = 261; + public static final int SEEMP_API_android_provider_Settings__put_VIBRATE_ON_ = 262; + public static final int SEEMP_API_android_provider_Settings__put_HAPTIC_FEEDBACK_ENABLED_ = 263; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_ALARM_ = 264; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_BLUETOOTH_SCO_ = 265; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_MUSIC_ = 266; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_NOTIFICATION_ = 267; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_RING_ = 268; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_SYSTEM_ = 269; + public static final int SEEMP_API_android_provider_Settings__put_VOLUME_VOICE_ = 270; + public static final int SEEMP_API_android_provider_Settings__put_SOUND_EFFECTS_ENABLED_ = 271; + public static final int SEEMP_API_android_provider_Settings__put_MODE_RINGER_STREAMS_AFFECTED_ = 272; + public static final int SEEMP_API_android_provider_Settings__put_MUTE_STREAMS_AFFECTED_ = 273; + public static final int SEEMP_API_android_provider_Settings__put_NOTIFICATION_SOUND_ = 274; + public static final int SEEMP_API_android_provider_Settings__put_APPEND_FOR_LAST_AUDIBLE_ = 275; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_MAX_DHCP_RETRY_COUNT_ = 276; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_ = 277; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_ = 278; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_ = 279; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_NUM_OPEN_NETWORKS_KEPT_ = 280; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_ON_ = 281; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_ = 282; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_DEFAULT_ = 283; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_NEVER_ = 284; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED_ = 285; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS1_ = 286; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS2_ = 287; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_GATEWAY_ = 288; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_IP_ = 289; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_STATIC_NETMASK_ = 290; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_USE_STATIC_IP_ = 291; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_ = 292; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_AP_COUNT_ = 293; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_ = 294; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_ = 295; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_ = 296; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_ = 297; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_MAX_AP_CHECKS_ = 298; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ON_ = 299; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_COUNT_ = 300; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_DELAY_MS_ = 301; + public static final int SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_TIMEOUT_MS_ = 302; + + private final static java.util.Map value_to_get_map; + static { + value_to_get_map = new java.util.HashMap( 198 ); + value_to_get_map.put(Settings.System.NOTIFICATION_SOUND, + SEEMP_API_android_provider_Settings__get_NOTIFICATION_SOUND_); + value_to_get_map.put(Settings.System.DTMF_TONE_WHEN_DIALING, + SEEMP_API_android_provider_Settings__get_DTMF_TONE_WHEN_DIALING_); + value_to_get_map.put(Settings.System.LOCK_PATTERN_ENABLED, + SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_ENABLED_); + value_to_get_map.put(Settings.System.WIFI_MAX_DHCP_RETRY_COUNT, + SEEMP_API_android_provider_Settings__get_WIFI_MAX_DHCP_RETRY_COUNT_); + value_to_get_map.put(Settings.System.AUTO_TIME, + SEEMP_API_android_provider_Settings__get_AUTO_TIME_); + value_to_get_map.put(Settings.System.SETUP_WIZARD_HAS_RUN, + SEEMP_API_android_provider_Settings__get_SETUP_WIZARD_HAS_RUN_); + value_to_get_map.put(Settings.System.SYS_PROP_SETTING_VERSION, + SEEMP_API_android_provider_Settings__get_SYS_PROP_SETTING_VERSION_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_); + value_to_get_map.put(Settings.System.LOCATION_PROVIDERS_ALLOWED, + SEEMP_API_android_provider_Settings__get_LOCATION_PROVIDERS_ALLOWED_); + value_to_get_map.put(Settings.System.ALARM_ALERT, + SEEMP_API_android_provider_Settings__get_ALARM_ALERT_); + value_to_get_map.put(Settings.System.VIBRATE_ON, + SEEMP_API_android_provider_Settings__get_VIBRATE_ON_); + value_to_get_map.put(Settings.System.USB_MASS_STORAGE_ENABLED, + SEEMP_API_android_provider_Settings__get_USB_MASS_STORAGE_ENABLED_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_DELAY_MS, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_DELAY_MS_); + value_to_get_map.put(Settings.System.FONT_SCALE, + SEEMP_API_android_provider_Settings__get_FONT_SCALE_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_AP_COUNT, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_AP_COUNT_); + value_to_get_map.put(Settings.System.ALWAYS_FINISH_ACTIVITIES, + SEEMP_API_android_provider_Settings__get_ALWAYS_FINISH_ACTIVITIES_); + value_to_get_map.put(Settings.System.ACCELEROMETER_ROTATION, + SEEMP_API_android_provider_Settings__get_ACCELEROMETER_ROTATION_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_TIMEOUT_MS_); + value_to_get_map.put(Settings.System.VOLUME_NOTIFICATION, + SEEMP_API_android_provider_Settings__get_VOLUME_NOTIFICATION_); + value_to_get_map.put(Settings.System.AIRPLANE_MODE_ON, + SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_ON_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_); + value_to_get_map.put(Settings.System.WIFI_STATIC_IP, + SEEMP_API_android_provider_Settings__get_WIFI_STATIC_IP_); + value_to_get_map.put(Settings.System.RADIO_BLUETOOTH, + SEEMP_API_android_provider_Settings__get_RADIO_BLUETOOTH_); + value_to_get_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY_TIMEOUT, + SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_TIMEOUT_); + value_to_get_map.put(Settings.System.VOLUME_RING, + SEEMP_API_android_provider_Settings__get_VOLUME_RING_); + value_to_get_map.put(Settings.System.MODE_RINGER_STREAMS_AFFECTED, + SEEMP_API_android_provider_Settings__get_MODE_RINGER_STREAMS_AFFECTED_); + value_to_get_map.put(Settings.System.VOLUME_SYSTEM, + SEEMP_API_android_provider_Settings__get_VOLUME_SYSTEM_); + value_to_get_map.put(Settings.System.SCREEN_OFF_TIMEOUT, + SEEMP_API_android_provider_Settings__get_SCREEN_OFF_TIMEOUT_); + value_to_get_map.put(Settings.System.RADIO_WIFI, + SEEMP_API_android_provider_Settings__get_RADIO_WIFI_); + value_to_get_map.put(Settings.System.AUTO_TIME_ZONE, + SEEMP_API_android_provider_Settings__get_AUTO_TIME_ZONE_); + value_to_get_map.put(Settings.System.TEXT_AUTO_CAPS, + SEEMP_API_android_provider_Settings__get_TEXT_AUTO_CAPS_); + value_to_get_map.put(Settings.System.WALLPAPER_ACTIVITY, + SEEMP_API_android_provider_Settings__get_WALLPAPER_ACTIVITY_); + value_to_get_map.put(Settings.System.ANIMATOR_DURATION_SCALE, + SEEMP_API_android_provider_Settings__get_ANIMATOR_DURATION_SCALE_); + value_to_get_map.put(Settings.System.WIFI_NUM_OPEN_NETWORKS_KEPT, + SEEMP_API_android_provider_Settings__get_WIFI_NUM_OPEN_NETWORKS_KEPT_); + value_to_get_map.put(Settings.System.LOCK_PATTERN_VISIBLE, + SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_VISIBLE_); + value_to_get_map.put(Settings.System.VOLUME_VOICE, + SEEMP_API_android_provider_Settings__get_VOLUME_VOICE_); + value_to_get_map.put(Settings.System.DEBUG_APP, + SEEMP_API_android_provider_Settings__get_DEBUG_APP_); + value_to_get_map.put(Settings.System.WIFI_ON, + SEEMP_API_android_provider_Settings__get_WIFI_ON_); + value_to_get_map.put(Settings.System.TEXT_SHOW_PASSWORD, + SEEMP_API_android_provider_Settings__get_TEXT_SHOW_PASSWORD_); + value_to_get_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, + SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_); + value_to_get_map.put(Settings.System.WIFI_SLEEP_POLICY, + SEEMP_API_android_provider_Settings__get_WIFI_SLEEP_POLICY_); + value_to_get_map.put(Settings.System.VOLUME_MUSIC, + SEEMP_API_android_provider_Settings__get_VOLUME_MUSIC_); + value_to_get_map.put(Settings.System.PARENTAL_CONTROL_LAST_UPDATE, + SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_LAST_UPDATE_); + value_to_get_map.put(Settings.System.DEVICE_PROVISIONED, + SEEMP_API_android_provider_Settings__get_DEVICE_PROVISIONED_); + value_to_get_map.put(Settings.System.HTTP_PROXY, + SEEMP_API_android_provider_Settings__get_HTTP_PROXY_); + value_to_get_map.put(Settings.System.ANDROID_ID, + SEEMP_API_android_provider_Settings__get_ANDROID_ID_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_MAX_AP_CHECKS, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_MAX_AP_CHECKS_); + value_to_get_map.put(Settings.System.END_BUTTON_BEHAVIOR, + SEEMP_API_android_provider_Settings__get_END_BUTTON_BEHAVIOR_); + value_to_get_map.put(Settings.System.NEXT_ALARM_FORMATTED, + SEEMP_API_android_provider_Settings__get_NEXT_ALARM_FORMATTED_); + value_to_get_map.put(Settings.System.RADIO_CELL, + SEEMP_API_android_provider_Settings__get_RADIO_CELL_); + value_to_get_map.put(Settings.System.PARENTAL_CONTROL_ENABLED, + SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_ENABLED_); + value_to_get_map.put(Settings.System.BLUETOOTH_ON, + SEEMP_API_android_provider_Settings__get_BLUETOOTH_ON_); + value_to_get_map.put(Settings.System.WINDOW_ANIMATION_SCALE, + SEEMP_API_android_provider_Settings__get_WINDOW_ANIMATION_SCALE_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_); + value_to_get_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY, + SEEMP_API_android_provider_Settings__get_BLUETOOTH_DISCOVERABILITY_); + value_to_get_map.put(Settings.System.WIFI_STATIC_DNS1, + SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS1_); + value_to_get_map.put(Settings.System.WIFI_STATIC_DNS2, + SEEMP_API_android_provider_Settings__get_WIFI_STATIC_DNS2_); + value_to_get_map.put(Settings.System.HAPTIC_FEEDBACK_ENABLED, + SEEMP_API_android_provider_Settings__get_HAPTIC_FEEDBACK_ENABLED_); + value_to_get_map.put(Settings.System.SHOW_WEB_SUGGESTIONS, + SEEMP_API_android_provider_Settings__get_SHOW_WEB_SUGGESTIONS_); + value_to_get_map.put(Settings.System.PARENTAL_CONTROL_REDIRECT_URL, + SEEMP_API_android_provider_Settings__get_PARENTAL_CONTROL_REDIRECT_URL_); + value_to_get_map.put(Settings.System.DATE_FORMAT, + SEEMP_API_android_provider_Settings__get_DATE_FORMAT_); + value_to_get_map.put(Settings.System.RADIO_NFC, + SEEMP_API_android_provider_Settings__get_RADIO_NFC_); + value_to_get_map.put(Settings.System.AIRPLANE_MODE_RADIOS, + SEEMP_API_android_provider_Settings__get_AIRPLANE_MODE_RADIOS_); + value_to_get_map.put(Settings.System.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, + SEEMP_API_android_provider_Settings__get_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_); + value_to_get_map.put(Settings.System.TIME_12_24, + SEEMP_API_android_provider_Settings__get_TIME_12_24_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_); + value_to_get_map.put(Settings.System.VOLUME_BLUETOOTH_SCO, + SEEMP_API_android_provider_Settings__get_VOLUME_BLUETOOTH_SCO_); + value_to_get_map.put(Settings.System.USER_ROTATION, + SEEMP_API_android_provider_Settings__get_USER_ROTATION_); + value_to_get_map.put(Settings.System.WIFI_STATIC_GATEWAY, + SEEMP_API_android_provider_Settings__get_WIFI_STATIC_GATEWAY_); + value_to_get_map.put(Settings.System.STAY_ON_WHILE_PLUGGED_IN, + SEEMP_API_android_provider_Settings__get_STAY_ON_WHILE_PLUGGED_IN_); + value_to_get_map.put(Settings.System.SOUND_EFFECTS_ENABLED, + SEEMP_API_android_provider_Settings__get_SOUND_EFFECTS_ENABLED_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_PING_COUNT, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_PING_COUNT_); + value_to_get_map.put(Settings.System.DATA_ROAMING, + SEEMP_API_android_provider_Settings__get_DATA_ROAMING_); + value_to_get_map.put(Settings.System.SETTINGS_CLASSNAME, + SEEMP_API_android_provider_Settings__get_SETTINGS_CLASSNAME_); + value_to_get_map.put(Settings.System.TRANSITION_ANIMATION_SCALE, + SEEMP_API_android_provider_Settings__get_TRANSITION_ANIMATION_SCALE_); + value_to_get_map.put(Settings.System.WAIT_FOR_DEBUGGER, + SEEMP_API_android_provider_Settings__get_WAIT_FOR_DEBUGGER_); + value_to_get_map.put(Settings.System.INSTALL_NON_MARKET_APPS, + SEEMP_API_android_provider_Settings__get_INSTALL_NON_MARKET_APPS_); + value_to_get_map.put(Settings.System.ADB_ENABLED, + SEEMP_API_android_provider_Settings__get_ADB_ENABLED_); + value_to_get_map.put(Settings.System.WIFI_USE_STATIC_IP, + SEEMP_API_android_provider_Settings__get_WIFI_USE_STATIC_IP_); + value_to_get_map.put(Settings.System.DIM_SCREEN, + SEEMP_API_android_provider_Settings__get_DIM_SCREEN_); + value_to_get_map.put(Settings.System.VOLUME_ALARM, + SEEMP_API_android_provider_Settings__get_VOLUME_ALARM_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_ON, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ON_); + value_to_get_map.put(Settings.System.WIFI_STATIC_NETMASK, + SEEMP_API_android_provider_Settings__get_WIFI_STATIC_NETMASK_); + value_to_get_map.put(Settings.System.NETWORK_PREFERENCE, + SEEMP_API_android_provider_Settings__get_NETWORK_PREFERENCE_); + value_to_get_map.put(Settings.System.SHOW_PROCESSES, + SEEMP_API_android_provider_Settings__get_SHOW_PROCESSES_); + value_to_get_map.put(Settings.System.TEXT_AUTO_REPLACE, + SEEMP_API_android_provider_Settings__get_TEXT_AUTO_REPLACE_); + value_to_get_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, + SEEMP_API_android_provider_Settings__get_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_); + value_to_get_map.put(Settings.System.APPEND_FOR_LAST_AUDIBLE, + SEEMP_API_android_provider_Settings__get_APPEND_FOR_LAST_AUDIBLE_); + value_to_get_map.put(Settings.System.SHOW_GTALK_SERVICE_STATUS, + SEEMP_API_android_provider_Settings__get_SHOW_GTALK_SERVICE_STATUS_); + value_to_get_map.put(Settings.System.SCREEN_BRIGHTNESS, + SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_); + value_to_get_map.put(Settings.System.USE_GOOGLE_MAIL, + SEEMP_API_android_provider_Settings__get_USE_GOOGLE_MAIL_); + value_to_get_map.put(Settings.System.RINGTONE, + SEEMP_API_android_provider_Settings__get_RINGTONE_); + value_to_get_map.put(Settings.System.LOGGING_ID, + SEEMP_API_android_provider_Settings__get_LOGGING_ID_); + value_to_get_map.put(Settings.System.MODE_RINGER, + SEEMP_API_android_provider_Settings__get_MODE_RINGER_); + value_to_get_map.put(Settings.System.MUTE_STREAMS_AFFECTED, + SEEMP_API_android_provider_Settings__get_MUTE_STREAMS_AFFECTED_); + value_to_get_map.put(Settings.System.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE, + SEEMP_API_android_provider_Settings__get_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_); + value_to_get_map.put(Settings.System.TEXT_AUTO_PUNCTUATE, + SEEMP_API_android_provider_Settings__get_TEXT_AUTO_PUNCTUATE_); + value_to_get_map.put(Settings.System.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__get_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_); + value_to_get_map.put(Settings.System.SCREEN_BRIGHTNESS_MODE, + SEEMP_API_android_provider_Settings__get_SCREEN_BRIGHTNESS_MODE_); + } + + public static int getSeempGetApiIdFromValue( String v ) + { + Integer result = value_to_get_map.get( v ); + if (result == null) + { + result = -1; + } + return result; + } + + private final static java.util.Map value_to_put_map; + static { + value_to_put_map = new java.util.HashMap( 198 ); + value_to_put_map.put(Settings.System.NOTIFICATION_SOUND, + SEEMP_API_android_provider_Settings__put_NOTIFICATION_SOUND_); + value_to_put_map.put(Settings.System.DTMF_TONE_WHEN_DIALING, + SEEMP_API_android_provider_Settings__put_DTMF_TONE_WHEN_DIALING_); + value_to_put_map.put(Settings.System.LOCK_PATTERN_ENABLED, + SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_ENABLED_); + value_to_put_map.put(Settings.System.WIFI_MAX_DHCP_RETRY_COUNT, + SEEMP_API_android_provider_Settings__put_WIFI_MAX_DHCP_RETRY_COUNT_); + value_to_put_map.put(Settings.System.AUTO_TIME, + SEEMP_API_android_provider_Settings__put_AUTO_TIME_); + value_to_put_map.put(Settings.System.SETUP_WIZARD_HAS_RUN, + SEEMP_API_android_provider_Settings__put_SETUP_WIZARD_HAS_RUN_); + value_to_put_map.put(Settings.System.SYS_PROP_SETTING_VERSION, + SEEMP_API_android_provider_Settings__put_SYS_PROP_SETTING_VERSION_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS_); + value_to_put_map.put(Settings.System.LOCATION_PROVIDERS_ALLOWED, + SEEMP_API_android_provider_Settings__put_LOCATION_PROVIDERS_ALLOWED_); + value_to_put_map.put(Settings.System.ALARM_ALERT, + SEEMP_API_android_provider_Settings__put_ALARM_ALERT_); + value_to_put_map.put(Settings.System.VIBRATE_ON, + SEEMP_API_android_provider_Settings__put_VIBRATE_ON_); + value_to_put_map.put(Settings.System.USB_MASS_STORAGE_ENABLED, + SEEMP_API_android_provider_Settings__put_USB_MASS_STORAGE_ENABLED_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_DELAY_MS, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_DELAY_MS_); + value_to_put_map.put(Settings.System.FONT_SCALE, + SEEMP_API_android_provider_Settings__put_FONT_SCALE_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_AP_COUNT, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_AP_COUNT_); + value_to_put_map.put(Settings.System.ALWAYS_FINISH_ACTIVITIES, + SEEMP_API_android_provider_Settings__put_ALWAYS_FINISH_ACTIVITIES_); + value_to_put_map.put(Settings.System.ACCELEROMETER_ROTATION, + SEEMP_API_android_provider_Settings__put_ACCELEROMETER_ROTATION_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_TIMEOUT_MS_); + value_to_put_map.put(Settings.System.VOLUME_NOTIFICATION, + SEEMP_API_android_provider_Settings__put_VOLUME_NOTIFICATION_); + value_to_put_map.put(Settings.System.AIRPLANE_MODE_ON, + SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_ON_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS_); + value_to_put_map.put(Settings.System.WIFI_STATIC_IP, + SEEMP_API_android_provider_Settings__put_WIFI_STATIC_IP_); + value_to_put_map.put(Settings.System.RADIO_BLUETOOTH, + SEEMP_API_android_provider_Settings__put_RADIO_BLUETOOTH_); + value_to_put_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY_TIMEOUT, + SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_TIMEOUT_); + value_to_put_map.put(Settings.System.VOLUME_RING, + SEEMP_API_android_provider_Settings__put_VOLUME_RING_); + value_to_put_map.put(Settings.System.MODE_RINGER_STREAMS_AFFECTED, + SEEMP_API_android_provider_Settings__put_MODE_RINGER_STREAMS_AFFECTED_); + value_to_put_map.put(Settings.System.VOLUME_SYSTEM, + SEEMP_API_android_provider_Settings__put_VOLUME_SYSTEM_); + value_to_put_map.put(Settings.System.SCREEN_OFF_TIMEOUT, + SEEMP_API_android_provider_Settings__put_SCREEN_OFF_TIMEOUT_); + value_to_put_map.put(Settings.System.RADIO_WIFI, + SEEMP_API_android_provider_Settings__put_RADIO_WIFI_); + value_to_put_map.put(Settings.System.AUTO_TIME_ZONE, + SEEMP_API_android_provider_Settings__put_AUTO_TIME_ZONE_); + value_to_put_map.put(Settings.System.TEXT_AUTO_CAPS, + SEEMP_API_android_provider_Settings__put_TEXT_AUTO_CAPS_); + value_to_put_map.put(Settings.System.WALLPAPER_ACTIVITY, + SEEMP_API_android_provider_Settings__put_WALLPAPER_ACTIVITY_); + value_to_put_map.put(Settings.System.ANIMATOR_DURATION_SCALE, + SEEMP_API_android_provider_Settings__put_ANIMATOR_DURATION_SCALE_); + value_to_put_map.put(Settings.System.WIFI_NUM_OPEN_NETWORKS_KEPT, + SEEMP_API_android_provider_Settings__put_WIFI_NUM_OPEN_NETWORKS_KEPT_); + value_to_put_map.put(Settings.System.LOCK_PATTERN_VISIBLE, + SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_VISIBLE_); + value_to_put_map.put(Settings.System.VOLUME_VOICE, + SEEMP_API_android_provider_Settings__put_VOLUME_VOICE_); + value_to_put_map.put(Settings.System.DEBUG_APP, + SEEMP_API_android_provider_Settings__put_DEBUG_APP_); + value_to_put_map.put(Settings.System.WIFI_ON, + SEEMP_API_android_provider_Settings__put_WIFI_ON_); + value_to_put_map.put(Settings.System.TEXT_SHOW_PASSWORD, + SEEMP_API_android_provider_Settings__put_TEXT_SHOW_PASSWORD_); + value_to_put_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, + SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY_); + value_to_put_map.put(Settings.System.WIFI_SLEEP_POLICY, + SEEMP_API_android_provider_Settings__put_WIFI_SLEEP_POLICY_); + value_to_put_map.put(Settings.System.VOLUME_MUSIC, + SEEMP_API_android_provider_Settings__put_VOLUME_MUSIC_); + value_to_put_map.put(Settings.System.PARENTAL_CONTROL_LAST_UPDATE, + SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_LAST_UPDATE_); + value_to_put_map.put(Settings.System.DEVICE_PROVISIONED, + SEEMP_API_android_provider_Settings__put_DEVICE_PROVISIONED_); + value_to_put_map.put(Settings.System.HTTP_PROXY, + SEEMP_API_android_provider_Settings__put_HTTP_PROXY_); + value_to_put_map.put(Settings.System.ANDROID_ID, + SEEMP_API_android_provider_Settings__put_ANDROID_ID_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_MAX_AP_CHECKS, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_MAX_AP_CHECKS_); + value_to_put_map.put(Settings.System.END_BUTTON_BEHAVIOR, + SEEMP_API_android_provider_Settings__put_END_BUTTON_BEHAVIOR_); + value_to_put_map.put(Settings.System.NEXT_ALARM_FORMATTED, + SEEMP_API_android_provider_Settings__put_NEXT_ALARM_FORMATTED_); + value_to_put_map.put(Settings.System.RADIO_CELL, + SEEMP_API_android_provider_Settings__put_RADIO_CELL_); + value_to_put_map.put(Settings.System.PARENTAL_CONTROL_ENABLED, + SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_ENABLED_); + value_to_put_map.put(Settings.System.BLUETOOTH_ON, + SEEMP_API_android_provider_Settings__put_BLUETOOTH_ON_); + value_to_put_map.put(Settings.System.WINDOW_ANIMATION_SCALE, + SEEMP_API_android_provider_Settings__put_WINDOW_ANIMATION_SCALE_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED_); + value_to_put_map.put(Settings.System.BLUETOOTH_DISCOVERABILITY, + SEEMP_API_android_provider_Settings__put_BLUETOOTH_DISCOVERABILITY_); + value_to_put_map.put(Settings.System.WIFI_STATIC_DNS1, + SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS1_); + value_to_put_map.put(Settings.System.WIFI_STATIC_DNS2, + SEEMP_API_android_provider_Settings__put_WIFI_STATIC_DNS2_); + value_to_put_map.put(Settings.System.HAPTIC_FEEDBACK_ENABLED, + SEEMP_API_android_provider_Settings__put_HAPTIC_FEEDBACK_ENABLED_); + value_to_put_map.put(Settings.System.SHOW_WEB_SUGGESTIONS, + SEEMP_API_android_provider_Settings__put_SHOW_WEB_SUGGESTIONS_); + value_to_put_map.put(Settings.System.PARENTAL_CONTROL_REDIRECT_URL, + SEEMP_API_android_provider_Settings__put_PARENTAL_CONTROL_REDIRECT_URL_); + value_to_put_map.put(Settings.System.DATE_FORMAT, + SEEMP_API_android_provider_Settings__put_DATE_FORMAT_); + value_to_put_map.put(Settings.System.RADIO_NFC, + SEEMP_API_android_provider_Settings__put_RADIO_NFC_); + value_to_put_map.put(Settings.System.AIRPLANE_MODE_RADIOS, + SEEMP_API_android_provider_Settings__put_AIRPLANE_MODE_RADIOS_); + value_to_put_map.put(Settings.System.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, + SEEMP_API_android_provider_Settings__put_LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED_); + value_to_put_map.put(Settings.System.TIME_12_24, + SEEMP_API_android_provider_Settings__put_TIME_12_24_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT_); + value_to_put_map.put(Settings.System.VOLUME_BLUETOOTH_SCO, + SEEMP_API_android_provider_Settings__put_VOLUME_BLUETOOTH_SCO_); + value_to_put_map.put(Settings.System.USER_ROTATION, + SEEMP_API_android_provider_Settings__put_USER_ROTATION_); + value_to_put_map.put(Settings.System.WIFI_STATIC_GATEWAY, + SEEMP_API_android_provider_Settings__put_WIFI_STATIC_GATEWAY_); + value_to_put_map.put(Settings.System.STAY_ON_WHILE_PLUGGED_IN, + SEEMP_API_android_provider_Settings__put_STAY_ON_WHILE_PLUGGED_IN_); + value_to_put_map.put(Settings.System.SOUND_EFFECTS_ENABLED, + SEEMP_API_android_provider_Settings__put_SOUND_EFFECTS_ENABLED_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_PING_COUNT, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_PING_COUNT_); + value_to_put_map.put(Settings.System.DATA_ROAMING, + SEEMP_API_android_provider_Settings__put_DATA_ROAMING_); + value_to_put_map.put(Settings.System.SETTINGS_CLASSNAME, + SEEMP_API_android_provider_Settings__put_SETTINGS_CLASSNAME_); + value_to_put_map.put(Settings.System.TRANSITION_ANIMATION_SCALE, + SEEMP_API_android_provider_Settings__put_TRANSITION_ANIMATION_SCALE_); + value_to_put_map.put(Settings.System.WAIT_FOR_DEBUGGER, + SEEMP_API_android_provider_Settings__put_WAIT_FOR_DEBUGGER_); + value_to_put_map.put(Settings.System.INSTALL_NON_MARKET_APPS, + SEEMP_API_android_provider_Settings__put_INSTALL_NON_MARKET_APPS_); + value_to_put_map.put(Settings.System.ADB_ENABLED, + SEEMP_API_android_provider_Settings__put_ADB_ENABLED_); + value_to_put_map.put(Settings.System.WIFI_USE_STATIC_IP, + SEEMP_API_android_provider_Settings__put_WIFI_USE_STATIC_IP_); + value_to_put_map.put(Settings.System.DIM_SCREEN, + SEEMP_API_android_provider_Settings__put_DIM_SCREEN_); + value_to_put_map.put(Settings.System.VOLUME_ALARM, + SEEMP_API_android_provider_Settings__put_VOLUME_ALARM_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_ON, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ON_); + value_to_put_map.put(Settings.System.WIFI_STATIC_NETMASK, + SEEMP_API_android_provider_Settings__put_WIFI_STATIC_NETMASK_); + value_to_put_map.put(Settings.System.NETWORK_PREFERENCE, + SEEMP_API_android_provider_Settings__put_NETWORK_PREFERENCE_); + value_to_put_map.put(Settings.System.SHOW_PROCESSES, + SEEMP_API_android_provider_Settings__put_SHOW_PROCESSES_); + value_to_put_map.put(Settings.System.TEXT_AUTO_REPLACE, + SEEMP_API_android_provider_Settings__put_TEXT_AUTO_REPLACE_); + value_to_put_map.put(Settings.System.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, + SEEMP_API_android_provider_Settings__put_WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON_); + value_to_put_map.put(Settings.System.APPEND_FOR_LAST_AUDIBLE, + SEEMP_API_android_provider_Settings__put_APPEND_FOR_LAST_AUDIBLE_); + value_to_put_map.put(Settings.System.SHOW_GTALK_SERVICE_STATUS, + SEEMP_API_android_provider_Settings__put_SHOW_GTALK_SERVICE_STATUS_); + value_to_put_map.put(Settings.System.SCREEN_BRIGHTNESS, + SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_); + value_to_put_map.put(Settings.System.USE_GOOGLE_MAIL, + SEEMP_API_android_provider_Settings__put_USE_GOOGLE_MAIL_); + value_to_put_map.put(Settings.System.RINGTONE, + SEEMP_API_android_provider_Settings__put_RINGTONE_); + value_to_put_map.put(Settings.System.LOGGING_ID, + SEEMP_API_android_provider_Settings__put_LOGGING_ID_); + value_to_put_map.put(Settings.System.MODE_RINGER, + SEEMP_API_android_provider_Settings__put_MODE_RINGER_); + value_to_put_map.put(Settings.System.MUTE_STREAMS_AFFECTED, + SEEMP_API_android_provider_Settings__put_MUTE_STREAMS_AFFECTED_); + value_to_put_map.put(Settings.System.WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE, + SEEMP_API_android_provider_Settings__put_WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE_); + value_to_put_map.put(Settings.System.TEXT_AUTO_PUNCTUATE, + SEEMP_API_android_provider_Settings__put_TEXT_AUTO_PUNCTUATE_); + value_to_put_map.put(Settings.System.WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS, + SEEMP_API_android_provider_Settings__put_WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS_); + value_to_put_map.put(Settings.System.SCREEN_BRIGHTNESS_MODE, + SEEMP_API_android_provider_Settings__put_SCREEN_BRIGHTNESS_MODE_); + } + + public static int getSeempPutApiIdFromValue( String v ) + { + Integer result = value_to_put_map.get( v ); + if (result == null) + { + result = -1; + } + return result; + } +} diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index 19d5c730368..03504efbc25 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -1844,6 +1844,7 @@ public static final boolean isWakeKey(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: case KeyEvent.KEYCODE_MENU: + case KeyEvent.KEYCODE_HOME: case KeyEvent.KEYCODE_WAKEUP: case KeyEvent.KEYCODE_PAIRING: case KeyEvent.KEYCODE_STEM_1: diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index bcf9b2c7fe7..584fe765b98 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -215,6 +215,12 @@ private static native void nativeSetDisplayPowerMode( */ public static final int BUILT_IN_DISPLAY_ID_HDMI = 1; + /** + * Built-in physical display id: Attached HDMI display. + * Use only with {@link SurfaceControl#getBuiltInDisplay(int)}. + */ + public static final int BUILT_IN_DISPLAY_ID_TERTIARY = 2; + /* Display power modes * / /** diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 720d9a8d43f..d22520d898a 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -33,6 +33,7 @@ import android.content.Context; import android.content.ContextWrapper; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.content.res.ColorStateList; import android.content.res.Configuration; import android.content.res.Resources; @@ -7641,7 +7642,7 @@ public void setLayoutDirection(@LayoutDir int layoutDirection) { @ResolvedLayoutDir public int getLayoutDirection() { final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion; - if (targetSdkVersion < JELLY_BEAN_MR1) { + if (targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp()) { mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED; return LAYOUT_DIRECTION_RESOLVED_DEFAULT; } @@ -9284,6 +9285,7 @@ public boolean dispatchTouchEvent(MotionEvent event) { final int actionMasked = event.getActionMasked(); if (actionMasked == MotionEvent.ACTION_DOWN) { + android.util.SeempLog.record(3); // Defensive cleanup for new gesture stopNestedScroll(); } @@ -9828,6 +9830,7 @@ public boolean onKeyPreIme(int keyCode, KeyEvent event) { * @param event The KeyEvent object that defines the button action. */ public boolean onKeyDown(int keyCode, KeyEvent event) { + android.util.SeempLog.record(4); boolean result = false; if (KeyEvent.isConfirmKey(keyCode)) { @@ -9872,6 +9875,7 @@ public boolean onKeyLongPress(int keyCode, KeyEvent event) { * @param event The KeyEvent object that defines the button action. */ public boolean onKeyUp(int keyCode, KeyEvent event) { + android.util.SeempLog.record(5); if (KeyEvent.isConfirmKey(keyCode)) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; @@ -10269,6 +10273,7 @@ public void onHoverChanged(boolean hovered) { * @return True if the event was handled, false otherwise. */ public boolean onTouchEvent(MotionEvent event) { + android.util.SeempLog.record(3); final float x = event.getX(); final float y = event.getY(); final int viewFlags = mViewFlags; @@ -14140,7 +14145,14 @@ private boolean hasRtlSupport() { */ private boolean isRtlCompatibilityMode() { final int targetSdkVersion = getContext().getApplicationInfo().targetSdkVersion; - return targetSdkVersion < JELLY_BEAN_MR1 || !hasRtlSupport(); + return (targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp()) || !hasRtlSupport(); + } + + /** + * Return true if we are in a system app context. + */ + private boolean isSystemApp() { + return ((getContext().getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) != 0); } /** @@ -15940,8 +15952,7 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) { RenderNode renderNode = null; Bitmap cache = null; int layerType = getLayerType(); // TODO: signify cache state with just 'cache' local - if (layerType == LAYER_TYPE_SOFTWARE - || (!drawingWithRenderNode && layerType != LAYER_TYPE_NONE)) { + if (!drawingWithRenderNode && layerType != LAYER_TYPE_NONE) { // If not drawing with RenderNode, treat HW layers as SW layerType = LAYER_TYPE_SOFTWARE; buildDrawingCache(true); diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 52d6cbec4ab..d9266293509 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -22,6 +22,7 @@ import android.annotation.UiThread; import android.content.Context; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.TypedArray; @@ -7115,8 +7116,10 @@ public MarginLayoutParams(Context c, AttributeSet attrs) { } final boolean hasRtlSupport = c.getApplicationInfo().hasRtlSupport(); + final boolean isSystemApp = (c.getApplicationInfo().flags & + ApplicationInfo.FLAG_SYSTEM) != 0; final int targetSdkVersion = c.getApplicationInfo().targetSdkVersion; - if (targetSdkVersion < JELLY_BEAN_MR1 || !hasRtlSupport) { + if ((targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp) || !hasRtlSupport) { mMarginFlags |= RTL_COMPATIBILITY_MODE_MASK; } diff --git a/core/java/android/view/WindowManagerImpl.java b/core/java/android/view/WindowManagerImpl.java index 98e9f54c13f..95e291c9e93 100644 --- a/core/java/android/view/WindowManagerImpl.java +++ b/core/java/android/view/WindowManagerImpl.java @@ -81,12 +81,14 @@ public void setDefaultToken(IBinder token) { @Override public void addView(@NonNull View view, @NonNull ViewGroup.LayoutParams params) { + android.util.SeempLog.record_vg_layout(383,params); applyDefaultToken(params); mGlobal.addView(view, params, mDisplay, mParentWindow); } @Override public void updateViewLayout(@NonNull View view, @NonNull ViewGroup.LayoutParams params) { + android.util.SeempLog.record_vg_layout(384,params); applyDefaultToken(params); mGlobal.updateViewLayout(view, params); } diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java index 4737e9be3f9..01fcc1aec56 100644 --- a/core/java/android/webkit/WebChromeClient.java +++ b/core/java/android/webkit/WebChromeClient.java @@ -290,7 +290,9 @@ public void onReachedMaxAppCacheSize(long requiredStorage, long quota, * origin. */ public void onGeolocationPermissionsShowPrompt(String origin, - GeolocationPermissions.Callback callback) {} + GeolocationPermissions.Callback callback) { + android.util.SeempLog.record(54); + } /** * Notify the host application that a request for Geolocation permissions, diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java index fac36c578da..61ab7068079 100644 --- a/core/java/android/widget/ExpandableListView.java +++ b/core/java/android/widget/ExpandableListView.java @@ -19,6 +19,7 @@ import com.android.internal.R; import android.content.Context; +import android.content.pm.ApplicationInfo; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Rect; @@ -281,7 +282,9 @@ public ExpandableListView( */ private boolean isRtlCompatibilityMode() { final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion; - return targetSdkVersion < JELLY_BEAN_MR1 || !hasRtlSupport(); + final boolean isSystemApp = (mContext.getApplicationInfo().flags & + ApplicationInfo.FLAG_SYSTEM) != 0; + return (targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp) || !hasRtlSupport(); } /** diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java index ff2f22be6db..2d56c522b3d 100644 --- a/core/java/android/widget/MediaController.java +++ b/core/java/android/widget/MediaController.java @@ -22,6 +22,7 @@ import android.media.AudioManager; import android.os.Handler; import android.os.Message; +import android.text.TextUtils; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; @@ -99,6 +100,8 @@ public class MediaController extends FrameLayout { private CharSequence mPlayDescription; private CharSequence mPauseDescription; private final AccessibilityManager mAccessibilityManager; + private final boolean isLayoutRtl = TextUtils.getLayoutDirectionFromLocale( + Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL; public MediaController(Context context, AttributeSet attrs) { super(context, attrs); @@ -269,7 +272,11 @@ private void initControllerView(View v) { mFfwdButton = (ImageButton) v.findViewById(com.android.internal.R.id.ffwd); if (mFfwdButton != null) { - mFfwdButton.setOnClickListener(mFfwdListener); + if (isLayoutRtl) { + mFfwdButton.setOnClickListener(mRewListener); + } else { + mFfwdButton.setOnClickListener(mFfwdListener); + } if (!mFromXml) { mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE); } @@ -277,7 +284,11 @@ private void initControllerView(View v) { mRewButton = (ImageButton) v.findViewById(com.android.internal.R.id.rew); if (mRewButton != null) { - mRewButton.setOnClickListener(mRewListener); + if (isLayoutRtl) { + mRewButton.setOnClickListener(mFfwdListener); + } else { + mRewButton.setOnClickListener(mRewListener); + } if (!mFromXml) { mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE); } @@ -674,12 +685,20 @@ public void onClick(View v) { private void installPrevNextListeners() { if (mNextButton != null) { - mNextButton.setOnClickListener(mNextListener); + if (isLayoutRtl) { + mNextButton.setOnClickListener(mPrevListener); + } else { + mNextButton.setOnClickListener(mNextListener); + } mNextButton.setEnabled(mNextListener != null); } if (mPrevButton != null) { - mPrevButton.setOnClickListener(mPrevListener); + if (isLayoutRtl) { + mPrevButton.setOnClickListener(mNextListener); + } else { + mPrevButton.setOnClickListener(mPrevListener); + } mPrevButton.setEnabled(mPrevListener != null); } } diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index abcd614f3fc..78223a32cb3 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -27,6 +27,7 @@ import java.util.TreeSet; import android.content.Context; +import android.content.pm.ApplicationInfo; import android.content.res.TypedArray; import android.graphics.Rect; import android.os.Build; @@ -1243,7 +1244,9 @@ public LayoutParams(Context c, AttributeSet attrs) { com.android.internal.R.styleable.RelativeLayout_Layout); final int targetSdkVersion = c.getApplicationInfo().targetSdkVersion; - mIsRtlCompatibilityMode = (targetSdkVersion < JELLY_BEAN_MR1 || + final boolean isSystemApp = (c.getApplicationInfo().flags & + ApplicationInfo.FLAG_SYSTEM) != 0; + mIsRtlCompatibilityMode = ((targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp) || !c.getApplicationInfo().hasRtlSupport()); final int[] rules = mRules; diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 0c4b60b0202..f629904530d 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -33,6 +33,7 @@ import android.content.Context; import android.content.Intent; import android.content.UndoManager; +import android.content.pm.ApplicationInfo; import android.content.res.ColorStateList; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; @@ -376,7 +377,9 @@ static class Drawables { public Drawables(Context context) { final int targetSdkVersion = context.getApplicationInfo().targetSdkVersion; - mIsRtlCompatibilityMode = (targetSdkVersion < JELLY_BEAN_MR1 || + final boolean isSystemApp = (context.getApplicationInfo().flags & + ApplicationInfo.FLAG_SYSTEM) != 0; + mIsRtlCompatibilityMode = ((targetSdkVersion < JELLY_BEAN_MR1 && !isSystemApp) || !context.getApplicationInfo().hasRtlSupport()); mOverride = false; } @@ -6515,10 +6518,12 @@ private Layout.Alignment getLayoutAlignment() { case TEXT_ALIGNMENT_GRAVITY: switch (mGravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) { case Gravity.START: - alignment = Layout.Alignment.ALIGN_NORMAL; + alignment = !isLayoutRtl() ? Layout.Alignment.ALIGN_NORMAL : + Layout.Alignment.ALIGN_RIGHT; break; case Gravity.END: - alignment = Layout.Alignment.ALIGN_OPPOSITE; + alignment = !isLayoutRtl() ? Layout.Alignment.ALIGN_OPPOSITE : + Layout.Alignment.ALIGN_LEFT; break; case Gravity.LEFT: alignment = Layout.Alignment.ALIGN_LEFT; @@ -9597,8 +9602,8 @@ public void onRtlPropertiesChanged(int layoutDirection) { TextDirectionHeuristic getTextDirectionHeuristic() { if (hasPasswordTransformationMethod()) { - // passwords fields should be LTR - return TextDirectionHeuristics.LTR; + // passwords fields should be ANYRTL_LTR + return TextDirectionHeuristics.ANYRTL_LTR; } // Always need to resolve layout direction first diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java index d552e542e52..6a5200fa5ea 100644 --- a/core/java/com/android/internal/app/AssistUtils.java +++ b/core/java/com/android/internal/app/AssistUtils.java @@ -29,6 +29,7 @@ import android.provider.Settings; import android.util.Log; + /** * Utility method for dealing with the assistant aspects of * {@link com.android.internal.app.IVoiceInteractionManagerService IVoiceInteractionManagerService}. diff --git a/core/java/com/android/internal/app/IAppOpsService.aidl b/core/java/com/android/internal/app/IAppOpsService.aidl index 9fa2c23dc95..aa1c265dce2 100644 --- a/core/java/com/android/internal/app/IAppOpsService.aidl +++ b/core/java/com/android/internal/app/IAppOpsService.aidl @@ -46,4 +46,12 @@ interface IAppOpsService { void setUserRestrictions(in Bundle restrictions, int userHandle); void removeUser(int userHandle); + boolean isControlAllowed(int code, String packageName); + + // Privacy guard methods + boolean getPrivacyGuardSettingForPackage(int uid, String packageName); + void setPrivacyGuardSettingForPackage(int uid, String packageName, boolean state); + + // AppOps accounting + void resetCounters(); } diff --git a/core/java/com/android/internal/app/LocalePicker.java b/core/java/com/android/internal/app/LocalePicker.java index 4efefa94394..939c39df9fb 100644 --- a/core/java/com/android/internal/app/LocalePicker.java +++ b/core/java/com/android/internal/app/LocalePicker.java @@ -28,6 +28,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.provider.Settings; +import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -41,6 +42,7 @@ import java.util.List; import java.util.Locale; import java.util.ArrayList; +import java.util.Arrays; public class LocalePicker extends ListFragment { private static final String TAG = "LocalePicker"; @@ -83,12 +85,28 @@ public int compareTo(LocaleInfo another) { } } + public static ArrayList getLocaleArray(String[] locales, Resources resources) { + String localeCodes = resources.getString(R.string.locale_codes); + String[] localeCodesArray = null; + if (localeCodes != null && !TextUtils.isEmpty(localeCodes.trim())) { + localeCodes = localeCodes.replace('_', '-'); + // ICU use "fil" instead of "tl" + localeCodes = localeCodes.replaceAll("tl-", "fil-"); + localeCodesArray = localeCodes.split(","); + } + ArrayList localeList = new ArrayList( + Arrays.asList((localeCodesArray == null || localeCodesArray.length == 0) ? locales + : localeCodesArray)); + return localeList; + } + public static List getAllAssetLocales(Context context, boolean isInDeveloperMode) { final Resources resources = context.getResources(); - final String[] locales = Resources.getSystem().getAssets().getLocales(); - List localeList = new ArrayList(locales.length); - Collections.addAll(localeList, locales); + String[] locales = Resources.getSystem().getAssets().getLocales(); + // Check the locale_codes if the locales list is customized in data package overlay. + // If locale_codes is customized, use the customized list instead of built-in locales. + ArrayList localeList = getLocaleArray(locales, resources); // Don't show the pseudolocales unless we're in developer mode. http://b/17190407. if (!isInDeveloperMode) { @@ -142,6 +160,25 @@ public static List getAllAssetLocales(Context context, boolean isInD } } } + // If customized to true, always show the country name + boolean shallShowCountry + = resources.getBoolean(R.bool.config_display_country_for_locale_codes); + if (shallShowCountry) { + for (LocaleInfo locale : localeInfos) { + Locale l = locale.locale; + String languageName = toTitleCase(l.getDisplayLanguage(l)); + String displayName + = toTitleCase(getDisplayName(l, specialLocaleCodes, specialLocaleNames)); + if (locale.label.equals(languageName)) { + if (displayName.equals(languageName)) { + // Fix some cases where getDisplayName() not works(e.g. ar-EG). + displayName = toTitleCase(String.format("%s (%s)", languageName, + l.getDisplayCountry(l))); + } + locale.label = displayName; + } + } + } Collections.sort(localeInfos); return localeInfos; diff --git a/core/java/com/android/internal/logging/MetricsConstants.java b/core/java/com/android/internal/logging/MetricsConstants.java index b90cb364def..0e0d0bb883f 100644 --- a/core/java/com/android/internal/logging/MetricsConstants.java +++ b/core/java/com/android/internal/logging/MetricsConstants.java @@ -21,6 +21,7 @@ * @hide */ public interface MetricsConstants { + public static final int DONT_TRACK_ME_BRO = -Integer.MAX_VALUE + 1; // These constants must match those in the analytic pipeline, do not edit. // Add temporary values to the top of MetricsLogger instead. public static final int VIEW_UNKNOWN = 0; diff --git a/core/java/com/android/internal/view/RotationPolicy.java b/core/java/com/android/internal/view/RotationPolicy.java index b479cb1fb6d..ebbb92e3141 100644 --- a/core/java/com/android/internal/view/RotationPolicy.java +++ b/core/java/com/android/internal/view/RotationPolicy.java @@ -32,9 +32,8 @@ import android.view.IWindowManager; import android.view.Surface; import android.view.WindowManagerGlobal; - import com.android.internal.R; - +import android.os.SystemProperties; /** * Provides helper functions for configuring the display rotation policy. */ @@ -140,7 +139,14 @@ public void run() { try { IWindowManager wm = WindowManagerGlobal.getWindowManagerService(); if (enabled) { - wm.freezeRotation(rotation); + //Consider input rotation parameter even if display panel is mounted + //with 90 or 180 or 270 degrees rotated. + if (rotation < 0) { + wm.freezeRotation(rotation); + } else { + wm.freezeRotation(SystemProperties.getInt( + "persist.panel.orientation", 0)/90); + } } else { wm.thawRotation(); } @@ -194,4 +200,4 @@ public void onChange(boolean selfChange, Uri uri) { public abstract void onChange(); } -} \ No newline at end of file +} diff --git a/core/java/com/android/internal/view/menu/IconMenuItemView.java b/core/java/com/android/internal/view/menu/IconMenuItemView.java index de5e2798a7b..e8de3d4c16f 100644 --- a/core/java/com/android/internal/view/menu/IconMenuItemView.java +++ b/core/java/com/android/internal/view/menu/IconMenuItemView.java @@ -285,7 +285,7 @@ private void positionIcon() { getLineBounds(0, tmpRect); mPositionIconAvailable.set(0, 0, getWidth(), tmpRect.top); final int layoutDirection = getLayoutDirection(); - Gravity.apply(Gravity.CENTER_VERTICAL | Gravity.START, mIcon.getIntrinsicWidth(), mIcon + Gravity.apply(Gravity.CENTER_VERTICAL | Gravity.LEFT, mIcon.getIntrinsicWidth(), mIcon .getIntrinsicHeight(), mPositionIconAvailable, mPositionIconOutput, layoutDirection); mIcon.setBounds(mPositionIconOutput); diff --git a/core/java/com/android/internal/widget/ILockSettings.aidl b/core/java/com/android/internal/widget/ILockSettings.aidl index 4e4552d3328..72f18d6da2c 100644 --- a/core/java/com/android/internal/widget/ILockSettings.aidl +++ b/core/java/com/android/internal/widget/ILockSettings.aidl @@ -36,6 +36,7 @@ interface ILockSettings { boolean checkVoldPassword(int userId); boolean havePattern(int userId); boolean havePassword(int userId); + void sanitizePassword(); void registerStrongAuthTracker(in IStrongAuthTracker tracker); void unregisterStrongAuthTracker(in IStrongAuthTracker tracker); void requireStrongAuth(int strongAuthReason, int userId); diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 2e9f4f63899..eca8557eacf 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -538,6 +538,17 @@ public void saveLockPattern(List pattern, String savedPatt } } + /** + * clears stored password. + */ + public void sanitizePassword() { + try { + getLockSettings().sanitizePassword(); + } catch (RemoteException re) { + Log.e(TAG, "Couldn't sanitize password" + re); + } + } + private void updateCryptoUserInfo(int userId) { if (userId != UserHandle.USER_OWNER) { return; diff --git a/core/java/com/android/server/net/BaseNetworkObserver.java b/core/java/com/android/server/net/BaseNetworkObserver.java index 3d9fb5c872f..c3dcd40416a 100644 --- a/core/java/com/android/server/net/BaseNetworkObserver.java +++ b/core/java/com/android/server/net/BaseNetworkObserver.java @@ -62,6 +62,11 @@ public void interfaceClassDataActivityChanged(String label, boolean active, long // default no-op } + @Override + public void interfaceMessageRecevied(String message) { + // default no-op + } + @Override public void limitReached(String limitName, String iface) { // default no-op diff --git a/core/java/org/codeaurora/camera/Android.mk b/core/java/org/codeaurora/camera/Android.mk new file mode 100644 index 00000000000..2e005f79eef --- /dev/null +++ b/core/java/org/codeaurora/camera/Android.mk @@ -0,0 +1,30 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-subdir-java-files) + +LOCAL_MODULE_TAGS := optional + +LOCAL_MODULE:= org.codeaurora.camera + +# This will install the file in /system/framework +LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES) + +include $(BUILD_JAVA_LIBRARY) + +# ==== permissions ======================== +include $(CLEAR_VARS) + +LOCAL_MODULE := org.codeaurora.camera.xml + +LOCAL_MODULE_TAGS := optional + +LOCAL_MODULE_CLASS := ETC + +# This will install the file in /system/etc/permissions +LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions + +LOCAL_SRC_FILES := $(LOCAL_MODULE) + +include $(BUILD_PREBUILT) diff --git a/core/java/org/codeaurora/camera/ExtendedFace.java b/core/java/org/codeaurora/camera/ExtendedFace.java new file mode 100644 index 00000000000..afda0b64b14 --- /dev/null +++ b/core/java/org/codeaurora/camera/ExtendedFace.java @@ -0,0 +1,211 @@ +/* Copyright (c) 2015, The Linux Foundataion. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are +* met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of The Linux Foundation nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +package org.codeaurora.camera; + +import android.hardware.Camera; + +import java.util.ArrayList; + +import android.os.Bundle; + +import android.os.SystemProperties; + +/** + * {@hide} Information about a face identified through Extended camera face + * + *

+ * When face detection is used with a camera, the {@link FaceDetectionListener} + * returns a list of face objects for use in focusing and metering. + *

+ * + * @see FaceDetectionListener + */ +public class ExtendedFace extends android.hardware.Camera.Face { + public ExtendedFace() { + super(); + } + + private int smileDegree = 0; + private int smileScore = 0; + private int blinkDetected = 0; + private int faceRecognized = 0; + private int gazeAngle = 0; + private int updownDir = 0; + private int leftrightDir = 0; + private int rollDir = 0; + private int leyeBlink = 0; + private int reyeBlink = 0; + private int leftrightGaze = 0; + private int topbottomGaze = 0; + + private static final String STR_TRUE = "true"; + private static final String STR_FALSE = "false"; + + /** + * The smilie degree for the detection of the face. + * + * @see #startFaceDetection() + */ + public int getSmileDegree() { + return smileDegree; + } + + /** + * The smilie score for the detection of the face. + * + * @see #startFaceDetection() + */ + public int getSmileScore() { + return smileScore; + } + + /** + * The smilie degree for the detection of the face. + * + * @see #startFaceDetection() + */ + public int getBlinkDetected() { + return blinkDetected; + } + + /** + * If face is recognized. + * + * @see #startFaceDetection() + */ + public int getFaceRecognized() { + return faceRecognized; + } + + /** + * The gaze angle for the detected face. + * + * @see #startFaceDetection() + */ + public int getGazeAngle() { + return gazeAngle; + } + + /** + * The up down direction for the detected face. + * + * @see #startFaceDetection() + */ + public int getUpDownDirection() { + return updownDir; + } + + /** + * The left right direction for the detected face. + * + * @see #startFaceDetection() + */ + public int getLeftRightDirection() { + return leftrightDir; + } + + /** + * The roll direction for the detected face. + * + * @see #startFaceDetection() + */ + public int getRollDirection() { + return rollDir; + } + + /** + * The degree of left eye blink for the detected face. + * + * @see #startFaceDetection() + */ + public int getLeftEyeBlinkDegree() { + return leyeBlink; + } + + /** + * The degree of right eye blink for the detected face. + * + * @see #startFaceDetection() + */ + public int getRightEyeBlinkDegree() { + return reyeBlink; + } + + /** + * The gaze degree of left-right direction for the detected face. + * + * @see #startFaceDetection() + */ + public int getLeftRightGazeDegree() { + return leftrightGaze; + } + + /** + * The gaze degree of up-down direction for the detected face. + * + * @see #startFaceDetection() + */ + public int getTopBottomGazeDegree() { + return topbottomGaze; + } + + private static final String BUNDLE_KEY_SMILE_SCORE = "smileScore"; + private static final String BUNDLE_KEY_SMILE_VALUE = "smileValue"; + private static final String BUNDLE_KEY_BLINK_DETECTED = "blinkDetected"; + private static final String BUNDLE_KEY_LEFT_EYE_CLOSED_VALUE = "leftEyeClosedValue"; + private static final String BUNDLE_KEY_RIGHT_EYE_CLOSED_VALUE = "rightEyeClosedValue"; + private static final String BUNDLE_KEY_FACE_PITCH_DEGREE = "facePitchDegree"; + private static final String BUNDLE_KEY_FACE_YAW_DEGREE = "faceYawDegree"; + private static final String BUNDLE_KEY_FACE_ROLL_DEGREE = "faceRollDegree"; + private static final String BUNDLE_KEY_GAZE_UP_DOWN_DEGREE = "gazeUpDownDegree"; + private static final String BUNDLE_KEY_GAZE_LEFT_RIGHT_DEGREE = "gazeLeftRightDegree"; + private static final String BUNDLE_KEY_FACE_RECOGNIZED = "faceRecognized"; + + public Bundle getExtendedFaceInfo() { + Bundle faceInfo = new Bundle(); + faceInfo.putInt(BUNDLE_KEY_SMILE_VALUE, this.smileDegree); + + faceInfo.putInt(BUNDLE_KEY_LEFT_EYE_CLOSED_VALUE, this.leyeBlink); + faceInfo.putInt(BUNDLE_KEY_RIGHT_EYE_CLOSED_VALUE, this.reyeBlink); + + faceInfo.putInt(BUNDLE_KEY_FACE_PITCH_DEGREE, this.updownDir); + faceInfo.putInt(BUNDLE_KEY_FACE_YAW_DEGREE, this.leftrightDir); + faceInfo.putInt(BUNDLE_KEY_FACE_ROLL_DEGREE, this.rollDir); + faceInfo.putInt(BUNDLE_KEY_GAZE_UP_DOWN_DEGREE, this.topbottomGaze); + faceInfo.putInt(BUNDLE_KEY_GAZE_LEFT_RIGHT_DEGREE, this.leftrightGaze); + + faceInfo.putInt(BUNDLE_KEY_BLINK_DETECTED, this.blinkDetected); + faceInfo.putInt(BUNDLE_KEY_SMILE_SCORE, this.smileScore); + faceInfo.putInt(BUNDLE_KEY_FACE_RECOGNIZED, this.faceRecognized); + + return faceInfo; + } + +} diff --git a/core/java/org/codeaurora/camera/org.codeaurora.camera.xml b/core/java/org/codeaurora/camera/org.codeaurora.camera.xml new file mode 100644 index 00000000000..20b2aa05822 --- /dev/null +++ b/core/java/org/codeaurora/camera/org.codeaurora.camera.xml @@ -0,0 +1,35 @@ + + + + + + + diff --git a/core/jni/Android.mk b/core/jni/Android.mk index fc15b964826..ad52bd6a76b 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -29,6 +29,7 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_CFLAGS += -DU_USING_ICU_NAMESPACE=0 LOCAL_SRC_FILES:= \ + android_util_SeempLog.cpp \ AndroidRuntime.cpp \ com_android_internal_content_NativeLibraryHelper.cpp \ com_google_android_gles_jni_EGLImpl.cpp \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 2fad2f60f32..a715c5f7825 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -100,6 +100,7 @@ extern int register_android_media_JetPlayer(JNIEnv *env); extern int register_android_media_ToneGenerator(JNIEnv *env); namespace android { +extern int register_android_util_SeempLog(JNIEnv* env); /* * JNI-based registration functions. Note these are properly contained in @@ -1294,6 +1295,7 @@ static int register_jni_procs(const RegJNIRec array[], size_t count, JNIEnv* env } static const RegJNIRec gRegJNI[] = { + REG_JNI(register_android_util_SeempLog), REG_JNI(register_com_android_internal_os_RuntimeInit), REG_JNI(register_android_os_SystemClock), REG_JNI(register_android_util_EventLog), diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp index 4f44c262f26..e22725b3776 100644 --- a/core/jni/android_hardware_Camera.cpp +++ b/core/jni/android_hardware_Camera.cpp @@ -62,6 +62,18 @@ struct fields_t { jmethodID rect_constructor; jmethodID face_constructor; jmethodID point_constructor; + jfieldID face_sm_degree; + jfieldID face_sm_score; + jfieldID face_blink_detected; + jfieldID face_gaze_angle; + jfieldID face_updown_dir; + jfieldID face_leftright_dir; + jfieldID face_roll_dir; + jfieldID face_leye_blink; + jfieldID face_reye_blink; + jfieldID face_left_right_gaze; + jfieldID face_top_bottom_gaze; + jfieldID face_recognised; }; static fields_t fields; @@ -96,6 +108,7 @@ class JNICameraContext: public CameraListener jclass mFaceClass; // strong reference to Face class jclass mRectClass; // strong reference to Rect class jclass mPointClass; // strong reference to Point class + bool mIsExtendedFace; Mutex mLock; /* @@ -147,8 +160,16 @@ JNICameraContext::JNICameraContext(JNIEnv* env, jobject weak_this, jclass clazz, mCameraJClass = (jclass)env->NewGlobalRef(clazz); mCamera = camera; - jclass faceClazz = env->FindClass("android/hardware/Camera$Face"); - mFaceClass = (jclass) env->NewGlobalRef(faceClazz); + jclass extendedfaceClazz = env->FindClass("org/codeaurora/camera/ExtendedFace"); + if (NULL != extendedfaceClazz) { + mFaceClass = (jclass) env->NewGlobalRef(extendedfaceClazz); + mIsExtendedFace = true; + } else { + env->ExceptionClear(); + jclass faceClazz = env->FindClass("android/hardware/Camera$Face"); + mFaceClass = (jclass) env->NewGlobalRef(faceClazz); + mIsExtendedFace = false; + } jclass rectClazz = env->FindClass("android/graphics/Rect"); mRectClass = (jclass) env->NewGlobalRef(rectClazz); @@ -368,7 +389,6 @@ void JNICameraContext::postMetadata(JNIEnv *env, int32_t msgType, camera_frame_m env->SetIntField(rect, fields.rect_top, metadata->faces[i].rect[1]); env->SetIntField(rect, fields.rect_right, metadata->faces[i].rect[2]); env->SetIntField(rect, fields.rect_bottom, metadata->faces[i].rect[3]); - env->SetObjectField(face, fields.face_rect, rect); env->SetIntField(face, fields.face_score, metadata->faces[i].score); @@ -397,6 +417,21 @@ void JNICameraContext::postMetadata(JNIEnv *env, int32_t msgType, camera_frame_m env->SetIntField(mouth, fields.point_y, metadata->faces[i].mouth[1]); env->SetObjectField(face, fields.face_mouth, mouth); env->DeleteLocalRef(mouth); + + if (mIsExtendedFace) { + env->SetIntField(face, fields.face_sm_degree, metadata->faces[i].smile_degree); + env->SetIntField(face, fields.face_sm_score, metadata->faces[i].smile_score); + env->SetIntField(face, fields.face_blink_detected, metadata->faces[i].blink_detected); + env->SetIntField(face, fields.face_recognised, metadata->faces[i].face_recognised); + env->SetIntField(face, fields.face_gaze_angle, metadata->faces[i].gaze_angle); + env->SetIntField(face, fields.face_updown_dir, metadata->faces[i].updown_dir); + env->SetIntField(face, fields.face_leftright_dir, metadata->faces[i].leftright_dir); + env->SetIntField(face, fields.face_roll_dir, metadata->faces[i].roll_dir); + env->SetIntField(face, fields.face_leye_blink, metadata->faces[i].leye_blink); + env->SetIntField(face, fields.face_reye_blink, metadata->faces[i].reye_blink); + env->SetIntField(face, fields.face_left_right_gaze, metadata->faces[i].left_right_gaze); + env->SetIntField(face, fields.face_top_bottom_gaze, metadata->faces[i].top_bottom_gaze); + } } env->DeleteLocalRef(face); @@ -434,6 +469,56 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM } } +static void android_hardware_Camera_setLongshot(JNIEnv *env, jobject thiz, jboolean enable) +{ + ALOGV("setLongshot"); + JNICameraContext* context; + status_t rc; + sp camera = get_native_camera(env, thiz, &context); + if (camera == 0) return; + + if ( enable ) { + rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_ON, 0, 0); + } else { + rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_OFF, 0, 0); + } + + if (rc != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "enabling longshot mode failed"); + } +} + +static void android_hardware_Camera_sendHistogramData(JNIEnv *env, jobject thiz) + { + ALOGV("sendHistogramData" ); + JNICameraContext* context; + status_t rc; + sp camera = get_native_camera(env, thiz, &context); + if (camera == 0) return; + + rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_SEND_DATA, 0, 0); + + if (rc != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "send histogram data failed"); + } + } + static void android_hardware_Camera_setHistogramMode(JNIEnv *env, jobject thiz, jboolean mode) + { + ALOGV("setHistogramMode: mode:%d", (int)mode); + JNICameraContext* context; + status_t rc; + sp camera = get_native_camera(env, thiz, &context); + if (camera == 0) return; + + if(mode == true) + rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_ON, 0, 0); + else + rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_OFF, 0, 0); + + if (rc != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "set histogram mode failed"); + } + } void JNICameraContext::addCallbackBuffer( JNIEnv *env, jbyteArray cbb, int msgType) { @@ -717,7 +802,25 @@ static void android_hardware_Camera_setHasPreviewCallback(JNIEnv *env, jobject t context->setCallbackMode(env, installed, manualBuffer); } -static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, jint msgType) { +static void android_hardware_Camera_setMetadataCb(JNIEnv *env, jobject thiz, jboolean mode) +{ + ALOGV("setMetadataCb: mode:%d", (int)mode); + JNICameraContext* context; + status_t rc; + sp camera = get_native_camera(env, thiz, &context); + if (camera == 0) return; + + if(mode == true) + rc = camera->sendCommand(CAMERA_CMD_METADATA_ON, 0, 0); + else + rc = camera->sendCommand(CAMERA_CMD_METADATA_OFF, 0, 0); + + if (rc != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "set metadata mode failed"); + } +} + +static void android_hardware_Camera_addCallbackBuffer(JNIEnv *env, jobject thiz, jbyteArray bytes, int msgType) { ALOGV("addCallbackBuffer: 0x%x", msgType); JNICameraContext* context = reinterpret_cast(env->GetLongField(thiz, fields.context)); @@ -995,6 +1098,18 @@ static JNINativeMethod camMethods[] = { { "native_takePicture", "(I)V", (void *)android_hardware_Camera_takePicture }, + { "native_setHistogramMode", + "(Z)V", + (void *)android_hardware_Camera_setHistogramMode }, + { "native_setMetadataCb", + "(Z)V", + (void *)android_hardware_Camera_setMetadataCb }, + { "native_sendHistogramData", + "()V", + (void *)android_hardware_Camera_sendHistogramData }, + { "native_setLongshot", + "(Z)V", + (void *)android_hardware_Camera_setLongshot }, { "native_setParameters", "(Ljava/lang/String;)V", (void *)android_hardware_Camera_setParameters }, @@ -1073,6 +1188,27 @@ int register_android_hardware_Camera(JNIEnv *env) { "android/graphics/Point", "y", "I", &fields.point_y}, }; + field extendedfacefields_to_find[] = { + { "org/codeaurora/camera/ExtendedFace", "rect", "Landroid/graphics/Rect;", &fields.face_rect }, + { "org/codeaurora/camera/ExtendedFace", "score", "I", &fields.face_score }, + { "org/codeaurora/camera/ExtendedFace", "id", "I", &fields.face_id }, + { "org/codeaurora/camera/ExtendedFace", "leftEye", "Landroid/graphics/Point;", &fields.face_left_eye }, + { "org/codeaurora/camera/ExtendedFace", "rightEye", "Landroid/graphics/Point;", &fields.face_right_eye }, + { "org/codeaurora/camera/ExtendedFace", "mouth", "Landroid/graphics/Point;", &fields.face_mouth }, + { "org/codeaurora/camera/ExtendedFace", "smileDegree", "I", &fields.face_sm_degree }, + { "org/codeaurora/camera/ExtendedFace", "smileScore", "I", &fields.face_sm_score }, + { "org/codeaurora/camera/ExtendedFace", "blinkDetected", "I", &fields.face_blink_detected }, + { "org/codeaurora/camera/ExtendedFace", "faceRecognized", "I", &fields.face_recognised }, + { "org/codeaurora/camera/ExtendedFace", "gazeAngle", "I", &fields.face_gaze_angle }, + { "org/codeaurora/camera/ExtendedFace", "updownDir", "I", &fields.face_updown_dir }, + { "org/codeaurora/camera/ExtendedFace", "leftrightDir", "I", &fields.face_leftright_dir }, + { "org/codeaurora/camera/ExtendedFace", "rollDir", "I", &fields.face_roll_dir }, + { "org/codeaurora/camera/ExtendedFace", "leyeBlink", "I", &fields.face_leye_blink }, + { "org/codeaurora/camera/ExtendedFace", "reyeBlink", "I", &fields.face_reye_blink }, + { "org/codeaurora/camera/ExtendedFace", "leftrightGaze", "I", &fields.face_left_right_gaze }, + { "org/codeaurora/camera/ExtendedFace", "topbottomGaze", "I", &fields.face_top_bottom_gaze }, + }; + find_fields(env, fields_to_find, NELEM(fields_to_find)); jclass clazz = FindClassOrDie(env, "android/hardware/Camera"); @@ -1092,6 +1228,12 @@ int register_android_hardware_Camera(JNIEnv *env) return -1; } + clazz = env->FindClass("org/codeaurora/camera/ExtendedFace"); + if (NULL != clazz) { + fields.face_constructor = env->GetMethodID(clazz, "", "()V"); + find_fields(env, extendedfacefields_to_find, NELEM(extendedfacefields_to_find)); + } + // Register native functions return RegisterMethodsOrDie(env, "android/hardware/Camera", camMethods, NELEM(camMethods)); } diff --git a/core/jni/android_media_AudioFormat.h b/core/jni/android_media_AudioFormat.h index bb13c35ced1..211b4f0b10d 100644 --- a/core/jni/android_media_AudioFormat.h +++ b/core/jni/android_media_AudioFormat.h @@ -31,6 +31,14 @@ #define ENCODING_AAC_LC 10 #define ENCODING_AAC_HE_V1 11 #define ENCODING_AAC_HE_V2 12 + +#define ENCODING_AMR_NB 100 +#define ENCODING_AMR_WB 101 +#define ENCODING_EVRC 102 +#define ENCODING_EVRC_B 103 +#define ENCODING_EVRC_WB 104 +#define ENCODING_EVRC_NW 105 + #define ENCODING_INVALID 0 #define ENCODING_DEFAULT 1 @@ -64,6 +72,18 @@ static inline audio_format_t audioFormatToNative(int audioFormat) return AUDIO_FORMAT_AAC_HE_V1; case ENCODING_AAC_HE_V2: return AUDIO_FORMAT_AAC_HE_V2; + case ENCODING_AMR_NB: + return AUDIO_FORMAT_AMR_NB; + case ENCODING_AMR_WB: + return AUDIO_FORMAT_AMR_WB; + case ENCODING_EVRC: + return AUDIO_FORMAT_EVRC; + case ENCODING_EVRC_B: + return AUDIO_FORMAT_EVRCB; + case ENCODING_EVRC_WB: + return AUDIO_FORMAT_EVRCWB; + case ENCODING_EVRC_NW: + return AUDIO_FORMAT_EVRCNW; case ENCODING_DEFAULT: return AUDIO_FORMAT_DEFAULT; default: @@ -103,6 +123,18 @@ static inline int audioFormatFromNative(audio_format_t nativeFormat) return ENCODING_AAC_HE_V1; case AUDIO_FORMAT_AAC_HE_V2: return ENCODING_AAC_HE_V2; + case AUDIO_FORMAT_AMR_NB: + return ENCODING_AMR_NB; + case AUDIO_FORMAT_AMR_WB: + return ENCODING_AMR_WB; + case AUDIO_FORMAT_EVRC: + return ENCODING_EVRC; + case AUDIO_FORMAT_EVRCB: + return ENCODING_EVRC_B; + case AUDIO_FORMAT_EVRCWB: + return ENCODING_EVRC_WB; + case AUDIO_FORMAT_EVRCNW: + return ENCODING_EVRC_NW; case AUDIO_FORMAT_DEFAULT: return ENCODING_DEFAULT; default: diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index c139cd78b4c..9718fd7e3d4 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -144,7 +144,7 @@ static volatile int32_t gNumDeathRefs = 0; static void incRefsCreated(JNIEnv* env) { int old = android_atomic_inc(&gNumRefsCreated); - if (old == 200) { + if (old == 2000) { android_atomic_and(0, &gNumRefsCreated); env->CallStaticVoidMethod(gBinderInternalOffsets.mClass, gBinderInternalOffsets.mForceGc); diff --git a/core/jni/android_util_Process.cpp b/core/jni/android_util_Process.cpp index ee8fb195002..8967cf2f487 100644 --- a/core/jni/android_util_Process.cpp +++ b/core/jni/android_util_Process.cpp @@ -370,27 +370,40 @@ jint android_os_Process_getThreadPriority(JNIEnv* env, jobject clazz, return pri; } +static bool memcgSupported = false; +static int memcgTasksFd = -1; +static int memcgSwapTasksFd = -1; +static pthread_once_t memcgInitOnce = PTHREAD_ONCE_INIT; + +static void memcgInit(void) { + if (!access("/sys/fs/cgroup/memory/tasks", F_OK)) { + memcgTasksFd = open("/sys/fs/cgroup/memory/tasks", O_WRONLY); + if (memcgTasksFd < 0) { + return; + } + memcgSwapTasksFd = open("/sys/fs/cgroup/memory/sw/tasks", O_WRONLY); + if (memcgSwapTasksFd < 0) { + close(memcgTasksFd); + return; + } + memcgSupported = true; + } +} + jboolean android_os_Process_setSwappiness(JNIEnv *env, jobject clazz, jint pid, jboolean is_increased) { - char text[64]; - - if (is_increased) { - strcpy(text, "/sys/fs/cgroup/memory/sw/tasks"); - } else { - strcpy(text, "/sys/fs/cgroup/memory/tasks"); - } - - struct stat st; - if (stat(text, &st) || !S_ISREG(st.st_mode)) { + pthread_once(&memcgInitOnce, memcgInit); + if (!memcgSupported) { return false; } - int fd = open(text, O_WRONLY); + int fd = is_increased ? memcgSwapTasksFd : memcgTasksFd; + char text[64]; + if (fd >= 0) { sprintf(text, "%" PRId32, pid); write(fd, text, strlen(text)); - close(fd); } return true; diff --git a/core/jni/android_util_SeempLog.cpp b/core/jni/android_util_SeempLog.cpp new file mode 100644 index 00000000000..734490a0395 --- /dev/null +++ b/core/jni/android_util_SeempLog.cpp @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Not a Contribution. + * + * Copyright (C) 2007-2014 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __BIONIC__ +#include +#endif +#include + +#include "jni.h" +#include "JNIHelp.h" +#include "utils/misc.h" +#include "android_runtime/AndroidRuntime.h" + +#define LOG_BUF_SIZE 1024 +#define SEEMP_SOCK_NAME "/dev/socket/seempdw" +#ifndef __unused +#define __unused __attribute__((__unused__)) +#endif + +static int __write_to_log_init(struct iovec *vec, size_t nr); +static int (*write_to_log)(struct iovec *vec, size_t nr) = __write_to_log_init; +static int logd_fd = -1; + +/* give up, resources too limited */ +static int __write_to_log_null(struct iovec *vec __unused, + size_t nr __unused) +{ + return -1; +} + +/* log_init_lock assumed */ +static int __write_to_log_initialize() +{ + int i, ret = 0; + if (logd_fd >= 0) { + i = logd_fd; + logd_fd = -1; + close(i); + } + + i = socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (i < 0) { + ret = -errno; + write_to_log = __write_to_log_null; + } else if (fcntl(i, F_SETFL, O_NONBLOCK) < 0) { + ret = -errno; + close(i); + i = -1; + write_to_log = __write_to_log_null; + } else { + struct sockaddr_un un; + memset(&un, 0, sizeof(struct sockaddr_un)); + un.sun_family = AF_UNIX; + strlcpy(un.sun_path, SEEMP_SOCK_NAME, sizeof(un.sun_path)); + if (connect(i, (struct sockaddr *)&un, sizeof(struct sockaddr_un)) < 0) { + ret = -errno; + close(i); + i = -1; + } + } + logd_fd = i; + return ret; +} + +static int __write_to_log_socket(struct iovec *vec, size_t nr) +{ + ssize_t ret; + if (logd_fd < 0) { + return -EBADF; + } + + /* + * The write below could be lost, but will never block. + * + * ENOTCONN occurs if logd dies. + * EAGAIN occurs if logd is overloaded. + */ + ret = writev(logd_fd, vec, nr); + if (ret < 0) { + ret = -errno; + if (ret == -ENOTCONN) { + ret = __write_to_log_initialize(); + if (ret < 0) { + return ret; + } + + ret = writev(logd_fd, vec, nr); + if (ret < 0) { + ret = -errno; + } + } + } + + return ret; +} + +static int __write_to_log_init(struct iovec *vec, size_t nr) +{ + if (write_to_log == __write_to_log_init) { + int ret; + + ret = __write_to_log_initialize(); + if (ret < 0) { + return ret; + } + + write_to_log = __write_to_log_socket; + } + return write_to_log(vec, nr); +} + +int __android_seemp_socket_write(int len, const char *msg) +{ + struct iovec vec; + vec.iov_base = (void *) msg; + vec.iov_len = len; + + return write_to_log(&vec, 1); +} + +namespace android { + +/* + * In class android.util.Log: + * public static native int println_native(int buffer, int priority, String tag, String msg) + */ +static jint android_util_SeempLog_println_native(JNIEnv* env, jobject clazz, + jint api, jstring msgObj) +{ + if (msgObj == NULL) { + jniThrowNullPointerException(env, "seemp_println needs a message"); + return -1; + } + + int apiId = (int)api; + int apiIdLen = sizeof(apiId); + int utf8MsgLen = env->GetStringUTFLength(msgObj); + int len = apiIdLen + 1 + utf8MsgLen + 1; + char *msg = (char*)malloc(len); + if ( NULL == msg ) + { + return -1; + } + char *params = msg + apiIdLen + 1; // api_id + encoding byte + params + + *((int*)msg) = apiId; // copy api id + // // skip encoding byte + env->GetStringUTFRegion(msgObj, 0, env->GetStringLength(msgObj), params); // copy message + msg[len - 1] = 0; // copy terminating zero + + int res = __android_seemp_socket_write(len, msg); // send message + + free(msg); + + return res; +} + +/* + * JNI registration. + */ +static JNINativeMethod gMethods[] = { + /* name, signature, funcPtr */ + { "seemp_println_native", "(ILjava/lang/String;)I", + (void*) android_util_SeempLog_println_native }, +}; + +int register_android_util_SeempLog(JNIEnv* env) +{ + jclass clazz = env->FindClass("android/util/SeempLog"); + if (clazz == NULL) { + return -1; + } + + return AndroidRuntime::registerNativeMethods(env, "android/util/SeempLog", gMethods, + NELEM(gMethods)); +} + +}; // namespace android diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp index daa6f82ea12..e6e413d943c 100644 --- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp +++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp @@ -36,7 +36,7 @@ #include #include #include - +#include #define APK_LIB "lib/" #define APK_LIB_LEN (sizeof(APK_LIB) - 1) @@ -55,6 +55,10 @@ #define TMP_FILE_PATTERN "/tmp.XXXXXX" #define TMP_FILE_PATTERN_LEN (sizeof(TMP_FILE_PATTERN) - 1) +#define LIB_UNINIT 0 +#define LIB_INITED_AND_FAIL -1 +#define LIB_INITED_AND_SUCCESS 1 + namespace android { // These match PackageManager.java install codes @@ -70,6 +74,24 @@ enum install_status_t { typedef install_status_t (*iterFunc)(JNIEnv*, void*, ZipFileRO*, ZipEntryRO, const char*); +typedef int (*PGetAssetsStatusFunc) (ZipFileRO*, Vector, const int); +static PGetAssetsStatusFunc GetAssetsStatusFunc = NULL; +static int g_assetLibInit = LIB_UNINIT; + +static int initAssetsVerifierLib() { + if (g_assetLibInit != LIB_UNINIT) return g_assetLibInit; + void* handle = dlopen("libassetsverifier.so", RTLD_NOW); + if (handle != NULL) { + GetAssetsStatusFunc = (PGetAssetsStatusFunc)dlsym(handle, "getAssetsStatus"); + if (GetAssetsStatusFunc != NULL) { + g_assetLibInit = LIB_INITED_AND_SUCCESS; + } else { + g_assetLibInit = LIB_INITED_AND_FAIL; + } + } + return g_assetLibInit; +} + // Equivalent to android.os.FileUtils.isFilenameSafe static bool isFilenameSafe(const char* filename) @@ -478,6 +500,29 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported } } + if(status <= 0) { + // Scan the 'assets' folder only if + // the abi (after scanning the lib folder) + // is not already set to 32-bit (i.e '1' or '2'). + + int asset_status = NO_NATIVE_LIBRARIES; + int rc = initAssetsVerifierLib(); + + if (rc == LIB_INITED_AND_SUCCESS) { + asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis); + } else { + ALOGE("Failed to load assets verifier: %d", rc); + } + if(asset_status >= 0) { + // Override the ABI only if + // 'asset_status' is a valid ABI (64-bit or 32-bit). + // This is to prevent cases where 'lib' folder + // has native libraries, but + // 'assets' folder has none. + status = asset_status; + } + } + for (int i = 0; i < numAbis; ++i) { delete supportedAbis[i]; } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 28933e1045a..b5ee79f3db9 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -77,6 +77,7 @@ + diff --git a/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png new file mode 100644 index 00000000000..17b48668322 Binary files /dev/null and b/core/res/res/drawable-hdpi/ic_lock_power_reboot_alpha.png differ diff --git a/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png new file mode 100644 index 00000000000..471a41c8191 Binary files /dev/null and b/core/res/res/drawable-mdpi/ic_lock_power_reboot_alpha.png differ diff --git a/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png new file mode 100644 index 00000000000..a786b408bb3 Binary files /dev/null and b/core/res/res/drawable-xhdpi/ic_lock_power_reboot_alpha.png differ diff --git a/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png b/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png new file mode 100644 index 00000000000..6072387a435 Binary files /dev/null and b/core/res/res/drawable-xxhdpi/ic_lock_power_reboot_alpha.png differ diff --git a/core/res/res/drawable/ic_lock_power_reboot.xml b/core/res/res/drawable/ic_lock_power_reboot.xml new file mode 100644 index 00000000000..82c79270130 --- /dev/null +++ b/core/res/res/drawable/ic_lock_power_reboot.xml @@ -0,0 +1,33 @@ + + + + + diff --git a/core/res/res/drawable/stat_notify_privacy_guard.xml b/core/res/res/drawable/stat_notify_privacy_guard.xml new file mode 100644 index 00000000000..bcf3a7f3180 --- /dev/null +++ b/core/res/res/drawable/stat_notify_privacy_guard.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/core/res/res/layout/permission_confirmation_dialog.xml b/core/res/res/layout/permission_confirmation_dialog.xml new file mode 100644 index 00000000000..ab5b9fa3a5c --- /dev/null +++ b/core/res/res/layout/permission_confirmation_dialog.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + diff --git a/core/res/res/values-mcc310-mnc004/config.xml b/core/res/res/values-mcc310-mnc004/config.xml index cbe514514e3..60b67d00ca1 100755 --- a/core/res/res/values-mcc310-mnc004/config.xml +++ b/core/res/res/values-mcc310-mnc004/config.xml @@ -39,4 +39,11 @@ true true + + false + + false + diff --git a/core/res/res/values-mcc310-mnc008/config.xml b/core/res/res/values-mcc310-mnc008/config.xml new file mode 100644 index 00000000000..48c98ccda5a --- /dev/null +++ b/core/res/res/values-mcc310-mnc008/config.xml @@ -0,0 +1,33 @@ + + + + + + + + false + + false + + diff --git a/core/res/res/values-mcc310-mnc009/config.xml b/core/res/res/values-mcc310-mnc009/config.xml new file mode 100644 index 00000000000..48c98ccda5a --- /dev/null +++ b/core/res/res/values-mcc310-mnc009/config.xml @@ -0,0 +1,33 @@ + + + + + + + + false + + false + + diff --git a/core/res/res/values-mcc311-mnc480/config.xml b/core/res/res/values-mcc311-mnc480/config.xml index a986b75b9fd..343033d13bc 100755 --- a/core/res/res/values-mcc311-mnc480/config.xml +++ b/core/res/res/values-mcc311-mnc480/config.xml @@ -69,4 +69,10 @@ true true + + false + + false diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml index 8b46ae9fb45..bcfe8074317 100644 --- a/core/res/res/values-zh-rHK/strings.xml +++ b/core/res/res/values-zh-rHK/strings.xml @@ -1517,4 +1517,8 @@ 已選取 %1$d 個項目 已選取 %1$d 個項目 + + 中國移動 + 中國聯通 + 中國電信 diff --git a/core/res/res/values/aospb_arrays.xml b/core/res/res/values/aospb_arrays.xml new file mode 100644 index 00000000000..a428c63898e --- /dev/null +++ b/core/res/res/values/aospb_arrays.xml @@ -0,0 +1,160 @@ + + + + + + + + + @string/app_ops_access_location + + @string/app_ops_access_location + + @string/app_ops_access_location + + @string/app_ops_use_vibrate + + @string/app_ops_read_contacts + + @string/app_ops_modify_contacts + + @string/app_ops_read_call_log + + @string/app_ops_modify_call_log + + @string/app_ops_read_calendar + + @string/app_ops_modify_calendar + + @string/app_ops_scan_wifi + + @string/app_ops_post_notification + + @string/app_ops_access_location + + @string/app_ops_make_phone_call + + @string/app_ops_read_sms + + @string/app_ops_write_sms + ' + @string/app_ops_receive_sms + + @string/app_ops_receive_sms + + @string/app_ops_receive_sms + + @string/app_ops_receive_sms + + @string/app_ops_send_sms + + @string/app_ops_read_sms + + @string/app_ops_write_sms + + @string/app_ops_modify_settings + + @string/app_ops_draw_on_top + + @string/app_ops_access_notifications + + @string/app_ops_access_camera + + @string/app_ops_record_audio + + @string/app_ops_play_audio + + @string/app_ops_read_clipboard + + @string/app_ops_modify_clipboard + + @string/app_ops_use_media_buttons + + @string/app_ops_use_audio_focus + + @string/app_ops_use_master_volume + + @string/app_ops_use_voice_volume + + @string/app_ops_use_ring_volume + + @string/app_ops_use_media_volume + + @string/app_ops_use_alarm_volume + + @string/app_ops_use_notification_volume + + @string/app_ops_use_bluetooth_volume + + @string/app_ops_keep_device_awake + + @string/app_ops_access_location + + @string/app_ops_access_location + + @string/app_ops_get_usage_stats + + @string/app_ops_mute_unmute_microphone + + @string/app_ops_toast_window + + @string/app_ops_project_media + + @string/app_ops_activate_vpn + + @string/app_ops_change_wallpaper + + @string/app_ops_assist_structure + + @string/app_ops_assist_screenshot + + @string/app_ops_read_phone_state + + @string/app_ops_add_voicemail + + @string/app_ops_make_phone_call + + @string/app_ops_make_phone_call + + @string/app_ops_use_fingerprint + + @string/app_ops_use_body_sensors + + @string/app_ops_read_cell_broadcasts + + @string/app_ops_mock_location + + @string/app_ops_read_external_storage + + @string/app_ops_write_external_storage + + @string/app_ops_turn_on_screen + + @string/app_ops_get_accounts + + @string/app_ops_wifi_change + + @string/app_ops_toggle_bluetooth + + @string/app_ops_start_at_bootup + + @string/app_ops_toggle_nfc + + @string/app_ops_toggle_mobile_data + + @string/app_ops_su + + + diff --git a/core/res/res/values/aospb_strings.xml b/core/res/res/values/aospb_strings.xml new file mode 100644 index 00000000000..ee5b8793352 --- /dev/null +++ b/core/res/res/values/aospb_strings.xml @@ -0,0 +1,96 @@ + + + + + + access the camera + access your location + read your notifications + activate a VPN + start at power up + delete your call log + delete your contacts + delete your MMS messages + delete your SMS messages + draw windows on top + get app usage stats + keep your device awake + make a phone call + update your calendar + update the call log + modify the clipboard + update your contacts + update system settings + mute/unmute the microphone + play audio + post a notification + project media + read your calendar + read the call log + read the clipboard + read your contacts + read your MMS messages + read your SMS messages + receive an SMS message + record audio + send an MMS message + send an SMS message + start at power up + display toast messages + toggle Bluetooth + toggle mobile data + toggle NFC + toggle WiFi + control alarm volume + control the audio focus + control the Bluetooth volume + control the master volume + use the media buttons + control the media volume + control the notification volume + control the ringtone volume + use haptic feedback + control the voice call volume + write an MMS message + write an SMS message + use fingerprint + add a voicemail + access phone state + Scan WiFi Networks + change the wallpaper + use assist structure + take a screenshot + use body sensors + read cell broadcasts + mock your location + read external storage + write external storage + turn the screen on + get device accounts + change WiFI state + get Superuser access + + + enable or disable Privacy Guard + Allows the app to change whether another app runs with Privacy Guard. When an app is running with Privacy Guard, it will not have access to personal data such as contacts, call logs, or messages. + Privacy Guard active + %1$s will not be able to access personal data + Privacy Guard + %1$s would like to %2$s. + + diff --git a/core/res/res/values/aospb_symbols.xml b/core/res/res/values/aospb_symbols.xml new file mode 100644 index 00000000000..3775bcc993f --- /dev/null +++ b/core/res/res/values/aospb_symbols.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + diff --git a/core/res/res/values/bools.xml b/core/res/res/values/bools.xml index 7c63950a9ae..0d33a5198a3 100644 --- a/core/res/res/values/bools.xml +++ b/core/res/res/values/bools.xml @@ -29,4 +29,8 @@ false + + true + + false diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index f76dfb2609c..212747c914f 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -30,6 +30,7 @@ cast hotspot location + su bluetooth nfc tty @@ -537,6 +538,9 @@ 0 + + true + false @@ -1217,6 +1221,11 @@ --> + + @null + + @null + true @@ -1759,6 +1768,9 @@ 524288,1048576,2097152,262144,524288,1048576 + + true + false + + false + + + true + + true + 1 @@ -2365,4 +2389,47 @@ + + + CHINA\u0020\u0020MOBILE + CMCC + CHN-UNICOM + China Mobile + China Unicom + China Telecom + 中国移动 + 中国联通 + 中国电信 + 中國移動 + 中國聯通 + 中國電信 + Searching for Service + + + + China_Mobile + China_Mobile + China_Unicom + China_Mobile + China_Unicom + China_Telecom + China_Mobile + China_Unicom + China_Telecom + China_Mobile + China_Unicom + China_Telecom + roamingTextSearching + + + + false + + + false + + + 2G + 3G + 4G diff --git a/core/res/res/values/customize.xml b/core/res/res/values/customize.xml new file mode 100644 index 00000000000..c483dab1c09 --- /dev/null +++ b/core/res/res/values/customize.xml @@ -0,0 +1,66 @@ + + + + + + + + + + false + + + + + + + + + + + + false + + 4 + + + + + + + + false + diff --git a/core/res/res/values/qcom_strings.xml b/core/res/res/values/qcom_strings.xml new file mode 100644 index 00000000000..40e35636c6b --- /dev/null +++ b/core/res/res/values/qcom_strings.xml @@ -0,0 +1,23 @@ + + + + + Remember + Permission + diff --git a/core/res/res/values/qcom_symbols.xml b/core/res/res/values/qcom_symbols.xml new file mode 100755 index 00000000000..c9223973969 --- /dev/null +++ b/core/res/res/values/qcom_symbols.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 0793905860c..cd6db4e49ba 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -265,6 +265,8 @@ Cellular preferred Wi-Fi only + + %s + Reboot + + + Your tablet will reboot. + Your phone will reboot. + Power off + + Reboot + Bug report @@ -3147,6 +3160,9 @@ Tethering or hotspot active Touch to set up. + No connected device + %1$s connected device + %1$s connected devices Back @@ -4109,4 +4125,9 @@ %1$d selected %1$d selected + + + China Mobile + China Unicom + China Telecom diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index e709500b14e..6d5ede96e58 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -297,6 +297,7 @@ + @@ -360,6 +361,7 @@ + @@ -826,8 +828,10 @@ + + @@ -1107,6 +1111,7 @@ + @@ -1491,6 +1496,7 @@ + @@ -1560,6 +1566,7 @@ + @@ -1753,6 +1760,8 @@ + + @@ -1803,6 +1812,9 @@ + + + @@ -2342,4 +2354,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index e1ebdbb65a2..2b2c7ef921f 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -30,6 +30,7 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.util.AttributeSet; +import android.util.LayoutDirection; import java.io.IOException; @@ -182,8 +183,13 @@ public void applyTheme(Theme t) { public boolean getPadding(Rect padding) { final boolean pad = super.getPadding(padding); - padding.left += mState.mInsetLeft; - padding.right += mState.mInsetRight; + if (needMirroring()) { + padding.left += mState.mInsetRight; + padding.right += mState.mInsetLeft; + } else { + padding.left += mState.mInsetLeft; + padding.right += mState.mInsetRight; + } padding.top += mState.mInsetTop; padding.bottom += mState.mInsetBottom; @@ -217,9 +223,9 @@ protected void onBoundsChange(Rect bounds) { final Rect r = mTmpRect; r.set(bounds); - r.left += mState.mInsetLeft; + r.left += (needMirroring() ? mState.mInsetRight : mState.mInsetLeft); r.top += mState.mInsetTop; - r.right -= mState.mInsetRight; + r.right -= (needMirroring() ? mState.mInsetLeft : mState.mInsetRight); r.bottom -= mState.mInsetBottom; // Apply inset bounds to the wrapped drawable. @@ -279,5 +285,10 @@ private InsetDrawable(InsetState state, Resources res) { mState = state; } + + private boolean needMirroring() { + return getDrawable() != null && getDrawable().isAutoMirrored() && + getDrawable().getLayoutDirection() == LayoutDirection.RTL; + } } diff --git a/include/SeempLog.h b/include/SeempLog.h new file mode 100644 index 00000000000..30ae338b7e3 --- /dev/null +++ b/include/SeempLog.h @@ -0,0 +1,51 @@ +/* + +Copyright (c) 2015, The Linux Foundation. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include + +#define SEEMPLOG_RECORD(api, params) \ + static bool shouldTryLoad = true; \ + static void (*seemp_log_record_func)(int type, const char* msg) = NULL; \ + \ + if (shouldTryLoad) { \ + shouldTryLoad = false; \ + void* libhandle = dlopen("libSeemplog.so", RTLD_NOW); \ + if (libhandle != NULL) { \ + *(void**)(&seemp_log_record_func) = \ + dlsym(libhandle, "seemp_log_record"); \ + } \ + } \ + if (seemp_log_record_func) \ + seemp_log_record_func(api, params); + + + diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h index 0cfd2b103d2..0cfc2700aab 100644 --- a/include/androidfw/AssetManager.h +++ b/include/androidfw/AssetManager.h @@ -280,7 +280,7 @@ class AssetManager : public AAssetManager { const ResTable* getResTable(bool required = true) const; void setLocaleLocked(const char* locale); void updateResourceParamsLocked() const; - bool appendPathToResTable(const asset_path& ap) const; + bool appendPathToResTable(const asset_path& ap, size_t* entryIdx) const; Asset* openIdmapLocked(const struct asset_path& ap) const; diff --git a/include/private/time_genoff.h b/include/private/time_genoff.h new file mode 100644 index 00000000000..4df5680e0ab --- /dev/null +++ b/include/private/time_genoff.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Linux Foundation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef __TIME_GENOFF_H__ +#define __TIME_GENOFF_H__ + +/* + * Time genoff base -- To be used by the time setter + * Reserved bases to be supported later. + */ +typedef enum time_bases { + ATS_RTC = 0, + ATS_TOD, + ATS_USER, + ATS_SECURE, + ATS_RESERVED_1, + ATS_RESERVED_2, + ATS_RESERVED_3, + ATS_GPS, + ATS_1X, + ATS_RESERVED_4, + ATS_WCDMA, + ATS_SNTP, + ATS_UTC, + ATS_MFLO, + ATS_INVALID +} time_bases_type; + +/* Time unit -- Unit in which time is set/get */ +typedef enum time_unit { + TIME_STAMP, /* Not supported */ + TIME_MSEC, + TIME_SECS, + TIME_JULIAN, + TIME_20MS_FRAME, /* Not supported */ + TIME_INVALID +} time_unit_type; + +/* Operation to be done */ +typedef enum time_genoff_opr { + T_SET, + T_GET, + T_MAX +} time_genoff_opr_type; + +/* Structure to be passed as argument to time_genoff_operation() */ +/* + * In set/get: ts_val should be assigned memory and then passed. + * if time_unit = TIME_MSEC, TIME_SECS then ts_val = (uint64_t *) + * if time_unit = TIME_JULIAN then ts_val = (struct tm *) + */ +typedef struct time_genoff_info { + time_bases_type base; /* Genoff in consideration */ + void *ts_val; /* Time to be set/get */ + time_unit_type unit; /* Time unit */ + time_genoff_opr_type operation; /* Time operation to be done */ +}time_genoff_info_type; + +/* API to be called for time get/set operation */ +int time_genoff_operation(time_genoff_info_type *pargs); + +#endif /* __TIME_GENOFF_H__ */ diff --git a/include/storage/IMountService.h b/include/storage/IMountService.h index c3d34d84958..b04be8aa2c2 100644 --- a/include/storage/IMountService.h +++ b/include/storage/IMountService.h @@ -71,6 +71,7 @@ class IMountService: public IInterface { virtual bool getMountedObbPath(const String16& filename, String16& path) = 0; virtual int32_t decryptStorage(const String16& password) = 0; virtual int32_t encryptStorage(const String16& password) = 0; + virtual int32_t encryptWipeStorage(const String16& password) = 0; }; // ---------------------------------------------------------------------------- diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 2dc1c96259c..4f62204fe78 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -224,6 +224,11 @@ bool AssetManager::addAssetPath(const String8& path, int32_t* cookie) mAssetPaths.add(ap); + if (mResources != NULL) { + size_t index = mAssetPaths.size() - 1; + appendPathToResTable(ap, &index); + } + // new paths are always added at the end if (cookie) { *cookie = static_cast(mAssetPaths.size()); @@ -237,10 +242,6 @@ bool AssetManager::addAssetPath(const String8& path, int32_t* cookie) } #endif - if (mResources != NULL) { - appendPathToResTable(ap); - } - return true; } @@ -303,7 +304,8 @@ bool AssetManager::addOverlayPath(const String8& packagePath, int32_t* cookie) *cookie = static_cast(mAssetPaths.size()); if (mResources != NULL) { - appendPathToResTable(oap); + size_t index = mAssetPaths.size() - 1; + appendPathToResTable(oap, &index); } return true; @@ -610,7 +612,7 @@ FileType AssetManager::getFileType(const char* fileName) return kFileTypeRegular; } -bool AssetManager::appendPathToResTable(const asset_path& ap) const { +bool AssetManager::appendPathToResTable(const asset_path& ap, size_t* entryIdx) const { // skip those ap's that correspond to system overlays if (ap.isSystemOverlay) { return true; @@ -622,17 +624,16 @@ bool AssetManager::appendPathToResTable(const asset_path& ap) const { bool onlyEmptyResources = true; MY_TRACE_BEGIN(ap.path.string()); Asset* idmap = openIdmapLocked(ap); - size_t nextEntryIdx = mResources->getTableCount(); ALOGV("Looking for resource asset in '%s'\n", ap.path.string()); if (ap.type != kFileTypeDirectory) { - if (nextEntryIdx == 0) { + if (*entryIdx == 0) { // The first item is typically the framework resources, // which we want to avoid parsing every time. sharedRes = const_cast(this)-> mZipSet.getZipResourceTable(ap.path); if (sharedRes != NULL) { // skip ahead the number of system overlay packages preloaded - nextEntryIdx = sharedRes->getTableCount(); + *entryIdx += sharedRes->getTableCount() - 1; } } if (sharedRes == NULL) { @@ -650,20 +651,20 @@ bool AssetManager::appendPathToResTable(const asset_path& ap) const { } } - if (nextEntryIdx == 0 && ass != NULL) { + if (*entryIdx == 0 && ass != NULL) { // If this is the first resource table in the asset // manager, then we are going to cache it so that we // can quickly copy it out for others. ALOGV("Creating shared resources for %s", ap.path.string()); sharedRes = new ResTable(); - sharedRes->add(ass, idmap, nextEntryIdx + 1, false); + sharedRes->add(ass, idmap, *entryIdx + 1, false); #ifdef HAVE_ANDROID_OS const char* data = getenv("ANDROID_DATA"); LOG_ALWAYS_FATAL_IF(data == NULL, "ANDROID_DATA not set"); String8 overlaysListPath(data); overlaysListPath.appendPath(kResourceCache); overlaysListPath.appendPath("overlays.list"); - addSystemOverlays(overlaysListPath.string(), ap.path, sharedRes, nextEntryIdx); + addSystemOverlays(overlaysListPath.string(), ap.path, sharedRes, *entryIdx); #endif sharedRes = const_cast(this)-> mZipSet.setZipResourceTable(ap.path, sharedRes); @@ -685,7 +686,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap) const { mResources->add(sharedRes); } else { ALOGV("Parsing resources for %s", ap.path.string()); - mResources->add(ass, idmap, nextEntryIdx + 1, !shared); + mResources->add(ass, idmap, *entryIdx + 1, !shared); } onlyEmptyResources = false; @@ -694,7 +695,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap) const { } } else { ALOGV("Installing empty resources in to table %p\n", mResources); - mResources->addEmpty(nextEntryIdx + 1); + mResources->addEmpty(*entryIdx + 1); } if (idmap != NULL) { @@ -734,7 +735,7 @@ const ResTable* AssetManager::getResTable(bool required) const bool onlyEmptyResources = true; const size_t N = mAssetPaths.size(); for (size_t i=0; i @@ -551,6 +552,23 @@ class BpMountService: public BpInterface } return reply.readInt32(); } + + int32_t encryptWipeStorage(const String16& password) + { + Parcel data, reply; + data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); + data.writeString16(password); + if (remote()->transact(TRANSACTION_encryptWipeStorage, data, &reply) != NO_ERROR) { + ALOGD("encryptWipeStorage could not contact remote\n"); + return -1; + } + int32_t err = reply.readExceptionCode(); + if (err < 0) { + ALOGD("encryptWipeStorage caught exception %d\n", err); + return err; + } + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(MountService, "IMountService") diff --git a/location/java/android/location/GeoFenceParams.aidl b/location/java/android/location/GeoFenceParams.aidl new file mode 100644 index 00000000000..3e9be4c37e8 --- /dev/null +++ b/location/java/android/location/GeoFenceParams.aidl @@ -0,0 +1,23 @@ +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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.location; + +parcelable GeoFenceParams; diff --git a/location/java/android/location/GeoFenceParams.java b/location/java/android/location/GeoFenceParams.java new file mode 100644 index 00000000000..aa6e2450c2c --- /dev/null +++ b/location/java/android/location/GeoFenceParams.java @@ -0,0 +1,132 @@ +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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.location; + +import android.app.PendingIntent; +import android.os.Binder; +import android.os.Parcel; +import android.os.Parcelable; +import java.io.PrintWriter; + +/** + * GeoFenceParams for internal use + * {@hide} + */ +public class GeoFenceParams implements Parcelable { + public static final int ENTERING = 1; + public static final int LEAVING = 2; + public final int mUid; + public final double mLatitude; + public final double mLongitude; + public final float mRadius; + public final long mExpiration; + public final PendingIntent mIntent; + public final String mPackageName; + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public GeoFenceParams createFromParcel(Parcel in) { + return new GeoFenceParams(in); + } + + @Override + public GeoFenceParams[] newArray(int size) { + return new GeoFenceParams[size]; + } + }; + + public GeoFenceParams(double lat, double lon, float r, + long expire, PendingIntent intent, String packageName) { + this(Binder.getCallingUid(), lat, lon, r, expire, intent, packageName); + } + + public GeoFenceParams(int uid, double lat, double lon, float r, + long expire, PendingIntent intent, String packageName) { + mUid = uid; + mLatitude = lat; + mLongitude = lon; + mRadius = r; + mExpiration = expire; + mIntent = intent; + mPackageName = packageName; + } + + private GeoFenceParams(Parcel in) { + mUid = in.readInt(); + mLatitude = in.readDouble(); + mLongitude = in.readDouble(); + mRadius = in.readFloat(); + mExpiration = in.readLong(); + mIntent = in.readParcelable(null); + mPackageName = in.readString(); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(mUid); + dest.writeDouble(mLatitude); + dest.writeDouble(mLongitude); + dest.writeFloat(mRadius); + dest.writeLong(mExpiration); + dest.writeParcelable(mIntent, 0); + dest.writeString(mPackageName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("GeoFenceParams:\n\tmUid - "); + sb.append(mUid); + sb.append("\n\tmLatitide - "); + sb.append(mLatitude); + sb.append("\n\tmLongitude - "); + sb.append(mLongitude); + sb.append("\n\tmRadius - "); + sb.append(mRadius); + sb.append("\n\tmExpiration - "); + sb.append(mExpiration); + sb.append("\n\tmIntent - "); + sb.append(mIntent); + return sb.toString(); + } + + public long getExpiration() { + return mExpiration; + } + + public PendingIntent getIntent() { + return mIntent; + } + + public int getCallerUid() { + return mUid; + } + + public void dump(PrintWriter pw, String prefix) { + pw.println(prefix + this); + pw.println(prefix + "mLatitude=" + mLatitude + " mLongitude=" + mLongitude); + pw.println(prefix + "mRadius=" + mRadius + " mExpiration=" + mExpiration); + } +} diff --git a/core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl b/location/java/android/location/IGeoFenceListener.aidl old mode 100755 new mode 100644 similarity index 60% rename from core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl rename to location/java/android/location/IGeoFenceListener.aidl index 96c59e23915..ccec143fafa --- a/core/java/android/bluetooth/IBluetoothProfileServiceConnection.aidl +++ b/location/java/android/location/IGeoFenceListener.aidl @@ -1,5 +1,9 @@ -/* - * Copyright (C) 2014 The Android Open Source Project +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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. @@ -14,17 +18,13 @@ * limitations under the License. */ -package android.bluetooth; +package android.location; -import android.content.ComponentName; -import android.os.IBinder; +import android.app.PendingIntent; /** - * Callback for bluetooth profile connections. - * * {@hide} */ -interface IBluetoothProfileServiceConnection { - void onServiceConnected(in ComponentName comp, in IBinder service); - void onServiceDisconnected(in ComponentName comp); +oneway interface IGeoFenceListener { + void geoFenceExpired(in PendingIntent intent); } diff --git a/location/java/android/location/IGeoFencer.aidl b/location/java/android/location/IGeoFencer.aidl new file mode 100644 index 00000000000..d576c6e8781 --- /dev/null +++ b/location/java/android/location/IGeoFencer.aidl @@ -0,0 +1,33 @@ +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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.location; + +import android.location.GeoFenceParams; +import android.app.PendingIntent; + +/** + * {@hide} + */ +interface IGeoFencer { + boolean setGeoFence(in IBinder who, in GeoFenceParams params); + void clearGeoFence(in IBinder who, in PendingIntent fence); + void clearGeoFenceUser(int uid); +} diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 2c193243958..4544814a53a 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -456,6 +456,7 @@ public String getBestProvider(Criteria criteria, boolean enabledOnly) { @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) { + android.util.SeempLog.record(47); checkProvider(provider); checkListener(listener); @@ -488,6 +489,7 @@ public void requestLocationUpdates(String provider, long minTime, float minDista @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper) { + android.util.SeempLog.record(47); checkProvider(provider); checkListener(listener); @@ -521,6 +523,7 @@ public void requestLocationUpdates(String provider, long minTime, float minDista @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long minTime, float minDistance, Criteria criteria, LocationListener listener, Looper looper) { + android.util.SeempLog.record(47); checkCriteria(criteria); checkListener(listener); @@ -549,6 +552,7 @@ public void requestLocationUpdates(long minTime, float minDistance, Criteria cri @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestLocationUpdates(String provider, long minTime, float minDistance, PendingIntent intent) { + android.util.SeempLog.record(47); checkProvider(provider); checkPendingIntent(intent); @@ -651,6 +655,7 @@ public void requestLocationUpdates(String provider, long minTime, float minDista @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long minTime, float minDistance, Criteria criteria, PendingIntent intent) { + android.util.SeempLog.record(47); checkCriteria(criteria); checkPendingIntent(intent); @@ -680,6 +685,7 @@ public void requestLocationUpdates(long minTime, float minDistance, Criteria cri */ @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestSingleUpdate(String provider, LocationListener listener, Looper looper) { + android.util.SeempLog.record(64); checkProvider(provider); checkListener(listener); @@ -710,6 +716,7 @@ public void requestSingleUpdate(String provider, LocationListener listener, Loop */ @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestSingleUpdate(Criteria criteria, LocationListener listener, Looper looper) { + android.util.SeempLog.record(64); checkCriteria(criteria); checkListener(listener); @@ -733,6 +740,7 @@ public void requestSingleUpdate(Criteria criteria, LocationListener listener, Lo */ @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestSingleUpdate(String provider, PendingIntent intent) { + android.util.SeempLog.record(64); checkProvider(provider); checkPendingIntent(intent); @@ -757,6 +765,7 @@ public void requestSingleUpdate(String provider, PendingIntent intent) { */ @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void requestSingleUpdate(Criteria criteria, PendingIntent intent) { + android.util.SeempLog.record(64); checkCriteria(criteria); checkPendingIntent(intent); @@ -825,6 +834,7 @@ public void requestSingleUpdate(Criteria criteria, PendingIntent intent) { @SystemApi public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { + android.util.SeempLog.record(47); checkListener(listener); requestLocationUpdates(request, listener, looper, null); } @@ -852,6 +862,7 @@ public void requestLocationUpdates(LocationRequest request, LocationListener lis */ @SystemApi public void requestLocationUpdates(LocationRequest request, PendingIntent intent) { + android.util.SeempLog.record(47); checkPendingIntent(intent); requestLocationUpdates(request, null, null, intent); } @@ -870,6 +881,7 @@ private ListenerTransport wrapListener(LocationListener listener, Looper looper) private void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper, PendingIntent intent) { + android.util.SeempLog.record(47); String packageName = mContext.getPackageName(); @@ -978,6 +990,7 @@ public void removeUpdates(PendingIntent intent) { @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public void addProximityAlert(double latitude, double longitude, float radius, long expiration, PendingIntent intent) { + android.util.SeempLog.record(45); checkPendingIntent(intent); if (expiration < 0) expiration = Long.MAX_VALUE; @@ -1191,6 +1204,7 @@ public Location getLastLocation() { */ @RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION}) public Location getLastKnownLocation(String provider) { + android.util.SeempLog.record(46); checkProvider(provider); String packageName = mContext.getPackageName(); LocationRequest request = LocationRequest.createFromDeprecatedProvider( @@ -1511,6 +1525,7 @@ public void handleMessage(Message msg) { */ @RequiresPermission(ACCESS_FINE_LOCATION) public boolean addGpsStatusListener(GpsStatus.Listener listener) { + android.util.SeempLog.record(43); boolean result; if (mGpsStatusListeners.get(listener) != null) { @@ -1558,6 +1573,7 @@ public void removeGpsStatusListener(GpsStatus.Listener listener) { */ @RequiresPermission(ACCESS_FINE_LOCATION) public boolean addNmeaListener(GpsStatus.NmeaListener listener) { + android.util.SeempLog.record(44); boolean result; if (mNmeaListeners.get(listener) != null) { @@ -1676,6 +1692,7 @@ public GpsStatus getGpsStatus(GpsStatus status) { * @return true if the command succeeds. */ public boolean sendExtraCommand(String provider, String command, Bundle extras) { + android.util.SeempLog.record(48); try { return mService.sendExtraCommand(provider, command, extras); } catch (RemoteException e) { diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java index bde3d196c37..962316b6845 100644 --- a/media/java/android/media/AudioFormat.java +++ b/media/java/android/media/AudioFormat.java @@ -252,6 +252,30 @@ public class AudioFormat { * */ public static final int ENCODING_AAC_HE_V2 = 12; + /** Audio data format: AMRNB + * @hide + * */ + public static final int ENCODING_AMRNB = 100; + /** Audio data format: AMRWB + * @hide + * */ + public static final int ENCODING_AMRWB = 101; + /** Audio data format: EVRC + * @hide + * */ + public static final int ENCODING_EVRC = 102; + /** Audio data format: EVRCB + * @hide + * */ + public static final int ENCODING_EVRCB = 103; + /** Audio data format: EVRCWB + * @hide + * */ + public static final int ENCODING_EVRCWB = 104; + /** Audio data format: EVRCNW + * @hide + * */ + public static final int ENCODING_EVRCNW = 105; /** Invalid audio channel configuration */ /** @deprecated Use {@link #CHANNEL_INVALID} instead. */ @Deprecated public static final int CHANNEL_CONFIGURATION_INVALID = 0; @@ -409,6 +433,11 @@ public static int convertNativeChannelMaskToOutMask(int nativeMask) { public static final int CHANNEL_IN_STEREO = (CHANNEL_IN_LEFT | CHANNEL_IN_RIGHT); /** @hide */ public static final int CHANNEL_IN_FRONT_BACK = CHANNEL_IN_FRONT | CHANNEL_IN_BACK; + /** @hide */ + public static final int CHANNEL_IN_5POINT1 = (CHANNEL_IN_LEFT | + CHANNEL_IN_RIGHT | CHANNEL_IN_FRONT | CHANNEL_IN_BACK | + CHANNEL_IN_LEFT_PROCESSED | CHANNEL_IN_RIGHT_PROCESSED); + // CHANNEL_IN_ALL is not yet defined; if added then it should match AUDIO_CHANNEL_IN_ALL /** @hide */ @@ -422,6 +451,15 @@ public static int getBytesPerSample(int audioFormat) return 2; case ENCODING_PCM_FLOAT: return 4; + case ENCODING_AMRNB: + return 32; + case ENCODING_AMRWB: + return 61; + case ENCODING_EVRC: + case ENCODING_EVRCB: + case ENCODING_EVRCWB: + case ENCODING_EVRCNW: + return 23; case ENCODING_INVALID: default: throw new IllegalArgumentException("Bad audio format " + audioFormat); @@ -443,6 +481,12 @@ public static boolean isValidEncoding(int audioFormat) case ENCODING_AAC_LC: case ENCODING_AAC_HE_V1: case ENCODING_AAC_HE_V2: + case ENCODING_AMRNB: + case ENCODING_AMRWB: + case ENCODING_EVRC: + case ENCODING_EVRCB: + case ENCODING_EVRCWB: + case ENCODING_EVRCNW: return true; default: return false; @@ -483,6 +527,12 @@ public static boolean isEncodingLinearPcm(int audioFormat) case ENCODING_AAC_LC: case ENCODING_AAC_HE_V1: case ENCODING_AAC_HE_V2: + case ENCODING_AMRNB: + case ENCODING_AMRWB: + case ENCODING_EVRC: + case ENCODING_EVRCB: + case ENCODING_EVRCWB: + case ENCODING_EVRCNW: return false; case ENCODING_INVALID: default: @@ -715,6 +765,12 @@ public Builder setEncoding(@Encoding int encoding) throws IllegalArgumentExcepti case ENCODING_E_AC3: case ENCODING_DTS: case ENCODING_DTS_HD: + case ENCODING_AMRNB: + case ENCODING_AMRWB: + case ENCODING_EVRC: + case ENCODING_EVRCB: + case ENCODING_EVRCWB: + case ENCODING_EVRCNW: mEncoding = encoding; break; case ENCODING_INVALID: @@ -859,7 +915,13 @@ public String toString () { ENCODING_AC3, ENCODING_E_AC3, ENCODING_DTS, - ENCODING_DTS_HD + ENCODING_DTS_HD, + ENCODING_AMRNB, + ENCODING_AMRWB, + ENCODING_EVRC, + ENCODING_EVRCB, + ENCODING_EVRCWB, + ENCODING_EVRCNW }) @Retention(RetentionPolicy.SOURCE) public @interface Encoding {} diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 875e7165fa8..fc917f6c18b 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -67,7 +67,6 @@ public class AudioManager { private final boolean mUseFixedVolume; private static String TAG = "AudioManager"; private static final AudioPortEventHandler sAudioPortEventHandler = new AudioPortEventHandler(); - /** * Broadcast intent, a hint for applications that audio is about to become * 'noisy' due to a change in audio outputs. For example, this intent may @@ -310,6 +309,32 @@ public class AudioManager { */ public static final String EXTRA_ENCODINGS = "android.media.extra.ENCODINGS"; + /** + * @hide Broadcast intent when RemoteControlClient list is updated. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String RCC_CHANGED_ACTION = + "org.codeaurora.bluetooth.RCC_CHANGED_ACTION"; + + /** + * @hide Used for sharing the calling package name + */ + public static final String EXTRA_CALLING_PACKAGE_NAME = + "org.codeaurora.bluetooth.EXTRA_CALLING_PACKAGE_NAME"; + + /** + * @hide Used for sharing the focus changed value + */ + public static final String EXTRA_FOCUS_CHANGED_VALUE = + "org.codeaurora.bluetooth.EXTRA_FOCUS_CHANGED_VALUE"; + + /** + * @hide Used for sharing the availability changed value + */ + public static final String EXTRA_AVAILABLITY_CHANGED_VALUE = + "org.codeaurora.bluetooth.EXTRA_AVAILABLITY_CHANGED_VALUE"; + + /** The audio stream for phone calls */ public static final int STREAM_VOICE_CALL = AudioSystem.STREAM_VOICE_CALL; /** The audio stream for system sounds */ @@ -2481,6 +2506,7 @@ public int abandonAudioFocus(OnAudioFocusChangeListener l, AudioAttributes aa) { //==================================================================== // Remote Control + /** * Register a component to be the sole receiver of MEDIA_BUTTON intents. * @param eventReceiver identifier of a {@link android.content.BroadcastReceiver} @@ -2499,6 +2525,7 @@ public void registerMediaButtonEventReceiver(ComponentName eventReceiver) { "receiver and context package names don't match"); return; } + // construct a PendingIntent for the media button and register it Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); // the associated intent will be handled by the component being registered @@ -2508,6 +2535,7 @@ public void registerMediaButtonEventReceiver(ComponentName eventReceiver) { registerMediaButtonIntent(pi, eventReceiver); } + /** * Register a component to be the sole receiver of MEDIA_BUTTON intents. This is like * {@link #registerMediaButtonEventReceiver(android.content.ComponentName)}, but allows @@ -2637,6 +2665,13 @@ public boolean registerRemoteController(RemoteController rctlr) { return false; } rctlr.startListeningToSessions(); + IAudioService service = getService(); + try { + service.updateRemoteControllerOnExistingMediaPlayers(); + } catch (RemoteException e) { + Log.e(TAG, "Error in calling Audio service interface" + + "updateRemoteControllerOnExistingMediaPlayers() due to " + e); + } return true; } @@ -2658,6 +2693,24 @@ public void unregisterRemoteController(RemoteController rctlr) { rctlr.stopListeningToSessions(); } + /** + * @hide + */ + public void updateMediaPlayerList(String packageName, boolean toAdd) { + IAudioService service = getService(); + try { + if (toAdd) { + Log.d(TAG, "updateMediaPlayerList: Add RCC " + packageName + " to List"); + service.addMediaPlayerAndUpdateRemoteController(packageName); + } else { + Log.d(TAG, "updateMediaPlayerList: Remove RCC " + packageName + " from List"); + service.removeMediaPlayerAndUpdateRemoteController(packageName); + } + } catch (RemoteException e) { + Log.e(TAG, "Exception while executing updateMediaPlayerList: " + e); + } + } + /** * @hide * Registers a remote control display that will be sent information by remote control clients. @@ -2811,6 +2864,52 @@ public void unregisterAudioPolicyAsync(@NonNull AudioPolicy policy) { } } + /** + * @hide + * Request the user of a RemoteControlClient to play the requested item. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + * @param uid uid of the song to be played. + * @scope scope of the file system to use + */ + public void setRemoteControlClientPlayItem(long uid, int scope) { + IAudioService service = getService(); + try { + service.setRemoteControlClientPlayItem(uid, scope); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in setRemoteControlClientPlayItem(" + + uid + ", " + scope + ")", e); + } + } + + /** + * @hide + * Request the user of a RemoteControlClient to provide with the now playing list entries. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + */ + public void getRemoteControlClientNowPlayingEntries() { + IAudioService service = getService(); + try { + service.getRemoteControlClientNowPlayingEntries(); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in getRemoteControlClientNowPlayingEntries(" + ")", e); + } + } + + /** + * @hide + * Request the user of a RemoteControlClient to set the music player as current browsed player. + */ + public void setRemoteControlClientBrowsedPlayer() { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer: "); + IAudioService service = getService(); + try { + service.setRemoteControlClientBrowsedPlayer(); + } catch (RemoteException e) { + Log.e(TAG, "Dead object in setRemoteControlClientBrowsedPlayer(" + ")", e); + } + } /** * @hide diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java index 974b62e117b..ecd4881473b 100644 --- a/media/java/android/media/AudioRecord.java +++ b/media/java/android/media/AudioRecord.java @@ -643,6 +643,12 @@ private void audioParamCheck(int audioSource, int sampleRateInHz, int audioForma case AudioFormat.ENCODING_PCM_FLOAT: case AudioFormat.ENCODING_PCM_16BIT: case AudioFormat.ENCODING_PCM_8BIT: + case AudioFormat.ENCODING_AMRNB: + case AudioFormat.ENCODING_AMRWB: + case AudioFormat.ENCODING_EVRC: + case AudioFormat.ENCODING_EVRCB: + case AudioFormat.ENCODING_EVRCWB: + case AudioFormat.ENCODING_EVRCNW: mAudioFormat = audioFormat; break; default: @@ -845,6 +851,9 @@ static public int getMinBufferSize(int sampleRateInHz, int channelConfig, int au case (AudioFormat.CHANNEL_IN_FRONT | AudioFormat.CHANNEL_IN_BACK): channelCount = 2; break; + case AudioFormat.CHANNEL_IN_5POINT1: + channelCount = 6; + break; case AudioFormat.CHANNEL_INVALID: default: loge("getMinBufferSize(): Invalid channel configuration."); @@ -881,6 +890,7 @@ public int getAudioSessionId() { */ public void startRecording() throws IllegalStateException { + android.util.SeempLog.record(70); if (mState != STATE_INITIALIZED) { throw new IllegalStateException("startRecording() called on an " + "uninitialized AudioRecord."); @@ -904,6 +914,7 @@ public void startRecording() */ public void startRecording(MediaSyncEvent syncEvent) throws IllegalStateException { + android.util.SeempLog.record(70); if (mState != STATE_INITIALIZED) { throw new IllegalStateException("startRecording() called on an " + "uninitialized AudioRecord."); diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java index c59d1c7b999..927cd87152b 100644 --- a/media/java/android/media/AudioSystem.java +++ b/media/java/android/media/AudioSystem.java @@ -319,7 +319,7 @@ private static void dynamicPolicyCallbackFromNative(int event, String regId, int public static final int DEVICE_OUT_AUX_LINE = 0x200000; public static final int DEVICE_OUT_SPEAKER_SAFE = 0x400000; public static final int DEVICE_OUT_IP = 0x800000; - + public static final int DEVICE_OUT_PROXY = 0x1000000; public static final int DEVICE_OUT_DEFAULT = DEVICE_BIT_DEFAULT; public static final int DEVICE_OUT_ALL = (DEVICE_OUT_EARPIECE | @@ -346,6 +346,7 @@ private static void dynamicPolicyCallbackFromNative(int event, String regId, int DEVICE_OUT_AUX_LINE | DEVICE_OUT_SPEAKER_SAFE | DEVICE_OUT_IP | + DEVICE_OUT_PROXY | DEVICE_OUT_DEFAULT); public static final int DEVICE_OUT_ALL_A2DP = (DEVICE_OUT_BLUETOOTH_A2DP | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | @@ -385,6 +386,7 @@ private static void dynamicPolicyCallbackFromNative(int event, String regId, int public static final int DEVICE_IN_BLUETOOTH_A2DP = DEVICE_BIT_IN | 0x20000; public static final int DEVICE_IN_LOOPBACK = DEVICE_BIT_IN | 0x40000; public static final int DEVICE_IN_IP = DEVICE_BIT_IN | 0x80000; + public static final int DEVICE_IN_PROXY = DEVICE_BIT_IN | 0x1000000; public static final int DEVICE_IN_DEFAULT = DEVICE_BIT_IN | DEVICE_BIT_DEFAULT; public static final int DEVICE_IN_ALL = (DEVICE_IN_COMMUNICATION | @@ -407,6 +409,7 @@ private static void dynamicPolicyCallbackFromNative(int event, String regId, int DEVICE_IN_BLUETOOTH_A2DP | DEVICE_IN_LOOPBACK | DEVICE_IN_IP | + DEVICE_IN_PROXY | DEVICE_IN_DEFAULT); public static final int DEVICE_IN_ALL_SCO = DEVICE_IN_BLUETOOTH_SCO_HEADSET; public static final int DEVICE_IN_ALL_USB = (DEVICE_IN_USB_ACCESSORY | @@ -442,6 +445,7 @@ private static void dynamicPolicyCallbackFromNative(int event, String regId, int public static final String DEVICE_OUT_AUX_LINE_NAME = "aux_line"; public static final String DEVICE_OUT_SPEAKER_SAFE_NAME = "speaker_safe"; public static final String DEVICE_OUT_IP_NAME = "ip"; + public static final String DEVICE_OUT_PROXY_NAME = "proxy"; public static final String DEVICE_IN_COMMUNICATION_NAME = "communication"; public static final String DEVICE_IN_AMBIENT_NAME = "ambient"; @@ -515,6 +519,8 @@ public static String getOutputDeviceName(int device) return DEVICE_OUT_SPEAKER_SAFE_NAME; case DEVICE_OUT_IP: return DEVICE_OUT_IP_NAME; + case DEVICE_OUT_PROXY: + return DEVICE_OUT_PROXY_NAME; case DEVICE_OUT_DEFAULT: default: return Integer.toString(device); diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java index d303a2e3988..6785670d192 100644 --- a/media/java/android/media/CamcorderProfile.java +++ b/media/java/android/media/CamcorderProfile.java @@ -206,6 +206,77 @@ public class CamcorderProfile private static final int QUALITY_HIGH_SPEED_LIST_START = QUALITY_HIGH_SPEED_LOW; private static final int QUALITY_HIGH_SPEED_LIST_END = QUALITY_HIGH_SPEED_2160P; + // Vendor-specific quality profiles + /** + * Quality level corresponding to the VGA (640 x 480) resolution. + * @hide + */ + public static final int QUALITY_VGA = 10000; + + /** + * Quality level corresponding to the 4k-DCI (4096 x 2160) resolution. + * @hide + */ + public static final int QUALITY_4KDCI = 10001; + + /** + * Time lapse quality level corresponding to the VGA (640 x 480) resolution. + * @hide + */ + public static final int QUALITY_TIME_LAPSE_VGA = 10002; + + /** + * Time lapse quality level corresponding to the 4k-DCI (4096 x 2160) resolution. + * @hide + */ + public static final int QUALITY_TIME_LAPSE_4KDCI = 10003; + + /** + * High speed ( >= 100fps) quality level corresponding to the CIF (352 x 288) + * @hide + */ + public static final int QUALITY_HIGH_SPEED_CIF = 10004; + + /** + * High speed ( >= 100fps) quality level corresponding to the VGA (640 x 480) + * @hide + */ + public static final int QUALITY_HIGH_SPEED_VGA = 10005; + + /** + * High speed ( >= 100fps) quality level corresponding to the 4K-DCI (4096 x 2160) + * @hide + */ + public static final int QUALITY_HIGH_SPEED_4KDCI = 10006; + + /** + * Quality level corresponding to QHD resolution + * @hide + */ + public static final int QUALITY_QHD = 10007; + + /** + * Quality level corresponding to 2K resolution + * @hide + */ + public static final int QUALITY_2k = 10008; + + /** + * Time lapse quality level corresponding to the QHD resolution. + * @hide + */ + public static final int QUALITY_TIME_LAPSE_QHD = 10009; + + /** + * Time lapse quality level corresponding to the 2K resolution. + * @hide + */ + public static final int QUALITY_TIME_LAPSE_2k = 10010; + + // Start and end of vendor quality list + private static final int QUALITY_VENDOR_LIST_START = QUALITY_VGA; + private static final int QUALITY_VENDOR_LIST_END = QUALITY_TIME_LAPSE_2k; + /** * Default recording duration in seconds before the session is terminated. * This is useful for applications like MMS has limited file size requirement. @@ -391,7 +462,9 @@ public static CamcorderProfile get(int cameraId, int quality) { (quality >= QUALITY_TIME_LAPSE_LIST_START && quality <= QUALITY_TIME_LAPSE_LIST_END) || (quality >= QUALITY_HIGH_SPEED_LIST_START && - quality <= QUALITY_HIGH_SPEED_LIST_END))) { + quality <= QUALITY_HIGH_SPEED_LIST_END) || + (quality >= QUALITY_VENDOR_LIST_START && + quality <= QUALITY_VENDOR_LIST_END))) { String errMessage = "Unsupported quality level: " + quality; throw new IllegalArgumentException(errMessage); } diff --git a/media/java/android/media/ClosedCaptionRenderer.java b/media/java/android/media/ClosedCaptionRenderer.java index 8403c1ce711..2cf754e9a8e 100644 --- a/media/java/android/media/ClosedCaptionRenderer.java +++ b/media/java/android/media/ClosedCaptionRenderer.java @@ -609,8 +609,10 @@ void der() { if (mLines[mRow] != null) { for (int i = 0; i < mCol; i++) { if (mLines[mRow].charAt(i) != TS) { - for (int j = mCol; j < mLines[mRow].length(); j++) { - mLines[j].setCharAt(j, TS); + for (int j = mCol; j < mLines[mRow].length() && j < mLines.length; j++) { + if (mLines[j] != null){ + mLines[j].setCharAt(j, TS); + } } return; } diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl index 8aebe117722..0b98e1b07b9 100644 --- a/media/java/android/media/IAudioService.aidl +++ b/media/java/android/media/IAudioService.aidl @@ -215,4 +215,16 @@ interface IAudioService { int setFocusPropertiesForPolicy(int duckingBehavior, in IAudioPolicyCallback pcb); void setVolumePolicy(in VolumePolicy policy); + + void setRemoteControlClientBrowsedPlayer(); + + void getRemoteControlClientNowPlayingEntries(); + + void setRemoteControlClientPlayItem(long uid, int scope); + + void updateRemoteControllerOnExistingMediaPlayers(); + + void addMediaPlayerAndUpdateRemoteController(String packageName); + + void removeMediaPlayerAndUpdateRemoteController(String packageName); } diff --git a/media/java/android/media/IRemoteControlClient.aidl b/media/java/android/media/IRemoteControlClient.aidl index aa142d6e7da..d8e73c8b922 100644 --- a/media/java/android/media/IRemoteControlClient.aidl +++ b/media/java/android/media/IRemoteControlClient.aidl @@ -52,11 +52,14 @@ oneway interface IRemoteControlClient */ void setCurrentClientGenerationId(int clientGeneration); - void plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h); + void plugRemoteControlDisplay(IRemoteControlDisplay rcd, int w, int h); void unplugRemoteControlDisplay(IRemoteControlDisplay rcd); void setBitmapSizeForDisplay(IRemoteControlDisplay rcd, int w, int h); void setWantsSyncForDisplay(IRemoteControlDisplay rcd, boolean wantsSync); void enableRemoteControlDisplay(IRemoteControlDisplay rcd, boolean enabled); void seekTo(int clientGeneration, long timeMs); void updateMetadata(int clientGeneration, int key, in Rating value); + void setPlayItem(int scope, long uid); + void setBrowsedPlayer(); + void getNowPlayingEntries(); } \ No newline at end of file diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java index 41019357a0e..957ba161863 100644 --- a/media/java/android/media/MediaCodecInfo.java +++ b/media/java/android/media/MediaCodecInfo.java @@ -589,6 +589,13 @@ public MediaFormat getDefaultFormat() { return mDefaultFormat; } + /* Return the capabilities info, so the app can query custom settings + * like for VT. */ + /** @hide */ + public MediaFormat getCapabilitiesInfoFormat() { + return mCapabilitiesInfo; + } + /** * Returns the mime type for which this codec-capability object was created. */ diff --git a/media/java/android/media/MediaFile.java b/media/java/android/media/MediaFile.java index 526656ae8fe..e91548c1774 100644 --- a/media/java/android/media/MediaFile.java +++ b/media/java/android/media/MediaFile.java @@ -46,6 +46,18 @@ public class MediaFile { private static final int FIRST_AUDIO_FILE_TYPE = FILE_TYPE_MP3; private static final int LAST_AUDIO_FILE_TYPE = FILE_TYPE_FLAC; + // More audio file types + public static final int FILE_TYPE_DTS = 300; + public static final int FILE_TYPE_3GPA = 301; + public static final int FILE_TYPE_AC3 = 302; + public static final int FILE_TYPE_QCP = 303; + public static final int FILE_TYPE_PCM = 304; + public static final int FILE_TYPE_EC3 = 305; + public static final int FILE_TYPE_AIFF = 306; + public static final int FILE_TYPE_APE = 307; + private static final int FIRST_AUDIO_FILE_TYPE_EXT = FILE_TYPE_DTS; + private static final int LAST_AUDIO_FILE_TYPE_EXT = FILE_TYPE_APE; + // MIDI file types public static final int FILE_TYPE_MID = 11; public static final int FILE_TYPE_SMF = 12; @@ -69,8 +81,10 @@ public class MediaFile { // More video file types public static final int FILE_TYPE_MP2PS = 200; + public static final int FILE_TYPE_DIVX = 201; + public static final int FILE_TYPE_FLV = 202; private static final int FIRST_VIDEO_FILE_TYPE2 = FILE_TYPE_MP2PS; - private static final int LAST_VIDEO_FILE_TYPE2 = FILE_TYPE_MP2PS; + private static final int LAST_VIDEO_FILE_TYPE2 = FILE_TYPE_FLV; // Image file types public static final int FILE_TYPE_JPEG = 31; @@ -87,9 +101,10 @@ public class MediaFile { public static final int FILE_TYPE_PLS = 42; public static final int FILE_TYPE_WPL = 43; public static final int FILE_TYPE_HTTPLIVE = 44; + public static final int FILE_TYPE_DASH = 45; private static final int FIRST_PLAYLIST_FILE_TYPE = FILE_TYPE_M3U; - private static final int LAST_PLAYLIST_FILE_TYPE = FILE_TYPE_HTTPLIVE; + private static final int LAST_PLAYLIST_FILE_TYPE = FILE_TYPE_DASH; // Drm file types public static final int FILE_TYPE_FL = 51; @@ -240,13 +255,24 @@ private static boolean isWMVEnabled() { addFileType("ZIP", FILE_TYPE_ZIP, "application/zip"); addFileType("MPG", FILE_TYPE_MP2PS, "video/mp2p"); addFileType("MPEG", FILE_TYPE_MP2PS, "video/mp2p"); + addFileType("DIVX", FILE_TYPE_DIVX, "video/divx"); + addFileType("FLV", FILE_TYPE_FLV, "video/flv"); + addFileType("MPD", FILE_TYPE_DASH, "application/dash+xml"); + addFileType("QCP", FILE_TYPE_QCP, "audio/qcelp"); + addFileType("AC3", FILE_TYPE_AC3, "audio/ac3"); + addFileType("EC3", FILE_TYPE_EC3, "audio/eac3"); + addFileType("AIF", FILE_TYPE_AIFF, "audio/x-aiff"); + addFileType("AIFF", FILE_TYPE_AIFF, "audio/x-aiff"); + addFileType("APE", FILE_TYPE_APE, "audio/x-ape"); } public static boolean isAudioFileType(int fileType) { return ((fileType >= FIRST_AUDIO_FILE_TYPE && fileType <= LAST_AUDIO_FILE_TYPE) || (fileType >= FIRST_MIDI_FILE_TYPE && - fileType <= LAST_MIDI_FILE_TYPE)); + fileType <= LAST_MIDI_FILE_TYPE) || + (fileType >= FIRST_AUDIO_FILE_TYPE_EXT && + fileType <= LAST_AUDIO_FILE_TYPE_EXT)); } public static boolean isVideoFileType(int fileType) { diff --git a/media/java/android/media/MediaHTTPConnection.java b/media/java/android/media/MediaHTTPConnection.java index d6bf421ffa9..59eaeef1e29 100644 --- a/media/java/android/media/MediaHTTPConnection.java +++ b/media/java/android/media/MediaHTTPConnection.java @@ -19,6 +19,7 @@ import android.net.NetworkUtils; import android.os.IBinder; import android.os.StrictMode; +import android.os.SystemProperties; import android.util.Log; import java.io.BufferedInputStream; @@ -34,8 +35,14 @@ import java.net.ProtocolException; import java.net.UnknownServiceException; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.Socket; +import java.net.SocketAddress; + import static android.media.MediaPlayer.MEDIA_ERROR_UNSUPPORTED; /** @hide */ @@ -48,10 +55,14 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub { private long mCurrentOffset = -1; private URL mURL = null; + private int mProxyPort = 0; + private String mProxyIP; private Map mHeaders = null; private HttpURLConnection mConnection = null; private long mTotalSize = -1; private InputStream mInputStream = null; + private List mCookies = null; + private boolean mIsCookieUpdated = false; private boolean mAllowCrossDomainRedirect = true; private boolean mAllowCrossProtocolRedirect = true; @@ -97,10 +108,21 @@ private boolean parseBoolean(String val) { /* returns true iff header is internal */ private boolean filterOutInternalHeaders(String key, String val) { + Log.d(TAG, "filterOutInternalHeaders: key=" + key + ", val=" + val); if ("android-allow-cross-domain-redirect".equalsIgnoreCase(key)) { mAllowCrossDomainRedirect = parseBoolean(val); // cross-protocol redirects are also controlled by this flag mAllowCrossProtocolRedirect = mAllowCrossDomainRedirect; + } else if ("use-proxy".equalsIgnoreCase(key)) { + Log.d(TAG, "filterOutInternalHeaders use-proxy " + val); + int colonPos = val.indexOf(":"); + if (colonPos > 0) { + mProxyIP = new String((val.substring(0, colonPos)).trim()); + mProxyPort = Integer.parseInt(val.substring(colonPos + 1)); + Log.d(TAG, "sta-proxy-ip " + mProxyIP + " port " + mProxyPort); + } + } else if ("Cookie".equalsIgnoreCase(key) && mIsCookieUpdated) { + Log.d(TAG, "filterOutInternalHeaders: Cookie"); } else { return false; } @@ -180,10 +202,19 @@ private void seekTo(long offset) throws IOException { boolean noProxy = isLocalHost(url); while (true) { - if (noProxy) { - mConnection = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); + + Log.d(TAG, "proxy " + mProxyIP +" port "+ mProxyPort); + if (mProxyPort > 0) { + SocketAddress socketAddr = new InetSocketAddress(mProxyIP, mProxyPort); + java.net.Proxy proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, socketAddr); + mConnection = (HttpURLConnection) url.openConnection(proxy); + Log.d(TAG, "connection initialized with proxy"); } else { - mConnection = (HttpURLConnection)url.openConnection(); + if (noProxy) { + mConnection = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); + } else { + mConnection = (HttpURLConnection)url.openConnection(); + } } mConnection.setConnectTimeout(CONNECT_TIMEOUT_MS); @@ -197,6 +228,14 @@ private void seekTo(long offset) throws IOException { } } + if (mIsCookieUpdated) { + if (VERBOSE) + Log.d(TAG, "add Cookie in the request"); + for (String cookie : mCookies) { + mConnection.addRequestProperty("Cookie", cookie.split(";", 2)[0]); + } + } + if (offset > 0) { mConnection.setRequestProperty( "Range", "bytes=" + offset + "-"); @@ -283,6 +322,16 @@ private void seekTo(long offset) throws IOException { throw new IOException(); } else { mTotalSize = mConnection.getContentLength(); + if (mConnection.getHeaderFields().containsKey("Set-Cookie")) { + mIsCookieUpdated = SystemProperties.getBoolean( + "persist.media.cookie.cust", false); + mCookies = mConnection.getHeaderFields().get("Set-Cookie"); + if (VERBOSE) { + for (String cookie : mCookies) { + Log.d(TAG, "get Cookie" + cookie); + } + } + } } if (offset > 0 && response != HttpURLConnection.HTTP_PARTIAL) { diff --git a/media/java/android/media/MediaMetadataEditor.java b/media/java/android/media/MediaMetadataEditor.java index 566b93f7c2e..eeb8fe2597b 100644 --- a/media/java/android/media/MediaMetadataEditor.java +++ b/media/java/android/media/MediaMetadataEditor.java @@ -439,7 +439,7 @@ public synchronized Object getObject(int key, Object defaultValue) protected static final SparseIntArray METADATA_KEYS_TYPE; static { - METADATA_KEYS_TYPE = new SparseIntArray(17); + METADATA_KEYS_TYPE = new SparseIntArray(18); // NOTE: if adding to the list below, make sure you increment the array initialization size // keys with long values METADATA_KEYS_TYPE.put( @@ -465,5 +465,7 @@ public synchronized Object getObject(int key, Object defaultValue) // keys with Rating values METADATA_KEYS_TYPE.put(RATING_KEY_BY_OTHERS, METADATA_TYPE_RATING); METADATA_KEYS_TYPE.put(RATING_KEY_BY_USER, METADATA_TYPE_RATING); + // Meta data for total number of tracks in Album + METADATA_KEYS_TYPE.put(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS, METADATA_TYPE_LONG); } } diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 587d4942568..b3f25eea565 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -3453,6 +3453,23 @@ private boolean isVideoScalingModeSupported(int mode) { mode == VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); } + /** @hide + */ + public boolean suspend() { + stayAwake(false); + return _suspend(); + } + + private native boolean _suspend(); + + /** @hide + */ + public boolean resume() { + return _resume(); + } + + private native boolean _resume(); + /** @hide */ static class TimeProvider implements MediaPlayer.OnSeekCompleteListener, MediaTimeProvider { diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index ed2c4cbd248..4e405e3cccd 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -345,6 +345,13 @@ private OutputFormat() {} /** VP8/VORBIS data in a WEBM container */ public static final int WEBM = 9; + + /** @hide QCP file format */ + public static final int QCP = 20; + + /** @hide WAVE media file format*/ + public static final int WAVE = 21; + }; /** @@ -369,6 +376,12 @@ private AudioEncoder() {} public static final int AAC_ELD = 5; /** Ogg Vorbis audio codec */ public static final int VORBIS = 6; + /** @hide EVRC audio codec */ + public static final int EVRC = 10; + /** @hide QCELP audio codec */ + public static final int QCELP = 11; + /** @hide Linear PCM audio codec */ + public static final int LPCM = 12; } /** @@ -385,6 +398,8 @@ private VideoEncoder() {} public static final int H264 = 2; public static final int MPEG_4_SP = 3; public static final int VP8 = 4; + /** @hide **/ + public static final int H265 = 1001; } /** @@ -436,8 +451,9 @@ public void setProfile(CamcorderProfile profile) { setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight); setVideoEncodingBitRate(profile.videoBitRate); setVideoEncoder(profile.videoCodec); - if (profile.quality >= CamcorderProfile.QUALITY_TIME_LAPSE_LOW && - profile.quality <= CamcorderProfile.QUALITY_TIME_LAPSE_QVGA) { + if ((profile.quality >= CamcorderProfile.QUALITY_TIME_LAPSE_LOW && + profile.quality <= CamcorderProfile.QUALITY_TIME_LAPSE_2160P) || + profile.quality == CamcorderProfile.QUALITY_TIME_LAPSE_VGA) { // Nothing needs to be done. Call to setCaptureRate() enables // time lapse video recording. } else { @@ -792,6 +808,10 @@ public void prepare() throws IllegalStateException, IOException */ public native void start() throws IllegalStateException; + /** @hide + */ + public native void pause() throws IllegalStateException; + /** * Stops recording. Call this after start(). Once recording is stopped, * you will have to configure it again as if it has just been constructed. diff --git a/media/java/android/media/RemoteControlClient.java b/media/java/android/media/RemoteControlClient.java index c9a86d8586e..07b8c2332f2 100644 --- a/media/java/android/media/RemoteControlClient.java +++ b/media/java/android/media/RemoteControlClient.java @@ -707,6 +707,79 @@ private void setPlaybackStateInt(int state, long timeInMs, float playbackSpeed, } } + /** + * @hide + */ + public void playItemResponse(boolean success) { + Log.e(TAG, "playItemResponse"); + playItemResponseInt(success); + } + + private void playItemResponseInt(boolean success) { + Log.d(TAG, "playItemResponseInt"); + Log.v(TAG, "success: " + success); + + // USE_SESSIONS + if (mSession != null) { + mSession.playItemResponse(success); + } + } + + /** + * @hide + */ + public void updateNowPlayingEntries(long[] playList) { + Log.e(TAG, "updateNowPlayingEntries: Item numbers: " + playList.length); + updateNowPlayingEntriesInt(playList); + } + + private void updateNowPlayingEntriesInt(long[] playList) { + Log.d(TAG, "updateNowPlayingEntriesInt"); + + // USE_SESSIONS + if (mSession != null) { + mSession.updateNowPlayingEntries(playList); + } + } + + /** + * @hide + */ + public void updateFolderInfoBrowsedPlayer(String stringUri) { + Log.e(TAG, "updateFolderInfoBrowsedPlayer"); + synchronized(mCacheLock) { + updateFolderInfoBrowsedPlayerInt(stringUri); + } + } + + private void updateFolderInfoBrowsedPlayerInt(String stringUri) { + Log.d(TAG, "updateFolderInfoBrowsedPlayerInt"); + + // USE_SESSIONS + if (mSession != null) { + mSession.updateFolderInfoBrowsedPlayer(stringUri); + } + } + + /** + * @hide + */ + public void updateNowPlayingContentChange() { + Log.e(TAG, "updateNowPlayingContentChange"); + synchronized(mCacheLock) { + updateNowPlayingContentChangeInt(); + } + } + + private void updateNowPlayingContentChangeInt() { + Log.d(TAG, "updateNowPlayingContentChangeInt"); + + // USE_SESSIONS + if (mSession != null) { + mSession.updateNowPlayingContentChange(); + } + } + // TODO investigate if we still need position drift checking private void onPositionDriftCheck() { if (DEBUG) { Log.d(TAG, "onPositionDriftCheck()"); } @@ -798,6 +871,56 @@ public void setMetadataUpdateListener(OnMetadataUpdateListener l) { } } + /** + * @hide + */ + public interface OnGetNowPlayingEntriesListener { + public abstract void onGetNowPlayingEntries(); + } + + /** + * @hide + */ + public void setNowPlayingEntriesUpdateListener(OnGetNowPlayingEntriesListener l) { + Log.d(TAG, "setNowPlayingEntriesUpdateListener"); + synchronized(mCacheLock) { + mGetNowPlayingEntriesListener = l; + } + } + + /** + * @hide + */ + public interface OnSetBrowsedPlayerListener { + public abstract void onSetBrowsedPlayer(); + } + + /** + * @hide + */ + public void setBrowsedPlayerUpdateListener(OnSetBrowsedPlayerListener l) { + Log.d(TAG, "setBrowsedPlayerUpdateListener"); + synchronized(mCacheLock) { + mSetBrowsedPlayerListener = l; + } + } + + /** + * @hide + */ + public interface OnSetPlayItemListener { + public abstract void onSetPlayItem(int scope, long uid); + } + + /** + * @hide + */ + public void setPlayItemListener(OnSetPlayItemListener l) { + Log.d(TAG, "setPlayItemListener"); + synchronized(mCacheLock) { + mSetPlayItemListener = l; + } + } /** * Interface definition for a callback to be invoked when the media playback position is @@ -946,6 +1069,13 @@ && playbackPositionShouldMove(mPlaybackState)) { /** * The current remote control client generation ID across the system, as known by this object */ + + private OnSetBrowsedPlayerListener mSetBrowsedPlayerListener; + + private OnSetPlayItemListener mSetPlayItemListener; + + private OnGetNowPlayingEntriesListener mGetNowPlayingEntriesListener; + private int mCurrentClientGenId = -1; /** @@ -999,10 +1129,43 @@ public void onSetRating(Rating rating) { onUpdateMetadata(mCurrentClientGenId, MetadataEditor.RATING_KEY_BY_USER, rating); } } + + @Override + public void setPlayItem(int scope, long uid) { + // only post messages, we can't block here + if (mEventHandler != null) { + mEventHandler.removeMessages(MSG_SET_PLAY_ITEM); + mEventHandler.sendMessage(mEventHandler.obtainMessage( + MSG_SET_PLAY_ITEM, 0 /* arg1 */, scope /* arg2, ignored */, + new Long(uid))); + } + } + + @Override + public void getNowPlayingEntries() { + // only post messages, we can't block here + if (mEventHandler != null) { + mEventHandler.removeMessages(MSG_GET_NOW_PLAYING_ENTRIES); + mEventHandler.sendMessage(mEventHandler.obtainMessage( + MSG_GET_NOW_PLAYING_ENTRIES, 0, 0, null)); + } + } + + @Override + public void setBrowsedPlayer() { + Log.d(TAG, "setBrowsedPlayer in RemoteControlClient"); + if (mEventHandler != null) { + mEventHandler.sendMessage(mEventHandler.obtainMessage( + MSG_SET_BROWSED_PLAYER, 0 /* arg1 */, 0 /* arg2*/, null)); + } + } }; private EventHandler mEventHandler; private final static int MSG_POSITION_DRIFT_CHECK = 11; + private final static int MSG_SET_BROWSED_PLAYER = 12; + private final static int MSG_SET_PLAY_ITEM = 13; + private final static int MSG_GET_NOW_PLAYING_ENTRIES = 14; private class EventHandler extends Handler { public EventHandler(RemoteControlClient rcc, Looper looper) { @@ -1015,6 +1178,16 @@ public void handleMessage(Message msg) { case MSG_POSITION_DRIFT_CHECK: onPositionDriftCheck(); break; + case MSG_SET_BROWSED_PLAYER: + Log.d(TAG, "MSG_SET_BROWSED_PLAYER in RemoteControlClient"); + onSetBrowsedPlayer(); + break; + case MSG_SET_PLAY_ITEM: + onSetPlayItem(msg.arg2, ((Long)msg.obj).longValue()); + break; + case MSG_GET_NOW_PLAYING_ENTRIES: + onGetNowPlayingEntries(); + break; default: Log.e(TAG, "Unknown event " + msg.what + " in RemoteControlClient handler"); } @@ -1040,6 +1213,36 @@ private void onUpdateMetadata(int generationId, int key, Object value) { } } + private void onSetPlayItem(int scope, long uid) { + Log.d(TAG, "onSetPlayItem"); + synchronized (mCacheLock) { + if (mSetPlayItemListener != null) { + Log.d(TAG, "mSetPlayItemListener.onSetPlayItem"); + mSetPlayItemListener.onSetPlayItem(scope, uid); + } + } + } + + private void onSetBrowsedPlayer() { + Log.d(TAG, "onSetBrowsedPlayer"); + synchronized (mCacheLock) { + if (mSetBrowsedPlayerListener != null) { + Log.d(TAG, "mSetBrowsedPlayerListener.onSetBrowsedPlayer"); + mSetBrowsedPlayerListener.onSetBrowsedPlayer(); + } + } + } + + private void onGetNowPlayingEntries() { + Log.d(TAG, "onGetNowPlayingEntries"); + synchronized (mCacheLock) { + if (mGetNowPlayingEntriesListener != null) { + Log.d(TAG, "mGetNowPlayingEntriesListener.onGetNowPlayingEntries"); + mGetNowPlayingEntriesListener.onGetNowPlayingEntries(); + } + } + } + //=========================================================== // Internal utilities diff --git a/media/java/android/media/RemoteController.java b/media/java/android/media/RemoteController.java index d84cf30e464..aba7ad619b8 100644 --- a/media/java/android/media/RemoteController.java +++ b/media/java/android/media/RemoteController.java @@ -88,6 +88,7 @@ private boolean mIsRegistered = false; private PendingIntent mClientPendingIntentCurrent; private OnClientUpdateListener mOnClientUpdateListener; + private OnClientAvrcpUpdateListener mOnClientAvrcpUpdateListener; private PlaybackInfo mLastPlaybackInfo; private int mArtworkWidth = -1; private int mArtworkHeight = -1; @@ -150,6 +151,25 @@ public RemoteController(Context context, OnClientUpdateListener updateListener, } } + /** + * @hide + */ + public RemoteController(Context context, OnClientUpdateListener updateListener, Looper looper, + OnClientAvrcpUpdateListener avrcpUpdateListener) throws IllegalArgumentException { + this(context, updateListener, looper); + mOnClientAvrcpUpdateListener = avrcpUpdateListener; + } + + /** + * @hide + */ + public interface OnClientAvrcpUpdateListener { + public void onClientFolderInfoBrowsedPlayer(String stringUri); + public void onClientUpdateNowPlayingEntries(long[] playList); + public void onClientNowPlayingContentChange(); + public void onClientPlayItemResponse(boolean success); + }; + /** * Interface definition for the callbacks to be invoked whenever media events, metadata @@ -355,6 +375,7 @@ public boolean sendMediaKeyEvent(KeyEvent keyEvent) throws IllegalArgumentExcept * @throws IllegalArgumentException */ public boolean seekTo(long timeMs) throws IllegalArgumentException { + Log.e(TAG, "seekTo() in RemoteController"); if (!mEnabled) { Log.e(TAG, "Cannot use seekTo() from a disabled RemoteController"); return false; @@ -370,6 +391,69 @@ public boolean seekTo(long timeMs) throws IllegalArgumentException { return true; } + /** + * @hide + * Request the user of a RemoteControlClient to play the requested item. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + * @param uid uid of the song to be played. + * @scope scope of the file system to use + */ + public void setRemoteControlClientPlayItem(long uid, int scope) { + Log.e(TAG, "setRemoteControlClientPlayItem()"); + if (!mEnabled) { + Log.e(TAG, "Cannot use setRemoteControlClientPlayItem()" + + " from a disabled RemoteController"); + return; + } + synchronized (mInfoLock) { + if (mCurrentSession != null) { + mCurrentSession.getTransportControls().setRemoteControlClientPlayItem(uid, scope); + } + } + return; + } + + /** + * @hide + * Request the user of a RemoteControlClient to provide with the now playing list entries. + * @param generationId the RemoteControlClient generation counter for which this request is + * issued. + */ + public void getRemoteControlClientNowPlayingEntries() { + Log.e(TAG, "getRemoteControlClientNowPlayingEntries()"); + if (!mEnabled) { + Log.e(TAG, "Cannot use getRemoteControlClientNowPlayingEntries()" + + " from a disabled RemoteController"); + return; + } + synchronized (mInfoLock) { + if (mCurrentSession != null) { + mCurrentSession.getTransportControls().getRemoteControlClientNowPlayingEntries(); + } + } + return; + } + + /** + * @hide + * Request the user of a RemoteControlClient to set the music player as current browsed player. + * @param packageName package name of the targeted media player. + */ + public void setRemoteControlClientBrowsedPlayer() { + Log.e(TAG, "setRemoteControlClientBrowsedPlayer()"); + if (!mEnabled) { + Log.e(TAG, "Cannot use setRemoteControlClientBrowsedPlayer()" + + " from a disabled RemoteController"); + return; + } + synchronized (mInfoLock) { + if (mCurrentSession != null) { + mCurrentSession.getTransportControls().setRemoteControlClientBrowsedPlayer(); + } + } + return; + } /** * @hide @@ -704,6 +788,30 @@ public void onPlaybackStateChanged(PlaybackState state) { public void onMetadataChanged(MediaMetadata metadata) { onNewMediaMetadata(metadata); } + + @Override + public void onUpdateFolderInfoBrowsedPlayer(String stringUri) { + Log.d(TAG, "MediaControllerCallback: onUpdateFolderInfoBrowsedPlayer"); + onFolderInfoBrowsedPlayer(stringUri); + } + + @Override + public void onUpdateNowPlayingEntries(long[] playList) { + Log.d(TAG, "MediaControllerCallback: onUpdateNowPlayingEntries"); + onNowPlayingEntriesUpdate(playList); + } + + @Override + public void onUpdateNowPlayingContentChange() { + Log.d(TAG, "MediaControllerCallback: onUpdateNowPlayingContentChange"); + onNowPlayingContentChange(); + } + + @Override + public void onPlayItemResponse(boolean success) { + Log.d(TAG, "MediaControllerCallback: onPlayItemResponse"); + onSetPlayItemResponse(success); + } } /** @@ -980,6 +1088,8 @@ private void updateController(MediaController controller) { synchronized (mInfoLock) { if (controller == null) { if (mCurrentSession != null) { + Log.v(TAG, "Updating current controller as null"); + mAudioManager.updateMediaPlayerList(mCurrentSession.getPackageName(), false); mCurrentSession.unregisterCallback(mSessionCb); mCurrentSession = null; sendMsg(mEventHandler, MSG_CLIENT_CHANGE, SENDMSG_REPLACE, @@ -989,13 +1099,21 @@ private void updateController(MediaController controller) { || !controller.getSessionToken() .equals(mCurrentSession.getSessionToken())) { if (mCurrentSession != null) { + Log.v(TAG, "Updating current controller package as " + + controller.getPackageName() + " from " + mCurrentSession.getPackageName()); mCurrentSession.unregisterCallback(mSessionCb); + } else { + Log.v(TAG, "Updating current controller package as " + + controller.getPackageName() + " from null"); } + sendMsg(mEventHandler, MSG_CLIENT_CHANGE, SENDMSG_REPLACE, 0 /* genId */, 0 /* clearing */, null /* obj */, 0 /* delay */); mCurrentSession = controller; mCurrentSession.registerCallback(mSessionCb, mEventHandler); + mAudioManager.updateMediaPlayerList(mCurrentSession.getPackageName(), true); + PlaybackState state = controller.getPlaybackState(); sendMsg(mEventHandler, MSG_NEW_PLAYBACK_STATE, SENDMSG_REPLACE, 0 /* genId */, 0, state /* obj */, 0 /* delay */); @@ -1052,6 +1170,74 @@ private void onNewMediaMetadata(MediaMetadata metadata) { } } + private void onFolderInfoBrowsedPlayer(String stringUri) { + Log.d(TAG, "RemoteController: onFolderInfoBrowsedPlayer"); + final OnClientAvrcpUpdateListener l; + + synchronized(mInfoLock) { + l = mOnClientAvrcpUpdateListener; + } + + try { + if (l != null) { + l.onClientFolderInfoBrowsedPlayer(stringUri); + } + } catch (Exception e) { + Log.e(TAG, "Error Updating AVRCP on receiving Browsed player response", e); + } + } + + private void onNowPlayingEntriesUpdate(long[] playList) { + Log.d(TAG, "RemoteController: onUpdateNowPlayingEntries"); + final OnClientAvrcpUpdateListener l; + + synchronized(mInfoLock) { + l = mOnClientAvrcpUpdateListener; + } + + try { + if (l != null) { + l.onClientUpdateNowPlayingEntries(playList); + } + } catch (Exception e) { + Log.e(TAG, "Error Updating AVRCP on receiving Now Playing Entries", e); + } + } + + private void onNowPlayingContentChange() { + Log.d(TAG, "RemoteController: onNowPlayingContentChange"); + final OnClientAvrcpUpdateListener l; + + synchronized(mInfoLock) { + l = mOnClientAvrcpUpdateListener; + } + + try { + if (l != null) { + l.onClientNowPlayingContentChange(); + } + } catch (Exception e) { + Log.e(TAG, "Error Updating AVRCP on Now Playing Content Change", e); + } + } + + private void onSetPlayItemResponse(boolean success) { + Log.d(TAG, "RemoteController: onPlayItemResponse"); + final OnClientAvrcpUpdateListener l; + + synchronized(mInfoLock) { + l = mOnClientAvrcpUpdateListener; + } + + try { + if (l != null) { + l.onClientPlayItemResponse(success); + } + } catch (Exception e) { + Log.e(TAG, "Error Updating AVRCP on receiving Play Item response", e); + } + } + //================================================== private static class PlaybackInfo { int mState; diff --git a/media/java/android/media/ToneGenerator.java b/media/java/android/media/ToneGenerator.java index 4661226cdb5..05e44714da7 100644 --- a/media/java/android/media/ToneGenerator.java +++ b/media/java/android/media/ToneGenerator.java @@ -728,13 +728,24 @@ public class ToneGenerator * @see #ToneGenerator(int, int) */ public static final int TONE_CDMA_SIGNAL_OFF = 98; + /** + * SUPERVISORY_CH - 440Hz + * + * @hide #ToneGenerator(int, int) + */ + public static final int TONE_SUPERVISORY_CH = 100; + /** + * HOLD_RECALL - 440Hz + * + * @hide #ToneGenerator(int, int) + */ + public static final int TONE_HOLD_RECALL = 101; /** Maximum volume, for use with {@link #ToneGenerator(int,int)} */ public static final int MAX_VOLUME = 100; /** Minimum volume setting, for use with {@link #ToneGenerator(int,int)} */ public static final int MIN_VOLUME = 0; - /** * ToneGenerator class contructor specifying output stream type and volume. * diff --git a/media/java/android/media/session/ISession.aidl b/media/java/android/media/session/ISession.aidl index bd0019f0f1d..34eadcb4684 100644 --- a/media/java/android/media/session/ISession.aidl +++ b/media/java/android/media/session/ISession.aidl @@ -45,6 +45,10 @@ interface ISession { void setQueueTitle(CharSequence title); void setExtras(in Bundle extras); void setRatingType(int type); + void playItemResponse(boolean success); + void updateNowPlayingEntries(in long[] playList); + void updateFolderInfoBrowsedPlayer(String stringUri); + void updateNowPlayingContentChange(); // These commands relate to volume handling void setPlaybackToLocal(in AudioAttributes attributes); diff --git a/media/java/android/media/session/ISessionCallback.aidl b/media/java/android/media/session/ISessionCallback.aidl index adb6b0600f9..ed13ff6024d 100644 --- a/media/java/android/media/session/ISessionCallback.aidl +++ b/media/java/android/media/session/ISessionCallback.aidl @@ -41,6 +41,9 @@ oneway interface ISessionCallback { void onFastForward(); void onRewind(); void onSeekTo(long pos); + void setRemoteControlClientBrowsedPlayer(); + void setRemoteControlClientPlayItem(long uid, int scope); + void getRemoteControlClientNowPlayingEntries(); void onRate(in Rating rating); void onCustomAction(String action, in Bundle args); diff --git a/media/java/android/media/session/ISessionController.aidl b/media/java/android/media/session/ISessionController.aidl index 285e5f7a088..006ffac064b 100644 --- a/media/java/android/media/session/ISessionController.aidl +++ b/media/java/android/media/session/ISessionController.aidl @@ -62,6 +62,9 @@ interface ISessionController { void fastForward(); void rewind(); void seekTo(long pos); + void setRemoteControlClientBrowsedPlayer(); + void setRemoteControlClientPlayItem(long uid, int scope); + void getRemoteControlClientNowPlayingEntries(); void rate(in Rating rating); void sendCustomAction(String action, in Bundle args); MediaMetadata getMetadata(); diff --git a/media/java/android/media/session/ISessionControllerCallback.aidl b/media/java/android/media/session/ISessionControllerCallback.aidl index cf3176706d7..a5ad9132bc3 100644 --- a/media/java/android/media/session/ISessionControllerCallback.aidl +++ b/media/java/android/media/session/ISessionControllerCallback.aidl @@ -36,4 +36,8 @@ oneway interface ISessionControllerCallback { void onQueueTitleChanged(CharSequence title); void onExtrasChanged(in Bundle extras); void onVolumeInfoChanged(in ParcelableVolumeInfo info); + void onPlayItemResponse(boolean success); + void onUpdateNowPlayingEntries(in long[] playList); + void onUpdateFolderInfoBrowsedPlayer(String stringUri); + void onUpdateNowPlayingContentChange(); } diff --git a/media/java/android/media/session/MediaController.java b/media/java/android/media/session/MediaController.java index b1a51a56db2..f1f9516a906 100644 --- a/media/java/android/media/session/MediaController.java +++ b/media/java/android/media/session/MediaController.java @@ -64,6 +64,10 @@ public final class MediaController { private static final int MSG_UPDATE_QUEUE_TITLE = 6; private static final int MSG_UPDATE_EXTRAS = 7; private static final int MSG_DESTROYED = 8; + private static final int MSG_FOLDER_INFO_BROWSED_PLAYER = 9; + private static final int MSG_UPDATE_NOWPLAYING_ENTRIES = 10; + private static final int MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE = 11; + private static final int MSG_PLAY_ITEM_RESPONSE = 12; private final ISessionController mSessionBinder; @@ -579,6 +583,31 @@ public void onExtrasChanged(@Nullable Bundle extras) { */ public void onAudioInfoChanged(PlaybackInfo info) { } + + /** + * @hide + */ + public void onUpdateFolderInfoBrowsedPlayer(String stringUri) { + } + + /** + * @hide + */ + public void onUpdateNowPlayingEntries(long[] playList) { + } + + /** + * @hide + */ + public void onUpdateNowPlayingContentChange() { + } + + /** + * @hide + */ + public void onPlayItemResponse(boolean success) { + } + } /** @@ -704,6 +733,7 @@ public void stop() { * @param pos Position to move to, in milliseconds. */ public void seekTo(long pos) { + Log.d(TAG, "seekTo in TransportControls"); try { mSessionBinder.seekTo(pos); } catch (RemoteException e) { @@ -711,6 +741,42 @@ public void seekTo(long pos) { } } + /** + * @hide + */ + public void setRemoteControlClientBrowsedPlayer() { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer in TransportControls"); + try { + mSessionBinder.setRemoteControlClientBrowsedPlayer(); + } catch (RemoteException e) { + Log.wtf(TAG, "Error calling setRemoteControlClientBrowsedPlayer.", e); + } + } + + /** + * @hide + */ + public void setRemoteControlClientPlayItem(long uid, int scope) { + Log.d(TAG, "setRemoteControlClientPlayItem in TransportControls"); + try { + mSessionBinder.setRemoteControlClientPlayItem(uid, scope); + } catch (RemoteException e) { + Log.wtf(TAG, "Error calling setRemoteControlClientPlayItem.", e); + } + } + + /** + * @hide + */ + public void getRemoteControlClientNowPlayingEntries() { + Log.d(TAG, "getRemoteControlClientNowPlayingEntries in TransportControls"); + try { + mSessionBinder.getRemoteControlClientNowPlayingEntries(); + } catch (RemoteException e) { + Log.wtf(TAG, "Error calling getRemoteControlClientNowPlayingEntries.", e); + } + } + /** * Start fast forwarding. If playback is already fast forwarding this * may increase the rate. @@ -973,6 +1039,42 @@ public void onVolumeInfoChanged(ParcelableVolumeInfo pvi) { } } + @Override + public void onUpdateFolderInfoBrowsedPlayer(String stringUri) { + Log.d(TAG, "CallBackStub: onUpdateFolderInfoBrowsedPlayer"); + MediaController controller = mController.get(); + if (controller != null) { + controller.postMessage(MSG_FOLDER_INFO_BROWSED_PLAYER, stringUri, null); + } + } + + @Override + public void onUpdateNowPlayingEntries(long[] playList) { + Log.d(TAG, "CallBackStub: onUpdateNowPlayingEntries"); + MediaController controller = mController.get(); + if (controller != null) { + controller.postMessage(MSG_UPDATE_NOWPLAYING_ENTRIES, playList, null); + } + } + + @Override + public void onUpdateNowPlayingContentChange() { + Log.d(TAG, "CallBackStub: onUpdateNowPlayingContentChange"); + MediaController controller = mController.get(); + if (controller != null) { + controller.postMessage(MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE, null, null); + } + } + + @Override + public void onPlayItemResponse(boolean success) { + Log.d(TAG, "CallBackStub: onPlayItemResponse"); + MediaController controller = mController.get(); + if (controller != null) { + controller.postMessage(MSG_PLAY_ITEM_RESPONSE, new Boolean(success), null); + } + } + } private final static class MessageHandler extends Handler { @@ -1014,6 +1116,18 @@ public void handleMessage(Message msg) { case MSG_DESTROYED: mCallback.onSessionDestroyed(); break; + case MSG_FOLDER_INFO_BROWSED_PLAYER: + mCallback.onUpdateFolderInfoBrowsedPlayer((String) msg.obj); + break; + case MSG_UPDATE_NOWPLAYING_ENTRIES: + mCallback.onUpdateNowPlayingEntries((long[]) msg.obj); + break; + case MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE: + mCallback.onUpdateNowPlayingContentChange(); + break; + case MSG_PLAY_ITEM_RESPONSE: + mCallback.onPlayItemResponse(((Boolean)(msg.obj)).booleanValue()); + break; } } diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java index e1e9b792810..be89dfc3597 100644 --- a/media/java/android/media/session/MediaSession.java +++ b/media/java/android/media/session/MediaSession.java @@ -492,6 +492,58 @@ public void setExtras(@Nullable Bundle extras) { } } + /** + * @hide + */ + public void playItemResponse(boolean success) { + Log.d(TAG, "MediaSession: playItemResponse"); + + try { + mBinder.playItemResponse(success); + } catch (RemoteException e) { + Log.wtf(TAG, "Dead object in playItemResponse.", e); + } + } + + /** + * @hide + */ + public void updateNowPlayingEntries(long[] playList) { + Log.d(TAG, "MediaSession: updateNowPlayingEntries"); + + try { + mBinder.updateNowPlayingEntries(playList); + } catch (RemoteException e) { + Log.wtf(TAG, "Dead object in updateNowPlayingEntries.", e); + } + } + + /** + * @hide + */ + public void updateFolderInfoBrowsedPlayer(String stringUri) { + Log.d(TAG, "MediaSession: updateFolderInfoBrowsedPlayer"); + + try { + mBinder.updateFolderInfoBrowsedPlayer(stringUri); + } catch (RemoteException e) { + Log.wtf(TAG, "Dead object in updateFolderInfoBrowsedPlayer.", e); + } + } + + /** + * @hide + */ + public void updateNowPlayingContentChange() { + Log.d(TAG, "MediaSession: updateNowPlayingContentChange"); + + try { + mBinder.updateNowPlayingContentChange(); + } catch (RemoteException e) { + Log.wtf(TAG, "Dead object in updateNowPlayingContentChange.", e); + } + } + /** * Notify the system that the remote volume changed. * @@ -572,6 +624,34 @@ private void dispatchMediaButton(Intent mediaButtonIntent) { postToCallback(CallbackMessageHandler.MSG_MEDIA_BUTTON, mediaButtonIntent); } + private void dispatchSetBrowsedPlayerCommand() { + postToCallback(CallbackMessageHandler.MSG_SET_BROWSED_PLAYER); + } + + private void dispatchSetPlayItemCommand(long uid, int scope) { + PlayItemToken playItemToken = new PlayItemToken(uid, scope); + postToCallback(CallbackMessageHandler.MSG_SET_PLAY_ITEM, playItemToken); + } + + private class PlayItemToken { + private long mUid; + private int mScope; + public PlayItemToken(long uid, int scope) { + mUid = uid; + mScope = scope; + } + public int getScope() { + return mScope; + } + public long getUid() { + return mUid; + } + } + + private void dispatchGetNowPlayingItemsCommand() { + postToCallback(CallbackMessageHandler.MSG_GET_NOW_PLAYING_ITEMS); + } + private void dispatchAdjustVolume(int direction) { postToCallback(CallbackMessageHandler.MSG_ADJUST_VOLUME, direction); } @@ -894,6 +974,25 @@ public void onSetRating(@NonNull Rating rating) { */ public void onCustomAction(@NonNull String action, @Nullable Bundle extras) { } + + /** + * @hide + */ + public void setBrowsedPlayer() { + } + + /** + * @hide + */ + public void setPlayItem(int scope, long uid) { + } + + /** + * @hide + */ + public void getNowPlayingEntries() { + } + } /** @@ -1033,6 +1132,33 @@ public void onRate(Rating rating) { } } + @Override + public void setRemoteControlClientBrowsedPlayer() throws RemoteException { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer in CallbackStub"); + MediaSession session = mMediaSession.get(); + if (session != null) { + session.dispatchSetBrowsedPlayerCommand(); + } + } + + @Override + public void setRemoteControlClientPlayItem(long uid, int scope) throws RemoteException { + Log.d(TAG, "setRemoteControlClientPlayItem in CallbackStub"); + MediaSession session = mMediaSession.get(); + if (session != null) { + session.dispatchSetPlayItemCommand(uid, scope); + } + } + + @Override + public void getRemoteControlClientNowPlayingEntries() throws RemoteException { + Log.d(TAG, "getRemoteControlClientNowPlayingEntries in CallbackStub"); + MediaSession session = mMediaSession.get(); + if (session != null) { + session.dispatchGetNowPlayingItemsCommand(); + } + } + @Override public void onCustomAction(String action, Bundle args) { MediaSession session = mMediaSession.get(); @@ -1173,6 +1299,9 @@ private class CallbackMessageHandler extends Handler { private static final int MSG_ADJUST_VOLUME = 16; private static final int MSG_SET_VOLUME = 17; private static final int MSG_PLAY_URI = 18; + private static final int MSG_SET_BROWSED_PLAYER = 19; + private static final int MSG_SET_PLAY_ITEM = 20; + private static final int MSG_GET_NOW_PLAYING_ITEMS = 21; private MediaSession.Callback mCallback; @@ -1267,6 +1396,18 @@ public void handleMessage(Message msg) { if (vp != null) { vp.onSetVolumeTo((int) msg.obj); } + case MSG_SET_BROWSED_PLAYER: + Log.d(TAG, "MSG_SET_BROWSED_PLAYER received in CallbackMessageHandler"); + mCallback.setBrowsedPlayer(); + break; + case MSG_SET_PLAY_ITEM: + Log.d(TAG, "MSG_SET_PLAY_ITEM received in CallbackMessageHandler"); + PlayItemToken playItemToken = (PlayItemToken) msg.obj; + mCallback.setPlayItem(playItemToken.getScope(), playItemToken.getUid()); + break; + case MSG_GET_NOW_PLAYING_ITEMS: + Log.d(TAG, "MSG_GET_NOW_PLAYING_ITEMS received in CallbackMessageHandler"); + mCallback.getNowPlayingEntries(); break; } } diff --git a/media/java/android/media/session/MediaSessionLegacyHelper.java b/media/java/android/media/session/MediaSessionLegacyHelper.java index c61d7ad0a0b..22082b96be3 100644 --- a/media/java/android/media/session/MediaSessionLegacyHelper.java +++ b/media/java/android/media/session/MediaSessionLegacyHelper.java @@ -549,6 +549,27 @@ public void onSetRating(Rating rating) { mRccListener.onSetRating(rating); } } + + @Override + public void setBrowsedPlayer() { + if (mRccListener != null) { + mRccListener.setBrowsedPlayer(); + } + } + + @Override + public void setPlayItem(int scope, long uid) { + if (mRccListener != null) { + mRccListener.setPlayItem(scope, uid); + } + } + + @Override + public void getNowPlayingEntries() { + if (mRccListener != null) { + mRccListener.getNowPlayingEntries(); + } + } } } } diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp index d8041f4bff0..88670eac90f 100644 --- a/media/jni/android_media_MediaPlayer.cpp +++ b/media/jni/android_media_MediaPlayer.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include "android_util_Binder.h" // ---------------------------------------------------------------------------- @@ -137,6 +138,153 @@ void JNIMediaPlayerListener::notify(int msg, int ext1, int ext2, const Parcel *o } } + +static const char *EXTMEDIAJNI_LIB_NAME = "libextmedia_jni.so"; +static const char *kCreateJNIExtMediaPlayerListener = "CreateJNIExtMediaPlayerListener"; +static const char *kCheckExtMedia = "checkExtMedia"; +static const char *kCreateNativeQCMediaPlayer = "CreateNativeQCMediaPlayer"; +typedef MediaPlayerListener* (*CreateJNIExtMediaPlayerListenerFn)(JNIEnv *, jobject, jobject, sp listener); +typedef bool (*CheckExtMediaFn)(JNIEnv *env, jobject); +typedef MediaPlayer* (*CreateNativeQCMediaPlayerFn)(); + + + +class JNIMediaPlayerFactory { + public: + JNIMediaPlayerFactory() {}; + static bool CheckAndCreateExtMediaPlayer(JNIEnv *env, jobject thiz, jobject weak_this, sp &listener, sp &mp); + private: + static void *mLibHandle; + static void loadLib(); + + static CreateJNIExtMediaPlayerListenerFn loadJNIExtMediaPlayerListener(); + static CreateJNIExtMediaPlayerListenerFn sExtDashListnerFnPtr; + + static CheckExtMediaFn sExtMediaFn; + static CheckExtMediaFn loadExtMedia(); + + static CreateNativeQCMediaPlayerFn sNativeQCMediaPlayerFn; + static CreateNativeQCMediaPlayerFn loadNativeQCMediaPlayer(); + + static sp createExtMediaPlayerListener(JNIEnv *env, jobject thiz, jobject weak_this, sp listener); + static bool checkExtMedia(JNIEnv *env, jobject thiz); + static void CreateNativeQCMediaPlayer(sp &mp); +}; + +void *JNIMediaPlayerFactory::mLibHandle = NULL; + +CreateJNIExtMediaPlayerListenerFn JNIMediaPlayerFactory::sExtDashListnerFnPtr = + JNIMediaPlayerFactory::loadJNIExtMediaPlayerListener(); + +CheckExtMediaFn JNIMediaPlayerFactory::sExtMediaFn = + JNIMediaPlayerFactory::loadExtMedia(); + +CreateNativeQCMediaPlayerFn JNIMediaPlayerFactory::sNativeQCMediaPlayerFn = + JNIMediaPlayerFactory::loadNativeQCMediaPlayer(); + + +void JNIMediaPlayerFactory::loadLib() +{ + if (!mLibHandle) { + mLibHandle = ::dlopen(EXTMEDIAJNI_LIB_NAME, RTLD_LAZY); + if (!mLibHandle) { + ALOGV("%s", dlerror()); + return; + } + ALOGV("Opened %s", EXTMEDIAJNI_LIB_NAME); + } +} + +CreateJNIExtMediaPlayerListenerFn JNIMediaPlayerFactory::loadJNIExtMediaPlayerListener() +{ + loadLib(); + CreateJNIExtMediaPlayerListenerFn pCreateExtDashListnerFnPtr = NULL; + if (mLibHandle != NULL) { + pCreateExtDashListnerFnPtr = (CreateJNIExtMediaPlayerListenerFn) + dlsym(mLibHandle, kCreateJNIExtMediaPlayerListener); + if (pCreateExtDashListnerFnPtr == NULL) { + ALOGW("Failed to load symbol %s : %s", kCreateJNIExtMediaPlayerListener, dlerror()); + } + } + return pCreateExtDashListnerFnPtr; +} + +CheckExtMediaFn JNIMediaPlayerFactory::loadExtMedia() +{ + loadLib(); + CheckExtMediaFn pCheckExtMediaFnPtr = NULL; + if (mLibHandle != NULL) { + pCheckExtMediaFnPtr = (CheckExtMediaFn)dlsym(mLibHandle, kCheckExtMedia); + if (pCheckExtMediaFnPtr == NULL) { + ALOGW("Failed to load symbol %s : %s", kCheckExtMedia, dlerror()); + } + } + return pCheckExtMediaFnPtr; +} + +CreateNativeQCMediaPlayerFn JNIMediaPlayerFactory::loadNativeQCMediaPlayer() +{ + loadLib(); + CreateNativeQCMediaPlayerFn pCreateNativeQCMediaPlayerFnPtr = NULL; + if (mLibHandle != NULL) { + pCreateNativeQCMediaPlayerFnPtr = (CreateNativeQCMediaPlayerFn) + dlsym(mLibHandle, kCreateNativeQCMediaPlayer); + if (pCreateNativeQCMediaPlayerFnPtr == NULL) { + ALOGW("Failed to load symbol %s : %s", kCreateNativeQCMediaPlayer, dlerror()); + } + } + return pCreateNativeQCMediaPlayerFnPtr; +} + + +sp JNIMediaPlayerFactory::createExtMediaPlayerListener(JNIEnv *env, jobject thiz, jobject weak_this, sp listener) +{ + if (checkExtMedia(env, thiz)) { + if (sExtDashListnerFnPtr ) { + listener = (*sExtDashListnerFnPtr)(env, thiz, weak_this, listener); + if (listener != NULL) { + ALOGE("JNIMediaPlayerFactory: createExtMediaPlayerListener : success"); + } + } + } + return listener; +} + +void JNIMediaPlayerFactory::CreateNativeQCMediaPlayer(sp &mp) +{ + if (sNativeQCMediaPlayerFn) { + mp = (*sNativeQCMediaPlayerFn)(); + if (mp != NULL) { + ALOGE("JNIMediaPlayerFactory: CreateNativeQCMediaPlayer : Success"); + } + } +} + + +bool JNIMediaPlayerFactory::checkExtMedia(JNIEnv *env, jobject thiz) +{ + bool bIsQCMediaPlayerPresent = false; + if (sExtMediaFn) { + bIsQCMediaPlayerPresent = (*sExtMediaFn)(env, thiz); + } + ALOGE("JNIMediaPlayerFactory: bIsQCMediaPlayerPresent %d", bIsQCMediaPlayerPresent); + return bIsQCMediaPlayerPresent; +} + +bool JNIMediaPlayerFactory::CheckAndCreateExtMediaPlayer( + JNIEnv *env, jobject thiz, jobject weak_this, sp &listener, sp &mp) +{ + bool bOk = false; + listener = createExtMediaPlayerListener(env, thiz, weak_this, listener); + if (listener != NULL && checkExtMedia(env,thiz)) { + CreateNativeQCMediaPlayer(mp); + if (mp != NULL) { + bOk = true; + } + } + return bOk; +} + // ---------------------------------------------------------------------------- static sp getMediaPlayer(JNIEnv* env, jobject thiz) @@ -868,14 +1016,26 @@ static void android_media_MediaPlayer_native_setup(JNIEnv *env, jobject thiz, jobject weak_this) { ALOGV("native_setup"); - sp mp = new MediaPlayer(); + + sp mp = NULL; + + bool bOk = false; + JNIMediaPlayerFactory *jniMediaPlayerFactory = new JNIMediaPlayerFactory(); + + sp listener = new JNIMediaPlayerListener(env, thiz, weak_this); + + if (jniMediaPlayerFactory) { + bOk = jniMediaPlayerFactory->CheckAndCreateExtMediaPlayer(env, thiz, weak_this, listener, mp); + delete(jniMediaPlayerFactory); + } + + if (!bOk){ + mp = new MediaPlayer(); + } if (mp == NULL) { jniThrowException(env, "java/lang/RuntimeException", "Out of memory"); return; } - - // create new listener and give it to MediaPlayer - sp listener = new JNIMediaPlayerListener(env, thiz, weak_this); mp->setListener(listener); // Stow our new C++ MediaPlayer in an opaque field in the Java object. @@ -1031,6 +1191,38 @@ android_media_MediaPlayer_setNextMediaPlayer(JNIEnv *env, jobject thiz, jobject ; } +static jboolean +android_media_MediaPlayer_suspend(JNIEnv *env, jobject thiz) +{ + sp mp = getMediaPlayer(env, thiz); + if (mp == NULL) { + jniThrowException(env, "java/lang/IllegalStateException", NULL); + return false; + } + + if (mp->suspend() != OK) { + return false; + } + + return true; +} + +static jboolean +android_media_MediaPlayer_resume(JNIEnv *env, jobject thiz) +{ + sp mp = getMediaPlayer(env, thiz); + if (mp == NULL) { + jniThrowException(env, "java/lang/IllegalStateException", NULL); + return false; + } + + if (mp->resume() != OK) { + return false; + } + + return true; +} + // ---------------------------------------------------------------------------- static JNINativeMethod gMethods[] = { @@ -1080,6 +1272,8 @@ static JNINativeMethod gMethods[] = { {"native_pullBatteryData", "(Landroid/os/Parcel;)I", (void *)android_media_MediaPlayer_pullBatteryData}, {"native_setRetransmitEndpoint", "(Ljava/lang/String;I)I", (void *)android_media_MediaPlayer_setRetransmitEndpoint}, {"setNextMediaPlayer", "(Landroid/media/MediaPlayer;)V", (void *)android_media_MediaPlayer_setNextMediaPlayer}, + {"_suspend", "()Z", (void *)android_media_MediaPlayer_suspend}, + {"_resume", "()Z", (void *)android_media_MediaPlayer_resume}, }; // This function only registers the native methods diff --git a/media/jni/android_media_MediaProfiles.cpp b/media/jni/android_media_MediaProfiles.cpp index ca9db91c5ee..91cdc6dc8e7 100644 --- a/media/jni/android_media_MediaProfiles.cpp +++ b/media/jni/android_media_MediaProfiles.cpp @@ -170,7 +170,9 @@ static bool isCamcorderQualityKnown(int quality) (quality >= CAMCORDER_QUALITY_TIME_LAPSE_LIST_START && quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END) || (quality >= CAMCORDER_QUALITY_HIGH_SPEED_LIST_START && - quality <= CAMCORDER_QUALITY_HIGH_SPEED_LIST_END)); + quality <= CAMCORDER_QUALITY_HIGH_SPEED_LIST_END) || + (quality >= CAMCORDER_QUALITY_VENDOR_START && + quality <= CAMCORDER_QUALITY_VENDOR_END)); } static jobject diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp index f60af63306b..69da951d3ba 100644 --- a/media/jni/android_media_MediaRecorder.cpp +++ b/media/jni/android_media_MediaRecorder.cpp @@ -40,6 +40,7 @@ #include #include +#include "SeempLog.h" // ---------------------------------------------------------------------------- @@ -219,7 +220,9 @@ static void android_media_MediaRecorder_setVideoEncoder(JNIEnv *env, jobject thiz, jint ve) { ALOGV("setVideoEncoder(%d)", ve); - if (ve < VIDEO_ENCODER_DEFAULT || ve >= VIDEO_ENCODER_LIST_END) { + if (ve < VIDEO_ENCODER_DEFAULT || + (ve >= VIDEO_ENCODER_LIST_END && ve <= VIDEO_ENCODER_LIST_VENDOR_START) || + ve >= VIDEO_ENCODER_LIST_VENDOR_END) { jniThrowException(env, "java/lang/IllegalArgumentException", "Invalid video encoder"); return; } @@ -390,6 +393,14 @@ android_media_MediaRecorder_start(JNIEnv *env, jobject thiz) process_media_recorder_call(env, mr->start(), "java/lang/RuntimeException", "start failed."); } +static void +android_media_MediaRecorder_pause(JNIEnv *env, jobject thiz) +{ + ALOGV("pause"); + sp mr = getMediaRecorder(env, thiz); + process_media_recorder_call(env, mr->pause(), "java/lang/RuntimeException", "pause failed."); +} + static void android_media_MediaRecorder_stop(JNIEnv *env, jobject thiz) { @@ -527,6 +538,7 @@ static JNINativeMethod gMethods[] = { {"getSurface", "()Landroid/view/Surface;", (void *)android_media_MediaRecorder_getSurface}, {"getMaxAmplitude", "()I", (void *)android_media_MediaRecorder_native_getMaxAmplitude}, {"start", "()V", (void *)android_media_MediaRecorder_start}, + {"pause", "()V", (void *)android_media_MediaRecorder_pause}, {"stop", "()V", (void *)android_media_MediaRecorder_stop}, {"native_reset", "()V", (void *)android_media_MediaRecorder_native_reset}, {"release", "()V", (void *)android_media_MediaRecorder_release}, diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index 883c8c6ed75..afa9dabd74d 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -52,7 +52,7 @@ public final class ClientOperation implements Operation, BaseStream { private static final String TAG = "ClientOperation"; - private static final boolean V = ObexHelper.VDBG; + private static final boolean V = Log.isLoggable(ObexHelper.LOG_TAG, Log.VERBOSE); private ClientSession mParent; @@ -632,21 +632,32 @@ private synchronized void startProcessing() throws IOException { if (mGetOperation) { if (!mOperationDone) { - mReplyHeader.responseCode = ResponseCodes.OBEX_HTTP_CONTINUE; - while ((more) && (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE)) { - more = sendRequest(ObexHelper.OBEX_OPCODE_GET); - } - // For GET we need to loop until all headers have been sent, - // And then we wait for the first continue package with the - // reply. - if (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE) { - mParent.sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL, - null, mReplyHeader, mPrivateInput, mSrmActive); - } - if (mReplyHeader.responseCode != ResponseCodes.OBEX_HTTP_CONTINUE) { - mOperationDone = true; + if (!mGetFinalFlag) { + mReplyHeader.responseCode = ResponseCodes.OBEX_HTTP_CONTINUE; + while ((more) && (mReplyHeader.responseCode == + ResponseCodes.OBEX_HTTP_CONTINUE)) { + more = sendRequest(ObexHelper.OBEX_OPCODE_GET); + } + // For GET we need to loop until all headers have been sent, + // And then we wait for the first continue package with the + // reply. + if (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE) { + mParent.sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL, + null, mReplyHeader, mPrivateInput, mSrmActive); + } + if (mReplyHeader.responseCode != ResponseCodes.OBEX_HTTP_CONTINUE) { + mOperationDone = true; + } else { + checkForSrm(); + } } else { - checkForSrm(); + more = sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL); + + if (more) { + throw new IOException("FINAL_GET forced, data didn't fit into one packet"); + } + + mOperationDone = true; } } } else { @@ -705,7 +716,15 @@ public synchronized boolean continueOperation(boolean sendEmpty, boolean inStrea if (mPrivateInput == null) { mPrivateInput = new PrivateInputStream(this); } - sendRequest(ObexHelper.OBEX_OPCODE_GET); + + if (!mGetFinalFlag) { + sendRequest(ObexHelper.OBEX_OPCODE_GET); + } else { + sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL); + } + if (mReplyHeader.responseCode != ResponseCodes.OBEX_HTTP_CONTINUE) { + mOperationDone = true; + } return true; } else if (mOperationDone) { diff --git a/obex/javax/obex/ClientSession.java b/obex/javax/obex/ClientSession.java index 272a920754f..f3609440acb 100644 --- a/obex/javax/obex/ClientSession.java +++ b/obex/javax/obex/ClientSession.java @@ -48,6 +48,7 @@ public final class ClientSession extends ObexSession { private static final String TAG = "ClientSession"; + private static final boolean V = Log.isLoggable(ObexHelper.LOG_TAG, Log.VERBOSE); private boolean mOpen; @@ -68,7 +69,7 @@ public final class ClientSession extends ObexSession { private final OutputStream mOutput; - private final boolean mLocalSrmSupported; + private boolean mLocalSrmSupported; private final ObexTransport mTransport; @@ -613,4 +614,9 @@ public void close() throws IOException { public boolean isSrmSupported() { return mLocalSrmSupported; } + + public void setLocalSrmStatus(boolean SrmEnabled) { + mLocalSrmSupported = SrmEnabled; + if (V) Log.v(TAG, "setLocalSrmStatus: " + mLocalSrmSupported); + } } diff --git a/obex/javax/obex/ObexHelper.java b/obex/javax/obex/ObexHelper.java index fa50943343e..431525edd23 100644 --- a/obex/javax/obex/ObexHelper.java +++ b/obex/javax/obex/ObexHelper.java @@ -52,7 +52,8 @@ public final class ObexHelper { private static final String TAG = "ObexHelper"; - public static final boolean VDBG = false; + public static final String LOG_TAG = "BluetoothObex"; + public static final boolean VDBG = Log.isLoggable(LOG_TAG, Log.VERBOSE); /** * Defines the basic packet length used by OBEX. Every OBEX packet has the * same basic format:
@@ -190,6 +191,7 @@ public static byte[] updateHeaderSet(HeaderSet header, byte[] headerArray) throw try { while (index < headerArray.length) { headerID = 0xFF & headerArray[index]; + if (VDBG) Log.v(TAG,"updateHeaderSet headerID = " + headerID); switch (headerID & (0xC0)) { /* @@ -375,8 +377,9 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { * Determine if there is a connection ID to send. If there is, * then it should be the first header in the packet. */ + if (VDBG) Log.v(TAG,"createHeader = " + head); if ((headImpl.mConnectionID != null) && (headImpl.getHeader(HeaderSet.TARGET) == null)) { - + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.CONNECTION_ID); out.write((byte)HeaderSet.CONNECTION_ID); out.write(headImpl.mConnectionID); } @@ -384,6 +387,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Count Header intHeader = (Long)headImpl.getHeader(HeaderSet.COUNT); if (intHeader != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.COUNT); out.write((byte)HeaderSet.COUNT); value = ObexHelper.convertToByteArray(intHeader.longValue()); out.write(value); @@ -395,6 +399,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Name Header stringHeader = (String)headImpl.getHeader(HeaderSet.NAME); if (stringHeader != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.NAME); out.write((byte)HeaderSet.NAME); value = ObexHelper.convertToUnicodeByteArray(stringHeader); length = value.length + 3; @@ -415,6 +420,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Type Header stringHeader = (String)headImpl.getHeader(HeaderSet.TYPE); if (stringHeader != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.TYPE); out.write((byte)HeaderSet.TYPE); try { value = stringHeader.getBytes("ISO8859_1"); @@ -436,6 +442,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Length Header intHeader = (Long)headImpl.getHeader(HeaderSet.LENGTH); if (intHeader != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.LENGTH); out.write((byte)HeaderSet.LENGTH); value = ObexHelper.convertToByteArray(intHeader.longValue()); out.write(value); @@ -447,7 +454,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Time ISO Header dateHeader = (Calendar)headImpl.getHeader(HeaderSet.TIME_ISO_8601); if (dateHeader != null) { - + if (VDBG) Log.v(TAG," Add dateHeader = " + HeaderSet.TIME_ISO_8601); /* * The ISO Header should take the form YYYYMMDDTHHMMSSZ. The * 'Z' will only be included if it is a UTC time. @@ -509,6 +516,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Time 4 Byte Header dateHeader = (Calendar)headImpl.getHeader(HeaderSet.TIME_4_BYTE); if (dateHeader != null) { + if (VDBG) Log.v(TAG," Add dateHeader = " + HeaderSet.TIME_4_BYTE); out.write(HeaderSet.TIME_4_BYTE); /* @@ -543,6 +551,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Target Header value = (byte[])headImpl.getHeader(HeaderSet.TARGET); if (value != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.TARGET); out.write((byte)HeaderSet.TARGET); length = value.length + 3; lengthArray[0] = (byte)(255 & (length >> 8)); @@ -571,6 +580,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Who Header value = (byte[])headImpl.getHeader(HeaderSet.WHO); if (value != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.WHO); out.write((byte)HeaderSet.WHO); length = value.length + 3; lengthArray[0] = (byte)(255 & (length >> 8)); @@ -582,9 +592,10 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { } } - // Connection ID Header + // Application Parameter Header value = (byte[])headImpl.getHeader(HeaderSet.APPLICATION_PARAMETER); if (value != null) { + if (VDBG) Log.v(TAG," Add APP PARAM Header = " + HeaderSet.APPLICATION_PARAMETER); out.write((byte)HeaderSet.APPLICATION_PARAMETER); length = value.length + 3; lengthArray[0] = (byte)(255 & (length >> 8)); @@ -623,6 +634,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { lengthArray[1] = (byte)(255 & length); out.write(lengthArray); out.write(value); + if (VDBG) Log.v(TAG," Add Unicode String value = " + value); if (nullOut) { headImpl.setHeader(i + 0x30, null); } @@ -637,6 +649,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { lengthArray[1] = (byte)(255 & length); out.write(lengthArray); out.write(value); + if (VDBG) Log.v(TAG," Add ByteSeq value = " + value); if (nullOut) { headImpl.setHeader(i + 0x70, null); } @@ -647,6 +660,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { if (byteHeader != null) { out.write((byte)i + 0xB0); out.write(byteHeader.byteValue()); + if (VDBG) Log.v(TAG," Add ByteHeader value = " + byteHeader.byteValue()); if (nullOut) { headImpl.setHeader(i + 0xB0, null); } @@ -657,6 +671,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { if (intHeader != null) { out.write((byte)i + 0xF0); out.write(ObexHelper.convertToByteArray(intHeader.longValue())); + if (VDBG) Log.v(TAG," Add Int value = " + intHeader.longValue()); if (nullOut) { headImpl.setHeader(i + 0xF0, null); } @@ -671,6 +686,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { lengthArray[1] = (byte)(255 & length); out.write(lengthArray); out.write(headImpl.mAuthChall); + if (VDBG) Log.v(TAG," Add mAuthChall value = " + headImpl.mAuthChall); if (nullOut) { headImpl.mAuthChall = null; } @@ -684,6 +700,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { lengthArray[1] = (byte)(255 & length); out.write(lengthArray); out.write(headImpl.mAuthResp); + if (VDBG) Log.v(TAG," Add mAuthChall value = " + headImpl.mAuthResp); if (nullOut) { headImpl.mAuthResp = null; } @@ -699,8 +716,10 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Add the SRM header byteHeader = (Byte)headImpl.getHeader(HeaderSet.SINGLE_RESPONSE_MODE); if (byteHeader != null) { + if (VDBG) Log.v(TAG," Add SRM Header = " + HeaderSet.SINGLE_RESPONSE_MODE); out.write((byte)HeaderSet.SINGLE_RESPONSE_MODE); out.write(byteHeader.byteValue()); + if (VDBG) Log.v(TAG," Add SRM value = " + byteHeader.byteValue()); if (nullOut) { headImpl.setHeader(HeaderSet.SINGLE_RESPONSE_MODE, null); } @@ -709,6 +728,7 @@ public static byte[] createHeader(HeaderSet head, boolean nullOut) { // Add the SRM parameter header byteHeader = (Byte)headImpl.getHeader(HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER); if (byteHeader != null) { + if (VDBG) Log.v(TAG," Add Header = " + HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER); out.write((byte)HeaderSet.SINGLE_RESPONSE_MODE_PARAMETER); out.write(byteHeader.byteValue()); if (nullOut) { diff --git a/obex/javax/obex/ObexSession.java b/obex/javax/obex/ObexSession.java index 542b9c8b249..f5e607cd14c 100644 --- a/obex/javax/obex/ObexSession.java +++ b/obex/javax/obex/ObexSession.java @@ -50,7 +50,7 @@ public class ObexSession { private static final String TAG = "ObexSession"; - private static final boolean V = ObexHelper.VDBG; + private static final boolean V = Log.isLoggable(ObexHelper.LOG_TAG, Log.VERBOSE); protected Authenticator mAuthenticator; diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java index 56a675acf08..87943bfe494 100644 --- a/obex/javax/obex/ServerOperation.java +++ b/obex/javax/obex/ServerOperation.java @@ -59,7 +59,7 @@ public final class ServerOperation implements Operation, BaseStream { private static final String TAG = "ServerOperation"; - private static final boolean V = ObexHelper.VDBG; // Verbose debugging + private static final boolean V = Log.isLoggable(ObexHelper.LOG_TAG, Log.VERBOSE); public boolean isAborted; @@ -124,6 +124,7 @@ public final class ServerOperation implements Operation, BaseStream { */ public ServerOperation(ServerSession p, InputStream in, int request, int maxSize, ServerRequestHandler listen) throws IOException { + if (V) Log.v(TAG, "ServerOperation"); isAborted = false; mParent = p; @@ -195,7 +196,12 @@ public ServerOperation(ServerSession p, InputStream in, int request, int maxSize if(!handleObexPacket(packet)) { return; } - if (!mHasBody) { + /* Don't Pre-Send continue when Remote requested for SRM + * Let the Application confirm. + */ + if(V) Log.v(TAG, "Get App confirmation if SRM ENABLED case: " + mSrmEnabled + + " not hasBody case: " + mHasBody); + if (!mHasBody && !mSrmEnabled) { while ((!mGetOperation) && (!finalBitSet)) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); if (mPrivateInput.available() > 0) { @@ -204,8 +210,13 @@ public ServerOperation(ServerSession p, InputStream in, int request, int maxSize } } } - - while ((!mGetOperation) && (!finalBitSet) && (mPrivateInput.available() == 0)) { + /* Don't Pre-Send continue when Remote requested for SRM + * Let the Application confirm. + */ + if(V) Log.v(TAG, "Get App confirmation if SRM ENABLED case: " + mSrmEnabled + + " not finalPacket: " + finalBitSet + " not GETOp Case: " + mGetOperation); + while ((!mSrmEnabled) && (!mGetOperation) && (!finalBitSet) + && (mPrivateInput.available() == 0)) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); if (mPrivateInput.available() > 0) { break; @@ -330,14 +341,17 @@ public boolean isValidBody() { */ public synchronized boolean continueOperation(boolean sendEmpty, boolean inStream) throws IOException { + if (V) Log.v(TAG, "continueOperation"); if (!mGetOperation) { if (!finalBitSet) { if (sendEmpty) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); + if (V) Log.v(TAG, "continueOperation:ServerSet SRM sendEmpty clause"); return true; } else { if ((mResponseSize > 3) || (mPrivateOutput.size() > 0)) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); + if (V) Log.v(TAG, "continueOperation: Server setting SRM"); return true; } else { return false; @@ -347,6 +361,7 @@ public synchronized boolean continueOperation(boolean sendEmpty, boolean inStrea return false; } } else { + if (V) Log.v(TAG, "Get continueOperation "); sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); return true; } @@ -395,6 +410,8 @@ public synchronized boolean sendReply(int type) throws IOException { bodyLength = mPrivateOutput.size(); orginalBodyLength = bodyLength; } + if(V)Log.v(TAG, "mMaxPcKLen : " + mMaxPacketLength); + if(V)Log.v(TAG, "headerArryLen : " + headerArray.length); if ((ObexHelper.BASE_PACKET_LENGTH + headerArray.length) > mMaxPacketLength) { diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java index acee5ddd5f8..33b0bde8142 100644 --- a/obex/javax/obex/ServerSession.java +++ b/obex/javax/obex/ServerSession.java @@ -47,7 +47,7 @@ public final class ServerSession extends ObexSession implements Runnable { private static final String TAG = "Obex ServerSession"; - private static final boolean V = ObexHelper.VDBG; + private static final boolean V = Log.isLoggable(ObexHelper.LOG_TAG, Log.VERBOSE); private ObexTransport mTransport; @@ -104,7 +104,6 @@ public void run() { case ObexHelper.OBEX_OPCODE_DISCONNECT: handleDisconnectRequest(); - done = true; break; case ObexHelper.OBEX_OPCODE_GET: @@ -125,6 +124,7 @@ public void run() { break; case -1: + Log.v(TAG, "Read request returned -1, exiting from loop"); done = true; break; @@ -175,7 +175,7 @@ private void handleAbortRequest() throws IOException { mInput.read(); } code = mListener.onAbort(request, reply); - Log.v(TAG, "onAbort request handler return value- " + code); + Log.d(TAG, "onAbort request handler return value- " + code); code = validateResponseCode(code); } sendResponse(code, null); @@ -195,6 +195,7 @@ private void handleAbortRequest() throws IOException { * @throws IOException if an error occurred at the transport layer */ private void handlePutRequest(int type) throws IOException { + if (V) Log.v(TAG, "handlePutRequest"); ServerOperation op = new ServerOperation(this, mInput, type, mMaxPacketLength, mListener); try { int response = -1; @@ -206,10 +207,12 @@ private void handlePutRequest(int type) throws IOException { response = validateResponseCode(mListener.onPut(op)); } if (response != ResponseCodes.OBEX_HTTP_OK && !op.isAborted) { + if (V) Log.v(TAG, "handlePutRequest pre != HTTP_OK sendReply"); op.sendReply(response); } else if (!op.isAborted) { // wait for the final bit while (!op.finalBitSet) { + if (V) Log.v(TAG, "handlePutRequest pre looped sendReply"); op.sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); } op.sendReply(response); @@ -220,7 +223,7 @@ private void handlePutRequest(int type) throws IOException { *internal error should not be sent because server has already replied with *OK response in "sendReply") */ - if(V) Log.d(TAG,"Exception occured - sending OBEX_HTTP_INTERNAL_ERROR reply",e); + if(V) Log.w(TAG,"Exception occured - sending OBEX_HTTP_INTERNAL_ERROR reply",e); if (!op.isAborted) { sendResponse(ResponseCodes.OBEX_HTTP_INTERNAL_ERROR, null); } @@ -241,6 +244,7 @@ private void handlePutRequest(int type) throws IOException { * @throws IOException if an error occurred at the transport layer */ private void handleGetRequest(int type) throws IOException { + if (V) Log.v(TAG, "handleGetRequest"); ServerOperation op = new ServerOperation(this, mInput, type, mMaxPacketLength, mListener); try { int response = validateResponseCode(mListener.onGet(op)); @@ -263,6 +267,7 @@ private void handleGetRequest(int type) throws IOException { public void sendResponse(int code, byte[] header) throws IOException { int totalLength = 3; byte[] data = null; + if (V) Log.v(TAG,"sendResponse code " + code + " header : " + header); OutputStream op = mOutput; if (op == null) { return; @@ -270,6 +275,7 @@ public void sendResponse(int code, byte[] header) throws IOException { if (header != null) { totalLength += header.length; + if (V) Log.v(TAG, "header != null totalLength = " + totalLength); data = new byte[totalLength]; data[0] = (byte)code; data[1] = (byte)(totalLength >> 8); @@ -658,6 +664,12 @@ private void handleConnectRequest() throws IOException { */ byte[] sendData = new byte[totalLength]; int maxRxLength = ObexHelper.getMaxRxPacketSize(mTransport); + //PTS expects least of maxPacketLen + if(maxRxLength > mMaxPacketLength) { + if(V) Log.v(TAG,"Set maxRxLength to min of maxRxServrLen:" + maxRxLength + + " and MaxNegotiated from Client: " + mMaxPacketLength); + maxRxLength = mMaxPacketLength; + } sendData[0] = (byte)code; sendData[1] = length[2]; sendData[2] = length[3]; diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index 0d326ecca56..9a86c8ef2f2 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -530,8 +530,10 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) { for (int i = 0; i < size; i++) { if (checked.valueAt(i)) { final Cursor cursor = mAdapter.getItem(checked.keyAt(i)); - final DocumentInfo doc = DocumentInfo.fromDirectoryCursor(cursor); - docs.add(doc); + if (cursor != null) { + final DocumentInfo doc = DocumentInfo.fromDirectoryCursor(cursor); + docs.add(doc); + } } } diff --git a/packages/Keyguard/res/values/strings.xml b/packages/Keyguard/res/values/strings.xml index d1e84f5ee3b..52708318614 100644 --- a/packages/Keyguard/res/values/strings.xml +++ b/packages/Keyguard/res/values/strings.xml @@ -48,6 +48,9 @@ to unlock the keyguard. Displayed in one line in a large font. --> Incorrect PIN code. + + Invalid Card. + Charged @@ -74,6 +77,8 @@ Network locked + + SIM card is Perso locked No SIM card @@ -355,4 +360,10 @@ Not recognized + + + Enter SIM PIN, you have %d remaining attempt before you must contact your carrier to unlock your device. + Enter SIM PIN, you have %d remaining attempts. + + diff --git a/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/packages/Keyguard/src/com/android/keyguard/CarrierText.java index 159ac4cc6cb..99c4035f052 100644 --- a/packages/Keyguard/src/com/android/keyguard/CarrierText.java +++ b/packages/Keyguard/src/com/android/keyguard/CarrierText.java @@ -28,6 +28,7 @@ import android.net.wifi.WifiManager; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; +import android.telephony.TelephonyManager; import android.text.TextUtils; import android.text.method.SingleLineTransformationMethod; import android.util.AttributeSet; @@ -65,6 +66,12 @@ public void onFinishedGoingToSleep(int why) { public void onStartedWakingUp() { setSelected(true); }; + + public void onSimStateChanged(int subId, int slotId, IccCardConstants.State simState) { + if (getStatusForIccState(simState) == StatusMode.SimIoError) { + updateCarrierText(); + } + }; }; /** * The status of this lock screen. Primarily used for widgets on LockScreen. @@ -77,7 +84,8 @@ private static enum StatusMode { SimPukLocked, // SIM card is PUK locked because SIM entered wrong too many times SimLocked, // SIM card is currently locked SimPermDisabled, // SIM card is permanently disabled due to PUK unlock failure - SimNotReady; // SIM is not ready yet. May never be on devices w/o a SIM. + SimNotReady, // SIM is not ready yet. May never be on devices w/o a SIM. + SimIoError; //The sim card is faulty } public CarrierText(Context context) { @@ -104,15 +112,59 @@ public CarrierText(Context context, AttributeSet attrs) { protected void updateCarrierText() { boolean allSimsMissing = true; boolean anySimReadyAndInService = false; + boolean showLocale = getContext().getResources().getBoolean( + com.android.internal.R.bool.config_monitor_locale_change); + boolean showRat = getContext().getResources().getBoolean( + com.android.internal.R.bool.config_display_rat); CharSequence displayText = null; List subs = mKeyguardUpdateMonitor.getSubscriptionInfo(false); final int N = subs.size(); if (DEBUG) Log.d(TAG, "updateCarrierText(): " + N); for (int i = 0; i < N; i++) { + CharSequence networkClass = ""; int subId = subs.get(i).getSubscriptionId(); State simState = mKeyguardUpdateMonitor.getSimState(subId); + if (showRat) { + ServiceState ss = mKeyguardUpdateMonitor.mServiceStates.get(subId); + if (ss != null && (ss.getDataRegState() == ServiceState.STATE_IN_SERVICE + || ss.getVoiceRegState() == ServiceState.STATE_IN_SERVICE)) { + int networkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; + if (ss.getRilDataRadioTechnology() != + ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) { + networkType = ss.getDataNetworkType(); + } else if (ss.getRilVoiceRadioTechnology() != + ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) { + networkType = ss.getVoiceNetworkType(); + } + networkClass = networkClassToString(TelephonyManager + .getNetworkClass(networkType)); + } + } CharSequence carrierName = subs.get(i).getCarrierName(); + if (showLocale || showRat) { + String[] names = carrierName.toString().split(mSeparator.toString(), 2); + StringBuilder newCarrierName = new StringBuilder(); + for (int j = 0; j < names.length; j++) { + if (showLocale) { + names[j] = android.util.NativeTextHelper.getLocalString(getContext(), + names[j], com.android.internal.R.array.origin_carrier_names, + com.android.internal.R.array.locale_carrier_names); + } + if (!TextUtils.isEmpty(names[j])) { + if (!TextUtils.isEmpty(networkClass) && showRat) { + names[j] = new StringBuilder().append(names[j]).append(" ") + .append(networkClass).toString(); + } + if (j > 0 && names[j].equals(names[j-1])) { + continue; + } + if (j > 0) newCarrierName.append(mSeparator); + newCarrierName.append(names[j]); + } + } + carrierName = newCarrierName.toString(); + } CharSequence carrierTextForSimState = getCarrierTextForSimState(simState, carrierName); if (DEBUG) { Log.d(TAG, "Handling (subId=" + subId + "): " + simState + " " + carrierName); @@ -243,7 +295,7 @@ private CharSequence getCarrierTextForSimState(IccCardConstants.State simState, case NetworkLocked: carrierText = makeCarrierStringOnEmergencyCapable( - mContext.getText(R.string.keyguard_network_locked_message), text); + getContext().getText(R.string.keyguard_perso_locked_message), text); break; case SimMissing: @@ -270,6 +322,11 @@ private CharSequence getCarrierTextForSimState(IccCardConstants.State simState, getContext().getText(R.string.keyguard_sim_puk_locked_message), text); break; + case SimIoError: + carrierText = makeCarrierStringOnEmergencyCapable( + getContext().getText(R.string.lockscreen_sim_error_message_short), + text); + break; } return carrierText; @@ -306,7 +363,7 @@ private StatusMode getStatusForIccState(IccCardConstants.State simState) { case ABSENT: return StatusMode.SimMissing; case NETWORK_LOCKED: - return StatusMode.SimMissingLocked; + return StatusMode.NetworkLocked; case NOT_READY: return StatusMode.SimNotReady; case PIN_REQUIRED: @@ -319,6 +376,8 @@ private StatusMode getStatusForIccState(IccCardConstants.State simState) { return StatusMode.SimPermDisabled; case UNKNOWN: return StatusMode.SimMissing; + case CARD_IO_ERROR: + return StatusMode.SimIoError; } return StatusMode.SimMissing; } @@ -387,4 +446,16 @@ public CharSequence getTransformation(CharSequence source, View view) { return source; } } + + private String networkClassToString (int networkClass) { + final int[] classIds = { 0, // TelephonyManager.NETWORK_CLASS_UNKNOWN + com.android.internal.R.string.config_rat_2g, + com.android.internal.R.string.config_rat_3g, + com.android.internal.R.string.config_rat_4g }; + String classString = null; + if (networkClass < classIds.length) { + classString = getContext().getResources().getString(classIds[networkClass]); + } + return (classString == null) ? "" : classString; + } } diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java index cbf22c00d61..1411aaa15e0 100644 --- a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java +++ b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java @@ -22,6 +22,7 @@ import android.content.res.Configuration; import android.os.PowerManager; import android.os.SystemClock; +import android.os.SystemProperties; import android.os.UserHandle; import android.telecom.TelecomManager; import android.util.AttributeSet; @@ -135,7 +136,7 @@ public void takeEmergencyCallAction() { } } - private void updateEmergencyCallButton() { + public void updateEmergencyCallButton() { boolean visible = false; if (mIsVoiceCapable) { // Emergency calling requires voice capability. @@ -149,7 +150,8 @@ private void updateEmergencyCallButton() { visible = mEnableEmergencyCallWhileSimLocked; } else { // Only show if there is a secure screen (pin/pattern/SIM pin/SIM puk); - visible = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser()); + visible = mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser()) || + SystemProperties.getBoolean("persist.radio.emgcy_btn_onswipe", false); } } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java index 2033159af72..1d10b57f48c 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java @@ -50,7 +50,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView { private ProgressDialog mSimUnlockProgressDialog = null; private CheckSimPin mCheckSimPinThread; - + private boolean mShowDefaultMessage = true; + private int mRemainingAttempts = -1; private AlertDialog mRemainingAttemptsDialog; private int mSubId; private ImageView mSimImageView; @@ -74,25 +75,8 @@ public KeyguardSimPinView(Context context, AttributeSet attrs) { public void resetState() { super.resetState(); if (DEBUG) Log.v(TAG, "Resetting state"); - KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext); - mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED); - if (SubscriptionManager.isValidSubscriptionId(mSubId)) { - int count = TelephonyManager.getDefault().getSimCount(); - Resources rez = getResources(); - final String msg; - int color = Color.WHITE; - if (count < 2) { - msg = rez.getString(R.string.kg_sim_pin_instructions); - } else { - SubscriptionInfo info = monitor.getSubscriptionInfoForSubId(mSubId); - CharSequence displayName = info != null ? info.getDisplayName() : ""; // don't crash - msg = rez.getString(R.string.kg_sim_pin_instructions_multi, displayName); - if (info != null) { - color = info.getIconTint(); - } - } - mSecurityMessageDisplay.setMessage(msg, true); - mSimImageView.setImageTintList(ColorStateList.valueOf(color)); + if (mShowDefaultMessage) { + showDefaultMessage(); } } @@ -108,17 +92,19 @@ protected int getPromtReasonStringRes(int reason) { return 0; } - private String getPinPasswordErrorMessage(int attemptsRemaining) { + private String getPinPasswordErrorMessage(int attemptsRemaining, boolean isDefault) { String displayMessage; - + int msgId; if (attemptsRemaining == 0) { displayMessage = getContext().getString(R.string.kg_password_wrong_pin_code_pukked); } else if (attemptsRemaining > 0) { + msgId = isDefault ? R.plurals.kg_password_default_pin_message : + R.plurals.kg_password_wrong_pin_code; displayMessage = getContext().getResources() - .getQuantityString(R.plurals.kg_password_wrong_pin_code, attemptsRemaining, - attemptsRemaining); + .getQuantityString(msgId, attemptsRemaining, attemptsRemaining); } else { - displayMessage = getContext().getString(R.string.kg_password_pin_failed); + msgId = isDefault ? R.string.kg_sim_pin_instructions : R.string.kg_password_pin_failed; + displayMessage = getContext().getString(msgId); } if (DEBUG) Log.d(LOG_TAG, "getPinPasswordErrorMessage:" + " attemptsRemaining=" + attemptsRemaining + " displayMessage=" + displayMessage); @@ -150,6 +136,9 @@ protected void onFinishInflate() { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); + if (mShowDefaultMessage) { + showDefaultMessage(); + } KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback); } @@ -228,7 +217,7 @@ private Dialog getSimUnlockProgressDialog() { } private Dialog getSimRemainingAttemptsDialog(int remaining) { - String msg = getPinPasswordErrorMessage(remaining); + String msg = getPinPasswordErrorMessage(remaining, false); if (mRemainingAttemptsDialog == null) { Builder builder = new AlertDialog.Builder(mContext); builder.setMessage(msg); @@ -262,6 +251,7 @@ protected void verifyPasswordAndUnlock() { void onSimCheckResponse(final int result, final int attemptsRemaining) { post(new Runnable() { public void run() { + mRemainingAttempts = attemptsRemaining; if (mSimUnlockProgressDialog != null) { mSimUnlockProgressDialog.hide(); } @@ -269,8 +259,12 @@ public void run() { if (result == PhoneConstants.PIN_RESULT_SUCCESS) { KeyguardUpdateMonitor.getInstance(getContext()) .reportSimUnlocked(mSubId); - mCallback.dismiss(true); + mRemainingAttempts = -1; + if (mCallback != null) { + mCallback.dismiss(true); + } } else { + mShowDefaultMessage = false; if (result == PhoneConstants.PIN_PASSWORD_INCORRECT) { if (attemptsRemaining <= 2) { // this is getting critical - show dialog @@ -278,7 +272,8 @@ public void run() { } else { // show message mSecurityMessageDisplay.setMessage( - getPinPasswordErrorMessage(attemptsRemaining), true); + getPinPasswordErrorMessage( + attemptsRemaining, false), true); } } else { // "PIN operation failed!" - no idea what this was and no way to @@ -309,5 +304,47 @@ public void startAppearAnimation() { public boolean startDisappearAnimation(Runnable finishRunnable) { return false; } + + private void showDefaultMessage() { + KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext); + mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED); + if (!SubscriptionManager.isValidSubscriptionId(mSubId)) { + return; + } + if (mRemainingAttempts >= 0) { + mSecurityMessageDisplay.setMessage(getPinPasswordErrorMessage( + mRemainingAttempts, true), true); + return; + } + + int count = TelephonyManager.getDefault().getSimCount(); + Resources rez = getResources(); + final String msg; + int color = Color.WHITE; + if (count < 2) { + msg = rez.getString(R.string.kg_sim_pin_instructions); + } else { + SubscriptionInfo info = monitor.getSubscriptionInfoForSubId(mSubId); + CharSequence displayName = info != null ? info.getDisplayName() : ""; // don't crash + msg = rez.getString(R.string.kg_sim_pin_instructions_multi, displayName); + if (info != null) { + color = info.getIconTint(); + } + } + mSecurityMessageDisplay.setMessage(msg, true); + mSimImageView.setImageTintList(ColorStateList.valueOf(color)); + + new CheckSimPin("", mSubId) { + void onSimCheckResponse(final int result, final int attemptsRemaining) { + Log.d(LOG_TAG, "onSimCheckResponse " + " dummy One result" + result + + " attemptsRemaining=" + attemptsRemaining); + if (attemptsRemaining >= 0) { + mRemainingAttempts = attemptsRemaining; + mSecurityMessageDisplay.setMessage( + getPinPasswordErrorMessage(attemptsRemaining, true), true); + } + } + }.start(); + } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java index af882395ee7..7ba952b72ef 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java @@ -50,6 +50,7 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView { private ProgressDialog mSimUnlockProgressDialog = null; private CheckSimPuk mCheckSimPukThread; + private boolean mShowDefaultMessage = true; private String mPukText; private String mPinText; private StateMachine mStateMachine = new StateMachine(); @@ -133,7 +134,10 @@ void reset() { color = info.getIconTint(); } } - mSecurityMessageDisplay.setMessage(msg, true); + if (mShowDefaultMessage) { + mSecurityMessageDisplay.setMessage(msg, true); + } + mShowDefaultMessage = true; mSimImageView.setImageTintList(ColorStateList.valueOf(color)); } mPasswordEntry.requestFocus(); @@ -328,6 +332,7 @@ public void run() { .reportSimUnlocked(mSubId); mCallback.dismiss(true); } else { + mShowDefaultMessage = false; if (result == PhoneConstants.PIN_PASSWORD_INCORRECT) { if (attemptsRemaining <= 2) { // this is getting critical - show dialog diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java index f95b0aebfd7..6cdf0cbba56 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java @@ -23,6 +23,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.os.UserHandle; +import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.AttributeSet; @@ -229,25 +230,27 @@ static void update(Context context, boolean hasAlarm) { : R.string.abbrev_wday_month_day_no_year); final String clockView12Skel = res.getString(R.string.clock_12hr_format); final String clockView24Skel = res.getString(R.string.clock_24hr_format); - final String key = locale.toString() + dateViewSkel + clockView12Skel + clockView24Skel; - if (key.equals(cacheKey)) return; - - dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); - + if (res.getBoolean(com.android.internal.R.bool.config_dateformat)) { + final String dateformat = Settings.System.getString(context.getContentResolver(), + Settings.System.DATE_FORMAT); + dateView = dateformat.equals(dateView) ? dateView : dateformat; + } else { + final String key = locale.toString() + dateViewSkel + clockView12Skel + + clockView24Skel; + if (key.equals(cacheKey)) return; + dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); + cacheKey = key; + } clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel); // CLDR insists on adding an AM/PM indicator even though it wasn't in the skeleton // format. The following code removes the AM/PM indicator if we didn't want it. if (!clockView12Skel.contains("a")) { clockView12 = clockView12.replaceAll("a", "").trim(); } - clockView24 = DateFormat.getBestDateTimePattern(locale, clockView24Skel); - // Use fancy colon. clockView24 = clockView24.replace(':', '\uee01'); clockView12 = clockView12.replace(':', '\uee01'); - - cacheKey = key; } } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java index 57ee319f8ff..e82db976cec 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -136,6 +136,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { private static final int MSG_SERVICE_STATE_CHANGE = 330; private static final int MSG_SCREEN_TURNED_ON = 331; private static final int MSG_SCREEN_TURNED_OFF = 332; + private static final int MSG_LOCALE_CHANGED = 500; /** Fingerprint state: Not listening to fingerprint. */ private static final int FINGERPRINT_STATE_STOPPED = 0; @@ -274,6 +275,9 @@ public void handleMessage(Message msg) { case MSG_SCREEN_TURNED_OFF: handleScreenTurnedOff(); break; + case MSG_LOCALE_CHANGED: + handleLocaleChanged(); + break; } } }; @@ -650,6 +654,8 @@ MSG_BATTERY_UPDATE, new BatteryStatus(status, level, plugged, health, } mHandler.sendMessage( mHandler.obtainMessage(MSG_SERVICE_STATE_CHANGE, subId, 0, serviceState)); + } else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) { + mHandler.sendEmptyMessage(MSG_LOCALE_CHANGED); } } }; @@ -772,11 +778,13 @@ static SimData fromIntent(Intent intent) { state = IccCardConstants.State.PIN_REQUIRED; } else if (IccCardConstants.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) { state = IccCardConstants.State.PUK_REQUIRED; + } else if (IccCardConstants.INTENT_VALUE_LOCKED_NETWORK.equals(lockedReason)) { + state = IccCardConstants.State.NETWORK_LOCKED; } else { state = IccCardConstants.State.UNKNOWN; } - } else if (IccCardConstants.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) { - state = IccCardConstants.State.NETWORK_LOCKED; + } else if (IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR.equals(stateExtra)) { + state = IccCardConstants.State.CARD_IO_ERROR; } else if (IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(stateExtra) || IccCardConstants.INTENT_VALUE_ICC_IMSI.equals(stateExtra)) { // This is required because telephony doesn't return to "READY" after @@ -976,6 +984,7 @@ private KeyguardUpdateMonitor(Context context) { filter.addAction(Intent.ACTION_BATTERY_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); + filter.addAction(Intent.ACTION_LOCALE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED); filter.addAction(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED); filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); @@ -1315,6 +1324,18 @@ private void handleSimStateChange(int subId, int slotId, State state) { } } + /** + * Handle {@link #MSG_LOCALE_CHANGED} + */ + private void handleLocaleChanged() { + for (int j = 0; j < mCallbacks.size(); j++) { + KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get(); + if (cb != null) { + cb.onRefreshCarrierInfo(); + } + } + } + /** * Handle {@link #MSG_SERVICE_STATE_CHANGE} */ diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml index 9b1f103edfa..bc1f16dabbe 100644 --- a/packages/SettingsLib/res/values/strings.xml +++ b/packages/SettingsLib/res/values/strings.xml @@ -123,6 +123,8 @@ Message Access SIM Access + + Dial-up Network Access Connected to media audio @@ -142,6 +144,8 @@ Connected to device for Internet access Sharing local Internet connection with device + + Connected to Dun Server Use for input + + Use for Dial-up Network access Pair diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java old mode 100755 new mode 100644 index 9608daad70e..873d3925233 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java @@ -116,7 +116,11 @@ public boolean connect(BluetoothDevice device) { List sinks = getConnectedDevices(); if (sinks != null) { for (BluetoothDevice sink : sinks) { - mService.disconnect(sink); + if (sink.equals(device)) { + // Connect to same device, Ignore it + Log.d(TAG,"Not disconnecting device = " + sink); + return true; + } } } return mService.connect(device); @@ -124,18 +128,36 @@ public boolean connect(BluetoothDevice device) { public boolean disconnect(BluetoothDevice device) { if (mService == null) return false; - // Downgrade priority as user is disconnecting the headset. - if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ - mService.setPriority(device, BluetoothProfile.PRIORITY_ON); + List deviceList = mService.getConnectedDevices(); + if (!deviceList.isEmpty()) { + for (BluetoothDevice dev : deviceList) { + if (dev.equals(device)) { + if (V) Log.d(TAG,"Downgrade priority as user" + + "is disconnecting the headset"); + // Downgrade priority as user is disconnecting the headset. + if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) { + mService.setPriority(device, BluetoothProfile.PRIORITY_ON); + } + return mService.disconnect(device); + } + } } - return mService.disconnect(device); + return false; } public int getConnectionStatus(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.STATE_DISCONNECTED; } - return mService.getConnectionState(device); + List deviceList = mService.getConnectedDevices(); + if (!deviceList.isEmpty()) { + for (BluetoothDevice dev : deviceList) { + if (dev.equals(device)) { + return mService.getConnectionState(device); + } + } + } + return BluetoothProfile.STATE_DISCONNECTED; } public boolean isPreferred(BluetoothDevice device) { diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java new file mode 100755 index 00000000000..fd76d81fa08 --- /dev/null +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2011 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 com.android.settingslib.bluetooth; + +import android.bluetooth.BluetoothA2dpSink; +import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothClass; +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothProfile; +import android.bluetooth.BluetoothUuid; +import android.content.Context; +import android.os.ParcelUuid; +import android.util.Log; + +import com.android.settingslib.R; + +import java.util.ArrayList; +import java.util.List; + +final class A2dpSinkProfile implements LocalBluetoothProfile { + private static final String TAG = "A2dpSinkProfile"; + private static boolean V = true; + + private BluetoothA2dpSink mService; + private boolean mIsProfileReady; + + private final LocalBluetoothAdapter mLocalAdapter; + private final CachedBluetoothDeviceManager mDeviceManager; + + static final ParcelUuid[] SRC_UUIDS = { + BluetoothUuid.AudioSource, + BluetoothUuid.AdvAudioDist, + }; + + static final String NAME = "A2DPSink"; + private final LocalBluetoothProfileManager mProfileManager; + + // Order of this profile in device profiles list + private static final int ORDINAL = 5; + + // These callbacks run on the main thread. + private final class A2dpSinkServiceListener + implements BluetoothProfile.ServiceListener { + + public void onServiceConnected(int profile, BluetoothProfile proxy) { + if (V) Log.d(TAG,"Bluetooth service connected"); + mService = (BluetoothA2dpSink) proxy; + // We just bound to the service, so refresh the UI for any connected A2DP devices. + List deviceList = mService.getConnectedDevices(); + while (!deviceList.isEmpty()) { + BluetoothDevice nextDevice = deviceList.remove(0); + CachedBluetoothDevice device = mDeviceManager.findDevice(nextDevice); + // we may add a new device here, but generally this should not happen + if (device == null) { + Log.w(TAG, "A2dpSinkProfile found new device: " + nextDevice); + device = mDeviceManager.addDevice(mLocalAdapter, mProfileManager, nextDevice); + } + device.onProfileStateChanged(A2dpSinkProfile.this, BluetoothProfile.STATE_CONNECTED); + device.refresh(); + } + mIsProfileReady=true; + } + + public void onServiceDisconnected(int profile) { + if (V) Log.d(TAG,"Bluetooth service disconnected"); + mIsProfileReady=false; + } + } + + public boolean isProfileReady() { + return mIsProfileReady; + } + + A2dpSinkProfile(Context context, LocalBluetoothAdapter adapter, + CachedBluetoothDeviceManager deviceManager, + LocalBluetoothProfileManager profileManager) { + mLocalAdapter = adapter; + mDeviceManager = deviceManager; + mProfileManager = profileManager; + mLocalAdapter.getProfileProxy(context, new A2dpSinkServiceListener(), + BluetoothProfile.A2DP_SINK); + } + + public boolean isConnectable() { + return true; + } + + public boolean isAutoConnectable() { + return true; + } + + public List getConnectedDevices() { + if (mService == null) return new ArrayList(0); + return mService.getDevicesMatchingConnectionStates( + new int[] {BluetoothProfile.STATE_CONNECTED, + BluetoothProfile.STATE_CONNECTING, + BluetoothProfile.STATE_DISCONNECTING}); + } + + public boolean connect(BluetoothDevice device) { + if (mService == null) return false; + List srcs = getConnectedDevices(); + if (srcs != null) { + for (BluetoothDevice src : srcs) { + if (src.equals(device)) { + // Connect to same device, Ignore it + Log.d(TAG,"Ignoring Connect"); + return true; + } + } + for (BluetoothDevice src : srcs) { + mService.disconnect(src); + } + } + return mService.connect(device); + } + + public boolean disconnect(BluetoothDevice device) { + if (mService == null) return false; + // Downgrade priority as user is disconnecting the headset. + if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ + mService.setPriority(device, BluetoothProfile.PRIORITY_ON); + } + return mService.disconnect(device); + } + + public int getConnectionStatus(BluetoothDevice device) { + if (mService == null) { + return BluetoothProfile.STATE_DISCONNECTED; + } + return mService.getConnectionState(device); + } + + public boolean isPreferred(BluetoothDevice device) { + if (mService == null) return false; + return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; + } + + public int getPreferred(BluetoothDevice device) { + if (mService == null) return BluetoothProfile.PRIORITY_OFF; + return mService.getPriority(device); + } + + public void setPreferred(BluetoothDevice device, boolean preferred) { + if (mService == null) return; + if (preferred) { + if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { + mService.setPriority(device, BluetoothProfile.PRIORITY_ON); + } + } else { + mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); + } + } + + boolean isA2dpPlaying() { + if (mService == null) return false; + List srcs = mService.getConnectedDevices(); + if (!srcs.isEmpty()) { + if (mService.isA2dpPlaying(srcs.get(0))) { + return true; + } + } + return false; + } + + public String toString() { + return NAME; + } + + public int getOrdinal() { + return ORDINAL; + } + + public int getNameResource(BluetoothDevice device) { + // we need to have same string in UI for even SINK Media Audio. + return R.string.bluetooth_profile_a2dp; + } + + public int getSummaryResourceForDevice(BluetoothDevice device) { + int state = getConnectionStatus(device); + switch (state) { + case BluetoothProfile.STATE_DISCONNECTED: + return R.string.bluetooth_a2dp_profile_summary_use_for; + + case BluetoothProfile.STATE_CONNECTED: + return R.string.bluetooth_a2dp_profile_summary_connected; + + default: + return Utils.getConnectionStateSummary(state); + } + } + + public int getDrawableResource(BluetoothClass btClass) { + return R.drawable.ic_bt_headphones_a2dp; + } + + protected void finalize() { + if (V) Log.d(TAG, "finalize()"); + if (mService != null) { + try { + BluetoothAdapter.getDefaultAdapter().closeProfileProxy(BluetoothProfile.A2DP_SINK, + mService); + mService = null; + }catch (Throwable t) { + Log.w(TAG, "Error cleaning up A2DP proxy", t); + } + } + } +} diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothDeviceFilter.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothDeviceFilter.java old mode 100644 new mode 100755 index 8dec86ac361..0bd8dbd0e7e --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothDeviceFilter.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothDeviceFilter.java @@ -112,11 +112,15 @@ boolean matches(ParcelUuid[] uuids, BluetoothClass btClass) { if (BluetoothUuid.containsAnyUuid(uuids, A2dpProfile.SINK_UUIDS)) { return true; } + if (BluetoothUuid.containsAnyUuid(uuids, A2dpSinkProfile.SRC_UUIDS)) { + return true; + } if (BluetoothUuid.containsAnyUuid(uuids, HeadsetProfile.UUIDS)) { return true; } } else if (btClass != null) { if (btClass.doesClassMatch(BluetoothClass.PROFILE_A2DP) || + btClass.doesClassMatch(BluetoothClass.PROFILE_A2DP_SINK) || btClass.doesClassMatch(BluetoothClass.PROFILE_HEADSET)) { return true; } diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java index 4bcbea76f13..76408d7062d 100755 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java @@ -23,6 +23,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.text.TextUtils; import android.util.Log; import com.android.settingslib.R; @@ -107,6 +110,7 @@ void setProfileManager(LocalBluetoothProfileManager manager) { addHandler(Intent.ACTION_DOCK_EVENT, new DockEventHandler()); mContext.registerReceiver(mBroadcastReceiver, mAdapterIntentFilter, null, mReceiverHandler); + setDefaultBtName(); } void registerProfileIntentReceiver() { @@ -120,6 +124,25 @@ public void setReceiverHandler(android.os.Handler handler) { registerProfileIntentReceiver(); } + // set bluetooth default name + private void setDefaultBtName() { + String name = mContext.getResources().getString( + com.android.internal.R.string.def_custom_bt_defname); + boolean needSet = !TextUtils.isEmpty(name); + Log.d(TAG, "custom bluetooth name: " + name); + // This flag is to only set default bluetooth name once. + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext); + boolean notSet = preferences.getBoolean("is_first_boot",true); + // only bluetooth state is on, set name will success, or, it will fail. + boolean okToSet = mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_ON; + if (needSet && notSet && okToSet) { + mLocalAdapter.setName(name); + SharedPreferences.Editor edit = preferences.edit(); + edit.putBoolean("is_first_boot",false); + edit.apply(); + } + } + /** Register to start receiving callbacks for Bluetooth events. */ public void registerCallback(BluetoothCallback callback) { synchronized (mCallbacks) { @@ -155,6 +178,9 @@ public void onReceive(Context context, Intent intent, BluetoothAdapter.ERROR); // update local profiles and get paired devices mLocalAdapter.setBluetoothStateInt(state); + if (state == BluetoothAdapter.STATE_ON) { + setDefaultBtName(); + } // send callback to update UI and possibly start scanning synchronized (mCallbacks) { for (BluetoothCallback callback : mCallbacks) { @@ -196,6 +222,8 @@ public void onReceive(Context context, Intent intent, cachedDevice = mDeviceManager.addDevice(mLocalAdapter, mProfileManager, device); Log.d(TAG, "DeviceFoundHandler created new CachedBluetoothDevice: " + cachedDevice); + // callback to UI to create Preference for new device + dispatchDeviceAdded(cachedDevice); } cachedDevice.setRssi(rssi); cachedDevice.setBtClass(btClass); diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index d994841d64f..d15fc56b1da 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -135,6 +135,8 @@ void onProfileStateChanged(LocalBluetoothProfile profile, int newProfileState) { if (newProfileState == BluetoothProfile.STATE_CONNECTED) { if (profile instanceof MapProfile) { profile.setPreferred(mDevice, true); + mRemovedProfiles.remove(profile); + mProfiles.add(profile); } else if (!mProfiles.contains(profile)) { mRemovedProfiles.remove(profile); mProfiles.add(profile); @@ -521,7 +523,29 @@ void refreshBtClass() { * Refreshes the UI when framework alerts us of a UUID change. */ void onUuidChanged() { + Log.d(TAG, " onUuidChanged, mProfile Size " + mProfiles.size()); + List mPrevProfiles = + new ArrayList(); + mPrevProfiles.clear(); + mPrevProfiles.addAll(mProfiles); updateProfiles(); + /* + * Check if new profiles are added + */ + if ((mPrevProfiles.containsAll(mProfiles)) && (!mPrevProfiles.isEmpty())) { + Log.d(TAG,"UUID not udpated, returning"); + mProfiles.clear(); + mProfiles.addAll(mPrevProfiles); + return; + } + for (int i = 0; i { private Object mTag; + public boolean foundInScanResult = false; + public AccessPoint(Context context, Bundle savedState) { mContext = context; mConfig = savedState.getParcelable(KEY_CONFIG); @@ -640,12 +642,7 @@ private boolean isInfoForThisAccessPoint(WifiConfiguration config, WifiInfo info } else if (config != null) { return matches(config); } - else { - // Might be an ephemeral connection with no WifiConfiguration. Try matching on SSID. - // (Note that we only do this if the WifiConfiguration explicitly equals INVALID). - // TODO: Handle hex string SSIDs. - return ssid.equals(removeDoubleQuotes(info.getSSID())); - } + return false; } public boolean isSaved() { diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index c28288eb91b..ed0371c059e 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -320,6 +320,7 @@ private void updateAccessPoints() { continue; } AccessPoint accessPoint = getCachedOrCreate(config, cachedAccessPoints); + accessPoint.foundInScanResult = false; if (mLastInfo != null && mLastNetworkInfo != null) { if (config.isPasspoint() == false) { accessPoint.update(connectionConfig, mLastInfo, mLastNetworkInfo); @@ -352,6 +353,7 @@ private void updateAccessPoints() { boolean found = false; for (AccessPoint accessPoint : apMap.getAll(result.SSID)) { if (accessPoint.update(result)) { + accessPoint.foundInScanResult = true; found = true; break; } diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index ef32c190b50..0f550ebdc90 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -213,4 +213,82 @@ + + + + + + + + + false + + + 5 + + + 11 + + + 4 + + + 6 + + + 5 + + + 5 + + + 11 + + + 4 + + + 6 + + + 5 + + + 5 + + + 11 + + + 4 + + + 6 + + + 5 + + + 4 + + + + + + + + + 0 + + + diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java index 2e96f18bedb..0c6b4c44095 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -261,13 +261,13 @@ public String configKey() { // Now build the canonical config key paralleling the WifiConfiguration semantics final String key; if (types.get(KeyMgmt.WPA_PSK)) { - key = bareSsid + KeyMgmt.strings[KeyMgmt.WPA_PSK]; + key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK]; } else if (types.get(KeyMgmt.WPA_EAP) || types.get(KeyMgmt.IEEE8021X)) { - key = bareSsid + KeyMgmt.strings[KeyMgmt.WPA_EAP]; + key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } else if (hasWepKey) { - key = bareSsid + "WEP"; // hardcoded this way in WifiConfiguration + key = bareSsid + "-WEP"; // hardcoded this way in WifiConfiguration } else { - key = bareSsid + KeyMgmt.strings[KeyMgmt.NONE]; + key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.NONE]; } return key; } diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index aa00f7df6f0..b8eeafb4418 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -124,6 +124,11 @@ public class SettingsProvider extends ContentProvider { private static final String TABLE_BOOKMARKS = "bookmarks"; private static final String TABLE_ANDROID_METADATA = "android_metadata"; + private static final String HEADSET = "_headset"; + private static final String HEADPHONE = "_headphone"; + private static final String SPEAKER = "_speaker"; + private static final String EARPIECE = "_earpiece"; + // The set of removed legacy tables. private static final Set REMOVED_LEGACY_TABLES = new ArraySet<>(); static { @@ -1925,6 +1930,139 @@ private SettingsState getSystemSettingsLocked(int userId) { return getSettingsLocked(SETTINGS_TYPE_SYSTEM, userId); } + private void loadCustomizedVolumeLevels(SettingsState systemSettings) { + + systemSettings.updateSettingLocked(Settings.System.VOLUME_MUSIC, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_music_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.updateSettingLocked(Settings.System.VOLUME_RING, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_ringtone_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.updateSettingLocked(Settings.System.VOLUME_VOICE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_voice_call_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.updateSettingLocked(Settings.System.VOLUME_ALARM, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_alarm_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.updateSettingLocked(Settings.System.VOLUME_NOTIFICATION, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_notification_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + // set headset default volume + systemSettings.insertSettingLocked(Settings.System.VOLUME_MUSIC + HEADSET, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_music_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_RING + HEADSET, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_ringtone_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_VOICE + HEADSET, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_voice_call_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_ALARM + HEADSET, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_alarm_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_NOTIFICATION + HEADSET, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_notification_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + // set headphone default volume + systemSettings.insertSettingLocked(Settings.System.VOLUME_MUSIC + HEADPHONE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_music_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_RING + HEADPHONE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_ringtone_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_VOICE + HEADPHONE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_voice_call_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_ALARM + HEADPHONE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_alarm_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_NOTIFICATION + HEADPHONE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_notification_headset_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + // set speaker default volume + systemSettings.insertSettingLocked(Settings.System.VOLUME_MUSIC + SPEAKER, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_music_speaker_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_RING + SPEAKER, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_ringtone_speaker_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_VOICE + SPEAKER, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_voice_call_speaker_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_ALARM + SPEAKER, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_alarm_speaker_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + systemSettings.insertSettingLocked(Settings.System.VOLUME_NOTIFICATION + SPEAKER, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_notification_speaker_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + + // set earpiece default volume + systemSettings.insertSettingLocked(Settings.System.VOLUME_VOICE + EARPIECE, + Integer.toString( + getContext().getResources().getInteger( + R.integer.def_voice_call_earpiece_volume)), + SettingsState.SYSTEM_PACKAGE_NAME); + } + /** * You must perform all necessary mutations to bring the settings * for this user from the old to the new version. When you add a new @@ -2005,6 +2143,60 @@ private int onUpgradeLocked(int userId, int oldVersion, int newVersion) { defaultComponent, SettingsState.SYSTEM_PACKAGE_NAME); } + + // Allow openmarket OEMs to set default customized + defaultComponent + = getContext().getResources().getString(R.string.def_input_method); + if (!TextUtils.isEmpty(defaultComponent)) { + secureSettings.insertSettingLocked( + Settings.Secure.DEFAULT_INPUT_METHOD, + defaultComponent, + SettingsState.SYSTEM_PACKAGE_NAME); + } + + defaultComponent = getContext().getResources() + .getString(R.string.def_enable_input_methods); + if (!TextUtils.isEmpty(defaultComponent)) { + secureSettings.insertSettingLocked( + Settings.Secure.ENABLED_INPUT_METHODS, + defaultComponent, + SettingsState.SYSTEM_PACKAGE_NAME); + } + + // Allow OEMs to set volumes in resources. + if (getContext().getResources().getBoolean(R.bool.def_custom_sys_volume)) { + final SettingsState systemSettings = getSystemSettingsLocked(userId); + loadCustomizedVolumeLevels(systemSettings); + } + + // Allow OEMs to set date format, time format and enable/disable accessibility + // services in resource. + final SettingsState dateAndTimeSettings = getSystemSettingsLocked(userId); + String defaultStringComponent; + int defaultIntComponent; + defaultStringComponent = getContext().getResources().getString( + R.string.def_date_format); + if (!TextUtils.isEmpty(defaultStringComponent)) { + dateAndTimeSettings.insertSettingLocked(Settings.System.DATE_FORMAT, + defaultStringComponent,SettingsState.SYSTEM_PACKAGE_NAME); + } + defaultStringComponent = getContext().getResources().getString( + R.string.def_time_format); + if (!TextUtils.isEmpty(defaultStringComponent)) { + dateAndTimeSettings.insertSettingLocked(Settings.System.TIME_12_24, + defaultStringComponent,SettingsState.SYSTEM_PACKAGE_NAME); + } + defaultIntComponent = getContext().getResources().getInteger( + R.integer.def_enable_accessibility); + secureSettings.insertSettingLocked(Settings.Secure.ACCESSIBILITY_ENABLED, + String.valueOf(defaultIntComponent),SettingsState.SYSTEM_PACKAGE_NAME); + defaultStringComponent = getContext().getResources().getString( + R.string.def_enable_accessibility_services); + if (!TextUtils.isEmpty(defaultStringComponent)) { + secureSettings.insertSettingLocked(Settings.Secure. + ENABLED_ACCESSIBILITY_SERVICES,defaultStringComponent, + SettingsState.SYSTEM_PACKAGE_NAME); + } currentVersion = 122; } diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 80f4d4cea0b..a069e4dbc18 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -50,6 +50,7 @@ + diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_1x.png new file mode 100755 index 00000000000..551c67258e3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_3g.png new file mode 100755 index 00000000000..aee2cf25e94 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_4g.png new file mode 100755 index 00000000000..28bdabb4191 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_e.png new file mode 100755 index 00000000000..a6d46728e2a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_g.png new file mode 100755 index 00000000000..c9a6c8e60ed Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_h.png new file mode 100755 index 00000000000..83aa3c74317 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_hp.png new file mode 100755 index 00000000000..7f86ac3d989 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_fully_connected_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_fully_connected_hp.png new file mode 100755 index 00000000000..46dc18bbcc0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_fully_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_1x.png new file mode 100644 index 00000000000..818e29230fc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_3g.png new file mode 100644 index 00000000000..95866b12e61 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_4g.png new file mode 100644 index 00000000000..1aea6127990 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_e.png new file mode 100644 index 00000000000..016b30b079a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_g.png new file mode 100644 index 00000000000..ec672eb118e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_h.png new file mode 100644 index 00000000000..27bab73745a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_idle_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_1x.png new file mode 100644 index 00000000000..66fb60e9036 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_3g.png new file mode 100644 index 00000000000..07ea499fb74 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_4g.png new file mode 100644 index 00000000000..879c703f7b1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_e.png new file mode 100644 index 00000000000..e39767a6dad Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_g.png new file mode 100644 index 00000000000..47c1fca3323 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_h.png new file mode 100644 index 00000000000..ac80dceeca9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_in_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_4g.png new file mode 100644 index 00000000000..c5edf2c19e3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_e.png new file mode 100644 index 00000000000..0ef47018993 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_h.png new file mode 100644 index 00000000000..ed02984ef85 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inandout_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_1x.png new file mode 100644 index 00000000000..f88091b59ff Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_3g.png new file mode 100644 index 00000000000..95bb3cd9251 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_g.png new file mode 100644 index 00000000000..31b926bd2f0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_inout_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_1x.png new file mode 100644 index 00000000000..0ee5b08ed66 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_3g.png new file mode 100644 index 00000000000..cac78027f57 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_4g.png new file mode 100644 index 00000000000..ddf88bedb96 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_e.png new file mode 100644 index 00000000000..df6e1952b1c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_g.png new file mode 100644 index 00000000000..4a2f867ece4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_h.png new file mode 100644 index 00000000000..2b4628fcf78 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_out_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim1_new.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim1_new.png new file mode 100644 index 00000000000..16f8254aec3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim1_new.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim2_new.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim2_new.png new file mode 100644 index 00000000000..f9ddcd7225d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim2_new.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim_1.png new file mode 100644 index 00000000000..fbcf293f3a0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_no_sim_1.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_3g.png new file mode 100644 index 00000000000..453cffb3ea7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..ec1a23e4efa Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_g.png new file mode 100644 index 00000000000..a43d8830f36 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_h.png new file mode 100644 index 00000000000..8b2c611e9da Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_hp.png new file mode 100644 index 00000000000..badc93d0241 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_3g.png new file mode 100644 index 00000000000..af716004b0b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..24be3363668 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_g.png new file mode 100644 index 00000000000..3e5bb799fda Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_h.png new file mode 100644 index 00000000000..a1102d66787 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_hp.png new file mode 100644 index 00000000000..cee81b37c0b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_3g.png new file mode 100644 index 00000000000..453cffb3ea7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_4g.png new file mode 100644 index 00000000000..76bf51c52e8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_g.png new file mode 100644 index 00000000000..a43d8830f36 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_h.png new file mode 100644 index 00000000000..8b2c611e9da Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_hp.png new file mode 100644 index 00000000000..8f536d9b81a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_3g.png new file mode 100644 index 00000000000..af716004b0b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_4g.png new file mode 100644 index 00000000000..222a65ff1bd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_g.png new file mode 100644 index 00000000000..3e5bb799fda Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_h.png new file mode 100644 index 00000000000..a1102d66787 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_hp.png new file mode 100644 index 00000000000..42c2b3c1fa2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_0_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_3g.png new file mode 100644 index 00000000000..6a34d7c0d51 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..4dc30ee90cc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_g.png new file mode 100644 index 00000000000..9b6ff777ab2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_h.png new file mode 100644 index 00000000000..477dd57aa48 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_hp.png new file mode 100644 index 00000000000..94dfff0c827 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_3g.png new file mode 100644 index 00000000000..d1bfb5e167e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..40c09721319 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_g.png new file mode 100644 index 00000000000..52c01e00a08 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_h.png new file mode 100644 index 00000000000..13e1dadf816 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_hp.png new file mode 100644 index 00000000000..ab40c2f2d87 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_3g.png new file mode 100644 index 00000000000..f9adf5e4679 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_4g.png new file mode 100644 index 00000000000..74c614ccf5e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_g.png new file mode 100644 index 00000000000..5cb8c27f4b8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_h.png new file mode 100644 index 00000000000..a47d44dcd08 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_hp.png new file mode 100644 index 00000000000..3130da3c994 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_3g.png new file mode 100644 index 00000000000..70b639a7fb0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_4g.png new file mode 100644 index 00000000000..8a267f01122 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_g.png new file mode 100644 index 00000000000..5ed53106734 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_h.png new file mode 100644 index 00000000000..7f919e952c6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_hp.png new file mode 100644 index 00000000000..b3f07ba8725 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_1_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_3g.png new file mode 100644 index 00000000000..3de1d955c2a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..046714bdd11 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_g.png new file mode 100644 index 00000000000..83305772e3b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_h.png new file mode 100644 index 00000000000..261644a5eb7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_hp.png new file mode 100644 index 00000000000..acf7cfe57ec Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_3g.png new file mode 100644 index 00000000000..f84cd0a40b0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..55f57d6fa88 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_g.png new file mode 100644 index 00000000000..0f67463aea9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_h.png new file mode 100644 index 00000000000..9ab998bd2e3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_hp.png new file mode 100644 index 00000000000..659efb48772 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_3g.png new file mode 100644 index 00000000000..f7bfe98fd04 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_4g.png new file mode 100644 index 00000000000..2135915a2d4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_g.png new file mode 100644 index 00000000000..69e649f3571 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_h.png new file mode 100644 index 00000000000..30fc05b2069 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_hp.png new file mode 100644 index 00000000000..aed81791eee Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_3g.png new file mode 100644 index 00000000000..617af25ae1a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_4g.png new file mode 100644 index 00000000000..33c4abdc300 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_g.png new file mode 100644 index 00000000000..6eee46540da Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_h.png new file mode 100644 index 00000000000..4fea813b1b1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_hp.png new file mode 100644 index 00000000000..e76c53f7a36 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_2_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_3g.png new file mode 100644 index 00000000000..bb7bc97f162 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..97120a9efe7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_g.png new file mode 100644 index 00000000000..7e1c0618d68 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_h.png new file mode 100644 index 00000000000..2992e5c4156 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_hp.png new file mode 100644 index 00000000000..ceb1c2c1018 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_3g.png new file mode 100644 index 00000000000..e98751c7527 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..f3419fd7b89 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_g.png new file mode 100644 index 00000000000..262eda94bb0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_h.png new file mode 100644 index 00000000000..cda6d0a0681 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_hp.png new file mode 100644 index 00000000000..c5a0a601d2b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_3g.png new file mode 100644 index 00000000000..e9fd96af3c0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_4g.png new file mode 100644 index 00000000000..ca418cae77e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_g.png new file mode 100644 index 00000000000..3a2152119d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_h.png new file mode 100644 index 00000000000..ad3f81c0164 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_hp.png new file mode 100644 index 00000000000..a9a71911a32 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_3g.png new file mode 100644 index 00000000000..44284d83c0c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_4g.png new file mode 100644 index 00000000000..a8c6c32031d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_g.png new file mode 100644 index 00000000000..429253844f3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_h.png new file mode 100644 index 00000000000..65c0e2da46e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_hp.png new file mode 100644 index 00000000000..bdf6790e11c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_3_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_3g.png new file mode 100644 index 00000000000..7993fc24bcf Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..849796a846d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_g.png new file mode 100644 index 00000000000..0eae5efc868 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_h.png new file mode 100644 index 00000000000..e7894dc632a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_hp.png new file mode 100644 index 00000000000..0d55f93cbfc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_3g.png new file mode 100644 index 00000000000..a21eb1d7b80 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..012eb8a3637 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_g.png new file mode 100644 index 00000000000..cd37c329283 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_h.png new file mode 100644 index 00000000000..1d77c307aa6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_hp.png new file mode 100644 index 00000000000..978c284c559 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_3g.png new file mode 100644 index 00000000000..aba3a69d2c6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_4g.png new file mode 100644 index 00000000000..7ee0c634990 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_g.png new file mode 100644 index 00000000000..ad17c6115e7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_h.png new file mode 100644 index 00000000000..9d710b1a94e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_hp.png new file mode 100644 index 00000000000..73c369ff46a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_3g.png new file mode 100644 index 00000000000..06416c3a309 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_4g.png new file mode 100644 index 00000000000..247978347ae Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_g.png new file mode 100644 index 00000000000..61f6a884628 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_h.png new file mode 100644 index 00000000000..e4441e38caa Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_hp.png new file mode 100644 index 00000000000..8503fbfa901 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_r_signal_4_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x.png new file mode 100644 index 00000000000..e75b98f3a1f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully.png new file mode 100644 index 00000000000..e75b98f3a1f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully_roam.png new file mode 100644 index 00000000000..5b074682bab Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only.png new file mode 100644 index 00000000000..b93b0a02528 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully.png new file mode 100644 index 00000000000..b93b0a02528 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully_roam.png new file mode 100644 index 00000000000..5103f772148 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_roam.png new file mode 100644 index 00000000000..5103f772148 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_only_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_roam.png new file mode 100644 index 00000000000..5b074682bab Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_1x_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g.png new file mode 100644 index 00000000000..79aabb75cfa Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default.png new file mode 100644 index 00000000000..750b8db42c7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully.png new file mode 100644 index 00000000000..e9236b050d5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully_roam.png new file mode 100755 index 00000000000..3cf236d8b46 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_roam.png new file mode 100755 index 00000000000..9550ab5ad4b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_fully.png new file mode 100644 index 00000000000..6339bc37783 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_2g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g.png new file mode 100644 index 00000000000..e11d0b1dc8f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default.png new file mode 100644 index 00000000000..bb68877e28e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully.png new file mode 100644 index 00000000000..bb68877e28e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully_roam.png new file mode 100644 index 00000000000..917f6cf9e8a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_roam.png new file mode 100644 index 00000000000..917f6cf9e8a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully.png new file mode 100644 index 00000000000..e11d0b1dc8f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully_roam.png new file mode 100644 index 00000000000..bd76da867e3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_roam.png new file mode 100644 index 00000000000..bd76da867e3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_3g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g.png new file mode 100755 index 00000000000..f5f74f925a2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default.png new file mode 100755 index 00000000000..a33ac2ee628 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully.png new file mode 100755 index 00000000000..f572200aa56 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully_roam.png new file mode 100755 index 00000000000..44736da6935 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_roam.png new file mode 100755 index 00000000000..c09a1c02332 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_fully.png new file mode 100755 index 00000000000..d5c25b3d551 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_fully_roam.png new file mode 100755 index 00000000000..fb6cd9d2fd6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_roam.png new file mode 100755 index 00000000000..fb6cd9d2fd6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e.png new file mode 100755 index 00000000000..651b1ad0787 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully.png new file mode 100755 index 00000000000..71059aa310e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully_roam.png new file mode 100755 index 00000000000..ac814fdaea4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_roam.png new file mode 100755 index 00000000000..e8826aa61d5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_3g.png new file mode 100644 index 00000000000..8276cc945ba Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..68c871a8c0f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_g.png new file mode 100644 index 00000000000..189c78ab08b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_h.png new file mode 100644 index 00000000000..c6f889b570e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_hp.png new file mode 100644 index 00000000000..11e32c07f68 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_3g.png new file mode 100644 index 00000000000..15edf670342 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..e17d4580a2e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_g.png new file mode 100644 index 00000000000..36b847ea736 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_h.png new file mode 100644 index 00000000000..7e43f762194 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_hp.png new file mode 100644 index 00000000000..63fe13d87f0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g.png new file mode 100644 index 00000000000..3145814c2b4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully.png new file mode 100644 index 00000000000..3145814c2b4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully_roam.png new file mode 100644 index 00000000000..106e546b75f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_roam.png new file mode 100644 index 00000000000..106e546b75f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm.png new file mode 100755 index 00000000000..2a56bce6fd5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm_fully.png new file mode 100755 index 00000000000..415658bdb52 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_3g.png new file mode 100644 index 00000000000..8276cc945ba Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_4g.png new file mode 100644 index 00000000000..80dcbe27916 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_g.png new file mode 100644 index 00000000000..189c78ab08b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_h.png new file mode 100644 index 00000000000..c6f889b570e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_hp.png new file mode 100644 index 00000000000..abd7f922f1b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_3g.png new file mode 100644 index 00000000000..15edf670342 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_4g.png new file mode 100644 index 00000000000..386a1aceddb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_g.png new file mode 100644 index 00000000000..36b847ea736 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_h.png new file mode 100644 index 00000000000..7e43f762194 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_hp.png new file mode 100644 index 00000000000..c9daf031a15 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png new file mode 100755 index 00000000000..fd8d2f28dc0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x.png new file mode 100644 index 00000000000..cb12346aad4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully.png new file mode 100644 index 00000000000..5714b95864e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully_roam.png new file mode 100644 index 00000000000..5a8271c556b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only.png new file mode 100644 index 00000000000..e40825e2729 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully.png new file mode 100644 index 00000000000..a69eca45851 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully_roam.png new file mode 100644 index 00000000000..022ec4a60a1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_roam.png new file mode 100644 index 00000000000..1bbf43224f1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_only_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_roam.png new file mode 100644 index 00000000000..9e4ce76e1ed Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_1x_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g.png new file mode 100644 index 00000000000..87844527441 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default.png new file mode 100644 index 00000000000..8bd67869012 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully.png new file mode 100644 index 00000000000..38f57043950 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully_roam.png new file mode 100755 index 00000000000..48f1af95c79 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_roam.png new file mode 100755 index 00000000000..d82154934f1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_fully.png new file mode 100644 index 00000000000..e201a00f7fb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_2g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g.png new file mode 100644 index 00000000000..368ada3b135 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default.png new file mode 100644 index 00000000000..4bd8efb1679 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully.png new file mode 100644 index 00000000000..f36be768524 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully_roam.png new file mode 100644 index 00000000000..55a7b405c47 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_roam.png new file mode 100644 index 00000000000..daed7823bb8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully.png new file mode 100644 index 00000000000..bf644deadb5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully_roam.png new file mode 100644 index 00000000000..a0004f042b7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_roam.png new file mode 100644 index 00000000000..eed77ab60a4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_3g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g.png new file mode 100755 index 00000000000..c7d855e15c6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default.png new file mode 100755 index 00000000000..42ba3f9b604 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully.png new file mode 100755 index 00000000000..009fd7d365e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully_roam.png new file mode 100755 index 00000000000..d58b9a3601d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_roam.png new file mode 100755 index 00000000000..3ae325b4330 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_fully.png new file mode 100755 index 00000000000..4ca959f74c3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_fully_roam.png new file mode 100755 index 00000000000..cce1bb41894 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_roam.png new file mode 100755 index 00000000000..41791cb361d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e.png new file mode 100755 index 00000000000..660842f7d60 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully.png new file mode 100755 index 00000000000..da72330b215 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully_roam.png new file mode 100755 index 00000000000..be05ea644bb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_roam.png new file mode 100755 index 00000000000..cb3ec07f515 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_3g.png new file mode 100644 index 00000000000..ec4e72bd3c2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..f4327b89dfd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_g.png new file mode 100644 index 00000000000..3b4e528bcdd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_h.png new file mode 100644 index 00000000000..939ae38a335 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_hp.png new file mode 100644 index 00000000000..0cb531ea997 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_3g.png new file mode 100644 index 00000000000..3ee5d1ee39b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..ca4769a084f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_g.png new file mode 100644 index 00000000000..6bc60e83dbd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_h.png new file mode 100644 index 00000000000..1d4949dddef Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_hp.png new file mode 100644 index 00000000000..950b936ebed Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g.png new file mode 100644 index 00000000000..d05e974e681 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully.png new file mode 100644 index 00000000000..f0656f397cb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully_roam.png new file mode 100644 index 00000000000..49dee6d3953 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_roam.png new file mode 100644 index 00000000000..dab2dc7f3b2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm.png new file mode 100755 index 00000000000..16286326c39 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm_fully.png new file mode 100755 index 00000000000..7526746b32c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_3g.png new file mode 100644 index 00000000000..8771fa083f9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_4g.png new file mode 100644 index 00000000000..c8bdad77d8a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_g.png new file mode 100644 index 00000000000..57038ec38a2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_h.png new file mode 100644 index 00000000000..9f6a5143904 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_hp.png new file mode 100644 index 00000000000..3e27781a359 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_3g.png new file mode 100644 index 00000000000..ce788e603aa Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_4g.png new file mode 100644 index 00000000000..e917bfda3b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_g.png new file mode 100644 index 00000000000..99edb6a0fb8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_h.png new file mode 100644 index 00000000000..9660faee2d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_hp.png new file mode 100644 index 00000000000..6eaa344719b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_in.png new file mode 100644 index 00000000000..6a16578f2bf Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_inout.png new file mode 100644 index 00000000000..172379308da Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_no.png new file mode 100644 index 00000000000..893033adea5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_out.png new file mode 100644 index 00000000000..bef52117c65 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1x_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png new file mode 100755 index 00000000000..3b4aaa1c67f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x.png new file mode 100644 index 00000000000..f5b898edfef Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully.png new file mode 100644 index 00000000000..363a1a93ceb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully_roam.png new file mode 100644 index 00000000000..acd014d3e61 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only.png new file mode 100644 index 00000000000..825eef48e8c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully.png new file mode 100644 index 00000000000..0696fea9e15 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully_roam.png new file mode 100644 index 00000000000..887c6c6e757 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_roam.png new file mode 100644 index 00000000000..892168722b7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_only_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_roam.png new file mode 100644 index 00000000000..ce372b73003 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_1x_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g.png new file mode 100644 index 00000000000..7f18a2e1ff7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default.png new file mode 100644 index 00000000000..668425518b4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully.png new file mode 100644 index 00000000000..d9b7c808aab Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully_roam.png new file mode 100755 index 00000000000..37d6b53951d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_roam.png new file mode 100755 index 00000000000..b971b3c5a9c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_fully.png new file mode 100644 index 00000000000..5f41237698b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_2g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g.png new file mode 100644 index 00000000000..e3271675e69 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default.png new file mode 100644 index 00000000000..9cdff01612c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully.png new file mode 100644 index 00000000000..b7b21d38801 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully_roam.png new file mode 100644 index 00000000000..05068b2938e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_roam.png new file mode 100644 index 00000000000..c352e4fcc28 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully.png new file mode 100644 index 00000000000..4f22987e770 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully_roam.png new file mode 100644 index 00000000000..b5760f04ca3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_roam.png new file mode 100644 index 00000000000..ee1b26f5d26 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_3g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g.png new file mode 100755 index 00000000000..2d574bf3031 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default.png new file mode 100755 index 00000000000..588b5a99871 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully.png new file mode 100755 index 00000000000..3cb4ee09651 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully_roam.png new file mode 100755 index 00000000000..4ea7ff2e20f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_roam.png new file mode 100755 index 00000000000..e4e842c4e7f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_fully.png new file mode 100755 index 00000000000..758fc22d512 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_fully_roam.png new file mode 100755 index 00000000000..a1f78ef27f6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_roam.png new file mode 100755 index 00000000000..74d45b6bc0b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e.png new file mode 100755 index 00000000000..f314c1508f9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully.png new file mode 100755 index 00000000000..b5cbd093919 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully_roam.png new file mode 100755 index 00000000000..20c7362c41d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_roam.png new file mode 100755 index 00000000000..aee5871b60a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_3g.png new file mode 100644 index 00000000000..0ca7ff3b76d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..58be4c92698 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_g.png new file mode 100644 index 00000000000..cf39dd5499d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_h.png new file mode 100644 index 00000000000..e5a54613fa1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_hp.png new file mode 100644 index 00000000000..55949918caa Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_3g.png new file mode 100644 index 00000000000..d90ca3560dc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..deea9b42f65 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_g.png new file mode 100644 index 00000000000..3e5de5bf1b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_h.png new file mode 100644 index 00000000000..f30da37b633 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_hp.png new file mode 100644 index 00000000000..7af7fe712c1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g.png new file mode 100644 index 00000000000..54a55c61f60 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully.png new file mode 100644 index 00000000000..91cbc6772ff Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully_roam.png new file mode 100644 index 00000000000..4820651befe Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_roam.png new file mode 100644 index 00000000000..736d41cd7b6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm.png new file mode 100755 index 00000000000..2b82165b65c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm_fully.png new file mode 100755 index 00000000000..91aba685b41 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_3g.png new file mode 100644 index 00000000000..6c20e8bc2a5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_4g.png new file mode 100644 index 00000000000..e4fa22ed041 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_g.png new file mode 100644 index 00000000000..8f0c5f5abae Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_h.png new file mode 100644 index 00000000000..dd0ee243be2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_hp.png new file mode 100644 index 00000000000..5a90d1fcd38 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_3g.png new file mode 100644 index 00000000000..51074bee3bc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_4g.png new file mode 100644 index 00000000000..a3bf393a4e6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_g.png new file mode 100644 index 00000000000..31e08943df2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_h.png new file mode 100644 index 00000000000..330aa082eaf Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_hp.png new file mode 100644 index 00000000000..ed316f050a0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_in.png new file mode 100644 index 00000000000..bce78accc43 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_inout.png new file mode 100644 index 00000000000..3a90366fe4c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_no.png new file mode 100644 index 00000000000..49e4f0791f1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_out.png new file mode 100644 index 00000000000..9e45681b6fd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2g_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png new file mode 100755 index 00000000000..873a317c163 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x.png new file mode 100644 index 00000000000..a7d7d75a7e0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully.png new file mode 100644 index 00000000000..7b34688067b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully_roam.png new file mode 100644 index 00000000000..08940ce6ee0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only.png new file mode 100644 index 00000000000..ec12d280769 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully.png new file mode 100644 index 00000000000..5235b7dc95a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully_roam.png new file mode 100644 index 00000000000..6f5beb47c84 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_roam.png new file mode 100644 index 00000000000..f6c6f29914a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_only_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_roam.png new file mode 100644 index 00000000000..1362fa3d33b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_1x_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g.png new file mode 100644 index 00000000000..53552e4e4da Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default.png new file mode 100644 index 00000000000..e3e8eb4cb02 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully.png new file mode 100644 index 00000000000..42915954b8f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully_roam.png new file mode 100755 index 00000000000..19c9a3deca3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_roam.png new file mode 100755 index 00000000000..6119135f075 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_fully.png new file mode 100644 index 00000000000..6d08ace1312 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_2g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g.png new file mode 100644 index 00000000000..ddb640d8c50 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default.png new file mode 100644 index 00000000000..39102034e71 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully.png new file mode 100644 index 00000000000..b6b440b202e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully_roam.png new file mode 100644 index 00000000000..1ce09ddf38a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_roam.png new file mode 100644 index 00000000000..9a0aabfa837 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully.png new file mode 100644 index 00000000000..fd571a06ecc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully_roam.png new file mode 100644 index 00000000000..94c60c3c974 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_roam.png new file mode 100644 index 00000000000..9d18bf7d5ea Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_3g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g.png new file mode 100755 index 00000000000..5090082386b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default.png new file mode 100755 index 00000000000..112011bc4cf Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully.png new file mode 100755 index 00000000000..34d6635ada8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully_roam.png new file mode 100755 index 00000000000..7334cb6f067 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_roam.png new file mode 100755 index 00000000000..c6e4917bc74 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_fully.png new file mode 100755 index 00000000000..5eaae026157 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_fully_roam.png new file mode 100755 index 00000000000..ca4db23989f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_roam.png new file mode 100755 index 00000000000..135a41287bc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e.png new file mode 100755 index 00000000000..9ea742c22b7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully.png new file mode 100755 index 00000000000..d708edc2a9b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully_roam.png new file mode 100755 index 00000000000..6ffb0328010 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_roam.png new file mode 100755 index 00000000000..61c7e2aefa9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_3g.png new file mode 100644 index 00000000000..b5e83d4ed66 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..e49c37ca41b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_g.png new file mode 100644 index 00000000000..2e0fd9abe89 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_h.png new file mode 100644 index 00000000000..d77d3b653cb Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_hp.png new file mode 100644 index 00000000000..52e9bb855a0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_3g.png new file mode 100644 index 00000000000..9ab6e83577c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..e4ea116cd56 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_g.png new file mode 100644 index 00000000000..e9e8737e293 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_h.png new file mode 100644 index 00000000000..550e4249a0d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_hp.png new file mode 100644 index 00000000000..65d87bfb093 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g.png new file mode 100644 index 00000000000..05f62dc521a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully.png new file mode 100644 index 00000000000..5a3e1fe26e1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully_roam.png new file mode 100644 index 00000000000..9fb62093db7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_roam.png new file mode 100644 index 00000000000..02e60599509 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm.png new file mode 100755 index 00000000000..84ae508b22e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm_fully.png new file mode 100755 index 00000000000..a141e806476 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_3g.png new file mode 100644 index 00000000000..79964b37e71 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_4g.png new file mode 100644 index 00000000000..1efc1e64b07 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_g.png new file mode 100644 index 00000000000..1238d36c40f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_h.png new file mode 100644 index 00000000000..128e994d5b2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_hp.png new file mode 100644 index 00000000000..d737b59d12f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_3g.png new file mode 100644 index 00000000000..596d4c767d3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_4g.png new file mode 100644 index 00000000000..10959856c74 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_g.png new file mode 100644 index 00000000000..fb62ca99f6a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_h.png new file mode 100644 index 00000000000..edc3d67d6f1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_hp.png new file mode 100644 index 00000000000..7da7832cde7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_in.png new file mode 100755 index 00000000000..fe25c2cc48c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_inout.png new file mode 100755 index 00000000000..316de0532e8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_no.png new file mode 100755 index 00000000000..5e6b81797af Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_out.png new file mode 100755 index 00000000000..f001a1163f0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3g_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png new file mode 100755 index 00000000000..d2381fcc539 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x.png new file mode 100644 index 00000000000..bf9cbf7b538 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully.png new file mode 100644 index 00000000000..c8d6f503168 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully_roam.png new file mode 100644 index 00000000000..3421cfa75e0 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only.png new file mode 100644 index 00000000000..f9a950825e7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully.png new file mode 100644 index 00000000000..6a2752742d5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully_roam.png new file mode 100644 index 00000000000..6c8fcfd9ae6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_roam.png new file mode 100644 index 00000000000..b5ab01b5998 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_only_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_roam.png new file mode 100644 index 00000000000..633e933d328 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_1x_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g.png new file mode 100644 index 00000000000..29d6f9d8780 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default.png new file mode 100644 index 00000000000..761685de02e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully.png new file mode 100644 index 00000000000..7f37ccfd2d1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully_roam.png new file mode 100755 index 00000000000..dbde94f46b2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_roam.png new file mode 100755 index 00000000000..77bf21f65f3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_fully.png new file mode 100644 index 00000000000..1f4076cb105 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_2g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g.png new file mode 100644 index 00000000000..df37519963f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default.png new file mode 100644 index 00000000000..a203298dd27 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully.png new file mode 100644 index 00000000000..caa4a4dbabc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully_roam.png new file mode 100644 index 00000000000..d4c907ebe51 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_roam.png new file mode 100644 index 00000000000..43fe7197fd6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully.png new file mode 100644 index 00000000000..12be96ae6d2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully_roam.png new file mode 100644 index 00000000000..69bc10346f2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_roam.png new file mode 100644 index 00000000000..5c5863d3051 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_3g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g.png new file mode 100755 index 00000000000..a3812250bd4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default.png new file mode 100755 index 00000000000..b3df2c9787e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully.png new file mode 100755 index 00000000000..468c0f76863 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully_roam.png new file mode 100755 index 00000000000..7332ddf73a6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_roam.png new file mode 100755 index 00000000000..dcce91261c4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_fully.png new file mode 100755 index 00000000000..6d4f3578d4e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_fully_roam.png new file mode 100755 index 00000000000..76a1301f54c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_roam.png new file mode 100755 index 00000000000..03ff3b65e18 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e.png new file mode 100755 index 00000000000..7d5bbfd8c5c Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully.png new file mode 100755 index 00000000000..c6657fb73fc Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully_roam.png new file mode 100755 index 00000000000..c1e71a57cd5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_roam.png new file mode 100755 index 00000000000..64485e5519e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_3g.png new file mode 100644 index 00000000000..76fd9895601 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..6dd8a689347 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_g.png new file mode 100644 index 00000000000..ffb5d5033db Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_h.png new file mode 100644 index 00000000000..f1a36a323e1 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_hp.png new file mode 100644 index 00000000000..d33b99b1cce Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_3g.png new file mode 100644 index 00000000000..f0a662182c3 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..df1395d5982 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_g.png new file mode 100644 index 00000000000..36f7b33758d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_h.png new file mode 100644 index 00000000000..07d5e2eb110 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_hp.png new file mode 100644 index 00000000000..51ed57e54f9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g.png new file mode 100644 index 00000000000..8ce7eeb6fb4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully.png new file mode 100644 index 00000000000..abc5155fc94 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully_roam.png new file mode 100644 index 00000000000..4665f0155fe Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_roam.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_roam.png new file mode 100644 index 00000000000..4c496a7e4b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm.png new file mode 100755 index 00000000000..eaa6a534c26 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm_fully.png new file mode 100755 index 00000000000..c97f7382818 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_3g.png new file mode 100644 index 00000000000..a4a217ba278 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_4g.png new file mode 100644 index 00000000000..2585797e40b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_g.png new file mode 100644 index 00000000000..1e5f672d1c5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_h.png new file mode 100644 index 00000000000..d166694dde2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_hp.png new file mode 100644 index 00000000000..1ece3224249 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_3g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_3g.png new file mode 100644 index 00000000000..9d138912297 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_4g.png new file mode 100644 index 00000000000..4ee5031891e Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_g.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_g.png new file mode 100644 index 00000000000..d2058d20bf8 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_h.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_h.png new file mode 100644 index 00000000000..b6695bf9e99 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_hp.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_hp.png new file mode 100644 index 00000000000..ff9ba0b4095 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_in.png new file mode 100755 index 00000000000..7ccf35c00ff Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_inout.png new file mode 100755 index 00000000000..ad684092ee9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_no.png new file mode 100755 index 00000000000..854f9e35fa9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_out.png new file mode 100755 index 00000000000..abe5ceff9c2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4g_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_in.png new file mode 100644 index 00000000000..a037253c629 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_inout.png new file mode 100644 index 00000000000..1c71f83b67b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_no.png new file mode 100644 index 00000000000..cd94520e2fe Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_out.png new file mode 100644 index 00000000000..0d73b0fe9a5 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_e_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_in.png new file mode 100644 index 00000000000..1a1342c100d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_inout.png new file mode 100644 index 00000000000..54f349d4a22 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_no.png new file mode 100644 index 00000000000..008f13c15d6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_out.png new file mode 100644 index 00000000000..d88733448c6 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_g_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_in.png new file mode 100644 index 00000000000..59b33c1bc35 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_inout.png new file mode 100644 index 00000000000..31a27e9937d Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_no.png new file mode 100644 index 00000000000..14443bb4467 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_out.png new file mode 100644 index 00000000000..d0cda1878d4 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_h_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_in.png new file mode 100644 index 00000000000..2a484a7cdf7 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_inout.png new file mode 100644 index 00000000000..e1847b2353f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_no.png new file mode 100644 index 00000000000..25d1042535a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_out.png new file mode 100644 index 00000000000..1deef41f74a Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_hp_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_in.png new file mode 100644 index 00000000000..6e845462f39 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_1.png new file mode 100644 index 00000000000..cb3e63074dd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_1.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim1.png new file mode 100644 index 00000000000..2ba7fd28410 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim1.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim2.png new file mode 100644 index 00000000000..834c80a9b96 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_null_sim2.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_out.png new file mode 100644 index 00000000000..11ffbde017f Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_in.png new file mode 100644 index 00000000000..cc59f7c6bd9 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_inout.png new file mode 100644 index 00000000000..8ba3dd2b8ff Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_no.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_no.png new file mode 100644 index 00000000000..29d4e60a58b Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_no.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_out.png new file mode 100644 index 00000000000..db3889be5e2 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_r_out.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_in.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_in.png new file mode 100644 index 00000000000..2bb923e6dbd Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_in.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_inout.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_inout.png new file mode 100644 index 00000000000..783ad175510 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_inout.png differ diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_out.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_out.png new file mode 100644 index 00000000000..e499f9d4284 Binary files /dev/null and b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_out.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_2g.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_2g.png new file mode 100644 index 00000000000..29ff6fe2af8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_2g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_2g.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_2g.png new file mode 100644 index 00000000000..5bbfa6f95eb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_2g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_hp.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_hp.png new file mode 100644 index 00000000000..6e88bf9b5fe Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_full_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_hp.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_hp.png new file mode 100644 index 00000000000..59c0e9f7862 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/ic_qs_signal_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png new file mode 100755 index 00000000000..5076cf95203 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_1x.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png new file mode 100755 index 00000000000..3ab84708d17 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_4g.png new file mode 100755 index 00000000000..83538d463d4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png new file mode 100755 index 00000000000..aa011ca0821 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png new file mode 100755 index 00000000000..4cebc4365e2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png new file mode 100755 index 00000000000..bd2b4ed6f1c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_hp.png new file mode 100755 index 00000000000..dd99d0321e0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_hp.png new file mode 100755 index 00000000000..eca60006f6c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_fully_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim1_new.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim1_new.png new file mode 100644 index 00000000000..f4d46856438 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim1_new.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim2_new.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim2_new.png new file mode 100644 index 00000000000..929c1f4a588 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim2_new.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim_1.png new file mode 100644 index 00000000000..5dc627c2f10 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_no_sim_1.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_3g.png new file mode 100644 index 00000000000..ff5c6af9b10 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..68bfaa9c46d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_g.png new file mode 100644 index 00000000000..3af557fa16e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_h.png new file mode 100644 index 00000000000..162393fcb61 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_hp.png new file mode 100644 index 00000000000..f1163cb6f25 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_3g.png new file mode 100644 index 00000000000..fe2607f6954 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..42b98899d75 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_g.png new file mode 100644 index 00000000000..65c1f2972dd Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_h.png new file mode 100644 index 00000000000..e4485b93d41 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_hp.png new file mode 100644 index 00000000000..669a65d4aa6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_3g.png new file mode 100644 index 00000000000..ff5c6af9b10 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_4g.png new file mode 100644 index 00000000000..4dac80fcb67 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_g.png new file mode 100644 index 00000000000..3af557fa16e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_h.png new file mode 100644 index 00000000000..162393fcb61 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_hp.png new file mode 100644 index 00000000000..dc9deb1e7d7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_3g.png new file mode 100644 index 00000000000..fe2607f6954 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_4g.png new file mode 100644 index 00000000000..d598aeaa694 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_g.png new file mode 100644 index 00000000000..65c1f2972dd Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_h.png new file mode 100644 index 00000000000..e4485b93d41 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_hp.png new file mode 100644 index 00000000000..3a449e599bf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_0_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_3g.png new file mode 100644 index 00000000000..5c730cbb7d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..61bc6cdb030 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_g.png new file mode 100644 index 00000000000..7c6f6dfebbf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_h.png new file mode 100644 index 00000000000..ba81c495b99 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_hp.png new file mode 100644 index 00000000000..b82719c2f48 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_3g.png new file mode 100644 index 00000000000..243737d4649 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..36f76c4a403 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_g.png new file mode 100644 index 00000000000..b1254cbbb59 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_h.png new file mode 100644 index 00000000000..bcdc84116b6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_hp.png new file mode 100644 index 00000000000..8128273a791 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_3g.png new file mode 100644 index 00000000000..31bc62c9331 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_4g.png new file mode 100644 index 00000000000..b34834c915d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_g.png new file mode 100644 index 00000000000..b988e00e558 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_h.png new file mode 100644 index 00000000000..70243b168ea Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_hp.png new file mode 100644 index 00000000000..b951e162e90 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_3g.png new file mode 100644 index 00000000000..ad1f04c8258 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_4g.png new file mode 100644 index 00000000000..601cdb1f40d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_g.png new file mode 100644 index 00000000000..61b14bb9db3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_h.png new file mode 100644 index 00000000000..063458f20d1 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_hp.png new file mode 100644 index 00000000000..ab7b1a16679 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_1_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_3g.png new file mode 100644 index 00000000000..82d26a33452 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..1a6ee0e6742 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_g.png new file mode 100644 index 00000000000..83aff3ddc3d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_h.png new file mode 100644 index 00000000000..ac043125258 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_hp.png new file mode 100644 index 00000000000..cac2e1b9661 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_3g.png new file mode 100644 index 00000000000..5faca75e497 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..67b074fc6f5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_g.png new file mode 100644 index 00000000000..95c2e069371 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_h.png new file mode 100644 index 00000000000..891f9f4cee8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_hp.png new file mode 100644 index 00000000000..647006efc96 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_3g.png new file mode 100644 index 00000000000..db434811325 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_4g.png new file mode 100644 index 00000000000..7a9dba2633d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_g.png new file mode 100644 index 00000000000..8bf18d3ecf0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_h.png new file mode 100644 index 00000000000..e172e18b22e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_hp.png new file mode 100644 index 00000000000..8347aa05766 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_3g.png new file mode 100644 index 00000000000..f8ab958ab8f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_4g.png new file mode 100644 index 00000000000..097cfc4f26a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_g.png new file mode 100644 index 00000000000..3546860670c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_h.png new file mode 100644 index 00000000000..53b74b10377 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_hp.png new file mode 100644 index 00000000000..b7aca12a609 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_2_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_3g.png new file mode 100644 index 00000000000..bea4818a5fd Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..5370205ccb3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_g.png new file mode 100644 index 00000000000..f9ec9192189 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_h.png new file mode 100644 index 00000000000..28bb4c457e1 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_hp.png new file mode 100644 index 00000000000..9fb2ffb747f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_3g.png new file mode 100644 index 00000000000..173188c6dbf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..221fae019f6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_g.png new file mode 100644 index 00000000000..ed3c6b388e4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_h.png new file mode 100644 index 00000000000..65683166ab0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_hp.png new file mode 100644 index 00000000000..b61f1277cb3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_3g.png new file mode 100644 index 00000000000..57929b3511b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_4g.png new file mode 100644 index 00000000000..f24da096fd3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_g.png new file mode 100644 index 00000000000..7f68ddaefce Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_h.png new file mode 100644 index 00000000000..35b004d0019 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_hp.png new file mode 100644 index 00000000000..b1f29bbfaa8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_3g.png new file mode 100644 index 00000000000..9e14317c14f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_4g.png new file mode 100644 index 00000000000..aadbdb36474 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_g.png new file mode 100644 index 00000000000..c8ad0107692 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_h.png new file mode 100644 index 00000000000..79b145004c7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_hp.png new file mode 100644 index 00000000000..48a57c8e657 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_3_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_3g.png new file mode 100644 index 00000000000..1ab2b2ce9f4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..671914f5878 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_g.png new file mode 100644 index 00000000000..b8df5cec75c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_h.png new file mode 100644 index 00000000000..69d8678ac34 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_hp.png new file mode 100644 index 00000000000..0b18b6dad53 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_3g.png new file mode 100644 index 00000000000..982a93ee5cb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..3fa66a2cfcc Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_g.png new file mode 100644 index 00000000000..64b3ecd883e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_h.png new file mode 100644 index 00000000000..02004e70e21 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_hp.png new file mode 100644 index 00000000000..ffe7e3a93c8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_3g.png new file mode 100644 index 00000000000..71463be0507 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_4g.png new file mode 100644 index 00000000000..d61ff7ea0fa Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_g.png new file mode 100644 index 00000000000..ef30e4329c5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_h.png new file mode 100644 index 00000000000..2504ed7fa39 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_hp.png new file mode 100644 index 00000000000..07bd8b167c2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_3g.png new file mode 100644 index 00000000000..1d813efbfa2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_4g.png new file mode 100644 index 00000000000..39309dff374 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_g.png new file mode 100644 index 00000000000..c86df18c95f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_h.png new file mode 100644 index 00000000000..1c492e1466d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_hp.png new file mode 100644 index 00000000000..95a3964c8d0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_r_signal_4_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g.png new file mode 100755 index 00000000000..f11b84eb006 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default.png new file mode 100755 index 00000000000..005b3a434ad Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully.png new file mode 100755 index 00000000000..6be21560b97 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully_roam.png new file mode 100755 index 00000000000..738ddec8025 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_roam.png new file mode 100755 index 00000000000..60450112a7e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_fully.png new file mode 100755 index 00000000000..24cbdaeb565 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g.png new file mode 100755 index 00000000000..0a71f598628 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default.png new file mode 100755 index 00000000000..3a4bd3ca186 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully.png new file mode 100755 index 00000000000..2608bc1fc22 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully_roam.png new file mode 100755 index 00000000000..ae85f936356 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_roam.png new file mode 100755 index 00000000000..ea320f91b87 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_fully.png new file mode 100755 index 00000000000..7dbba7db40a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e.png new file mode 100755 index 00000000000..55521f581f3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully.png new file mode 100755 index 00000000000..b88661da7ee Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully_roam.png new file mode 100755 index 00000000000..ad8a117cc52 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_roam.png new file mode 100755 index 00000000000..7358b66b7d5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_3g.png new file mode 100644 index 00000000000..52263415d30 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..b0b95813d12 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_g.png new file mode 100644 index 00000000000..429a149fa7d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_h.png new file mode 100644 index 00000000000..49b65546c3c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_hp.png new file mode 100644 index 00000000000..4b61681adbf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_3g.png new file mode 100644 index 00000000000..c7385f0c10d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..08f7b495d02 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_g.png new file mode 100644 index 00000000000..9296499ad1c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_h.png new file mode 100644 index 00000000000..8eeaca8d9ee Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_hp.png new file mode 100644 index 00000000000..e29348a4c66 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g.png new file mode 100755 index 00000000000..4fca6a3cfdf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully.png new file mode 100755 index 00000000000..e77a91aa369 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully_roam.png new file mode 100755 index 00000000000..7d0d206e598 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_roam.png new file mode 100755 index 00000000000..e77a626ef6f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm.png new file mode 100755 index 00000000000..b581f5d5ab3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm_fully.png new file mode 100755 index 00000000000..370fa889b56 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_3g.png new file mode 100644 index 00000000000..52263415d30 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_4g.png new file mode 100644 index 00000000000..85c241e7f53 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_g.png new file mode 100644 index 00000000000..429a149fa7d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_h.png new file mode 100644 index 00000000000..49b65546c3c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_hp.png new file mode 100644 index 00000000000..6158001414a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_3g.png new file mode 100644 index 00000000000..c7385f0c10d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_4g.png new file mode 100644 index 00000000000..e3446dd3aec Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_g.png new file mode 100644 index 00000000000..9296499ad1c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_h.png new file mode 100644 index 00000000000..8eeaca8d9ee Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_hp.png new file mode 100644 index 00000000000..67ae5899fd0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png new file mode 100755 index 00000000000..43053510881 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g.png new file mode 100755 index 00000000000..c5dd2c50e38 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default.png new file mode 100755 index 00000000000..39218a01ae1 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully.png new file mode 100755 index 00000000000..eebe87d39a4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully_roam.png new file mode 100755 index 00000000000..946e832fdef Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_roam.png new file mode 100755 index 00000000000..9c8d910e60e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_fully.png new file mode 100755 index 00000000000..25d9d069491 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g.png new file mode 100755 index 00000000000..7dbe663bab9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default.png new file mode 100755 index 00000000000..16d093dea63 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully.png new file mode 100755 index 00000000000..187e0af0ce4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully_roam.png new file mode 100755 index 00000000000..652cdb087f0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_roam.png new file mode 100755 index 00000000000..eaf6a27f4f8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_fully.png new file mode 100755 index 00000000000..c591c856900 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e.png new file mode 100755 index 00000000000..d79900c3374 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully.png new file mode 100755 index 00000000000..7360d59afcb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully_roam.png new file mode 100755 index 00000000000..05af68eec1e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_roam.png new file mode 100755 index 00000000000..f085372b827 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_3g.png new file mode 100644 index 00000000000..a31472332d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..21319491708 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_g.png new file mode 100644 index 00000000000..ec6ce88324f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_h.png new file mode 100644 index 00000000000..f9f00f7ff38 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_hp.png new file mode 100644 index 00000000000..41eaea06d36 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_3g.png new file mode 100644 index 00000000000..86ec69084c9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..ffa6b71ab07 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_g.png new file mode 100644 index 00000000000..77ee8e48e79 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_h.png new file mode 100644 index 00000000000..bead621c91f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_hp.png new file mode 100644 index 00000000000..0d3434045fb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g.png new file mode 100755 index 00000000000..7c6ef450180 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully.png new file mode 100755 index 00000000000..795f722b5f4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully_roam.png new file mode 100755 index 00000000000..b09dd9a1f0d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_roam.png new file mode 100755 index 00000000000..2bd02be4f52 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm.png new file mode 100755 index 00000000000..9b068c1bf42 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm_fully.png new file mode 100755 index 00000000000..3a0f4f453ce Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_3g.png new file mode 100644 index 00000000000..9ab76e819cb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_4g.png new file mode 100644 index 00000000000..eadf8887909 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_g.png new file mode 100644 index 00000000000..00b9a24f7f3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_h.png new file mode 100644 index 00000000000..9620a0f8167 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_hp.png new file mode 100644 index 00000000000..487cd1ff5b7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_3g.png new file mode 100644 index 00000000000..dbfd0210d33 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_4g.png new file mode 100644 index 00000000000..c9555030d89 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_g.png new file mode 100644 index 00000000000..ced6d85ea21 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_h.png new file mode 100644 index 00000000000..b5ad7ca900d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_hp.png new file mode 100644 index 00000000000..254211d4cb4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png new file mode 100755 index 00000000000..beb641bf20b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g.png new file mode 100755 index 00000000000..c715e53a9be Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default.png new file mode 100755 index 00000000000..6a6a34dd901 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully.png new file mode 100755 index 00000000000..2c2ee21e9e5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully_roam.png new file mode 100755 index 00000000000..e2cd61e27c4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_roam.png new file mode 100755 index 00000000000..331e52f06e6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_fully.png new file mode 100755 index 00000000000..01b735868ba Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g.png new file mode 100755 index 00000000000..a79913f98e9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default.png new file mode 100755 index 00000000000..89a8720aa28 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully.png new file mode 100755 index 00000000000..de92e6d8113 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully_roam.png new file mode 100755 index 00000000000..b95eb22f9d7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_roam.png new file mode 100755 index 00000000000..9ddf4291fd6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_fully.png new file mode 100755 index 00000000000..06f5ec9d660 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e.png new file mode 100755 index 00000000000..06638f33a30 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully.png new file mode 100755 index 00000000000..6076075e094 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully_roam.png new file mode 100755 index 00000000000..d040a2b6d22 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_roam.png new file mode 100755 index 00000000000..fe9f905e609 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_3g.png new file mode 100644 index 00000000000..e322672b6ed Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..946ae176caf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_g.png new file mode 100644 index 00000000000..6756017716c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_h.png new file mode 100644 index 00000000000..7f8f8a4a5fa Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_hp.png new file mode 100644 index 00000000000..b9304e7a896 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_3g.png new file mode 100644 index 00000000000..dfde6cab7ac Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..180eec96067 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_g.png new file mode 100644 index 00000000000..4316eff76b5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_h.png new file mode 100644 index 00000000000..91c9a031c90 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_hp.png new file mode 100644 index 00000000000..1f6145e7d50 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g.png new file mode 100755 index 00000000000..ba1ff45283b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully.png new file mode 100755 index 00000000000..f7fa38c7e3b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully_roam.png new file mode 100755 index 00000000000..8355a4a9e59 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_roam.png new file mode 100755 index 00000000000..91769b93a49 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm.png new file mode 100755 index 00000000000..2e6bc18c850 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm_fully.png new file mode 100755 index 00000000000..68c68fcaf55 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_3g.png new file mode 100644 index 00000000000..37633888f0f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_4g.png new file mode 100644 index 00000000000..88645bc12df Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_g.png new file mode 100644 index 00000000000..1ef1e120a6f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_h.png new file mode 100644 index 00000000000..266fa295fe2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_hp.png new file mode 100644 index 00000000000..fec6ead52ac Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_3g.png new file mode 100644 index 00000000000..f92c9c237bd Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_4g.png new file mode 100644 index 00000000000..5d6645b792a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_g.png new file mode 100644 index 00000000000..fe80330cf12 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_h.png new file mode 100644 index 00000000000..019e3825d93 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_hp.png new file mode 100644 index 00000000000..003737d95ef Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png new file mode 100755 index 00000000000..a4028cd2602 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g.png new file mode 100755 index 00000000000..6875565fc04 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default.png new file mode 100755 index 00000000000..56f83dd7712 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully.png new file mode 100755 index 00000000000..42935b6b8dc Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully_roam.png new file mode 100755 index 00000000000..b8742a027db Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_roam.png new file mode 100755 index 00000000000..cf04633d1cf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_fully.png new file mode 100755 index 00000000000..b0073c2dee6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g.png new file mode 100755 index 00000000000..0d9358064e0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default.png new file mode 100755 index 00000000000..bdbce47f9ab Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully.png new file mode 100755 index 00000000000..347ea6b7722 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully_roam.png new file mode 100755 index 00000000000..0ade75815f4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_roam.png new file mode 100755 index 00000000000..69d763da2d8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_fully.png new file mode 100755 index 00000000000..841da56a7d8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e.png new file mode 100755 index 00000000000..c684a5a7200 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully.png new file mode 100755 index 00000000000..d71f85f0aba Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully_roam.png new file mode 100755 index 00000000000..0e3d718715b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_roam.png new file mode 100755 index 00000000000..39fb603bef8 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_3g.png new file mode 100644 index 00000000000..77c354a3fe5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..14926a314e9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_g.png new file mode 100644 index 00000000000..4bcdc7bab1e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_h.png new file mode 100644 index 00000000000..1107844469a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_hp.png new file mode 100644 index 00000000000..47ff33dd317 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_3g.png new file mode 100644 index 00000000000..04e45dc84cf Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..d6078c6e1b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_g.png new file mode 100644 index 00000000000..3c3a6b3491f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_h.png new file mode 100644 index 00000000000..9871304842f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_hp.png new file mode 100644 index 00000000000..7272c32dde1 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g.png new file mode 100755 index 00000000000..d6e3cac5c96 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully.png new file mode 100755 index 00000000000..949d58a6b05 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully_roam.png new file mode 100755 index 00000000000..407e5c1ec19 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_roam.png new file mode 100755 index 00000000000..5f054488901 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm.png new file mode 100755 index 00000000000..9284534bedb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm_fully.png new file mode 100755 index 00000000000..f7e1a13760b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_3g.png new file mode 100644 index 00000000000..4a894f14e63 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_4g.png new file mode 100644 index 00000000000..51a0f3c1ef6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_g.png new file mode 100644 index 00000000000..6fa75b121d5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_h.png new file mode 100644 index 00000000000..aed122271df Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_hp.png new file mode 100644 index 00000000000..49c02b33b9b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_3g.png new file mode 100644 index 00000000000..358eab95c12 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_4g.png new file mode 100644 index 00000000000..a9ba830e85d Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_g.png new file mode 100644 index 00000000000..923555858ee Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_h.png new file mode 100644 index 00000000000..bc260dead41 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_hp.png new file mode 100644 index 00000000000..8ad18f03654 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png new file mode 100755 index 00000000000..b5ed22becc0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g.png new file mode 100755 index 00000000000..86fc340c335 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default.png new file mode 100755 index 00000000000..84c46996c1a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully.png new file mode 100755 index 00000000000..8e7ac74bf95 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully_roam.png new file mode 100755 index 00000000000..fe492fdc32f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_roam.png new file mode 100755 index 00000000000..3ec684e994a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_fully.png new file mode 100755 index 00000000000..96bbc46b6e1 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g.png new file mode 100755 index 00000000000..5c4a61eedb5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default.png new file mode 100755 index 00000000000..86b9a8877ad Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully.png new file mode 100755 index 00000000000..adcd352780e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully_roam.png new file mode 100755 index 00000000000..f545efe222b Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_roam.png new file mode 100755 index 00000000000..c2d055a9a96 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_fully.png new file mode 100755 index 00000000000..716581fcaa6 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e.png new file mode 100755 index 00000000000..de3917d63a3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully.png new file mode 100755 index 00000000000..f5e59582ea4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully_roam.png new file mode 100755 index 00000000000..de44dea1e13 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_roam.png new file mode 100755 index 00000000000..cb068da3473 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_3g.png new file mode 100644 index 00000000000..c9eb96fdaf7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..72eadc0a0cb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_g.png new file mode 100644 index 00000000000..fb4d39ec5f5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_h.png new file mode 100644 index 00000000000..e1e215e5cb0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_hp.png new file mode 100644 index 00000000000..b47d04f7172 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_3g.png new file mode 100644 index 00000000000..f80b324a8a2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..63ca13c8f2c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_g.png new file mode 100644 index 00000000000..421e8cbde35 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_h.png new file mode 100644 index 00000000000..86748c3d06f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_hp.png new file mode 100644 index 00000000000..3bbc885a8e5 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g.png new file mode 100755 index 00000000000..f54d21fbddb Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully.png new file mode 100755 index 00000000000..474f0756522 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully_roam.png new file mode 100755 index 00000000000..5c7eaaeeffe Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_roam.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_roam.png new file mode 100755 index 00000000000..c65123d84ea Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm.png new file mode 100755 index 00000000000..2a86141ebf2 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm_fully.png new file mode 100755 index 00000000000..02f3b831c1c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_3g.png new file mode 100644 index 00000000000..ffd689d176c Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_4g.png new file mode 100644 index 00000000000..b3eb6d9edc3 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_g.png new file mode 100644 index 00000000000..1abe466d6e4 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_h.png new file mode 100644 index 00000000000..e36e6f23405 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_hp.png new file mode 100644 index 00000000000..ef872fdc0e7 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim1_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_3g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_3g.png new file mode 100644 index 00000000000..ccbcfa0e40e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_3g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_4g.png new file mode 100644 index 00000000000..02d8244e9a9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_g.png new file mode 100644 index 00000000000..83296a53a53 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_g.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_h.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_h.png new file mode 100644 index 00000000000..1bf107d424e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_h.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_hp.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_hp.png new file mode 100644 index 00000000000..6c34eabc74e Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_sim2_hp.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_in.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_in.png new file mode 100644 index 00000000000..31c09366236 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_in.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_inout.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_inout.png new file mode 100644 index 00000000000..7e9b752f7b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_inout.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_1.png new file mode 100644 index 00000000000..ade18283904 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_1.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim1.png new file mode 100644 index 00000000000..782d5901a60 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim1.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim2.png new file mode 100644 index 00000000000..61317a6034f Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_null_sim2.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_out.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_out.png new file mode 100644 index 00000000000..3209234d94a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_out.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_in.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_in.png new file mode 100644 index 00000000000..95c56ede38a Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_in.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_inout.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_inout.png new file mode 100644 index 00000000000..11b9a93aaa0 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_inout.png differ diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_out.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_out.png new file mode 100644 index 00000000000..0f85ca0d738 Binary files /dev/null and b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_out.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_1x.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_1x.png new file mode 100755 index 00000000000..bd31253073c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_1x.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_3g.png new file mode 100755 index 00000000000..5ed365cb371 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_4g.png new file mode 100755 index 00000000000..5b22d20ce8f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_e.png new file mode 100755 index 00000000000..b156b06e373 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_g.png new file mode 100755 index 00000000000..f85047725b6 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_h.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_h.png new file mode 100755 index 00000000000..b261c1e35ea Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_h.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_hp.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_hp.png new file mode 100755 index 00000000000..65773655c7d Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_fully_connected_hp.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_fully_connected_hp.png new file mode 100755 index 00000000000..4172082efeb Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_fully_connected_hp.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..52569edd7e9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..034a68220b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim1_4g.png new file mode 100644 index 00000000000..1ed366e8b49 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim2_4g.png new file mode 100644 index 00000000000..18fe2a2545e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..175020cb7a3 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..10e733a9085 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim1_4g.png new file mode 100644 index 00000000000..295e678c94a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim2_4g.png new file mode 100644 index 00000000000..d36720a0e5f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..8044a22f087 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..256c8d322bf Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim1_4g.png new file mode 100644 index 00000000000..0b4d9cf010d Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim2_4g.png new file mode 100644 index 00000000000..d347e534a04 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..1b4e28ef149 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..c04653525fa Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim1_4g.png new file mode 100644 index 00000000000..976d87e8e0f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim2_4g.png new file mode 100644 index 00000000000..ae2c1b0f78a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..a7b3408c10b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..8cf9fcf1b10 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim1_4g.png new file mode 100644 index 00000000000..92d6840bac6 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim2_4g.png new file mode 100644 index 00000000000..bca3ef687d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_r_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g.png new file mode 100755 index 00000000000..ec1d1049881 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default.png new file mode 100755 index 00000000000..9f1de41ca85 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully.png new file mode 100755 index 00000000000..b5222fcd516 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully_roam.png new file mode 100755 index 00000000000..b12b0edd37b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_roam.png new file mode 100755 index 00000000000..f333138a307 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_fully.png new file mode 100755 index 00000000000..12f8875805f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g.png new file mode 100755 index 00000000000..9b03d185205 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default.png new file mode 100755 index 00000000000..ffdc80f9d85 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully.png new file mode 100755 index 00000000000..ae3d75a7dfe Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully_roam.png new file mode 100755 index 00000000000..c67bfe789f1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_roam.png new file mode 100755 index 00000000000..66019f80943 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_fully.png new file mode 100755 index 00000000000..d14e6890499 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e.png new file mode 100755 index 00000000000..281afe08a4c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully.png new file mode 100755 index 00000000000..083889e9ff6 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully_roam.png new file mode 100755 index 00000000000..c3efed13f57 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_roam.png new file mode 100755 index 00000000000..3fab702985a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim1_4g.png new file mode 100644 index 00000000000..1fc6d0e0ba9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim2_4g.png new file mode 100644 index 00000000000..e28b6f02960 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g.png new file mode 100755 index 00000000000..651ea7b8d45 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully.png new file mode 100755 index 00000000000..5942471029a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully_roam.png new file mode 100755 index 00000000000..9699a3abcf9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_roam.png new file mode 100755 index 00000000000..d976f3dc561 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm.png new file mode 100755 index 00000000000..1422d93606a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm_fully.png new file mode 100755 index 00000000000..0ef879b64ed Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim1_4g.png new file mode 100644 index 00000000000..dfc663d775b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim2_4g.png new file mode 100644 index 00000000000..27be3f89459 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_0_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png new file mode 100755 index 00000000000..9943613ab35 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g.png new file mode 100755 index 00000000000..8ff5ac893d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default.png new file mode 100755 index 00000000000..655edc3a4c5 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully.png new file mode 100755 index 00000000000..e151a7e2f75 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully_roam.png new file mode 100755 index 00000000000..9dc081b0f5f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_roam.png new file mode 100755 index 00000000000..51761046ed1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_fully.png new file mode 100755 index 00000000000..1c929281ea0 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g.png new file mode 100755 index 00000000000..7ebf56c85f6 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default.png new file mode 100755 index 00000000000..d7819349b5a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully.png new file mode 100755 index 00000000000..71aa042a743 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully_roam.png new file mode 100755 index 00000000000..3091f56d6bd Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_roam.png new file mode 100755 index 00000000000..60344ddb025 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_fully.png new file mode 100755 index 00000000000..b6689b5904b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e.png new file mode 100755 index 00000000000..79ca14f55e0 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully.png new file mode 100755 index 00000000000..e049773ee3e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully_roam.png new file mode 100755 index 00000000000..3d5e5982b11 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_roam.png new file mode 100755 index 00000000000..5bec8400851 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim1_4g.png new file mode 100644 index 00000000000..3c33f6d592c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim2_4g.png new file mode 100644 index 00000000000..7fc774bef3e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g.png new file mode 100755 index 00000000000..51187f998e5 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully.png new file mode 100755 index 00000000000..ea5baa13ef3 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully_roam.png new file mode 100755 index 00000000000..b3a322cab7e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_roam.png new file mode 100755 index 00000000000..5ac30c8e257 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm.png new file mode 100755 index 00000000000..b5b3611d5a2 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm_fully.png new file mode 100755 index 00000000000..7f3f307c944 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim1_4g.png new file mode 100644 index 00000000000..40096e83ab4 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim2_4g.png new file mode 100644 index 00000000000..5a04863315b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_1_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png new file mode 100755 index 00000000000..1fc177529fd Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g.png new file mode 100755 index 00000000000..12a75c698b1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default.png new file mode 100755 index 00000000000..078f837a4a1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully.png new file mode 100755 index 00000000000..f4a0cc24f03 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully_roam.png new file mode 100755 index 00000000000..20581f70320 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_roam.png new file mode 100755 index 00000000000..b03871f85e9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_fully.png new file mode 100755 index 00000000000..9583d93f29f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g.png new file mode 100755 index 00000000000..e9313ecf65b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default.png new file mode 100755 index 00000000000..5a2000b66c3 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully.png new file mode 100755 index 00000000000..91460b22d30 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully_roam.png new file mode 100755 index 00000000000..b9d52280b51 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_roam.png new file mode 100755 index 00000000000..6f6e6f86fbe Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_fully.png new file mode 100755 index 00000000000..50cd5b49e75 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e.png new file mode 100755 index 00000000000..8439cef1d08 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully.png new file mode 100755 index 00000000000..77931bce18e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully_roam.png new file mode 100755 index 00000000000..2e662e62e37 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_roam.png new file mode 100755 index 00000000000..31f52ace01e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim1_4g.png new file mode 100644 index 00000000000..a9b3b192169 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim2_4g.png new file mode 100644 index 00000000000..736c1919207 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g.png new file mode 100755 index 00000000000..f3ffb3be17f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully.png new file mode 100755 index 00000000000..636020289f5 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully_roam.png new file mode 100755 index 00000000000..60979713250 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_roam.png new file mode 100755 index 00000000000..64cdc95a5d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm.png new file mode 100755 index 00000000000..6486bbfb8d2 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm_fully.png new file mode 100755 index 00000000000..95eb1f25f2a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim1_4g.png new file mode 100644 index 00000000000..ed09e62d33d Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim2_4g.png new file mode 100644 index 00000000000..ca2472167a0 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_2_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png new file mode 100755 index 00000000000..82b9741bfed Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g.png new file mode 100755 index 00000000000..61d2d85abb8 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default.png new file mode 100755 index 00000000000..69fdc6218c1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully.png new file mode 100755 index 00000000000..13e60904fec Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully_roam.png new file mode 100755 index 00000000000..a3310a04b14 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_roam.png new file mode 100755 index 00000000000..a26b0835e4c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_fully.png new file mode 100755 index 00000000000..fd3dd306372 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g.png new file mode 100755 index 00000000000..eb38bbcae09 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default.png new file mode 100755 index 00000000000..cb8fc4f5b9c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully.png new file mode 100755 index 00000000000..fe055c75ad8 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully_roam.png new file mode 100755 index 00000000000..dcfa9042214 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_roam.png new file mode 100755 index 00000000000..e7ef1dffcad Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_fully.png new file mode 100755 index 00000000000..e16de169df9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e.png new file mode 100755 index 00000000000..87e96cc848f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully.png new file mode 100755 index 00000000000..a2d0faa37eb Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully_roam.png new file mode 100755 index 00000000000..6b52c5f3e19 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_roam.png new file mode 100755 index 00000000000..477a5fe8df1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim1_4g.png new file mode 100644 index 00000000000..52726fef215 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim2_4g.png new file mode 100644 index 00000000000..47422b3803e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g.png new file mode 100755 index 00000000000..b29d75ef12c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully.png new file mode 100755 index 00000000000..8920122e9e8 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully_roam.png new file mode 100755 index 00000000000..5769b586539 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_roam.png new file mode 100755 index 00000000000..1487ca7613d Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm.png new file mode 100755 index 00000000000..e0f48e1bc5c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm_fully.png new file mode 100755 index 00000000000..11b6c41ec44 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim1_4g.png new file mode 100644 index 00000000000..542884b0843 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim2_4g.png new file mode 100644 index 00000000000..8e5f6087d7a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_3_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png new file mode 100755 index 00000000000..9f4979ce2b9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g.png new file mode 100755 index 00000000000..76893c3806f Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default.png new file mode 100755 index 00000000000..fe5ea012fcb Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully.png new file mode 100755 index 00000000000..7576cddab88 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully_roam.png new file mode 100755 index 00000000000..7cdb571f9ee Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_roam.png new file mode 100755 index 00000000000..0799418a83b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_fully.png new file mode 100755 index 00000000000..82577bedd6d Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_3g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g.png new file mode 100755 index 00000000000..4f3494cbab0 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default.png new file mode 100755 index 00000000000..39d3beee710 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully.png new file mode 100755 index 00000000000..38c1a01e400 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully_roam.png new file mode 100755 index 00000000000..c2452a91bf1 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_roam.png new file mode 100755 index 00000000000..77770e493b8 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_default_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_fully.png new file mode 100755 index 00000000000..24c59105c5e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_4g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e.png new file mode 100755 index 00000000000..cd10b05f693 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully.png new file mode 100755 index 00000000000..d24e199e047 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully_roam.png new file mode 100755 index 00000000000..59da70a129c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_roam.png new file mode 100755 index 00000000000..ac30d5e5607 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_e_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim1_4g.png new file mode 100644 index 00000000000..0338d28778a Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim2_4g.png new file mode 100644 index 00000000000..231d3c51b9e Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_fully_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g.png new file mode 100755 index 00000000000..5b03544481b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully.png new file mode 100755 index 00000000000..3ad515cd63b Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully_roam.png new file mode 100755 index 00000000000..21d7c389157 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_fully_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_roam.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_roam.png new file mode 100755 index 00000000000..5f1dd070a7c Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_g_roam.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm.png new file mode 100755 index 00000000000..2e929d88e20 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm_fully.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm_fully.png new file mode 100755 index 00000000000..c8aad28e7b7 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_gsm_fully.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim1_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim1_4g.png new file mode 100644 index 00000000000..185e47715fb Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim1_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim2_4g.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim2_4g.png new file mode 100644 index 00000000000..6fac79fef14 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_4_sim2_4g.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_in.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_in.png new file mode 100644 index 00000000000..cc9c49f3ed5 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_in.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_inout.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_inout.png new file mode 100644 index 00000000000..5a313c51488 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_inout.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_out.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_out.png new file mode 100644 index 00000000000..373a4a4e017 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_signal_out.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_in.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_in.png new file mode 100644 index 00000000000..d299daf0bad Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_in.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_inout.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_inout.png new file mode 100644 index 00000000000..dcfdb7b41d9 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_inout.png differ diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_out.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_out.png new file mode 100644 index 00000000000..fb8125ab785 Binary files /dev/null and b/packages/SystemUI/res/drawable-xhdpi/stat_sys_wifi_out.png differ diff --git a/packages/SystemUI/res/drawable/ic_qs_signal_4g_plus.xml b/packages/SystemUI/res/drawable/ic_qs_signal_4g_plus.xml new file mode 100644 index 00000000000..cefb71402c6 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_qs_signal_4g_plus.xml @@ -0,0 +1,50 @@ + + + + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml new file mode 100644 index 00000000000..59e880bfa6a --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_data_fully_connected_4g_plus.xml @@ -0,0 +1,50 @@ + + + + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_in_auto_mirrored.xml b/packages/SystemUI/res/drawable/stat_sys_signal_in_auto_mirrored.xml new file mode 100644 index 00000000000..aad8e31b6a5 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_in_auto_mirrored.xml @@ -0,0 +1,32 @@ + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_inout_auto_mirrored.xml b/packages/SystemUI/res/drawable/stat_sys_signal_inout_auto_mirrored.xml new file mode 100644 index 00000000000..012afd31006 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_inout_auto_mirrored.xml @@ -0,0 +1,32 @@ + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_out_auto_mirrored.xml b/packages/SystemUI/res/drawable/stat_sys_signal_out_auto_mirrored.xml new file mode 100644 index 00000000000..27d37ae69e9 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_signal_out_auto_mirrored.xml @@ -0,0 +1,32 @@ + + + + diff --git a/packages/SystemUI/res/drawable/stat_sys_su.xml b/packages/SystemUI/res/drawable/stat_sys_su.xml new file mode 100644 index 00000000000..e013c135958 --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_su.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml index 444f0f016b8..de735381372 100644 --- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml +++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml @@ -36,6 +36,15 @@ android:textAppearance="?android:attr/textAppearanceSmall" android:accessibilityLiveRegion="polite" /> + + - - - - - + android:layout_height="wrap_content" + > + + + + + + + + + + + + diff --git a/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml b/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml index 0bef513af65..19a1ce5b78e 100644 --- a/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml +++ b/packages/SystemUI/res/layout/quick_settings_brightness_dialog.xml @@ -15,8 +15,8 @@ --> @@ -59,7 +59,7 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:scaleType="center" - android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_icon_padding" android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" android:src="@drawable/ic_sysbar_recent" /> @@ -81,7 +81,7 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:scaleType="center" - android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_icon_padding" android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" android:src="@drawable/ic_sysbar_home" /> @@ -111,7 +111,7 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:scaleType="matrix" - android:paddingLeft="@dimen/screen_pinning_request_inner_padding" + android:paddingStart="@dimen/screen_pinning_request_inner_padding" android:paddingTop="@dimen/screen_pinning_request_inner_padding" android:paddingBottom="@dimen/screen_pinning_request_inner_padding" android:src="@drawable/screen_pinning_bg_circ" /> @@ -120,7 +120,7 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:scaleType="center" - android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_icon_padding" android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" android:src="@drawable/ic_sysbar_back" /> diff --git a/packages/SystemUI/res/layout/signal_cluster_view.xml b/packages/SystemUI/res/layout/signal_cluster_view.xml index f8bd6fdc4fb..621a73991c9 100644 --- a/packages/SystemUI/res/layout/signal_cluster_view.xml +++ b/packages/SystemUI/res/layout/signal_cluster_view.xml @@ -75,6 +75,14 @@ android:alpha="0.0" systemui:hasOverlappingRendering="false" /> + + + + + + + android:layout_marginStart="@dimen/notification_side_padding" + android:layout_marginEnd="@dimen/notification_side_padding"/> diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index e42ce66ba2a..50e561ce2c5 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -65,8 +65,8 @@ android:layout_width="@dimen/notification_panel_width" android:layout_height="wrap_content" android:layout_gravity="@integer/notification_panel_layout_gravity" - android:paddingLeft="@dimen/notification_side_padding" - android:paddingRight="@dimen/notification_side_padding" + android:paddingStart="@dimen/notification_side_padding" + android:paddingEnd="@dimen/notification_side_padding" android:visibility="invisible"> @@ -29,7 +29,7 @@ style="@style/VolumeButtons" android:layout_width="@dimen/volume_button_size" android:layout_height="@dimen/volume_button_size" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:clickable="true" android:soundEffectsEnabled="false" android:src="@drawable/ic_volume_collapse_animation" diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml index 980da9d9cf0..e33ab98db07 100644 --- a/packages/SystemUI/res/values-zh-rCN/strings.xml +++ b/packages/SystemUI/res/values-zh-rCN/strings.xml @@ -142,7 +142,7 @@ "4G" "LTE" "CDMA" - "漫游中" + "数据漫游" "EDGE" "WLAN" "无 SIM 卡。" diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml index 46bf52d1215..2d06ee98c55 100644 --- a/packages/SystemUI/res/values-zh-rTW/strings.xml +++ b/packages/SystemUI/res/values-zh-rTW/strings.xml @@ -142,7 +142,7 @@ "4G" "LTE" "CDMA" - "漫遊中" + "數據漫遊" "Edge" "Wi-Fi" "沒有 SIM 卡。" diff --git a/packages/SystemUI/res/values/aospb_strings.xml b/packages/SystemUI/res/values/aospb_strings.xml new file mode 100644 index 00000000000..f1e2a03050a --- /dev/null +++ b/packages/SystemUI/res/values/aospb_strings.xml @@ -0,0 +1,19 @@ + + + + + + Superuser session active + + diff --git a/packages/SystemUI/res/values/arrays.xml b/packages/SystemUI/res/values/arrays.xml index 6102aa6e1a9..a0a3397ecbb 100644 --- a/packages/SystemUI/res/values/arrays.xml +++ b/packages/SystemUI/res/values/arrays.xml @@ -1,5 +1,8 @@ + + + + array/telephony_data_type_sim1 + array/telephony_data_type_sim1 + array/telephony_data_type_sim1 + + + + + 0 + + drawable/stat_sys_data_fully_connected_g + + drawable/stat_sys_data_fully_connected_e + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_1x + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_1x + + drawable/stat_sys_data_fully_connected_h + + drawable/stat_sys_data_fully_connected_h + + drawable/stat_sys_data_fully_connected_h + + 0 + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_g + + drawable/stat_sys_data_fully_connected_3g + + 0 + + + + + + + + + + + + + drawable/stat_sys_data_fully_connected_3g + + drawable/stat_sys_data_fully_connected_4g + + drawable/stat_sys_data_fully_connected_4g_plus + + + + + + 0 + + string/accessibility_data_connection_gprs + + string/accessibility_data_connection_edge + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_cdma + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_cdma + + string/accessibility_data_connection_3.5g + + string/accessibility_data_connection_3.5g + + string/accessibility_data_connection_3.5g + + 0 + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_lte + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_3.5g + + string/accessibility_data_connection_gprs + + string/accessibility_data_connection_3g + + 0 + + + + + string/accessibility_data_connection_3g + + string/accessibility_data_connection_4g + + + + + + array/data_activity_sim1 + array/data_activity_sim1 + array/data_activity_sim1 + + + + array/telephony_data_activity_unknown_sim1 + array/telephony_data_activity_g_sim1 + array/telephony_data_activity_e_sim1 + array/telephony_data_activity_2g_sim1 + array/telephony_data_activity_3g_sim1 + array/telephony_data_activity_4g_sim1 + array/telephony_data_activity_h_sim1 + array/telephony_data_activity_hp_sim1 + array/telephony_data_activity_1x_sim1 + array/telephony_data_activity_lte_sim1 + + + + + + + + + + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + 0 + drawable/stat_sys_signal_in_auto_mirrored + drawable/stat_sys_signal_out_auto_mirrored + drawable/stat_sys_signal_inout_auto_mirrored + 0 + + + + + + + + + + + + + array/telephony_siganl_strength_sim1 + array/telephony_siganl_strength_sim1 + array/telephony_siganl_strength_sim1 + + + + + array/telephony_siganl_strength_roaming_sim1 + array/telephony_siganl_strength_roaming_sim1 + array/telephony_siganl_strength_roaming_sim1 + + + + array/telephony_signal_strength_g_sim1 + array/telephony_signal_strength_e_sim1 + array/telephony_signal_strength_3g_sim1 + array/telephony_signal_strength_4g_sim1 + array/telephony_signal_strength_h_sim1 + array/telephony_signal_strength_hp_sim1 + array/telephony_signal_strength_1x_sim1 + array/telephony_signal_strength_cdma_sim1 + array/telephony_signal_strength_umts_sim1 + + + + + + + + + + array/telephony_signal_strength_g_roaming_sim1 + array/telephony_signal_strength_e_roaming_sim1 + array/telephony_signal_strength_3g_roaming_sim1 + array/telephony_signal_strength_4g_roaming_sim1 + array/telephony_signal_strength_h_roaming_sim1 + array/telephony_signal_strength_hp_roaming_sim1 + array/telephony_signal_strength_1x_roaming_sim1 + array/telephony_signal_strength_cdma_roaming_sim1 + array/telephony_signal_strength_umts_roaming_sim1 + + + + + + + + + + array/signal_strength_g_normal_sim1 + array/signal_strength_g_fully_sim1 + + + + array/signal_strength_g_normal_roaming_sim1 + array/signal_strength_g_fully_roaming_sim1 + + + + array/signal_strength_e_normal_sim1 + array/signal_strength_e_fully_sim1 + + + + array/signal_strength_e_normal_roaming_sim1 + array/signal_strength_e_fully_roaming_sim1 + + + + array/signal_strength_3g_normal_sim1 + array/signal_strength_3g_fully_sim1 + + + + array/signal_strength_3g_normal_roaming_sim1 + array/signal_strength_3g_fully_roaming_sim1 + + + + array/signal_strength_4g_normal_sim1 + array/signal_strength_4g_fully_sim1 + + + + array/signal_strength_4g_normal_roaming_sim1 + array/signal_strength_4g_fully_roaming_sim1 + + + + array/signal_strength_h_normal_sim1 + array/signal_strength_h_fully_sim1 + + + + array/signal_strength_h_normal_roaming_sim1 + array/signal_strength_h_fully_roaming_sim1 + + + + array/signal_strength_hp_normal_sim1 + array/signal_strength_hp_fully_sim1 + + + + array/signal_strength_hp_normal_roaming_sim1 + array/signal_strength_hp_fully_roaming_sim1 + + + + array/signal_strength_1x_normal_sim1 + array/signal_strength_1x_fully_sim1 + + + + array/signal_strength_1x_normal_roaming_sim1 + array/signal_strength_1x_fully_roaming_sim1 + + + + array/signal_strength_cdma_normal_sim1 + array/signal_strength_cdma_fully_sim1 + + + + array/signal_strength_cdma_normal_roaming_sim1 + array/signal_strength_cdma_fully_roaming_sim1 + + + + array/signal_strength_umts_normal_sim1 + array/signal_strength_umts_fully_sim1 + + + + array/signal_strength_umts_normal_roaming_sim1 + array/signal_strength_umts_fully_roaming_sim1 + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + drawable/stat_sys_signal_0_fully + drawable/stat_sys_signal_1_fully + drawable/stat_sys_signal_2_fully + drawable/stat_sys_signal_3_fully + drawable/stat_sys_signal_4_fully + + + + + string/accessibility_no_phone + string/accessibility_phone_one_bar + string/accessibility_phone_two_bars + string/accessibility_phone_three_bars + string/accessibility_phone_signal_full + + + + + + drawable/stat_sys_signal_null + drawable/stat_sys_signal_null + drawable/stat_sys_signal_null + + + + + + drawable/stat_sys_no_sims + drawable/stat_sys_no_sims + drawable/stat_sys_no_sims + + + + + array/signal_strength_g_normal_sim2 + array/signal_strength_g_fully_sim2 + + + array/signal_strength_g_normal_roaming_sim2 + array/signal_strength_g_fully_roaming_sim2 + + + array/signal_strength_e_normal_sim2 + array/signal_strength_e_fully_sim2 + + + array/signal_strength_e_normal_roaming_sim2 + array/signal_strength_e_fully_roaming_sim2 + + + array/signal_strength_3g_normal_sim2 + array/signal_strength_3g_fully_sim2 + + + array/signal_strength_3g_normal_roaming_sim2 + array/signal_strength_3g_fully_roaming_sim2 + + + array/signal_strength_4g_normal_sim2 + array/signal_strength_4g_fully_sim2 + + + array/signal_strength_4g_normal_roaming_sim2 + array/signal_strength_4g_fully_roaming_sim2 + + + array/signal_strength_h_normal_sim2 + array/signal_strength_h_fully_sim2 + + + array/signal_strength_h_normal_roaming_sim2 + array/signal_strength_h_fully_roaming_sim2 + + + array/signal_strength_hp_normal_sim2 + array/signal_strength_hp_fully_sim2 + + + array/signal_strength_hp_normal_roaming_sim2 + array/signal_strength_hp_fully_roaming_sim2 + + + array/signal_strength_1x_normal_sim2 + array/signal_strength_1x_fully_sim2 + + + array/signal_strength_1x_normal_roaming_sim2 + array/signal_strength_1x_fully_roaming_sim2 + + + array/signal_strength_cdma_normal_sim2 + array/signal_strength_cdma_fully_sim2 + + + array/signal_strength_cdma_normal_roaming_sim2 + array/signal_strength_cdma_fully_roaming_sim2 + + + array/signal_strength_umts_normal_sim2 + array/signal_strength_umts_fully_sim2 + + + array/signal_strength_umts_normal_roaming_sim2 + array/signal_strength_umts_fully_roaming_sim2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + array/signal_strength_g_normal_sim3 + array/signal_strength_g_fully_sim3 + + + array/signal_strength_g_normal_roaming_sim3 + array/signal_strength_g_fully_roaming_sim3 + + + array/signal_strength_e_normal_sim3 + array/signal_strength_e_fully_sim3 + + + array/signal_strength_e_normal_roaming_sim3 + array/signal_strength_e_fully_roaming_sim3 + + + array/signal_strength_3g_normal_sim3 + array/signal_strength_3g_fully_sim3 + + + array/signal_strength_3g_normal_roaming_sim3 + array/signal_strength_3g_fully_roaming_sim3 + + + array/signal_strength_4g_normal_sim3 + array/signal_strength_4g_fully_sim3 + + + array/signal_strength_4g_normal_roaming_sim3 + array/signal_strength_4g_fully_roaming_sim3 + + + array/signal_strength_h_normal_sim3 + array/signal_strength_h_fully_sim3 + + + array/signal_strength_h_normal_roaming_sim3 + array/signal_strength_h_fully_roaming_sim3 + + + array/signal_strength_hp_normal_sim3 + array/signal_strength_hp_fully_sim3 + + + array/signal_strength_hp_normal_roaming_sim3 + array/signal_strength_hp_fully_roaming_sim3 + + + array/signal_strength_1x_normal_sim3 + array/signal_strength_1x_fully_sim3 + + + array/signal_strength_1x_normal_roaming_sim3 + array/signal_strength_1x_fully_roaming_sim3 + + + array/signal_strength_cdma_normal_sim3 + array/signal_strength_cdma_fully_sim3 + + + array/signal_strength_cdma_normal_roaming_sim3 + array/signal_strength_cdma_fully_roaming_sim3 + + + array/signal_strength_umts_normal_sim3 + array/signal_strength_umts_fully_sim3 + + + array/signal_strength_umts_normal_roaming_sim3 + array/signal_strength_umts_fully_roaming_sim3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @drawable/stat_sys_signal_0_3g + @drawable/stat_sys_signal_0_4g + @drawable/stat_sys_signal_1_3g + @drawable/stat_sys_signal_1_4g + @drawable/stat_sys_signal_2_3g + @drawable/stat_sys_signal_2_4g + @drawable/stat_sys_signal_3_3g + @drawable/stat_sys_signal_3_4g + @drawable/stat_sys_signal_4_3g + @drawable/stat_sys_signal_4_4g + @drawable/stat_sys_signal_0_3g_fully + @drawable/stat_sys_signal_0_4g_fully + @drawable/stat_sys_signal_1_3g_fully + @drawable/stat_sys_signal_1_4g_fully + @drawable/stat_sys_signal_2_3g_fully + @drawable/stat_sys_signal_2_4g_fully + @drawable/stat_sys_signal_3_3g_fully + @drawable/stat_sys_signal_3_4g_fully + @drawable/stat_sys_signal_4_3g_fully + @drawable/stat_sys_signal_4_4g_fully + + + + @drawable/stat_sys_signal_0_3g_default + @drawable/stat_sys_signal_0_4g_default + @drawable/stat_sys_signal_1_3g_default + @drawable/stat_sys_signal_1_4g_default + @drawable/stat_sys_signal_2_3g_default + @drawable/stat_sys_signal_2_4g_default + @drawable/stat_sys_signal_3_3g_default + @drawable/stat_sys_signal_3_4g_default + @drawable/stat_sys_signal_4_3g_default + @drawable/stat_sys_signal_4_4g_default + @drawable/stat_sys_signal_0_3g_default_fully + @drawable/stat_sys_signal_0_4g_default_fully + @drawable/stat_sys_signal_1_3g_default_fully + @drawable/stat_sys_signal_1_4g_default_fully + @drawable/stat_sys_signal_2_3g_default_fully + @drawable/stat_sys_signal_2_4g_default_fully + @drawable/stat_sys_signal_3_3g_default_fully + @drawable/stat_sys_signal_3_4g_default_fully + @drawable/stat_sys_signal_4_3g_default_fully + @drawable/stat_sys_signal_4_4g_default_fully + diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 5d06768ecde..fe664da10a5 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -138,6 +138,35 @@ true + + false + + + false + + + false + + + false + + + 0 + + + false + 5000 @@ -284,11 +313,19 @@ true + + false + 3000 300 + + true + + + false diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 03ea73c262d..cb4bb0266da 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -484,7 +484,7 @@ 24dp 24dp - 65dp + 90dp 12sp diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index dc9c9fd06e1..5d5522e66c3 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -341,6 +341,9 @@ 4G + + 4G+ + LTE diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java index f3ad9d80339..fb46729999c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -167,8 +167,9 @@ public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState q @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, - int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + int qsType, boolean activityIn, boolean activityOut, int dataActivityId, + int mobileActivityId, int stackedDataIcon, int stackedVoiceIcon, + String typeContentDescription, String description, boolean isWide, int subId) { if (qsIcon == null) { // Not data sim, don't display. return; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 68e483c3a66..6dc261200f5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -18,6 +18,7 @@ import android.content.Context; import android.content.res.ColorStateList; +import android.content.res.Resources; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.drawable.Animatable; @@ -67,8 +68,8 @@ public class SignalClusterView private int mEthernetIconId = 0; private int mLastEthernetIconId = -1; private boolean mWifiVisible = false; - private int mWifiStrengthId = 0; - private int mLastWifiStrengthId = -1; + private int mWifiStrengthId = 0, mWifiActivityId = 0; + private int mLastWifiStrengthId = -1, mLastWifiActivityId = -1; private boolean mIsAirplaneMode = false; private int mAirplaneIconId = 0; private int mLastAirplaneIconId = -1; @@ -78,10 +79,12 @@ public class SignalClusterView private ArrayList mPhoneStates = new ArrayList(); private int mIconTint = Color.WHITE; private float mDarkIntensity; + private int mNoSimsIcon; ViewGroup mEthernetGroup, mWifiGroup; View mNoSimsCombo; ImageView mVpn, mEthernet, mWifi, mAirplane, mNoSims, mEthernetDark, mWifiDark, mNoSimsDark; + ImageView mWifiActivity; View mWifiAirplaneSpacer; View mWifiSignalSpacer; LinearLayout mMobileSignalGroup; @@ -167,6 +170,7 @@ protected void onAttachedToWindow() { mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo); mWifi = (ImageView) findViewById(R.id.wifi_signal); mWifiDark = (ImageView) findViewById(R.id.wifi_signal_dark); + mWifiActivity = (ImageView) findViewById(R.id.wifi_inout); mAirplane = (ImageView) findViewById(R.id.airplane); mNoSims = (ImageView) findViewById(R.id.no_sims); mNoSimsDark = (ImageView) findViewById(R.id.no_sims_dark); @@ -190,6 +194,7 @@ protected void onDetachedFromWindow() { mEthernet = null; mWifiGroup = null; mWifi = null; + mWifiActivity = null; mAirplane = null; mMobileSignalGroup.removeAllViews(); mMobileSignalGroup = null; @@ -215,6 +220,7 @@ public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState q boolean activityIn, boolean activityOut, String description) { mWifiVisible = statusIcon.visible && !mBlockWifi; mWifiStrengthId = statusIcon.icon; + mWifiActivityId = getWifiActivityId(activityIn, activityOut); mWifiDescription = statusIcon.contentDescription; apply(); @@ -222,8 +228,9 @@ public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState q @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, - int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + int qsType, boolean activityIn, boolean activityOut, int dataActivityId, + int mobileActivityId, int stackedDataId, int stackedVoiceId, + String typeContentDescription, String description, boolean isWide, int subId) { PhoneState state = getState(subId); if (state == null) { return; @@ -234,6 +241,10 @@ public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int state.mMobileDescription = statusIcon.contentDescription; state.mMobileTypeDescription = typeContentDescription; state.mIsMobileTypeIconWide = statusType != 0 && isWide; + state.mDataActivityId = dataActivityId; + state.mMobileActivityId = mobileActivityId; + state.mStackedDataId = stackedDataId; + state.mStackedVoiceId = stackedVoiceId; apply(); } @@ -295,6 +306,43 @@ private PhoneState getState(int subId) { return null; } + + private int getWifiActivityId(boolean activityIn, boolean activityOut) { + if (!getContext().getResources().getBoolean(R.bool.config_showWifiActivity)) { + return 0; + } + int activityId = 0; + if (activityIn && activityOut) { + activityId = R.drawable.stat_sys_wifi_inout; + } else if (activityIn) { + activityId = R.drawable.stat_sys_wifi_in; + } else if (activityOut) { + activityId = R.drawable.stat_sys_wifi_out; + } + return activityId; + } + + private int getNoSimIcon() { + int resId = 0; + final String[] noSimArray; + Resources res = getContext().getResources(); + + if (!res.getBoolean(R.bool.config_read_icons_from_xml)) return resId; + + try { + noSimArray = res.getStringArray(R.array.multi_no_sim); + } catch (android.content.res.Resources.NotFoundException e) { + return resId; + } + + if (noSimArray == null) return resId; + + String resName = noSimArray[0]; + resId = res.getIdentifier(resName, null, getContext().getPackageName()); + if (DEBUG) Log.d(TAG, "getNoSimIcon resId = " + resId + " resName = " + resName); + return resId; + } + private PhoneState inflatePhoneState(int subId) { PhoneState state = new PhoneState(subId, mContext); if (mMobileSignalGroup != null) { @@ -349,6 +397,11 @@ public void onRtlPropertiesChanged(int layoutDirection) { mLastWifiStrengthId = -1; } + if (mWifiActivity != null) { + mWifiActivity.setImageDrawable(null); + mLastWifiActivityId = -1; + } + for (PhoneState state : mPhoneStates) { if (state.mMobile != null) { state.maybeStopAnimatableDrawable(state.mMobile); @@ -404,6 +457,10 @@ private void apply() { mWifiDark.setImageResource(mWifiStrengthId); mLastWifiStrengthId = mWifiStrengthId; } + if (mWifiActivityId != mLastWifiActivityId) { + mWifiActivity.setImageResource(mWifiActivityId); + mLastWifiActivityId = mWifiActivityId; + } mWifiGroup.setContentDescription(mWifiDescription); mWifiGroup.setVisibility(View.VISIBLE); } else { @@ -411,9 +468,9 @@ private void apply() { } if (DEBUG) Log.d(TAG, - String.format("wifi: %s sig=%d", + String.format("wifi: %s sig=%d act=%d", (mWifiVisible ? "VISIBLE" : "GONE"), - mWifiStrengthId)); + mWifiStrengthId, mWifiActivityId)); boolean anyMobileVisible = false; int firstMobileTypeId = 0; @@ -449,6 +506,13 @@ private void apply() { mWifiSignalSpacer.setVisibility(View.GONE); } + if (mNoSimsVisible && mNoSims != null && mNoSimsDark != null) { + if (mNoSimsIcon == 0) mNoSimsIcon = getNoSimIcon(); + if (mNoSimsIcon != 0) { + mNoSims.setImageResource(mNoSimsIcon); + mNoSimsDark.setImageResource(mNoSimsIcon); + } + } mNoSimsCombo.setVisibility(mNoSimsVisible ? View.VISIBLE : View.GONE); boolean anythingVisible = mNoSimsVisible || mWifiVisible || mIsAirplaneMode @@ -497,6 +561,11 @@ private class PhoneState { private ViewGroup mMobileGroup; private ImageView mMobile, mMobileDark, mMobileType; + private int mDataActivityId = 0, mMobileActivityId = 0; + private int mStackedDataId = 0, mStackedVoiceId = 0; + private ImageView mDataActivity, mMobileActivity, mStackedData, mStackedVoice; + private ViewGroup mMobileSingleGroup, mMobileStackedGroup; + public PhoneState(int subId, Context context) { ViewGroup root = (ViewGroup) LayoutInflater.from(context) .inflate(R.layout.mobile_signal_group, null); @@ -509,6 +578,14 @@ public void setViews(ViewGroup root) { mMobile = (ImageView) root.findViewById(R.id.mobile_signal); mMobileDark = (ImageView) root.findViewById(R.id.mobile_signal_dark); mMobileType = (ImageView) root.findViewById(R.id.mobile_type); + mMobileActivity = (ImageView) root.findViewById(R.id.mobile_inout); + + mDataActivity = (ImageView) root.findViewById(R.id.data_inout); + mStackedData = (ImageView) root.findViewById(R.id.mobile_signal_data); + mStackedVoice = (ImageView) root.findViewById(R.id.mobile_signal_voice); + + mMobileSingleGroup = (ViewGroup) root.findViewById(R.id.mobile_signal_single); + mMobileStackedGroup = (ViewGroup) root.findViewById(R.id.mobile_signal_stacked); } public boolean apply(boolean isSecondaryIcon) { @@ -523,6 +600,39 @@ public boolean apply(boolean isSecondaryIcon) { mMobileType.setImageResource(mMobileTypeId); mLastMobileTypeId = mMobileTypeId; } + + mMobileType.setImageResource(mMobileTypeId); + + mDataActivity.setImageResource(mDataActivityId); + Drawable dataActivityDrawable = mDataActivity.getDrawable(); + if (dataActivityDrawable instanceof Animatable) { + Animatable ad = (Animatable) dataActivityDrawable; + if (!ad.isRunning()) { + ad.start(); + } + } + + mMobileActivity.setImageResource(mMobileActivityId); + Drawable mobileActivityDrawable = mMobileActivity.getDrawable(); + if (mobileActivityDrawable instanceof Animatable) { + Animatable ad = (Animatable) mobileActivityDrawable; + if (!ad.isRunning()) { + ad.start(); + } + } + + if (mStackedDataId != 0 && mStackedVoiceId != 0) { + mStackedData.setImageResource(mStackedDataId); + mStackedVoice.setImageResource(mStackedVoiceId); + mMobileSingleGroup.setVisibility(View.GONE); + mMobileStackedGroup.setVisibility(View.VISIBLE); + } else { + mStackedData.setImageResource(0); + mStackedVoice.setImageResource(0); + mMobileSingleGroup.setVisibility(View.VISIBLE); + mMobileStackedGroup.setVisibility(View.GONE); + } + mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription); mMobileGroup.setVisibility(View.VISIBLE); @@ -542,6 +652,8 @@ public boolean apply(boolean isSecondaryIcon) { (mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId)); mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE); + mDataActivity.setVisibility(mDataActivityId != 0 ? View.VISIBLE : View.GONE); + mMobileActivity.setVisibility(mMobileActivityId != 0 ? View.VISIBLE : View.GONE); return mMobileVisible; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 14176a6f5b3..63660a50306 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -35,6 +35,7 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; +import android.os.SystemProperties; import android.os.UserHandle; import android.provider.MediaStore; import android.service.media.CameraPrewarmService; @@ -51,6 +52,7 @@ import android.widget.TextView; import com.android.internal.widget.LockPatternUtils; +import com.android.keyguard.EmergencyButton; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.systemui.EventLogConstants; @@ -93,6 +95,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private static final int DOZE_ANIMATION_STAGGER_DELAY = 48; private static final int DOZE_ANIMATION_ELEMENT_DURATION = 250; + private EmergencyButton mEmergencyButton; private KeyguardAffordanceView mCameraImageView; private KeyguardAffordanceView mLeftAffordanceView; private LockIcon mLockIcon; @@ -193,6 +196,7 @@ protected void onFinishInflate() { super.onFinishInflate(); mLockPatternUtils = new LockPatternUtils(mContext); mPreviewContainer = (ViewGroup) findViewById(R.id.preview_container); + mEmergencyButton = (EmergencyButton) findViewById(R.id.emergency_call_button); mCameraImageView = (KeyguardAffordanceView) findViewById(R.id.camera_button); mLeftAffordanceView = (KeyguardAffordanceView) findViewById(R.id.left_button); mLockIcon = (LockIcon) findViewById(R.id.lock_icon); @@ -202,6 +206,7 @@ protected void onFinishInflate() { mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache.addListener(this); mLockIcon.update(); + updateEmergencyButton(); setClipChildren(false); setClipToPadding(false); mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext)); @@ -234,6 +239,7 @@ protected void onConfigurationChanged(Configuration newConfig) { mIndicationText.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize( com.android.internal.R.dimen.text_size_small_material)); + updateEmergencyButton(); } public void setActivityStarter(ActivityStarter activityStarter) { @@ -684,4 +690,12 @@ public void updateLeftAffordance() { updateLeftAffordanceIcon(); updateLeftPreview(); } + + private void updateEmergencyButton() { + if (SystemProperties.getBoolean("persist.radio.emgcy_btn_onswipe",false)) { + if (mEmergencyButton != null) { + mEmergencyButton.updateEmergencyCallButton(); + } + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java index b93fc760ce2..ede09572aaa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java @@ -104,7 +104,11 @@ private void updateVisibilities() { } else if (mMultiUserSwitch.getParent() == this && mKeyguardUserSwitcherShowing) { removeView(mMultiUserSwitch); } - mBatteryLevel.setVisibility(mBatteryCharging ? View.VISIBLE : View.GONE); + boolean showBatteryLevel = getResources().getBoolean(R.bool.config_showBatteryPercentage); + mBatteryLevel.setVisibility( + mBatteryCharging || showBatteryLevel ? View.VISIBLE : View.GONE); + boolean showCarrierText = getResources().getBoolean(R.bool.config_showOperatorInKeyguard); + mCarrierLabel.setVisibility(showCarrierText ? View.VISIBLE : View.GONE); } private void updateSystemIconsLayoutParams() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 73361bdebcd..54a169d709d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -83,6 +83,7 @@ import android.view.VelocityTracker; import android.view.View; import android.view.ViewGroup.LayoutParams; +import android.view.ViewGroup.MarginLayoutParams; import android.view.ViewStub; import android.view.WindowManager; import android.view.WindowManagerGlobal; @@ -150,6 +151,7 @@ import com.android.systemui.statusbar.policy.PreviewInflater; import com.android.systemui.statusbar.policy.RotationLockControllerImpl; import com.android.systemui.statusbar.policy.SecurityControllerImpl; +import com.android.systemui.statusbar.policy.SuControllerImpl; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.statusbar.policy.ZenModeController; @@ -275,6 +277,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, BrightnessMirrorController mBrightnessMirrorController; AccessibilityController mAccessibilityController; FingerprintUnlockController mFingerprintUnlockController; + SuControllerImpl mSuController; int mNaturalBarHeight = -1; @@ -296,6 +299,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, StatusBarIconController mIconController; + private View mCarrierText = null; + // expanded notifications NotificationPanelView mNotificationPanel; // the sliding/resizing panel within the notification window View mExpandedContents; @@ -321,6 +326,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, int mKeyguardMaxNotificationCount; + // carrier label + private TextView mCarrierLabel; + private boolean mShowCarrierInPanel = false; boolean mExpandedVisible; private int mNavigationBarWindowState = WINDOW_STATE_SHOWING; @@ -622,7 +630,7 @@ public void start() { // Lastly, call to the icon policy to install/update all the icons. mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController, mHotspotController, - mUserInfoController, mBluetoothController); + mUserInfoController, mBluetoothController, mSuController); mIconPolicy.setCurrentUserSetup(mUserSetup); mSettingsObserver.onChange(false); // set up @@ -742,6 +750,10 @@ public boolean onTouch(View v, MotionEvent event) { // figure out which pixel-format to use for the status bar. mPixelFormat = PixelFormat.OPAQUE; + if (mContext.getResources().getBoolean(R.bool.enable_operator_name)) { + mCarrierText = mStatusBarView.findViewById(R.id.status_carrier_text); + } + mStackScroller = (NotificationStackScrollLayout) mStatusBarWindow.findViewById( R.id.notification_stack_scroller); mStackScroller.setLongPressListener(getNotificationLongClicker()); @@ -844,6 +856,7 @@ public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging mZenModeController = mVolumeComponent.getZenController(); } mCastController = new CastControllerImpl(mContext); + mSuController = new SuControllerImpl(mContext); final SignalClusterView signalCluster = (SignalClusterView) mStatusBarView.findViewById(R.id.signal_cluster); final SignalClusterView signalClusterKeyguard = @@ -864,6 +877,23 @@ public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging mNetworkController.addEmergencyListener(mHeader); } + mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label); + final boolean showCarrierLabel = mContext.getResources().getBoolean( + R.bool.config_showCarrierLabel); + mShowCarrierInPanel = showCarrierLabel && (mCarrierLabel != null); + if (DEBUG) Log.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" + mShowCarrierInPanel); + if (mShowCarrierInPanel) { + mCarrierLabel.setVisibility(mShowCarrierInPanel ? View.VISIBLE : View.INVISIBLE); + } + + // make sure carrier label is not covered by navigation bar + if (mCarrierLabel != null && mNavigationBarView != null) { + MarginLayoutParams mlp = (MarginLayoutParams) mCarrierLabel.getLayoutParams(); + if (mlp != null && mlp.bottomMargin < mNavigationBarView.mBarSize) { + mlp.bottomMargin = mNavigationBarView.mBarSize; + mCarrierLabel.setLayoutParams(mlp); + } + } mFlashlightController = new FlashlightController(mContext); mKeyguardBottomArea.setFlashlightController(mFlashlightController); mKeyguardBottomArea.setPhoneStatusBar(this); @@ -1491,6 +1521,15 @@ protected void updateNotifications() { updateNotificationShade(); mIconController.updateNotificationIcons(mNotificationData); + + if (mContext.getResources().getBoolean(R.bool.enable_operator_name) + && mCarrierText != null) { + if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) { + mCarrierText.setVisibility(View.GONE); + } else { + mCarrierText.setVisibility(View.VISIBLE); + } + } } @Override @@ -1499,6 +1538,21 @@ protected void updateRowStates() { mNotificationPanel.notifyVisibleChildrenChanged(); } + protected void updateCarrierLabelVisibility() { + if (!mShowCarrierInPanel) return; + + final boolean makeVisible = mStackScroller.getVisibility() == View.VISIBLE + && mState != StatusBarState.KEYGUARD; + + if ((mCarrierLabel.getVisibility() == View.VISIBLE) != makeVisible) { + if (DEBUG) { + Log.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible")); + } + + mCarrierLabel.setVisibility(makeVisible ? View.VISIBLE : View.INVISIBLE); + } + } + @Override protected void setAreThereNotifications() { @@ -3646,6 +3700,7 @@ private void updateKeyguardState(boolean goingToFullShade, boolean fromShadeLock updateStackScrollerState(goingToFullShade); updateNotifications(); checkBarModes(); + updateCarrierLabelVisibility(); updateMediaMetaData(false); mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(), mStatusBarKeyguardViewManager.isSecure()); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java index fa9c4bbcb48..0393c01d2d5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -46,6 +46,7 @@ import com.android.systemui.statusbar.policy.CastController.CastDevice; import com.android.systemui.statusbar.policy.HotspotController; import com.android.systemui.statusbar.policy.UserInfoController; +import com.android.systemui.statusbar.policy.SuController; /** * This class contains all of the policy about which icons are installed in the status @@ -64,6 +65,7 @@ public class PhoneStatusBarPolicy implements Callback { private static final String SLOT_VOLUME = "volume"; private static final String SLOT_ALARM_CLOCK = "alarm_clock"; private static final String SLOT_MANAGED_PROFILE = "managed_profile"; + private static final String SLOT_SU = "su"; private final Context mContext; private final StatusBarManager mService; @@ -72,6 +74,7 @@ public class PhoneStatusBarPolicy implements Callback { private final HotspotController mHotspot; private final AlarmManager mAlarmManager; private final UserInfoController mUserInfoController; + private final SuController mSuController; // Assume it's all good unless we hear otherwise. We don't always seem // to get broadcasts that it *is* there. @@ -118,7 +121,7 @@ public void run() { }; public PhoneStatusBarPolicy(Context context, CastController cast, HotspotController hotspot, - UserInfoController userInfoController, BluetoothController bluetooth) { + UserInfoController userInfoController, BluetoothController bluetooth, SuController su) { mContext = context; mCast = cast; mHotspot = hotspot; @@ -127,6 +130,7 @@ public PhoneStatusBarPolicy(Context context, CastController cast, HotspotControl mService = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE); mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); mUserInfoController = userInfoController; + mSuController = su; // listen for broadcasts IntentFilter filter = new IntentFilter(); @@ -175,6 +179,11 @@ public PhoneStatusBarPolicy(Context context, CastController cast, HotspotControl mService.setIconVisibility(SLOT_HOTSPOT, mHotspot.isHotspotEnabled()); mHotspot.addCallback(mHotspotCallback); + // su + mService.setIcon(SLOT_SU, R.drawable.stat_sys_su, 0, null); + mService.setIconVisibility(SLOT_SU, false); + mSuController.addCallback(mSuCallback); + // managed profile mService.setIcon(SLOT_MANAGED_PROFILE, R.drawable.stat_sys_managed_profile_status, 0, mContext.getString(R.string.accessibility_managed_profile)); @@ -404,6 +413,10 @@ public void onHotspotChanged(boolean enabled) { } }; + private void updateSu() { + mService.setIconVisibility(SLOT_SU, mSuController.hasActiveSessions()); + } + private final CastController.Callback mCastCallback = new CastController.Callback() { @Override public void onCastDevicesChanged() { @@ -425,4 +438,12 @@ public void setCurrentUserSetup(boolean userSetup) { mCurrentUserSetup = userSetup; updateAlarm(); } + + private final SuController.Callback mSuCallback = new SuController.Callback() { + @Override + public void onSuSessionsChanged() { + updateSu(); + } + }; + } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java index e618cb87887..69f88469caa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java @@ -124,16 +124,19 @@ public void run() { @Override public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon, - final int statusType, final int qsType,final boolean activityIn, - final boolean activityOut, final String typeContentDescription, - final String description, final boolean isWide, final int subId) { + final int statusType, final int qsType, final boolean activityIn, + final boolean activityOut, final int dataActivityId, final int mobileActivityId, + final int stackedDataIcon, final int stackedVoiceIcon, + final String typeContentDescription, final String description, final boolean isWide, + final int subId) { post(new Runnable() { @Override public void run() { for (SignalCallback signalCluster : mSignalCallbacks) { signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType, - activityIn, activityOut, typeContentDescription, description, isWide, - subId); + activityIn, activityOut, dataActivityId, mobileActivityId, + stackedDataIcon, stackedVoiceIcon, + typeContentDescription, description, isWide, subId); } } }); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java index 186005cc216..23bdd52e875 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java @@ -106,10 +106,20 @@ protected void updateClock() { mCurrentTime.setTime(System.currentTimeMillis()); - final String text = mDateFormat.format(mCurrentTime); + final String text = getDateFormat(); if (!text.equals(mLastText)) { setText(text); mLastText = text; } } + + private String getDateFormat() { + if (getContext().getResources().getBoolean( + com.android.internal.R.bool.config_dateformat) + ) { + return DateFormat.getDateFormat(getContext()).format(mCurrentTime); + } else { + return mDateFormat.format(mCurrentTime); + } + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java index ad8e3bde58b..de8e0999d23 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java @@ -17,6 +17,7 @@ import android.content.Context; import android.content.Intent; +import android.content.res.Resources; import android.net.NetworkCapabilities; import android.os.Looper; import android.telephony.PhoneStateListener; @@ -56,6 +57,12 @@ public class MobileSignalController extends SignalController< // @VisibleForDemoMode final SparseArray mNetworkToIconLookup; + private boolean mLastShowSpn; + private String mLastSpn; + private String mLastDataSpn; + private boolean mLastShowPlmn; + private String mLastPlmn; + // Since some pieces of the phone state are interdependent we store it locally, // this could potentially become part of MobileState for simplification/complication // of code. @@ -66,6 +73,12 @@ public class MobileSignalController extends SignalController< private MobileIconGroup mDefaultIcons; private Config mConfig; + private final int STATUS_BAR_STYLE_ANDROID_DEFAULT = 0; + private final int STATUS_BAR_STYLE_CDMA_1X_COMBINED = 1; + private final int STATUS_BAR_STYLE_DEFAULT_DATA = 2; + private final int STATUS_BAR_STYLE_DATA_VOICE = 3; + private int mStyle = STATUS_BAR_STYLE_ANDROID_DEFAULT; + // TODO: Reduce number of vars passed in, if we have the NetworkController, probably don't // need listener lists anymore. public MobileSignalController(Context context, Config config, boolean hasMobileData, @@ -86,7 +99,14 @@ public MobileSignalController(Context context, Config config, boolean hasMobileD mNetworkNameDefault = getStringIfExists( com.android.internal.R.string.lockscreen_carrier_default); - mapIconSets(); + if (config.readIconsFromXml) { + TelephonyIcons.readIconsFromXml(context); + mDefaultIcons = !mConfig.showAtLeast3G ? TelephonyIcons.G : TelephonyIcons.THREE_G; + } else { + mapIconSets(); + } + + mStyle = context.getResources().getInteger(R.integer.status_bar_style); String networkName = info.getCarrierName() != null ? info.getCarrierName().toString() : mNetworkNameDefault; @@ -100,7 +120,9 @@ public MobileSignalController(Context context, Config config, boolean hasMobileD public void setConfiguration(Config config) { mConfig = config; - mapIconSets(); + if (!config.readIconsFromXml) { + mapIconSets(); + } updateTelephony(); } @@ -159,6 +181,7 @@ private void mapIconSets() { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_EVDO_B, TelephonyIcons.THREE_G); mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_EHRPD, TelephonyIcons.THREE_G); mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_UMTS, TelephonyIcons.THREE_G); + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_TD_SCDMA, TelephonyIcons.THREE_G); if (!mConfig.showAtLeast3G) { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_UNKNOWN, @@ -191,14 +214,20 @@ private void mapIconSets() { if (mConfig.show4gForLte) { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE, TelephonyIcons.FOUR_G); + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, + TelephonyIcons.FOUR_G_PLUS); } else { mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE, TelephonyIcons.LTE); + mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_LTE_CA, TelephonyIcons.LTE); } mNetworkToIconLookup.put(TelephonyManager.NETWORK_TYPE_IWLAN, TelephonyIcons.WFC); } @Override public void notifyListeners() { + if (mConfig.readIconsFromXml) { + generateIconGroup(); + } MobileIconGroup icons = getIcons(); String contentDescription = getStringIfExists(getContentDescription()); @@ -228,9 +257,14 @@ public void notifyListeners() { && mCurrentState.activityOut; showDataIcon &= mCurrentState.isDefault || mCurrentState.iconGroup == TelephonyIcons.ROAMING; + showDataIcon &= mStyle == STATUS_BAR_STYLE_ANDROID_DEFAULT; int typeIcon = showDataIcon ? icons.mDataType : 0; + int dataActivityId = showMobileActivity() ? 0 : icons.mActivityId; + int mobileActivityId = showMobileActivity() ? icons.mActivityId : 0; mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon, - activityIn, activityOut, dataContentDescription, description, icons.mIsWide, + activityIn, activityOut, dataActivityId, mobileActivityId, + icons.mStackedDataIcon, icons.mStackedVoiceIcon, + dataContentDescription, description, icons.mIsWide, mSubscriptionInfo.getSubscriptionId()); } @@ -239,6 +273,15 @@ protected MobileState cleanState() { return new MobileState(); } + @Override + public int getCurrentIconId() { + if (mConfig.readIconsFromXml && mCurrentState.connected) { + return getIcons().mSingleSignalIcon; + } else { + return super.getCurrentIconId(); + } + } + private boolean hasService() { if (mServiceState != null) { // Consider the device to be in service if either voice or data @@ -296,6 +339,11 @@ public void handleBroadcast(Intent intent) { } else if (action.equals(TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED)) { updateDataSim(); notifyListenersIfNecessary(); + } else if (action.equals(Intent.ACTION_LOCALE_CHANGED)) { + if (mConfig.showLocale) { + updateNetworkName(mLastShowSpn, mLastSpn, mLastDataSpn, mLastShowPlmn, mLastPlmn); + notifyListenersIfNecessary(); + } } } @@ -315,27 +363,85 @@ private void updateDataSim() { } } + private String getLocalString(String originalString) { + return android.util.NativeTextHelper.getLocalString(mContext, originalString, + com.android.internal.R.array.origin_carrier_names, + com.android.internal.R.array.locale_carrier_names); + } + + private String getNetworkClassString(ServiceState state) { + if (state != null && (state.getDataRegState() == ServiceState.STATE_IN_SERVICE || + state.getVoiceRegState() == ServiceState.STATE_IN_SERVICE)) { + int voiceNetType = state.getVoiceNetworkType(); + int dataNetType = state.getDataNetworkType(); + int chosenNetType = + ((dataNetType == TelephonyManager.NETWORK_TYPE_UNKNOWN) + ? voiceNetType : dataNetType); + return networkClassToString(TelephonyManager.getNetworkClass(chosenNetType)); + } else { + return ""; + } + } + + private String networkClassToString (int networkClass) { + final int[] classIds = { 0, // TelephonyManager.NETWORK_CLASS_UNKNOWN + com.android.internal.R.string.config_rat_2g, + com.android.internal.R.string.config_rat_3g, + com.android.internal.R.string.config_rat_4g }; + String classString = null; + if (networkClass < classIds.length) { + classString = mContext.getResources().getString(classIds[networkClass]); + } + return (classString == null) ? "" : classString; + } + /** * Updates the network's name based on incoming spn and plmn. */ void updateNetworkName(boolean showSpn, String spn, String dataSpn, boolean showPlmn, String plmn) { + mLastShowSpn = showSpn; + mLastSpn = spn; + mLastDataSpn = dataSpn; + mLastShowPlmn = showPlmn; + mLastPlmn = plmn; if (CHATTY) { Log.d("CarrierLabel", "updateNetworkName showSpn=" + showSpn + " spn=" + spn + " dataSpn=" + dataSpn + " showPlmn=" + showPlmn + " plmn=" + plmn); } + if (mConfig.showLocale) { + if (showSpn && !TextUtils.isEmpty(spn)) { + spn = getLocalString(spn); + } + if (showSpn && !TextUtils.isEmpty(dataSpn)) { + dataSpn = getLocalString(dataSpn); + } + if (showPlmn && !TextUtils.isEmpty(plmn)) { + plmn = getLocalString(plmn); + } + } + if (showPlmn && showSpn && !TextUtils.isEmpty(spn) && !TextUtils.isEmpty(plmn) + && plmn.equals(spn)) { + showSpn = false; + } + String networkClass = getNetworkClassString(mServiceState); StringBuilder str = new StringBuilder(); StringBuilder strData = new StringBuilder(); if (showPlmn && plmn != null) { str.append(plmn); strData.append(plmn); + if (mConfig.showRat) { + str.append(" ").append(networkClass); + strData.append(" ").append(networkClass); + } } if (showSpn && spn != null) { if (str.length() != 0) { str.append(mNetworkNameSeparator); } str.append(spn); + if (mConfig.showRat) str.append(" ").append(networkClass); } if (str.length() != 0) { mCurrentState.networkName = str.toString(); @@ -347,6 +453,7 @@ void updateNetworkName(boolean showSpn, String spn, String dataSpn, strData.append(mNetworkNameSeparator); } strData.append(dataSpn); + if (mConfig.showRat) strData.append(" ").append(networkClass); } if (strData.length() != 0) { mCurrentState.networkNameData = strData.toString(); @@ -362,7 +469,7 @@ void updateNetworkName(boolean showSpn, String spn, String dataSpn, */ private final void updateTelephony() { if (DEBUG) { - Log.d(mTag, "updateTelephonySignalStrength: hasService=" + hasService() + Log.d(mTag, "updateTelephony: hasService=" + hasService() + " ss=" + mSignalStrength); } mCurrentState.connected = hasService() && mSignalStrength != null; @@ -371,6 +478,13 @@ private final void updateTelephony() { mCurrentState.level = mSignalStrength.getCdmaLevel(); } else { mCurrentState.level = mSignalStrength.getLevel(); + if (mConfig.showRsrpSignalLevelforLTE) { + int dataType = mServiceState.getDataNetworkType(); + if (dataType == TelephonyManager.NETWORK_TYPE_LTE || + dataType == TelephonyManager.NETWORK_TYPE_LTE_CA) { + mCurrentState.level = getAlternateLteLevel(mSignalStrength); + } + } } } if (mNetworkToIconLookup.indexOfKey(mDataNetType) >= 0) { @@ -396,15 +510,225 @@ private final void updateTelephony() { mCurrentState.networkName = mServiceState.getOperatorAlphaShort(); } + if (mConfig.readIconsFromXml) { + mCurrentState.voiceLevel = getVoiceSignalLevel(); + } + notifyListenersIfNecessary(); } + private void generateIconGroup() { + final int level = mCurrentState.level; + final int voiceLevel = mCurrentState.voiceLevel; + final int inet = mCurrentState.inetCondition; + final boolean dataConnected = mCurrentState.dataConnected; + final boolean roaming = isRoaming(); + final int voiceType = getVoiceNetworkType(); + final int dataType = getDataNetworkType(); + + int[][] sbIcons = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH; + int[][] qsIcons = TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH; + int[] contentDesc = AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH; + int sbDiscState = TelephonyIcons.TELEPHONY_NO_NETWORK; + int qsDiscState = TelephonyIcons.QS_TELEPHONY_NO_NETWORK; + int discContentDesc = AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0]; + int dataContentDesc, dataTypeIcon, qsDataTypeIcon, dataActivityId; + int singleSignalIcon, stackedDataIcon = 0, stackedVoiceIcon = 0; + + final int slotId = getSimSlotIndex(); + if (slotId < 0 || slotId > mPhone.getPhoneCount()) { + Log.e(mTag, "generateIconGroup invalid slotId:" + slotId); + return; + } + + if (DEBUG) Log.d(mTag, "generateIconGroup slot:" + slotId + " style:" + mStyle + + " connected:" + mCurrentState.connected + " inetCondition:" + inet + + " roaming:" + roaming + " level:" + level + " voiceLevel:" + voiceLevel + + " dataConnected:" + dataConnected + + " dataActivity:" + mCurrentState.dataActivity + + " CS:" + voiceType + + "/" + TelephonyManager.getNetworkTypeName(voiceType) + + ", PS:" + dataType + + "/" + TelephonyManager.getNetworkTypeName(dataType)); + + // Update data icon set + int chosenNetworkType = ((dataType == TelephonyManager.NETWORK_TYPE_UNKNOWN) + ? voiceType : dataType); + TelephonyIcons.updateDataType(slotId, chosenNetworkType, mConfig.showAtLeast3G, + mConfig.show4gForLte, mConfig.hspaDataDistinguishable, inet); + + // Update signal strength icons + singleSignalIcon = TelephonyIcons.getSignalStrengthIcon(slotId, inet, level, roaming); + if (DEBUG) { + Log.d(mTag, "singleSignalIcon:" + getResourceName(singleSignalIcon)); + } + + dataActivityId = (mCurrentState.dataConnected && slotId >= 0) ? + TelephonyIcons.getDataActivity(slotId, mCurrentState.dataActivity) : 0; + + // Convert the icon to unstacked if necessary. + int unstackedSignalIcon = TelephonyIcons.convertMobileStrengthIcon(singleSignalIcon); + if (DEBUG) { + Log.d(mTag, "unstackedSignalIcon:" + getResourceName(unstackedSignalIcon)); + } + if (singleSignalIcon != unstackedSignalIcon) { + stackedDataIcon = singleSignalIcon; + singleSignalIcon = unstackedSignalIcon; + } + + if (mStyle == STATUS_BAR_STYLE_CDMA_1X_COMBINED) { + if (!roaming && showDataAndVoice()) { + stackedVoiceIcon = TelephonyIcons.getStackedVoiceIcon(voiceLevel); + } else if (roaming && dataActivityId != 0) { + // Remove data type indicator if already shown in data activity icon. + singleSignalIcon = TelephonyIcons.getRoamingSignalIconId(level, inet); + } + } + + // Clear satcked data icon if no satcked voice icon. + if (stackedVoiceIcon == 0) stackedDataIcon = 0; + + contentDesc = TelephonyIcons.getSignalStrengthDes(slotId); + sbDiscState = TelephonyIcons.getSignalNullIcon(slotId); + if (DEBUG) { + Log.d(mTag, "singleSignalIcon=" + getResourceName(singleSignalIcon) + + " dataActivityId=" + getResourceName(dataActivityId) + + " stackedDataIcon=" + getResourceName(stackedDataIcon) + + " stackedVoiceIcon=" + getResourceName(stackedVoiceIcon)); + } + + // Update data net type icons + if (dataType == TelephonyManager.NETWORK_TYPE_IWLAN) { + // wimax is a special 4g network not handled by telephony + dataTypeIcon = TelephonyIcons.ICON_4G; + qsDataTypeIcon = TelephonyIcons.QS_DATA_4G; + dataContentDesc = R.string.accessibility_data_connection_4g; + } else { + dataTypeIcon = TelephonyIcons.getDataTypeIcon(slotId); + dataContentDesc = TelephonyIcons.getDataTypeDesc(slotId); + qsDataTypeIcon = TelephonyIcons.getQSDataTypeIcon(slotId); + } + if (roaming) { + dataTypeIcon = TelephonyIcons.ROAMING_ICON; + qsDataTypeIcon = TelephonyIcons.QS_DATA_R; + } + if (DEBUG) { + Log.d(mTag, "updateDataNetType, dataTypeIcon=" + getResourceName(dataTypeIcon) + + " qsDataTypeIcon=" + getResourceName(qsDataTypeIcon) + + " dataContentDesc=" + dataContentDesc); + } + mCurrentState.iconGroup = new MobileIconGroup( + TelephonyManager.getNetworkTypeName(dataType), + sbIcons, qsIcons, contentDesc, 0, 0, sbDiscState, qsDiscState, discContentDesc, + dataContentDesc, dataTypeIcon, false, qsDataTypeIcon, + singleSignalIcon, stackedDataIcon, stackedVoiceIcon, dataActivityId); + } + + private int getSimSlotIndex() { + int slotId = -1; + if (mSubscriptionInfo != null) { + slotId = mSubscriptionInfo.getSimSlotIndex(); + } + if (DEBUG) Log.d(mTag, "getSimSlotIndex, slotId: " + slotId); + return slotId; + } + + private boolean showMobileActivity() { + return (mStyle == STATUS_BAR_STYLE_DEFAULT_DATA) + || (mStyle == STATUS_BAR_STYLE_ANDROID_DEFAULT); + } + + private int getVoiceNetworkType() { + if (mServiceState == null) { + return TelephonyManager.NETWORK_TYPE_UNKNOWN; + } + return mServiceState.getVoiceNetworkType(); + } + + private int getDataNetworkType() { + if (mServiceState == null) { + return TelephonyManager.NETWORK_TYPE_UNKNOWN; + } + return mServiceState.getDataNetworkType(); + } + + private int getVoiceSignalLevel() { + if (mSignalStrength == null) { + return SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + } + boolean isCdma = TelephonyManager.PHONE_TYPE_CDMA == TelephonyManager.getDefault() + .getCurrentPhoneType(mSubscriptionInfo.getSubscriptionId()); + return isCdma ? mSignalStrength.getCdmaLevel() : mSignalStrength.getGsmLevel(); + } + + private boolean showDataAndVoice() { + if (mStyle != STATUS_BAR_STYLE_CDMA_1X_COMBINED) { + return false; + } + int dataType = getDataNetworkType(); + int voiceType = getVoiceNetworkType(); + if ((dataType == TelephonyManager.NETWORK_TYPE_EVDO_0 + || dataType == TelephonyManager.NETWORK_TYPE_EVDO_0 + || dataType == TelephonyManager.NETWORK_TYPE_EVDO_A + || dataType == TelephonyManager.NETWORK_TYPE_EVDO_B + || dataType == TelephonyManager.NETWORK_TYPE_EHRPD + || dataType == TelephonyManager.NETWORK_TYPE_LTE + || dataType == TelephonyManager.NETWORK_TYPE_LTE_CA) + && (voiceType == TelephonyManager.NETWORK_TYPE_GSM + || voiceType == TelephonyManager.NETWORK_TYPE_1xRTT + || voiceType == TelephonyManager.NETWORK_TYPE_CDMA)) { + return true; + } + return false; + } + + private boolean show1xOnly() { + int dataType = getDataNetworkType(); + int voiceType = getVoiceNetworkType(); + if (dataType == TelephonyManager.NETWORK_TYPE_1xRTT + || dataType == TelephonyManager.NETWORK_TYPE_CDMA) { + return true; + } + return false; + } + + private int getAlternateLteLevel(SignalStrength signalStrength) { + int lteRsrp = signalStrength.getLteDbm(); + int rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + if (lteRsrp > -44) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + else if (lteRsrp >= -97) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_GREAT; + else if (lteRsrp >= -105) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_GOOD; + else if (lteRsrp >= -113) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_MODERATE; + else if (lteRsrp >= -120) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_POOR; + else if (lteRsrp >= -140) rsrpLevel = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; + if (DEBUG) { + Log.d(mTag, "getAlternateLteLevel lteRsrp:" + lteRsrp + " rsrpLevel = " + rsrpLevel); + } + return rsrpLevel; + } + + protected String getResourceName(int resId) { + if (resId != 0) { + final Resources res = mContext.getResources(); + try { + return res.getResourceName(resId); + } catch (android.content.res.Resources.NotFoundException ex) { + return "(unknown)"; + } + } else { + return "(null)"; + } + } + @VisibleForTesting void setActivity(int activity) { mCurrentState.activityIn = activity == TelephonyManager.DATA_ACTIVITY_INOUT || activity == TelephonyManager.DATA_ACTIVITY_IN; mCurrentState.activityOut = activity == TelephonyManager.DATA_ACTIVITY_INOUT || activity == TelephonyManager.DATA_ACTIVITY_OUT; + if (mConfig.readIconsFromXml) { + mCurrentState.dataActivity = activity; + } notifyListenersIfNecessary(); } @@ -440,6 +764,7 @@ public void onServiceStateChanged(ServiceState state) { + " dataState=" + state.getDataRegState()); } mServiceState = state; + updateNetworkName(mLastShowSpn, mLastSpn, mLastDataSpn, mLastShowPlmn, mLastPlmn); mDataNetType = state.getDataNetworkType(); updateTelephony(); } @@ -479,17 +804,35 @@ static class MobileIconGroup extends SignalController.IconGroup { final int mDataType; final boolean mIsWide; final int mQsDataType; + final int mSingleSignalIcon; + final int mStackedDataIcon; + final int mStackedVoiceIcon; + final int mActivityId; public MobileIconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int discContentDesc, int dataContentDesc, int dataType, boolean isWide, int qsDataType) { + this(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState, + qsDiscState, discContentDesc, dataContentDesc, dataType, isWide, + qsDataType, 0, 0, 0, 0); + } + + public MobileIconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, + int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, + int discContentDesc, int dataContentDesc, int dataType, boolean isWide, + int qsDataType, int singleSignalIcon, int stackedDataIcon, + int stackedVoicelIcon, int activityId) { super(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState, qsDiscState, discContentDesc); mDataContentDescription = dataContentDesc; mDataType = dataType; mIsWide = isWide; mQsDataType = qsDataType; + mSingleSignalIcon = singleSignalIcon; + mStackedDataIcon = stackedDataIcon; + mStackedVoiceIcon = stackedVoicelIcon; + mActivityId = activityId; } } @@ -502,6 +845,8 @@ static class MobileState extends SignalController.State { boolean airplaneMode; boolean carrierNetworkChangeMode; boolean isDefault; + int dataActivity; + int voiceLevel; @Override public void copyFrom(State s) { @@ -515,6 +860,8 @@ public void copyFrom(State s) { isEmergency = state.isEmergency; airplaneMode = state.airplaneMode; carrierNetworkChangeMode = state.carrierNetworkChangeMode; + dataActivity = state.dataActivity; + voiceLevel = state.voiceLevel; } @Override @@ -528,6 +875,7 @@ protected void toString(StringBuilder builder) { builder.append("isDefault=").append(isDefault).append(','); builder.append("isEmergency=").append(isEmergency).append(','); builder.append("airplaneMode=").append(airplaneMode).append(','); + builder.append("voiceLevel=").append(voiceLevel).append(','); builder.append("carrierNetworkChangeMode=").append(carrierNetworkChangeMode); } @@ -541,6 +889,7 @@ public boolean equals(Object o) { && ((MobileState) o).isEmergency == isEmergency && ((MobileState) o).airplaneMode == airplaneMode && ((MobileState) o).carrierNetworkChangeMode == carrierNetworkChangeMode + && ((MobileState) o).voiceLevel == voiceLevel && ((MobileState) o).isDefault == isDefault; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 38656ee0781..4b30eb18951 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -39,8 +39,10 @@ void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon, boolean activityIn, boolean activityOut, String description); void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, - int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId); + int qsType, boolean activityIn, boolean activityOut, int dataActivityId, + int mobileActivityId, int stackedDataIcon, int stackedVoiceIcon, + String typeContentDescription, String description, + boolean isWide, int subId); void setSubs(List subs); void setNoSims(boolean show); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index 29968081e75..8fbf4b6959f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -210,6 +210,7 @@ private void registerListeners() { filter.addAction(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); + filter.addAction(Intent.ACTION_LOCALE_CHANGED); filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); mContext.registerReceiver(this, filter, null, mReceiverHandler); mListening = true; @@ -377,6 +378,10 @@ public void onReceive(Context context, Intent intent) { } else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) { // Might have different subscriptions now. updateMobileControllers(); + } else if (action.equals(Intent.ACTION_LOCALE_CHANGED)) { + for (MobileSignalController controller : mMobileSignalControllers.values()) { + controller.handleBroadcast(intent); + } } else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) { mLastServiceState = ServiceState.newFromBundle(intent.getExtras()); if (mMobileSignalControllers.size() == 0) { @@ -751,6 +756,7 @@ public void dispatchDemoCommand(String command, Bundle args) { datatype.equals("1x") ? TelephonyIcons.ONE_X : datatype.equals("3g") ? TelephonyIcons.THREE_G : datatype.equals("4g") ? TelephonyIcons.FOUR_G : + datatype.equals("4g+") ? TelephonyIcons.FOUR_G_PLUS : datatype.equals("e") ? TelephonyIcons.E : datatype.equals("g") ? TelephonyIcons.G : datatype.equals("h") ? TelephonyIcons.H : @@ -825,6 +831,10 @@ static class Config { boolean alwaysShowCdmaRssi = false; boolean show4gForLte = false; boolean hspaDataDistinguishable; + boolean readIconsFromXml; + boolean showRsrpSignalLevelforLTE; + boolean showLocale; + boolean showRat; static Config readConfig(Context context) { Config config = new Config(); @@ -836,6 +846,14 @@ static Config readConfig(Context context) { config.show4gForLte = res.getBoolean(R.bool.config_show4GForLTE); config.hspaDataDistinguishable = res.getBoolean(R.bool.config_hspa_data_distinguishable); + config.readIconsFromXml = res.getBoolean(R.bool.config_read_icons_from_xml); + config.showRsrpSignalLevelforLTE = + res.getBoolean(R.bool.config_showRsrpSignalLevelforLTE); + config.showLocale = + res.getBoolean(com.android.internal.R.bool.config_monitor_locale_change); + config.showRat = + res.getBoolean(com.android.internal.R.bool.config_display_rat); + return config; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java index dce889f831d..511ad2bf6cb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java @@ -36,8 +36,9 @@ public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState q @Override public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, - int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, - String description, boolean isWide, int subId) { + int qsType, boolean activityIn, boolean activityOut, int dataActivity, + int mobileActivity, int stackedDataIcon, int stackedVoiceIcon, + String typeContentDescription, String description, boolean isWide, int subId) { } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuController.java new file mode 100644 index 00000000000..5f1e52e0bf2 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuController.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 The CyanogenMod 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 com.android.systemui.statusbar.policy; + +public interface SuController { + void addCallback(Callback callback); + void removeCallback(Callback callback); + boolean hasActiveSessions(); + + public interface Callback { + void onSuSessionsChanged(); + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuControllerImpl.java new file mode 100644 index 00000000000..1ba334a3e7f --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SuControllerImpl.java @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2014 The CyanogenMod 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 com.android.systemui.statusbar.policy; + +import android.app.ActivityManager; +import android.app.AppOpsManager; +import android.app.StatusBarManager; +import android.content.BroadcastReceiver; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Handler; +import android.os.UserHandle; +import android.os.UserManager; +import android.provider.Settings; +import android.util.Log; + +import com.android.systemui.R; + +import java.util.ArrayList; +import java.util.List; + +/** + * A controller to manage changes to superuser-related states and update the views accordingly. + */ +public class SuControllerImpl implements SuController { + private static final String TAG = "SuControllerImpl"; + + private static final int[] mSuOpArray = new int[] {AppOpsManager.OP_SU}; + + private ArrayList mCallbacks = new ArrayList(); + + private Context mContext; + + private AppOpsManager mAppOpsManager; + + private boolean mHasActiveSuSessions; + + public SuControllerImpl(Context context) { + mContext = context; + + mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); + + IntentFilter intentFilter = new IntentFilter(); + intentFilter.addAction(AppOpsManager.ACTION_SU_SESSION_CHANGED); + context.registerReceiverAsUser(new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + Log.i(TAG, "Got change"); + String action = intent.getAction(); + if (AppOpsManager.ACTION_SU_SESSION_CHANGED.equals(action)) { + updateActiveSuSessions(); + } + } + }, UserHandle.ALL, intentFilter, null, new Handler()); + + updateActiveSuSessions(); + } + + @Override + public void addCallback(Callback callback) { + mCallbacks.add(callback); + fireCallback(callback); + } + + @Override + public void removeCallback(Callback callback) { + mCallbacks.remove(callback); + } + + @Override + public boolean hasActiveSessions() { + return mHasActiveSuSessions; + } + + private void fireCallback(Callback callback) { + callback.onSuSessionsChanged(); + } + + private void fireCallbacks() { + for (Callback callback : mCallbacks) { + callback.onSuSessionsChanged(); + } + } + + /** + * Returns true if a su session is active + */ + private boolean hasActiveSuSessions() { + List packages + = mAppOpsManager.getPackagesForOps(mSuOpArray); + // AppOpsManager can return null when there is no requested data. + if (packages != null) { + final int numPackages = packages.size(); + for (int packageInd = 0; packageInd < numPackages; packageInd++) { + AppOpsManager.PackageOps packageOp = packages.get(packageInd); + List opEntries = packageOp.getOps(); + if (opEntries != null) { + final int numOps = opEntries.size(); + for (int opInd = 0; opInd < numOps; opInd++) { + AppOpsManager.OpEntry opEntry = opEntries.get(opInd); + if (opEntry.getOp() == AppOpsManager.OP_SU) { + if (opEntry.isRunning()) { + return true; + } + } + } + } + } + } + + return false; + } + + private void updateActiveSuSessions() { + boolean hadActiveSuSessions = mHasActiveSuSessions; + mHasActiveSuSessions = hasActiveSuSessions(); + if (mHasActiveSuSessions != hadActiveSuSessions) { + fireCallbacks(); + } + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java index 83e044612e0..2c9f2b93d98 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java @@ -1,4 +1,6 @@ /* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Not a Contribution. * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +18,14 @@ package com.android.systemui.statusbar.policy; +import android.content.Context; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.telephony.SignalStrength; +import android.telephony.TelephonyManager; +import android.util.Log; +import android.util.SparseArray; + import com.android.systemui.R; import com.android.systemui.statusbar.policy.MobileSignalController.MobileIconGroup; @@ -68,6 +78,20 @@ class TelephonyIcons { R.drawable.stat_sys_signal_4_fully } }; + //Default roaming icons with R indicator + static final int[][] TELEPHONY_SIGNAL_STRENGTH_ROAMING_R = { + { R.drawable.stat_sys_signal_0_default_roam, + R.drawable.stat_sys_signal_1_default_roam, + R.drawable.stat_sys_signal_2_default_roam, + R.drawable.stat_sys_signal_3_default_roam, + R.drawable.stat_sys_signal_4_default_roam }, + { R.drawable.stat_sys_signal_0_default_fully_roam, + R.drawable.stat_sys_signal_1_default_fully_roam, + R.drawable.stat_sys_signal_2_default_fully_roam, + R.drawable.stat_sys_signal_3_default_fully_roam, + R.drawable.stat_sys_signal_4_default_fully_roam } + }; + //CarrierNetworkChange static final int[][] TELEPHONY_CARRIER_NETWORK_CHANGE = { { R.drawable.stat_sys_signal_carrier_network_change_animation, @@ -182,6 +206,19 @@ class TelephonyIcons { static final int QS_DATA_4G = R.drawable.ic_qs_signal_4g; + static final int[][] DATA_4G_PLUS = { + { R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus }, + { R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus, + R.drawable.stat_sys_data_fully_connected_4g_plus } + }; + + static final int QS_DATA_4G_PLUS = R.drawable.ic_qs_signal_4g_plus; + // LTE branded "LTE" static final int[][] DATA_LTE = { { R.drawable.stat_sys_data_fully_connected_lte, @@ -204,6 +241,7 @@ class TelephonyIcons { static final int ICON_H = R.drawable.stat_sys_data_fully_connected_h; static final int ICON_3G = R.drawable.stat_sys_data_fully_connected_3g; static final int ICON_4G = R.drawable.stat_sys_data_fully_connected_4g; + static final int ICON_4G_PLUS = R.drawable.stat_sys_data_fully_connected_4g_plus; static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x; static final int ICON_CARRIER_NETWORK_CHANGE = R.drawable.stat_sys_signal_carrier_network_change_animation; @@ -211,9 +249,407 @@ class TelephonyIcons { static final int QS_ICON_LTE = R.drawable.ic_qs_signal_lte; static final int QS_ICON_3G = R.drawable.ic_qs_signal_3g; static final int QS_ICON_4G = R.drawable.ic_qs_signal_4g; + static final int QS_ICON_4G_PLUS = R.drawable.ic_qs_signal_4g_plus; static final int QS_ICON_1X = R.drawable.ic_qs_signal_1x; static final int QS_ICON_CARRIER_NETWORK_CHANGE = R.drawable.ic_qs_signal_carrier_network_change_animation; + static final int DATA_TYPE_UNKNOWN = 0; + static final int DATA_TYPE_G = 1; + static final int DATA_TYPE_E = 2; + static final int DATA_TYPE_2G = 3; + static final int DATA_TYPE_3G = 4; + static final int DATA_TYPE_4G = 5; + static final int DATA_TYPE_H = 6; + static final int DATA_TYPE_HP = 7; + static final int DATA_TYPE_1X = 8; + static final int DATA_TYPE_LTE = 9; + + static final int SIGNAL_STRENGTH_TYPE_G = 0; + static final int SIGNAL_STRENGTH_TYPE_E = 1; + static final int SIGNAL_STRENGTH_TYPE_3G = 2; + static final int SIGNAL_STRENGTH_TYPE_4G = 3; + static final int SIGNAL_STRENGTH_TYPE_H = 4; + static final int SIGNAL_STRENGTH_TYPE_HP = 5; + static final int SIGNAL_STRENGTH_TYPE_1X = 6; + static final int SIGNAL_STRENGTH_TYPE_CDMA = 7; + static final int SIGNAL_STRENGTH_TYPE_UMTS = 8; + + static final boolean DEBUG = true; + static final int DEFAULT_SUB = 0; + static final int INET_TYPE_NUM = 2; + static final int SIGNAL_LEVEL_NUM = SignalStrength.NUM_SIGNAL_STRENGTH_BINS; + static final String TAG = "TelephonyIcons"; + static final String NS = "com.android.systemui"; + + static String[] mDataTypeArray, mDataTypeGenerationArray; + static String[] mDataTypeDescriptionArray, mDataTypeGenerationDescArray; + static String[] mDataActivityArray; + static String[] mSignalStrengthArray, mSignalStrengthRoamingArray; + static String[] mSignalNullArray; + static String[] mSignalStrengthDesc; + + static int[] mSelectedDataTypeIcon; + static int[] mSelectedQSDataTypeIcon; + static String[] mSelectedDataTypeDesc; + static int[] mSelectedDataActivityIndex; + static int[] mSelectedSignalStreagthIndex; + static SparseArray mStacked2SingleIconLookup; + + private static Resources mRes; + private static boolean isInitiated = false; + + static void readIconsFromXml(Context context) { + if (isInitiated) { + log(TAG, "readIconsFromXml, already read!"); + return; + } + + mRes = context.getResources(); + try { + mDataTypeArray = mRes.getStringArray(R.array.multi_data_type); + mDataTypeDescriptionArray = mRes.getStringArray( + R.array.telephony_data_type_description); + mDataTypeGenerationArray = mRes.getStringArray( + R.array.telephony_data_type_generation); + mDataTypeGenerationDescArray = mRes.getStringArray( + R.array.telephony_data_type_generation_description); + mDataActivityArray = mRes.getStringArray(R.array.multi_data_activity); + mSignalStrengthArray = mRes.getStringArray(R.array.multi_signal_strength); + mSignalStrengthRoamingArray = mRes.getStringArray( + R.array.multi_signal_strength_roaming); + mSignalNullArray = mRes.getStringArray(R.array.multi_signal_null); + mSignalStrengthDesc = mRes.getStringArray(R.array.signal_strength_description); + initStacked2SingleIconLookup(); + } catch (android.content.res.Resources.NotFoundException e) { + isInitiated = false; + log(TAG, "readIconsFromXml, exception happened: " + e); + return; + } + + if (mSelectedDataTypeIcon == null + && mDataTypeArray.length != 0) { + mSelectedDataTypeIcon = new int[mDataTypeArray.length]; + } + if (mSelectedQSDataTypeIcon == null + && mDataTypeArray.length != 0) { + mSelectedQSDataTypeIcon = new int[mDataTypeArray.length]; + } + if (mSelectedDataTypeDesc == null + && mDataTypeArray.length != 0) { + mSelectedDataTypeDesc = new String[mDataTypeArray.length]; + } + if (mSelectedDataActivityIndex == null + && mDataActivityArray.length != 0) { + mSelectedDataActivityIndex = new int[mDataActivityArray.length]; + } + if (mSelectedSignalStreagthIndex == null + && mSignalStrengthArray.length != 0) { + mSelectedSignalStreagthIndex = new int[mSignalStrengthArray.length]; + } + isInitiated = true; + } + + static void initStacked2SingleIconLookup() { + mStacked2SingleIconLookup = new SparseArray<>(); + TypedArray stackedIcons = mRes.obtainTypedArray(R.array.stacked_signal_icons); + TypedArray singleIcons = mRes.obtainTypedArray(R.array.single_signal_icons); + + mStacked2SingleIconLookup.clear(); + for (int i = 0; i < stackedIcons.length() && i < singleIcons.length(); i++) { + mStacked2SingleIconLookup.put(stackedIcons.getResourceId(i,0), + singleIcons.getResourceId(i,0)); + } + stackedIcons.recycle(); + singleIcons.recycle(); + log(TAG, "initStacked2SingleIconLookup: size=" + mStacked2SingleIconLookup.size()); + } + + static int getSignalNullIcon(int slot) { + if (mSignalNullArray == null) { + return 0; + } + String resName = mSignalNullArray[slot]; + log(TAG, "null signal icon name: " + resName); + int resId = mRes.getIdentifier(resName, null, NS); + return resId; + } + + static void updateDataType(int slot, int type, boolean showAtLeast3G, + boolean show4GforLte, boolean hspaDistinguishable, int inet) { + log(TAG, "updateDataType " + + String.format("slot=%d, type=%d, inetCondition=%d", + slot, type, inet) + + " showAtLeast3G=" + String.valueOf(showAtLeast3G) + + " show4GforLte=" + String.valueOf(show4GforLte) + + " hspaDistinguishable=" + String.valueOf(hspaDistinguishable)); + + String resName = mDataTypeArray[slot]; + int resId = mRes.getIdentifier(resName, null, NS); + String[] dataTypeArray = mRes.getStringArray(resId); + + log(TAG, "data type item name: " + resName + " id:" + resId); + + switch (type) { + case TelephonyManager.NETWORK_TYPE_UNKNOWN: + if (!showAtLeast3G) { + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = 0; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedDataActivityIndex[slot] = 0; + mSelectedSignalStreagthIndex[slot] = 0; + break; + } else { + // fall through + } + case TelephonyManager.NETWORK_TYPE_EDGE: + if (!showAtLeast3G) { + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_E; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedDataActivityIndex[slot] = DATA_TYPE_E; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_E; + break; + } else { + // fall through + } + case TelephonyManager.NETWORK_TYPE_UMTS: + case TelephonyManager.NETWORK_TYPE_TD_SCDMA: + mSelectedDataActivityIndex[slot] = DATA_TYPE_3G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_3G; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_UMTS; + break; + case TelephonyManager.NETWORK_TYPE_HSDPA: + case TelephonyManager.NETWORK_TYPE_HSUPA: + case TelephonyManager.NETWORK_TYPE_HSPA: + if (hspaDistinguishable) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_H; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_H; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_H; + } else { + mSelectedDataActivityIndex[slot] = DATA_TYPE_3G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + mDataTypeGenerationArray[0], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_3G; + mSelectedDataTypeDesc[slot] = mDataTypeGenerationDescArray[0]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_3G; + + } + break; + case TelephonyManager.NETWORK_TYPE_HSPAP: + if (hspaDistinguishable) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_HP; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_H; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_HP; + } else { + mSelectedDataActivityIndex[slot] = DATA_TYPE_3G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + mDataTypeGenerationArray[0], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_3G; + mSelectedDataTypeDesc[slot] = mDataTypeGenerationDescArray[0]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_3G; + } + break; + case TelephonyManager.NETWORK_TYPE_CDMA: + if (!showAtLeast3G) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_1X; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_1X; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_CDMA; + break; + } else { + // fall through + } + case TelephonyManager.NETWORK_TYPE_1xRTT: + if (!showAtLeast3G) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_1X; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_1X; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_1X; + break; + } else { + // fall through + } + case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through + case TelephonyManager.NETWORK_TYPE_EVDO_A: + case TelephonyManager.NETWORK_TYPE_EVDO_B: + case TelephonyManager.NETWORK_TYPE_EHRPD: + mSelectedDataActivityIndex[slot] = DATA_TYPE_3G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_3G; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_3G; + break; + case TelephonyManager.NETWORK_TYPE_LTE: + case TelephonyManager.NETWORK_TYPE_LTE_CA: + if (show4GforLte) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_4G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + mDataTypeGenerationArray[1], null, NS); + if ( type == TelephonyManager.NETWORK_TYPE_LTE_CA) { + //Select 4G+ icon. + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + mDataTypeGenerationArray[2], null, NS); + } + mSelectedQSDataTypeIcon[slot] = QS_DATA_4G; + mSelectedDataTypeDesc[slot] = mDataTypeGenerationDescArray[1]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_4G; + } else { + mSelectedDataActivityIndex[slot] = DATA_TYPE_LTE; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_LTE; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_4G; + } + break; + case TelephonyManager.NETWORK_TYPE_GPRS: + case TelephonyManager.NETWORK_TYPE_GSM: + if (!showAtLeast3G) { + mSelectedDataActivityIndex[slot] = DATA_TYPE_G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + dataTypeArray[type], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_G; + mSelectedDataTypeDesc[slot] = mDataTypeDescriptionArray[type]; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_G; + } else { + mSelectedDataActivityIndex[slot] = DATA_TYPE_3G; + mSelectedDataTypeIcon[slot] = mRes.getIdentifier( + mDataTypeGenerationArray[0], null, NS); + mSelectedQSDataTypeIcon[slot] = QS_DATA_3G; + mSelectedDataTypeDesc[slot] = mDataTypeGenerationDescArray[0];; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_3G; + } + break; + default: + mSelectedDataActivityIndex[slot] = DATA_TYPE_UNKNOWN; + mSelectedDataTypeIcon[slot] = 0; + mSelectedQSDataTypeIcon[slot] = 0; + mSelectedDataTypeDesc[slot] = ""; + mSelectedSignalStreagthIndex[slot] = SIGNAL_STRENGTH_TYPE_G; + break; + } + log(TAG, "updateDataType " + String.format( + "mSelectedDataTypeIcon[%d]=%d, mSelectedDataActivityIndex=%d", + slot, mSelectedDataTypeIcon[slot], mSelectedDataActivityIndex[slot])); + } + + + static int getQSDataTypeIcon(int slot) { + return mSelectedQSDataTypeIcon[slot]; + } + + static int getDataTypeIcon(int slot) { + log(TAG, "getDataTypeIcon " + String.format("sub=%d", slot)); + return mSelectedDataTypeIcon[slot]; + } + + static int getDataTypeDesc(int slot) { + return mRes.getIdentifier(mSelectedDataTypeDesc[slot], null, NS); + } + + static int getDataActivity(int slot, int activity) { + log(TAG, String.format("getDataActivity, slot=%d, activity=%d", + slot, activity)); + + String[] dataActivityArray = mRes.getStringArray( + mRes.getIdentifier(mDataActivityArray[slot], null, NS)); + String[] selectedTypeArray = mRes.getStringArray(mRes.getIdentifier( + dataActivityArray[mSelectedDataActivityIndex[slot]], null, NS)); + + return mRes.getIdentifier(selectedTypeArray[activity], null, NS); + } + + static int getSignalStrengthIcon(int slot, int inet, int level, boolean roaming) { + log(TAG, "getSignalStrengthIcon: " + String.format( + "slot=%d, inetCondition=%d, level=%d, roaming=%b", slot, inet, level, roaming)); + + String[] signalStrengthArray, selectedTypeArray; + + signalStrengthArray = mRes.getStringArray(mRes.getIdentifier(!roaming ? + mSignalStrengthArray[slot] : mSignalStrengthRoamingArray[slot], null, NS)); + log(TAG, String.format("signalStrengthArray.length=%d", signalStrengthArray.length)); + + selectedTypeArray = mRes.getStringArray(mRes.getIdentifier( + signalStrengthArray[mSelectedSignalStreagthIndex[slot]], null, NS)); + log(TAG, String.format("selectedTypeArray.length=%d", selectedTypeArray.length)); + + String[] inetArray = mRes.getStringArray( + mRes.getIdentifier(selectedTypeArray[inet], null, NS)); + log(TAG, String.format("inetArray.length=%d", inetArray.length)); + + return mRes.getIdentifier(inetArray[level], null, NS); + } + + + static int convertMobileStrengthIcon(int stackedIcon) { + if (mStacked2SingleIconLookup == null) { + return stackedIcon; + } + int index = mStacked2SingleIconLookup.indexOfKey(stackedIcon); + if (index >= 0) { + return mStacked2SingleIconLookup.get(stackedIcon); + } + return stackedIcon; + } + + static int getStackedVoiceIcon(int level) { + int retValue = 0; + switch(level){ + case SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN: + retValue = R.drawable.stat_sys_signal_0_2g; + break; + case SignalStrength.SIGNAL_STRENGTH_POOR: + retValue = R.drawable.stat_sys_signal_1_2g; + break; + case SignalStrength.SIGNAL_STRENGTH_MODERATE: + retValue = R.drawable.stat_sys_signal_2_2g; + break; + case SignalStrength.SIGNAL_STRENGTH_GOOD: + retValue = R.drawable.stat_sys_signal_3_2g; + break; + case SignalStrength.SIGNAL_STRENGTH_GREAT: + retValue = R.drawable.stat_sys_signal_4_2g; + break; + default: + break; + } + return retValue; + } + + static int getRoamingSignalIconId(int level, int inet){ + return TELEPHONY_SIGNAL_STRENGTH_ROAMING_R[inet][level]; + } + + static int[] getSignalStrengthDes(int slot) { + int[] resId = new int[SIGNAL_LEVEL_NUM]; + for (int i = 0; i < SIGNAL_LEVEL_NUM; i++) { + resId[i] = mRes.getIdentifier(mSignalStrengthDesc[i], null, NS); + } + return resId; + } + + private static void log(String tag, String str){ + if (DEBUG) { + Log.d(tag, str); + } + } + static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup( "CARRIER_NETWORK_CHANGE", @@ -344,6 +780,21 @@ class TelephonyIcons { TelephonyIcons.QS_DATA_4G ); + static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup( + "4G+", + TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, + TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, + AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, + 0,0, + TelephonyIcons.TELEPHONY_NO_NETWORK, + TelephonyIcons.QS_TELEPHONY_NO_NETWORK, + AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], + R.string.accessibility_data_connection_4g_plus, + TelephonyIcons.ICON_4G_PLUS, + true, + TelephonyIcons.QS_DATA_4G_PLUS + ); + static final MobileIconGroup LTE = new MobileIconGroup( "LTE", TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java index 9b1e72a1648..29be2c9e854 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/WifiSignalController.java @@ -29,6 +29,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.AsyncChannel; +import com.android.systemui.R; import com.android.systemui.statusbar.policy.NetworkController.IconState; import java.util.List; @@ -75,8 +76,10 @@ protected WifiState cleanState() { @Override public void notifyListeners() { // only show wifi in the cluster if connected or if wifi-only + boolean visibleWhenEnabled = mContext.getResources().getBoolean( + R.bool.config_showWifiIndicatorWhenEnabled); boolean wifiVisible = mCurrentState.enabled - && (mCurrentState.connected || !mHasMobileData); + && (mCurrentState.connected || !mHasMobileData || visibleWhenEnabled); String wifiDesc = wifiVisible ? mCurrentState.ssid : null; boolean ssidPresent = wifiVisible && mCurrentState.ssid != null; String contentDescription = getStringIfExists(getContentDescription()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java index 00b8de23734..5e840f5a384 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java @@ -104,8 +104,8 @@ public void testSignalCallback_setMobileDataIndicators() { int qsType = R.drawable.ic_qs_signal_1x; boolean wide = true; int subId = 5; - mHandler.setMobileDataIndicators(status, qs, type, qsType, in, out, typeDescription, - description, wide, subId); + mHandler.setMobileDataIndicators(status, qs, type, qsType, in, out, 0, 0, 0, 0, + typeDescription, description, wide, subId); waitForCallbacks(); ArgumentCaptor statusArg = ArgumentCaptor.forClass(IconState.class); @@ -120,7 +120,11 @@ public void testSignalCallback_setMobileDataIndicators() { ArgumentCaptor subIdArg = ArgumentCaptor.forClass(Integer.class); Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(), qsArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(), inArg.capture(), - outArg.capture(), typeContentArg.capture(), descArg.capture(), wideArg.capture(), + outArg.capture(), ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + typeContentArg.capture(), descArg.capture(), wideArg.capture(), subIdArg.capture()); assertEquals(status, statusArg.getValue()); assertEquals(qs, qsArg.getValue()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java index 61d4e4a15c1..96aea9d29b0 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java @@ -277,6 +277,10 @@ protected void verifyLastQsMobileDataIndicators(boolean visible, int icon, int t iconArg.capture(), ArgumentCaptor.forClass(Integer.class).capture(), typeIconArg.capture(), dataInArg.capture(), dataOutArg.capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), ArgumentCaptor.forClass(String.class).capture(), ArgumentCaptor.forClass(String.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), @@ -303,6 +307,10 @@ protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typ ArgumentCaptor.forClass(Integer.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), + ArgumentCaptor.forClass(Integer.class).capture(), ArgumentCaptor.forClass(String.class).capture(), ArgumentCaptor.forClass(String.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), diff --git a/services/Android.mk b/services/Android.mk index 1918db54a04..ecbddaab0ab 100644 --- a/services/Android.mk +++ b/services/Android.mk @@ -48,6 +48,11 @@ LOCAL_SHARED_LIBRARIES := # include all the jni subdirs to collect their sources include $(wildcard $(LOCAL_PATH)/*/jni/Android.mk) +LOCAL_C_INCLUDES += \ + $(TOP)/frameworks/base/services/libtvextensions \ + +LOCAL_WHOLE_STATIC_LIBRARIES := libTvInputHalExtensions + LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES LOCAL_MODULE:= libandroid_servers diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java index 130a23431ee..76b21938d61 100644 --- a/services/core/java/com/android/server/AlarmManagerService.java +++ b/services/core/java/com/android/server/AlarmManagerService.java @@ -75,6 +75,7 @@ import static android.app.AlarmManager.RTC; import static android.app.AlarmManager.ELAPSED_REALTIME_WAKEUP; import static android.app.AlarmManager.ELAPSED_REALTIME; +import static android.app.AlarmManager.RTC_POWEROFF_WAKEUP; import com.android.internal.util.LocalLog; @@ -83,8 +84,10 @@ class AlarmManagerService extends SystemService { private static final int RTC_MASK = 1 << RTC; private static final int ELAPSED_REALTIME_WAKEUP_MASK = 1 << ELAPSED_REALTIME_WAKEUP; private static final int ELAPSED_REALTIME_MASK = 1 << ELAPSED_REALTIME; + private static final int RTC_POWEROFF_WAKEUP_MASK = 1 << RTC_POWEROFF_WAKEUP; static final int TIME_CHANGED_MASK = 1 << 16; - static final int IS_WAKEUP_MASK = RTC_WAKEUP_MASK|ELAPSED_REALTIME_WAKEUP_MASK; + static final int IS_WAKEUP_MASK = RTC_WAKEUP_MASK|ELAPSED_REALTIME_WAKEUP_MASK + |RTC_POWEROFF_WAKEUP_MASK; // Mask for testing whether a given alarm type is wakeup vs non-wakeup static final int TYPE_NONWAKEUP_MASK = 0x1; // low bit => non-wakeup @@ -111,8 +114,12 @@ class AlarmManagerService extends SystemService { final Object mLock = new Object(); + private final ArrayList mTriggeredUids = new ArrayList(); + private final ArrayList mBlockedUids = new ArrayList(); + long mNativeData; private long mNextWakeup; + private long mNextRtcWakeup; private long mNextNonWakeup; int mBroadcastRefCount = 0; PowerManager.WakeLock mWakeLock; @@ -347,6 +354,14 @@ Alarm get(int index) { return alarms.get(index); } + long getWhenByElapsedTime(long whenElapsed) { + for(int i=0;i< alarms.size();i++) { + if(alarms.get(i).whenElapsed == whenElapsed) + return alarms.get(i).when; + } + return 0; + } + boolean canHold(long whenElapsed, long maxWhen) { return (end >= whenElapsed) && (start <= maxWhen); } @@ -496,6 +511,17 @@ boolean hasWakeups() { return false; } + boolean isRtcPowerOffWakeup() { + final int N = alarms.size(); + for (int i = 0; i < N; i++) { + Alarm a = alarms.get(i); + if (a.type == RTC_POWEROFF_WAKEUP) { + return true; + } + } + return false; + } + @Override public String toString() { StringBuilder b = new StringBuilder(40); @@ -602,7 +628,8 @@ public AlarmManagerService(Context context) { } static long convertToElapsed(long when, int type) { - final boolean isRtc = (type == RTC || type == RTC_WAKEUP); + final boolean isRtc = (type == RTC || type == RTC_WAKEUP + || type == RTC_POWEROFF_WAKEUP); if (isRtc) { when -= System.currentTimeMillis() - SystemClock.elapsedRealtime(); } @@ -732,9 +759,10 @@ static final class InFlight extends Intent { final BroadcastStats mBroadcastStats; final FilterStats mFilterStats; final int mAlarmType; + final int mUid; InFlight(AlarmManagerService service, PendingIntent pendingIntent, WorkSource workSource, - int alarmType, String tag, long nowELAPSED) { + int alarmType, String tag, long nowELAPSED, int uid) { mPendingIntent = pendingIntent; mWorkSource = workSource; mTag = tag; @@ -747,6 +775,7 @@ static final class InFlight extends Intent { fs.lastTime = nowELAPSED; mFilterStats = fs; mAlarmType = alarmType; + mUid = uid; } } @@ -794,7 +823,7 @@ static final class BroadcastStats { @Override public void onStart() { mNativeData = init(); - mNextWakeup = mNextNonWakeup = 0; + mNextWakeup = mNextRtcWakeup = mNextNonWakeup = 0; // We have to set current TimeZone info to kernel // because kernel doesn't keep this after reboot @@ -916,7 +945,7 @@ void setImpl(int type, long triggerAtTime, long windowLength, long interval, interval = minInterval; } - if (type < RTC_WAKEUP || type > ELAPSED_REALTIME) { + if (type < RTC_WAKEUP || type > RTC_POWEROFF_WAKEUP) { throw new IllegalArgumentException("Invalid alarm type " + type); } @@ -1174,6 +1203,39 @@ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { dumpImpl(pw); } + + @Override + /* updates the blocked uids, so if a wake lock is acquired to only fire + * alarm for it, it can be released. + */ + public void updateBlockedUids(int uid, boolean isBlocked) { + + if (localLOGV) Slog.v(TAG, "UpdateBlockedUids: uid = " + uid + + " isBlocked = " + isBlocked); + + if (Binder.getCallingUid() != Process.SYSTEM_UID) { + if (localLOGV) Slog.v(TAG, "UpdateBlockedUids is not allowed"); + return; + } + + synchronized(mLock) { + if(isBlocked) { + mBlockedUids.add(new Integer(uid)); + if (checkReleaseWakeLock()) { + /* all the uids for which the alarms are triggered + * are either blocked or have called onSendFinished. + */ + if (mWakeLock.isHeld()) { + mWakeLock.release(); + if (localLOGV) + Slog.v(TAG, "AM WakeLock Released Internally in updateBlockedUids"); + } + } + } else { + mBlockedUids.clear(); + } + } + } }; void dumpImpl(PrintWriter pw) { @@ -1469,6 +1531,18 @@ private Batch findFirstWakeupBatchLocked() { return null; } + private Batch findFirstRtcWakeupBatchLocked() { + final int N = mAlarmBatches.size(); + for (int i = 0; i < N; i++) { + Batch b = mAlarmBatches.get(i); + long intervalTime = b.start - SystemClock.elapsedRealtime(); + if (b.isRtcPowerOffWakeup()) { + return b; + } + } + return null; + } + long getNextWakeFromIdleTimeImpl() { synchronized (mLock) { return mNextWakeFromIdle != null ? mNextWakeFromIdle.whenElapsed : Long.MAX_VALUE; @@ -1611,10 +1685,18 @@ void rescheduleKernelAlarmsLocked() { if (mAlarmBatches.size() > 0) { final Batch firstWakeup = findFirstWakeupBatchLocked(); final Batch firstBatch = mAlarmBatches.get(0); + final Batch firstRtcWakeup = findFirstRtcWakeupBatchLocked(); if (firstWakeup != null && mNextWakeup != firstWakeup.start) { mNextWakeup = firstWakeup.start; setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start); } + if (firstRtcWakeup != null && mNextRtcWakeup != firstRtcWakeup.start) { + mNextRtcWakeup = firstRtcWakeup.start; + long when = firstRtcWakeup.getWhenByElapsedTime(mNextRtcWakeup); + if (when != 0) { + setLocked(RTC_POWEROFF_WAKEUP, when); + } + } if (firstBatch != firstWakeup) { nextNonWakeup = firstBatch.start; } @@ -1630,10 +1712,36 @@ void rescheduleKernelAlarmsLocked() { } } + boolean checkReleaseWakeLock() { + if (mTriggeredUids.size() == 0 || mBlockedUids.size() == 0) + return false; + + int uid; + for (int i = 0; i < mTriggeredUids.size(); i++) { + uid = mTriggeredUids.get(i); + if (!mBlockedUids.contains(uid)) { + return false; + } + } + return true; + } + private void removeLocked(PendingIntent operation) { boolean didRemove = false; for (int i = mAlarmBatches.size() - 1; i >= 0; i--) { Batch b = mAlarmBatches.get(i); + ArrayList alarmList = b.alarms; + Alarm alarm = null; + for (int j = alarmList.size() - 1; j >= 0; j--) { + alarm = alarmList.get(j); + if (alarm.type == RTC_POWEROFF_WAKEUP && alarm.operation.equals(operation)) { + long alarmSeconds, alarmNanoseconds; + alarmSeconds = alarm.when / 1000; + alarmNanoseconds = (alarm.when % 1000) * 1000 * 1000; + clear(mNativeData, alarm.type, alarmSeconds, alarmNanoseconds); + mNextRtcWakeup = 0; + } + } didRemove |= b.remove(operation); if (b.size() == 0) { mAlarmBatches.remove(i); @@ -1804,6 +1912,7 @@ private static final String labelForType(int type) { case RTC_WAKEUP : return "RTC_WAKEUP"; case ELAPSED_REALTIME : return "ELAPSED"; case ELAPSED_REALTIME_WAKEUP: return "ELAPSED_WAKEUP"; + case RTC_POWEROFF_WAKEUP : return "RTC_POWEROFF_WAKEUP"; default: break; } @@ -1824,6 +1933,7 @@ private static final void dumpAlarmList(PrintWriter pw, ArrayList list, private native long init(); private native void close(long nativeData); private native void set(long nativeData, int type, long seconds, long nanoseconds); + private native void clear(long nativeData, int type, long seconds, long nanoseconds); private native int waitForAlarm(long nativeData); private native int setKernelTime(long nativeData, long millis); private native int setKernelTimezone(long nativeData, int minuteswest); @@ -1959,6 +2069,7 @@ private static class Alarm { public long maxWhenElapsed; // also in the elapsed time base public long repeatInterval; public PriorityClass priorityClass; + public int pid; public Alarm(int _type, long _when, long _whenElapsed, long _windowLength, long _maxWhen, long _interval, PendingIntent _op, WorkSource _ws, int _flags, @@ -1966,7 +2077,8 @@ public Alarm(int _type, long _when, long _whenElapsed, long _windowLength, long type = _type; origWhen = _when; wakeup = _type == AlarmManager.ELAPSED_REALTIME_WAKEUP - || _type == AlarmManager.RTC_WAKEUP; + || _type == AlarmManager.RTC_WAKEUP + || _type == AlarmManager.RTC_POWEROFF_WAKEUP; when = _when; whenElapsed = _whenElapsed; windowLength = _windowLength; @@ -1977,12 +2089,13 @@ public Alarm(int _type, long _when, long _whenElapsed, long _windowLength, long workSource = _ws; flags = _flags; alarmClock = _info; - uid = _uid; + uid = operation.getCreatorUid(); + pid = Binder.getCallingPid(); } public static String makeTag(PendingIntent pi, int type) { return pi.getTag(type == ELAPSED_REALTIME_WAKEUP || type == RTC_WAKEUP - ? "*walarm*:" : "*alarm*:"); + || type == RTC_POWEROFF_WAKEUP ? "*walarm*:" : "*alarm*:"); } @Override @@ -2002,7 +2115,8 @@ public String toString() { public void dump(PrintWriter pw, String prefix, long nowRTC, long nowELAPSED, SimpleDateFormat sdf) { - final boolean isRtc = (type == RTC || type == RTC_WAKEUP); + final boolean isRtc = (type == RTC || type == RTC_WAKEUP + || type == RTC_POWEROFF_WAKEUP); pw.print(prefix); pw.print("tag="); pw.println(tag); pw.print(prefix); pw.print("type="); pw.print(type); pw.print(" whenElapsed="); TimeUtils.formatDuration(whenElapsed, @@ -2117,15 +2231,25 @@ void deliverAlarmsLocked(ArrayList triggerList, long nowELAPSED) { mResultReceiver, mHandler, null, allowWhileIdle ? mIdleOptions : null); // we have an active broadcast so stay awake. - if (mBroadcastRefCount == 0) { + if (mBroadcastRefCount == 0 || !mWakeLock.isHeld()) { setWakelockWorkSource(alarm.operation, alarm.workSource, alarm.type, alarm.tag, true); mWakeLock.acquire(); } final InFlight inflight = new InFlight(AlarmManagerService.this, - alarm.operation, alarm.workSource, alarm.type, alarm.tag, nowELAPSED); + alarm.operation, + alarm.workSource, + alarm.type, alarm.tag, + nowELAPSED, alarm.uid); mInFlight.add(inflight); mBroadcastRefCount++; + mTriggeredUids.add(new Integer(alarm.uid)); + if (checkReleaseWakeLock()) { + if (mWakeLock.isHeld()) { + mWakeLock.release(); + if (localLOGV) Slog.v(TAG, "AM WakeLock Released Internally deliverAlarms"); + } + } if (allowWhileIdle) { // Record the last time this uid handled an ALLOW_WHILE_IDLE alarm. @@ -2149,7 +2273,8 @@ void deliverAlarmsLocked(ArrayList triggerList, long nowELAPSED) { fs.nesting++; } if (alarm.type == ELAPSED_REALTIME_WAKEUP - || alarm.type == RTC_WAKEUP) { + || alarm.type == RTC_WAKEUP + || alarm.type == RTC_POWEROFF_WAKEUP) { bs.numWakeup++; fs.numWakeup++; if (alarm.workSource != null && alarm.workSource.size() > 0) { @@ -2321,11 +2446,10 @@ void setWakelockWorkSource(PendingIntent pi, WorkSource ws, int type, String tag mWakeLock.setWorkSource(new WorkSource(uid)); return; } + // Something went wrong; fall back to attributing the lock to the OS + mWakeLock.setWorkSource(null); } catch (Exception e) { } - - // Something went wrong; fall back to attributing the lock to the OS - mWakeLock.setWorkSource(null); } private class AlarmHandler extends Handler { @@ -2533,9 +2657,11 @@ class ResultReceiver implements PendingIntent.OnFinished { public void onSendFinished(PendingIntent pi, Intent intent, int resultCode, String resultData, Bundle resultExtras) { synchronized (mLock) { + int uid = 0; InFlight inflight = null; for (int i=0; i 0) { mLog.w("Finished all broadcasts with " + mInFlight.size() + " remaining inflights"); @@ -2581,8 +2718,12 @@ public void onSendFinished(PendingIntent pi, Intent intent, int resultCode, } } else { // the next of our alarms is now in flight. reattribute the wakelock. + InFlight inFlight = null; if (mInFlight.size() > 0) { - InFlight inFlight = mInFlight.get(0); + for(int index = 0; index < mInFlight.size(); index++){ + inFlight = mInFlight.get(index); + if(!mBlockedUids.contains(inFlight.mUid)) break; + } setWakelockWorkSource(inFlight.mPendingIntent, inFlight.mWorkSource, inFlight.mAlarmType, inFlight.mTag, false); } else { diff --git a/services/core/java/com/android/server/AppOpsPolicy.java b/services/core/java/com/android/server/AppOpsPolicy.java new file mode 100644 index 00000000000..75bca05591f --- /dev/null +++ b/services/core/java/com/android/server/AppOpsPolicy.java @@ -0,0 +1,441 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.android.server; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; + +import android.app.AppOpsManager; +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager.NameNotFoundException; +import android.util.Slog; +import android.util.SparseArray; +import android.util.Xml; + +import com.android.internal.util.XmlUtils; + +public class AppOpsPolicy { + static final String TAG = "AppOpsPolicy"; + static final boolean DEBUG = false; + final File mFile; + final Context mContext; + public static final int CONTROL_SHOW = 0; + + public static final int CONTROL_NOSHOW = 1; + + public static final int CONTROL_UNKNOWN = 2; + + public static int stringToControl(String show) { + if ("true".equalsIgnoreCase(show)) { + return CONTROL_SHOW; + } else if ("false".equalsIgnoreCase(show)) { + return CONTROL_NOSHOW; + } + return CONTROL_UNKNOWN; + } + + HashMap mPolicy = new HashMap(); + + public AppOpsPolicy(File file, Context context) { + super(); + mFile = file; + mContext = context; + } + + public final static class PolicyPkg extends SparseArray { + public String packageName; + public int mode; + public int show; + public String type; + + public PolicyPkg(String packageName, int mode, int show, String type) { + this.packageName = packageName; + this.mode = mode; + this.show = show; + this.type = type; + } + + @Override + public String toString() { + return "PolicyPkg [packageName=" + packageName + ", mode=" + mode + + ", show=" + show + ", type=" + type + "]"; + } + + } + + public final static class PolicyOp { + public int op; + public int mode; + public int show; + + public PolicyOp(int op, int mode, int show) { + this.op = op; + this.mode = mode; + this.show = show; + } + + @Override + public String toString() { + return "PolicyOp [op=" + op + ", mode=" + mode + ", show=" + show + + "]"; + } + } + + void readPolicy() { + FileInputStream stream; + synchronized (mFile) { + try { + stream = new FileInputStream(mFile); + } catch (FileNotFoundException e) { + Slog.i(TAG, "App ops policy file (" + mFile.getPath() + + ") not found; Skipping."); + return; + } + boolean success = false; + try { + XmlPullParser parser = Xml.newPullParser(); + parser.setInput(stream, null); + int type; + success = true; + while ((type = parser.next()) != XmlPullParser.START_TAG + && type != XmlPullParser.END_DOCUMENT) { + ; + } + if (type != XmlPullParser.START_TAG) { + throw new IllegalStateException("no start tag found"); + } + + int outerDepth = parser.getDepth(); + while ((type = parser.next()) != XmlPullParser.END_DOCUMENT + && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { + if (type == XmlPullParser.END_TAG + || type == XmlPullParser.TEXT) { + continue; + } + + String tagName = parser.getName(); + if (tagName.equals("user-app") + || tagName.equals("system-app")) { + readDefaultPolicy(parser, tagName); + } else if (tagName.equals("application")) { + readApplicationPolicy(parser); + } else { + Slog.w(TAG, "Unknown element under : " + + parser.getName()); + XmlUtils.skipCurrentTag(parser); + } + } + } catch (IllegalStateException e) { + Slog.w(TAG, "Failed parsing " + e); + } catch (NullPointerException e) { + Slog.w(TAG, "Failed parsing " + e); + } catch (NumberFormatException e) { + Slog.w(TAG, "Failed parsing " + e); + } catch (XmlPullParserException e) { + Slog.w(TAG, "Failed parsing " + e); + } catch (IOException e) { + Slog.w(TAG, "Failed parsing " + e); + } catch (IndexOutOfBoundsException e) { + Slog.w(TAG, "Failed parsing " + e); + } finally { + if (!success) { + mPolicy.clear(); + } + try { + stream.close(); + } catch (IOException e) { + } + } + } + } + + private void readDefaultPolicy(XmlPullParser parser, String packageName) + throws NumberFormatException, XmlPullParserException, IOException { + if (!"user-app".equalsIgnoreCase(packageName) + && !"system-app".equalsIgnoreCase(packageName)) { + return; + } + int mode = AppOpsManager.stringToMode(parser.getAttributeValue(null, + "permission")); + int show = stringToControl(parser.getAttributeValue(null, "show")); + if (mode == AppOpsManager.MODE_ERRORED && show == CONTROL_UNKNOWN) { + return; + } + PolicyPkg pkg = this.mPolicy.get(packageName); + if (pkg == null) { + pkg = new PolicyPkg(packageName, mode, show, packageName); + this.mPolicy.put(packageName, pkg); + } else { + Slog.w(TAG, "Duplicate policy found for package: " + packageName + + " of type: " + packageName); + pkg.mode = mode; + pkg.show = show; + } + } + + private void readApplicationPolicy(XmlPullParser parser) + throws NumberFormatException, XmlPullParserException, IOException { + int outerDepth = parser.getDepth(); + int type; + while ((type = parser.next()) != XmlPullParser.END_DOCUMENT + && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { + if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { + continue; + } + String tagName = parser.getName(); + if (tagName.equals("pkg")) { + readPkgPolicy(parser); + } else { + Slog.w(TAG, + "Unknown element under : " + + parser.getName()); + XmlUtils.skipCurrentTag(parser); + } + } + } + + private void readPkgPolicy(XmlPullParser parser) + throws NumberFormatException, XmlPullParserException, IOException { + String packageName = parser.getAttributeValue(null, "name"); + if (packageName == null) + return; + String appType = parser.getAttributeValue(null, "type"); + if (appType == null) + return; + int mode = AppOpsManager.stringToMode(parser.getAttributeValue(null, + "permission")); + int show = stringToControl(parser.getAttributeValue(null, "show")); + String key = packageName + "." + appType; + PolicyPkg pkg = this.mPolicy.get(key); + if (pkg == null) { + pkg = new PolicyPkg(packageName, mode, show, appType); + this.mPolicy.put(key, pkg); + } else { + Slog.w(TAG, "Duplicate policy found for package: " + packageName + + " of type: " + appType); + pkg.mode = mode; + pkg.show = show; + } + + int outerDepth = parser.getDepth(); + int type; + while ((type = parser.next()) != XmlPullParser.END_DOCUMENT + && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { + if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { + continue; + } + String tagName = parser.getName(); + if (tagName.equals("op")) { + readOpPolicy(parser, pkg); + } else { + Slog.w(TAG, "Unknown element under : " + parser.getName()); + XmlUtils.skipCurrentTag(parser); + } + } + } + + private void readOpPolicy(XmlPullParser parser, PolicyPkg pkg) + throws NumberFormatException, XmlPullParserException, IOException { + if (pkg == null) { + return; + } + String opName = parser.getAttributeValue(null, "name"); + if (opName == null) { + Slog.w(TAG, "Op name is null"); + return; + } + int code = AppOpsManager.stringOpToOp(opName); + if (code == AppOpsManager.OP_NONE) { + Slog.w(TAG, "Unknown Op: " + opName); + return; + } + int mode = AppOpsManager.stringToMode(parser.getAttributeValue(null, + "permission")); + int show = stringToControl(parser.getAttributeValue(null, "show")); + if (mode == AppOpsManager.MODE_ERRORED && show == CONTROL_UNKNOWN) { + return; + } + PolicyOp op = pkg.get(code); + if (op == null) { + op = new PolicyOp(code, mode, show); + pkg.put(code, op); + } else { + Slog.w(TAG, "Duplicate policy found for package: " + + pkg.packageName + " type: " + pkg.type + " op: " + op.op); + op.mode = mode; + op.show = show; + } + } + + void debugPoilcy() { + Iterator> iterator = mPolicy.entrySet() + .iterator(); + while (iterator.hasNext()) { + String key = iterator.next().getKey(); + if (DEBUG) + Slog.d(TAG, "Key: " + key); + PolicyPkg pkg = mPolicy.get(key); + if (pkg == null) { + if (DEBUG) + Slog.d(TAG, "Pkg is null for key: " + key); + continue; + } + if (DEBUG) + Slog.d(TAG, pkg.toString()); + for (int i = 0; i < pkg.size(); i++) { + PolicyOp op = pkg.valueAt(i); + if (DEBUG) + Slog.d(TAG, op.toString()); + } + } + } + + private String getAppType(String packageName) { + String appType = null; + ApplicationInfo appInfo = null; + if (mContext != null) { + try { + appInfo = mContext.getPackageManager().getApplicationInfo( + packageName, 0); + } catch (NameNotFoundException e) { + appInfo = null; + } + if (appInfo != null) { + if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { + appType = "system-app"; + } else { + appType = "user-app"; + } + } + } else { + Slog.e(TAG, "Context is null"); + } + return appType; + } + + public boolean isControlAllowed(int code, String packageName) { + boolean isShow = true; + int show = CONTROL_UNKNOWN; + PolicyPkg pkg; + String key; + String type; + + if (mPolicy == null) { + return isShow; + } + + type = getAppType(packageName); + if (type != null) { + key = type; + pkg = mPolicy.get(key); + if (pkg != null && pkg.show != CONTROL_UNKNOWN) { + show = pkg.show; + } + } + key = packageName; + if (type != null) { + key = key + "." + type; + } + pkg = mPolicy.get(key); + if (pkg != null) { + if (pkg.show != CONTROL_UNKNOWN) { + show = pkg.show; + } + PolicyOp op = pkg.get(code); + if (op != null) { + if (op.show != CONTROL_UNKNOWN) { + show = op.show; + } + } + } + if (show == CONTROL_NOSHOW) { + isShow = false; + } + return isShow; + } + + public int getDefualtMode(int code, String packageName) { + int mode = AppOpsManager.MODE_ERRORED; + PolicyPkg pkg; + String key; + String type; + + if (mPolicy == null) { + return mode; + } + if (DEBUG) + Slog.d(TAG, "Default mode requested for op=" + code + " package=" + + packageName); + type = getAppType(packageName); + if (type != null) { + // Get value based on 'type' + key = type; + pkg = mPolicy.get(key); + if (pkg != null && pkg.mode != AppOpsManager.MODE_ERRORED) { + if (DEBUG) + Slog.d(TAG, "Setting value based on type: " + pkg); + mode = pkg.mode; + } + } + // Get value based on 'pkg'. + key = packageName; + if (type != null) { + key = key + "." + type; + } + pkg = mPolicy.get(key); + if (pkg != null) { + if (pkg.mode != AppOpsManager.MODE_ERRORED) { + if (DEBUG) + Slog.d(TAG, "Setting value based on packageName: " + pkg); + mode = pkg.mode; + } + // Get value base on 'op' + PolicyOp op = pkg.get(code); + if (op != null) { + if (op.mode != AppOpsManager.MODE_ERRORED) { + if (DEBUG) + Slog.d(TAG, "Setting value based on op: " + op); + mode = op.mode; + } + } + } + if (DEBUG) + Slog.d(TAG, "Returning mode=" + mode); + return mode; + } +} \ No newline at end of file diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java index 96c1e2a5cda..2e30bbd321f 100644 --- a/services/core/java/com/android/server/AppOpsService.java +++ b/services/core/java/com/android/server/AppOpsService.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +38,9 @@ import android.app.ActivityThread; import android.app.AppGlobals; import android.app.AppOpsManager; +import android.app.Dialog; import android.content.Context; +import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; @@ -45,6 +50,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; @@ -67,6 +73,7 @@ import com.android.internal.util.ArrayUtils; import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.XmlUtils; +import com.android.server.PermissionDialogReqQueue.PermissionDialogReq; import libcore.util.EmptyArray; import org.xmlpull.v1.XmlPullParser; @@ -80,9 +87,23 @@ public class AppOpsService extends IAppOpsService.Stub { // Write at most every 30 minutes. static final long WRITE_DELAY = DEBUG ? 1000 : 30*60*1000; + // Location of policy file. + static final String DEFAULT_POLICY_FILE = "/system/etc/appops_policy.xml"; + Context mContext; final AtomicFile mFile; final Handler mHandler; + final Looper mLooper; + final boolean mStrictEnable; + AppOpsPolicy mPolicy; + + private static final int[] PRIVACY_GUARD_OP_STATES = new int[] { + AppOpsManager.OP_COARSE_LOCATION, + AppOpsManager.OP_READ_CALL_LOG, + AppOpsManager.OP_READ_CONTACTS, + AppOpsManager.OP_READ_CALENDAR, + AppOpsManager.OP_READ_SMS + }; boolean mWriteScheduled; boolean mFastWriteScheduled; @@ -104,6 +125,14 @@ public void run() { final SparseArray mUidStates = new SparseArray<>(); + private Runnable mSuSessionChangedRunner = new Runnable() { + @Override + public void run() { + mContext.sendBroadcastAsUser(new Intent(AppOpsManager.ACTION_SU_SESSION_CHANGED), + UserHandle.ALL); + } + }; + private final SparseArray mOpRestrictions = new SparseArray(); private static final class UidState { @@ -149,12 +178,20 @@ public final static class Op { public long time; public long rejectTime; public int nesting; - - public Op(int _uid, String _packageName, int _op) { + public int noteOpCount; + public int startOpCount; + public PermissionDialogReqQueue dialogReqQueue; + final ArrayList clientTokens; + public int allowedCount; + public int ignoredCount; + + public Op(int _uid, String _packageName, int _op, int _mode) { uid = _uid; packageName = _packageName; op = _op; - mode = AppOpsManager.opToDefaultMode(op); + mode = _mode; + dialogReqQueue = new PermissionDialogReqQueue(); + clientTokens = new ArrayList(); } } @@ -226,17 +263,27 @@ public void binderDied() { } mClients.remove(mAppToken); } + + // We cannot broadcast on the synchronized block above because the broadcast might + // trigger another appop call that eventually arrives here from a different thread, + // causing a deadlock. + for (int i=mStartedOps.size()-1; i>=0; i--) { + broadcastOpIfNeeded(mStartedOps.get(i).op); + } } } public AppOpsService(File storagePath, Handler handler) { mFile = new AtomicFile(storagePath); mHandler = handler; + mLooper = Looper.myLooper(); + mStrictEnable = AppOpsManager.isStrictEnable(); readState(); } public void publish(Context context) { mContext = context; + readPolicy(); ServiceManager.addService(Context.APP_OPS_SERVICE, asBinder()); } @@ -372,7 +419,7 @@ private ArrayList collectOps(Ops pkgOps, int[] ops) { Op curOp = pkgOps.valueAt(j); resOps.add(new AppOpsManager.OpEntry(curOp.op, curOp.mode, curOp.time, curOp.rejectTime, curOp.duration, curOp.proxyUid, - curOp.proxyPackageName)); + curOp.proxyPackageName, curOp.allowedCount, curOp.ignoredCount)); } } else { for (int j=0; j collectOps(Ops pkgOps, int[] ops) { } resOps.add(new AppOpsManager.OpEntry(curOp.op, curOp.mode, curOp.time, curOp.rejectTime, curOp.duration, curOp.proxyUid, - curOp.proxyPackageName)); + curOp.proxyPackageName, curOp.allowedCount, curOp.ignoredCount)); } } } @@ -475,7 +522,8 @@ public void setUidMode(int code, int uid, int mode) { code = AppOpsManager.opToSwitch(code); synchronized (this) { - final int defaultMode = AppOpsManager.opToDefaultMode(code); + final int defaultMode = AppOpsManager.opToDefaultMode(code, + AppOpsManager.isStrictOp(code)); UidState uidState = getUidStateLocked(uid, false); if (uidState == null) { @@ -603,7 +651,7 @@ public void setMode(int code, int uid, String packageName, int mode) { } repCbs.addAll(cbs); } - if (mode == AppOpsManager.opToDefaultMode(op.op)) { + if (mode == getDefaultMode(code, uid, packageName)) { // If going into the default mode, prune this op // if there is nothing else interesting in it. pruneOp(op, uid, packageName); @@ -730,9 +778,11 @@ public void resetAllModes(int reqUserId, String reqPackageName) { Ops pkgOps = ent.getValue(); for (int j=pkgOps.size()-1; j>=0; j--) { Op curOp = pkgOps.valueAt(j); + int defaultMode = getDefaultMode(curOp.op, curOp.uid, + curOp.packageName); if (AppOpsManager.opAllowsReset(curOp.op) - && curOp.mode != AppOpsManager.opToDefaultMode(curOp.op)) { - curOp.mode = AppOpsManager.opToDefaultMode(curOp.op); + && curOp.mode != defaultMode) { + curOp.mode = defaultMode; changed = true; callbacks = addCallbacks(callbacks, packageName, curOp.op, mOpModeWatchers.get(curOp.op)); @@ -853,7 +903,7 @@ public int checkOperation(int code, int uid, String packageName) { } Op op = getOpLocked(code, uid, packageName, false); if (op == null) { - return AppOpsManager.opToDefaultMode(code); + return getDefaultMode(code, uid, packageName); } return op.mode; } @@ -944,6 +994,7 @@ public int noteOperation(int code, int uid, String packageName) { private int noteOperationUnchecked(int code, int uid, String packageName, int proxyUid, String proxyPackageName) { + final PermissionDialogReq req; synchronized (this) { Ops ops = getOpsLocked(uid, packageName, true); if (ops == null) { @@ -953,6 +1004,7 @@ private int noteOperationUnchecked(int code, int uid, String packageName, } Op op = getOpLocked(ops, code, true); if (isOpRestricted(uid, code, packageName)) { + op.ignoredCount++; return AppOpsManager.MODE_IGNORED; } if (op.duration == -1) { @@ -973,24 +1025,52 @@ private int noteOperationUnchecked(int code, int uid, String packageName, } } final Op switchOp = switchCode != code ? getOpLocked(ops, switchCode, true) : op; - if (switchOp.mode != AppOpsManager.MODE_ALLOWED) { - if (DEBUG) Log.d(TAG, "noteOperation: reject #" + op.mode + " for code " - + switchCode + " (" + code + ") uid " + uid + " package " + packageName); + if (switchOp.mode != AppOpsManager.MODE_ALLOWED + && switchOp.mode != AppOpsManager.MODE_ASK) { + if (DEBUG) + Log.d(TAG, "noteOperation: reject #" + op.mode + + " for code " + switchCode + " (" + code + + ") uid " + uid + " package " + packageName); op.rejectTime = System.currentTimeMillis(); + op.ignoredCount++; return switchOp.mode; + } else if (switchOp.mode == AppOpsManager.MODE_ALLOWED) { + if (DEBUG) Log.d(TAG, "noteOperation: allowing code " + code + " uid " + uid + + " package " + packageName); + op.time = System.currentTimeMillis(); + op.rejectTime = 0; + op.proxyUid = proxyUid; + op.proxyPackageName = proxyPackageName; + op.allowedCount++; + broadcastOpIfNeeded(code); + return AppOpsManager.MODE_ALLOWED; + + } else { + if (Looper.myLooper() == mLooper) { + Log.e(TAG, + "noteOperation: This method will deadlock if called" + + " from the main thread. (Code: " + + code + + " uid: " + + uid + + " package: " + + packageName + ")"); + return switchOp.mode; + } + op.noteOpCount++; + req = askOperationLocked(code, uid, packageName, switchOp); } - if (DEBUG) Log.d(TAG, "noteOperation: allowing code " + code + " uid " + uid - + " package " + packageName); - op.time = System.currentTimeMillis(); - op.rejectTime = 0; - op.proxyUid = proxyUid; - op.proxyPackageName = proxyPackageName; - return AppOpsManager.MODE_ALLOWED; } + + int result = req.get(); + broadcastOpIfNeeded(code); + return result; } @Override - public int startOperation(IBinder token, int code, int uid, String packageName) { + public int startOperation(IBinder token, int code, int uid, + String packageName) { + final PermissionDialogReq req; verifyIncomingUid(uid); verifyIncomingOp(code); ClientState client = (ClientState)token; @@ -1003,6 +1083,7 @@ public int startOperation(IBinder token, int code, int uid, String packageName) } Op op = getOpLocked(ops, code, true); if (isOpRestricted(uid, code, packageName)) { + op.ignoredCount++; return AppOpsManager.MODE_IGNORED; } final int switchCode = AppOpsManager.opToSwitch(code); @@ -1018,25 +1099,51 @@ public int startOperation(IBinder token, int code, int uid, String packageName) } } final Op switchOp = switchCode != code ? getOpLocked(ops, switchCode, true) : op; - if (switchOp.mode != AppOpsManager.MODE_ALLOWED) { - if (DEBUG) Log.d(TAG, "startOperation: reject #" + op.mode + " for code " - + switchCode + " (" + code + ") uid " + uid + " package " + packageName); + if (switchOp.mode != AppOpsManager.MODE_ALLOWED + && switchOp.mode != AppOpsManager.MODE_ASK) { + if (DEBUG) + Log.d(TAG, "startOperation: reject #" + op.mode + + " for code " + switchCode + " (" + code + + ") uid " + uid + " package " + packageName); op.rejectTime = System.currentTimeMillis(); + op.ignoredCount++; return switchOp.mode; + } else if (switchOp.mode == AppOpsManager.MODE_ALLOWED) { + if (DEBUG) + Log.d(TAG, "startOperation: allowing code " + code + + " uid " + uid + " package " + packageName); + if (op.nesting == 0) { + op.time = System.currentTimeMillis(); + op.rejectTime = 0; + op.duration = -1; + op.allowedCount++; + } + op.nesting++; + if (client.mStartedOps != null) { + client.mStartedOps.add(op); + } + broadcastOpIfNeeded(code); + return AppOpsManager.MODE_ALLOWED; + } else { + if (Looper.myLooper() == mLooper) { + Log.e(TAG, + "startOperation: This method will deadlock if called from the main thread. (Code: " + + code + + " uid: " + + uid + + " package: " + + packageName + ")"); + return switchOp.mode; + } + op.startOpCount++; + IBinder clientToken = client.mAppToken; + op.clientTokens.add(clientToken); + req = askOperationLocked(code, uid, packageName, switchOp); } - if (DEBUG) Log.d(TAG, "startOperation: allowing code " + code + " uid " + uid - + " package " + packageName); - if (op.nesting == 0) { - op.time = System.currentTimeMillis(); - op.rejectTime = 0; - op.duration = -1; - } - op.nesting++; - if (client.mStartedOps != null) { - client.mStartedOps.add(op); - } - return AppOpsManager.MODE_ALLOWED; } + int result = req.get(); + broadcastOpIfNeeded(code); + return result; } @Override @@ -1057,6 +1164,7 @@ public void finishOperation(IBinder token, int code, int uid, String packageName } finishOperationLocked(op); } + broadcastOpIfNeeded(code); } @Override @@ -1081,6 +1189,10 @@ void finishOperationLocked(Op op) { } private void verifyIncomingUid(int uid) { + if (Binder.getCallingUid() == 0) { + // Allow root to delegate uid operations. + return; + } if (uid == Binder.getCallingUid()) { return; } @@ -1115,6 +1227,9 @@ private Ops getOpsLocked(int uid, String packageName, boolean edit) { packageName = "root"; } else if (uid == Process.SHELL_UID) { packageName = "com.android.shell"; + } else if (uid == Process.SYSTEM_UID) { + if (packageName == null) + packageName = "android"; } return getOpsRawLocked(uid, packageName, edit); } @@ -1202,12 +1317,14 @@ private Op getOpLocked(int code, int uid, String packageName, boolean edit) { } private Op getOpLocked(Ops ops, int code, boolean edit) { + int mode; Op op = ops.get(code); if (op == null) { if (!edit) { return null; } - op = new Op(ops.uidState.uid, ops.packageName, code); + mode = getDefaultMode(code, ops.uidState.uid, ops.packageName); + op = new Op(ops.uidState.uid, ops.packageName, code, mode); ops.put(code, op); } if (edit) { @@ -1387,10 +1504,32 @@ void readUid(XmlPullParser parser, String pkgName) throws NumberFormatException, String tagName = parser.getName(); if (tagName.equals("op")) { - Op op = new Op(uid, pkgName, Integer.parseInt(parser.getAttributeValue(null, "n"))); + int code = Integer + .parseInt(parser.getAttributeValue(null, "n")); + // use op name string if it exists + String codeNameStr = parser.getAttributeValue(null, "ns"); + if (codeNameStr != null) { + // returns OP_NONE if it could not be mapped + code = AppOpsManager.nameToOp(codeNameStr); + } + // skip op codes that are out of bounds + if (code == AppOpsManager.OP_NONE + || code >= AppOpsManager._NUM_OP) { + continue; + } + Op op = new Op(uid, pkgName, code, AppOpsManager.MODE_ERRORED); String mode = parser.getAttributeValue(null, "m"); if (mode != null) { op.mode = Integer.parseInt(mode); + } else { + String sDefualtMode = parser.getAttributeValue(null, "dm"); + int defaultMode; + if (sDefualtMode != null) { + defaultMode = Integer.parseInt(sDefualtMode); + } else { + defaultMode = getDefaultMode(code, uid, pkgName); + } + op.mode = defaultMode; } String time = parser.getAttributeValue(null, "t"); if (time != null) { @@ -1412,7 +1551,14 @@ void readUid(XmlPullParser parser, String pkgName) throws NumberFormatException, if (proxyPackageName != null) { op.proxyPackageName = proxyPackageName; } - + String allowed = parser.getAttributeValue(null, "ac"); + if (allowed != null) { + op.allowedCount = Integer.parseInt(allowed); + } + String ignored = parser.getAttributeValue(null, "ic"); + if (ignored != null) { + op.ignoredCount = Integer.parseInt(ignored); + } UidState uidState = getUidStateLocked(uid, true); if (uidState.pkgOps == null) { uidState.pkgOps = new ArrayMap<>(); @@ -1499,8 +1645,13 @@ void writeState() { AppOpsManager.OpEntry op = ops.get(j); out.startTag(null, "op"); out.attribute(null, "n", Integer.toString(op.getOp())); - if (op.getMode() != AppOpsManager.opToDefaultMode(op.getOp())) { + out.attribute(null, "ns", AppOpsManager.opToName(op.getOp())); + int defaultMode = getDefaultMode(op.getOp(), + pkg.getUid(), pkg.getPackageName()); + if (op.getMode() != defaultMode) { out.attribute(null, "m", Integer.toString(op.getMode())); + } else { + out.attribute(null, "dm", Integer.toString(defaultMode)); } long time = op.getTime(); if (time != 0) { @@ -1522,6 +1673,14 @@ void writeState() { if (proxyPackageName != null) { out.attribute(null, "pp", proxyPackageName); } + int allowed = op.getAllowedCount(); + if (allowed != 0) { + out.attribute(null, "ac", Integer.toString(allowed)); + } + int ignored = op.getIgnoredCount(); + if (ignored != 0) { + out.attribute(null, "ic", Integer.toString(ignored)); + } out.endTag(null, "op"); } out.endTag(null, "uid"); @@ -1765,14 +1924,178 @@ public void removeUser(int userHandle) throws RemoteException { private void checkSystemUid(String function) { int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID) { - throw new SecurityException(function + " must by called by the system"); + throw new SecurityException(function + + " must by called by the system"); + } + } + + final class AskRunnable implements Runnable { + final int code; + final int uid; + final String packageName; + final Op op; + final PermissionDialogReq request; + + public AskRunnable(int code, int uid, String packageName, Op op, + PermissionDialogReq request) { + super(); + this.code = code; + this.uid = uid; + this.packageName = packageName; + this.op = op; + this.request = request; + } + + @Override + public void run() { + synchronized (AppOpsService.this) { + Log.e(TAG, "Creating dialog box"); + op.dialogReqQueue.register(request); + if (op.dialogReqQueue.getDialog() == null) { + Dialog d = new PermissionDialog(mContext, + AppOpsService.this, code, uid, packageName); + op.dialogReqQueue.setDialog((PermissionDialog)d); + d.show(); + } + } + } + } + + private PermissionDialogReq askOperationLocked(int code, int uid, + String packageName, Op op) { + PermissionDialogReq request = new PermissionDialogReq(); + mHandler.post(new AskRunnable(code, uid, packageName, op, request)); + return request; + } + + private int getDefaultMode(int code, int uid, String packageName) { + int mode = AppOpsManager.opToDefaultMode(code, + isStrict(code, uid, packageName)); + if (AppOpsManager.isStrictOp(code) && mPolicy != null) { + int policyMode = mPolicy.getDefualtMode(code, packageName); + if (policyMode != AppOpsManager.MODE_ERRORED) { + mode = policyMode; + } + } + return mode; + } + + private boolean isStrict(int code, int uid, String packageName) { + if (!mStrictEnable) + return false; + + return UserHandle.isApp(uid); + } + + private void printOperationLocked(Op op, int mode, String operation) { + if(op != null) { + int switchCode = AppOpsManager.opToSwitch(op.op); + if (mode == AppOpsManager.MODE_IGNORED) { + if (DEBUG) Log.d(TAG, operation + ": reject #" + mode + " for code " + + switchCode + " (" + op.op + ") uid " + op.uid + " package " + + op.packageName); + } else if (mode == AppOpsManager.MODE_ALLOWED) { + if (DEBUG) Log.d(TAG, operation + ": allowing code " + op.op + " uid " + + op.uid + + " package " + op.packageName); + } + } + } + + private void recordOperationLocked(int code, int uid, String packageName, + int mode) { + Op op = getOpLocked(code, uid, packageName, false); + if(op != null) { + if(op.noteOpCount != 0) + printOperationLocked(op, mode, "noteOperartion"); + if(op.startOpCount != 0) + printOperationLocked(op, mode, "startOperation"); + if (mode == AppOpsManager.MODE_IGNORED) { + op.rejectTime = System.currentTimeMillis(); + } else if (mode == AppOpsManager.MODE_ALLOWED) { + if(op.noteOpCount != 0) { + op.time = System.currentTimeMillis(); + op.rejectTime = 0; + } + if(op.startOpCount != 0) { + if(op.nesting == 0) { + op.time = System.currentTimeMillis(); + op.rejectTime = 0; + op.duration = -1; + } + op.nesting = op.nesting + op.startOpCount; + while(op.clientTokens.size() != 0) { + IBinder clientToken = op.clientTokens.get(0); + ClientState client = mClients.get(clientToken); + if (client != null) { + if (client.mStartedOps != null) { + client.mStartedOps.add(op); + } + } + op.clientTokens.remove(0); + } + } + } + op.clientTokens.clear(); + op.startOpCount = 0; + op.noteOpCount = 0; + } + } + + public void notifyOperation(int code, int uid, String packageName, + int mode, boolean remember) { + verifyIncomingUid(uid); + verifyIncomingOp(code); + ArrayList repCbs = null; + int switchCode = AppOpsManager.opToSwitch(code); + synchronized (this) { + recordOperationLocked(code, uid, packageName, mode); + Op op = getOpLocked(switchCode, uid, packageName, true); + if (op != null) { + // Send result to all waiting client + if (op.dialogReqQueue.getDialog() != null) { + op.dialogReqQueue.notifyAll(mode); + op.dialogReqQueue.setDialog(null); + } + if (remember && op.mode != mode) { + op.mode = mode; + ArrayList cbs = mOpModeWatchers.get(switchCode); + if (cbs != null) { + if (repCbs == null) { + repCbs = new ArrayList(); + } + repCbs.addAll(cbs); + } + cbs = mPackageModeWatchers.get(packageName); + if (cbs != null) { + if (repCbs == null) { + repCbs = new ArrayList(); + } + repCbs.addAll(cbs); + } + if (mode == getDefaultMode(op.op, op.uid, op.packageName)) { + // If going into the default mode, prune this op + // if there is nothing else interesting in it. + pruneOp(op, uid, packageName); + } + scheduleWriteLocked(); + } + } + } + if (repCbs != null) { + for (int i = 0; i < repCbs.size(); i++) { + try { + repCbs.get(i).mCallback.opChanged(switchCode, packageName); + } catch (RemoteException e) { + } + } } } private static String[] getPackagesForUid(int uid) { String[] packageNames = null; try { - packageNames= AppGlobals.getPackageManager().getPackagesForUid(uid); + packageNames = AppGlobals.getPackageManager().getPackagesForUid(uid); } catch (RemoteException e) { /* ignore - local call */ } @@ -1781,4 +2104,75 @@ private static String[] getPackagesForUid(int uid) { } return packageNames; } + + private void broadcastOpIfNeeded(int op) { + switch (op) { + case AppOpsManager.OP_SU: + mHandler.post(mSuSessionChangedRunner); + break; + default: + break; + } + } + + private void readPolicy() { + if (mStrictEnable) { + mPolicy = new AppOpsPolicy(new File(DEFAULT_POLICY_FILE), mContext); + mPolicy.readPolicy(); + mPolicy.debugPoilcy(); + } else { + mPolicy = null; + } + } + + public boolean isControlAllowed(int code, String packageName) { + boolean isShow = true; + if (mPolicy != null) { + isShow = mPolicy.isControlAllowed(code, packageName); + } + return isShow; + } + + @Override + public boolean getPrivacyGuardSettingForPackage(int uid, String packageName) { + for (int op : PRIVACY_GUARD_OP_STATES) { + int switchOp = AppOpsManager.opToSwitch(op); + int mode = checkOperation(op, uid, packageName); + if (mode != AppOpsManager.MODE_ALLOWED && mode != AppOpsManager.MODE_IGNORED) { + return true; + } + } + return false; + } + + @Override + public void setPrivacyGuardSettingForPackage(int uid, String packageName, boolean state) { + for (int op : PRIVACY_GUARD_OP_STATES) { + int switchOp = AppOpsManager.opToSwitch(op); + setMode(switchOp, uid, packageName, state + ? AppOpsManager.MODE_ASK : AppOpsManager.MODE_ALLOWED); + } + } + + @Override + public void resetCounters() { + mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS, + Binder.getCallingPid(), Binder.getCallingUid(), null); + synchronized (this) { + for (int i=0; i ent : uidState.pkgOps.entrySet()) { + String packageName = ent.getKey(); + Ops pkgOps = ent.getValue(); + for (int j=0; j mProfileServices = - new HashMap (); + private boolean mIntentPending = false; private void registerForAirplaneMode(IntentFilter filter) { final ContentResolver resolver = mContext.getContentResolver(); @@ -619,7 +612,7 @@ public boolean enableNoAutoConnect() return true; } - public boolean enable() { + public boolean enable(String callingPackage) { if ((Binder.getCallingUid() != Process.SYSTEM_UID) && (!checkIfCallerIsForegroundUser())) { Log.w(TAG,"enable(): not allowed for non-active and non system user"); @@ -633,6 +626,13 @@ public boolean enable() { " mBinding = " + mBinding); } + AppOpsManager appOps = (AppOpsManager) mContext + .getSystemService(Context.APP_OPS_SERVICE); + int callingUid = Binder.getCallingUid(); + if (appOps.noteOp(AppOpsManager.OP_BLUETOOTH_CHANGE, callingUid, + callingPackage) != AppOpsManager.MODE_ALLOWED) + return false; + synchronized(mReceiver) { mQuietEnableExternal = false; mEnableExternal = true; @@ -707,69 +707,6 @@ public IBluetoothGatt getBluetoothGatt() { return mBluetoothGatt; } - @Override - public boolean bindBluetoothProfileService(int bluetoothProfile, - IBluetoothProfileServiceConnection proxy) { - if (!mEnable) { - if (DBG) { - Log.d(TAG, "Trying to bind to profile: " + bluetoothProfile + - ", while Bluetooth was disabled"); - } - return false; - } - synchronized (mProfileServices) { - ProfileServiceConnections psc = mProfileServices.get(new Integer(bluetoothProfile)); - if (psc == null) { - if (DBG) { - Log.d(TAG, "Creating new ProfileServiceConnections object for" - + " profile: " + bluetoothProfile); - } - - if (bluetoothProfile != BluetoothProfile.HEADSET) return false; - - Intent intent = new Intent(IBluetoothHeadset.class.getName()); - psc = new ProfileServiceConnections(intent); - if (!psc.bindService()) return false; - - mProfileServices.put(new Integer(bluetoothProfile), psc); - } - } - - // Introducing a delay to give the client app time to prepare - Message addProxyMsg = mHandler.obtainMessage(MESSAGE_ADD_PROXY_DELAYED); - addProxyMsg.arg1 = bluetoothProfile; - addProxyMsg.obj = proxy; - mHandler.sendMessageDelayed(addProxyMsg, ADD_PROXY_DELAY_MS); - return true; - } - - @Override - public void unbindBluetoothProfileService(int bluetoothProfile, - IBluetoothProfileServiceConnection proxy) { - synchronized (mProfileServices) { - ProfileServiceConnections psc = mProfileServices.get(new Integer(bluetoothProfile)); - if (psc == null) { - return; - } - psc.removeProxy(proxy); - } - } - - private void unbindAllBluetoothProfileServices() { - synchronized (mProfileServices) { - for (Integer i : mProfileServices.keySet()) { - ProfileServiceConnections psc = mProfileServices.get(i); - try { - mContext.unbindService(psc); - } catch (IllegalArgumentException e) { - Log.e(TAG, "Unable to unbind service with intent: " + psc.mIntent, e); - } - psc.removeAllProxies(); - } - mProfileServices.clear(); - } - } - /** * Send enable message and set adapter name and address. Called when the boot phase becomes * PHASE_SYSTEM_SERVICES_READY. @@ -795,148 +732,6 @@ public void handleOnSwitchUser(int userHandle) { mHandler.sendMessage(mHandler.obtainMessage(MESSAGE_USER_SWITCHED, userHandle, 0)); } - /** - * This class manages the clients connected to a given ProfileService - * and maintains the connection with that service. - */ - final private class ProfileServiceConnections implements ServiceConnection, - IBinder.DeathRecipient { - final RemoteCallbackList mProxies = - new RemoteCallbackList (); - IBinder mService; - ComponentName mClassName; - Intent mIntent; - boolean mInvokingProxyCallbacks = false; - - ProfileServiceConnections(Intent intent) { - mService = null; - mClassName = null; - mIntent = intent; - } - - private boolean bindService() { - if (mIntent != null && mService == null && - doBind(mIntent, this, 0, UserHandle.CURRENT_OR_SELF)) { - Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE); - msg.obj = this; - mHandler.sendMessageDelayed(msg, TIMEOUT_BIND_MS); - return true; - } - Log.w(TAG, "Unable to bind with intent: " + mIntent); - return false; - } - - private void addProxy(IBluetoothProfileServiceConnection proxy) { - mProxies.register(proxy); - if (mService != null) { - try{ - proxy.onServiceConnected(mClassName, mService); - } catch (RemoteException e) { - Log.e(TAG, "Unable to connect to proxy", e); - } - } else { - if (!mHandler.hasMessages(MESSAGE_BIND_PROFILE_SERVICE, this)) { - Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE); - msg.obj = this; - mHandler.sendMessage(msg); - } - } - } - - private void removeProxy(IBluetoothProfileServiceConnection proxy) { - if (proxy != null) { - if (mProxies.unregister(proxy)) { - try { - proxy.onServiceDisconnected(mClassName); - } catch (RemoteException e) { - Log.e(TAG, "Unable to disconnect proxy", e); - } - } - } else { - Log.w(TAG, "Trying to remove a null proxy"); - } - } - - private void removeAllProxies() { - onServiceDisconnected(mClassName); - mProxies.kill(); - } - - @Override - public void onServiceConnected(ComponentName className, IBinder service) { - // remove timeout message - mHandler.removeMessages(MESSAGE_BIND_PROFILE_SERVICE, this); - mService = service; - mClassName = className; - try { - mService.linkToDeath(this, 0); - } catch (RemoteException e) { - Log.e(TAG, "Unable to linkToDeath", e); - } - - if (mInvokingProxyCallbacks) { - Log.e(TAG, "Proxy callbacks already in progress."); - return; - } - mInvokingProxyCallbacks = true; - - final int n = mProxies.beginBroadcast(); - try { - for (int i = 0; i < n; i++) { - try { - mProxies.getBroadcastItem(i).onServiceConnected(className, service); - } catch (RemoteException e) { - Log.e(TAG, "Unable to connect to proxy", e); - } - } - } finally { - mProxies.finishBroadcast(); - mInvokingProxyCallbacks = false; - } - } - - @Override - public void onServiceDisconnected(ComponentName className) { - if (mService == null) return; - mService.unlinkToDeath(this, 0); - mService = null; - mClassName = null; - - if (mInvokingProxyCallbacks) { - Log.e(TAG, "Proxy callbacks already in progress."); - return; - } - mInvokingProxyCallbacks = true; - - final int n = mProxies.beginBroadcast(); - try { - for (int i = 0; i < n; i++) { - try { - mProxies.getBroadcastItem(i).onServiceDisconnected(className); - } catch (RemoteException e) { - Log.e(TAG, "Unable to disconnect from proxy", e); - } - } - } finally { - mProxies.finishBroadcast(); - mInvokingProxyCallbacks = false; - } - } - - @Override - public void binderDied() { - if (DBG) { - Log.w(TAG, "Profile service for profile: " + mClassName - + " died."); - } - onServiceDisconnected(mClassName); - // Trigger rebind - Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE); - msg.obj = this; - mHandler.sendMessageDelayed(msg, TIMEOUT_BIND_MS); - } - } - private void sendBluetoothStateCallback(boolean isUp) { try { int n = mStateChangeCallbacks.beginBroadcast(); @@ -1258,28 +1053,6 @@ public void handleMessage(Message msg) { } break; } - case MESSAGE_ADD_PROXY_DELAYED: - { - ProfileServiceConnections psc = mProfileServices.get( - new Integer(msg.arg1)); - if (psc == null) { - break; - } - IBluetoothProfileServiceConnection proxy = - (IBluetoothProfileServiceConnection) msg.obj; - psc.addProxy(proxy); - break; - } - case MESSAGE_BIND_PROFILE_SERVICE: - { - ProfileServiceConnections psc = (ProfileServiceConnections) msg.obj; - removeMessages(MESSAGE_BIND_PROFILE_SERVICE, msg.obj); - if (psc == null) { - break; - } - psc.bindService(); - break; - } case MESSAGE_BLUETOOTH_SERVICE_CONNECTED: { if (DBG) Log.d(TAG,"MESSAGE_BLUETOOTH_SERVICE_CONNECTED: " + msg.arg1); @@ -1483,20 +1256,19 @@ public void handleMessage(Message msg) { mState = BluetoothAdapter.STATE_TURNING_ON; } - waitForOnOff(true, false); + waitForMonitoredOnOff(true, false); if (mState == BluetoothAdapter.STATE_TURNING_ON) { bluetoothStateChangeHandler(mState, BluetoothAdapter.STATE_ON); } - unbindAllBluetoothProfileServices(); // disable handleDisable(); // Pbap service need receive STATE_TURNING_OFF intent to close bluetoothStateChangeHandler(BluetoothAdapter.STATE_ON, BluetoothAdapter.STATE_TURNING_OFF); - waitForOnOff(false, true); + waitForMonitoredOnOff(false, true); bluetoothStateChangeHandler(BluetoothAdapter.STATE_TURNING_OFF, BluetoothAdapter.STATE_OFF); @@ -1666,7 +1438,11 @@ private void bluetoothStateChangeHandler(int prevState, int newState) { unbindAndFinish(); sendBleStateChanged(prevState, newState); // Don't broadcast as it has already been broadcast before - isStandardBroadcast = false; + if(!mIntentPending) { + isStandardBroadcast = false; + } else { + mIntentPending = false; + } } } else if (!intermediate_off) { @@ -1695,6 +1471,13 @@ private void bluetoothStateChangeHandler(int prevState, int newState) { // Broadcast as STATE_OFF newState = BluetoothAdapter.STATE_OFF; sendBrEdrDownCallback(); + if(!isBleAppPresent()){ + isStandardBroadcast = false; + mIntentPending = true; + } else { + mIntentPending = false; + isStandardBroadcast = true; + } } } else if (newState == BluetoothAdapter.STATE_ON) { boolean isUp = (newState==BluetoothAdapter.STATE_ON); @@ -1711,15 +1494,25 @@ private void bluetoothStateChangeHandler(int prevState, int newState) { sendBleStateChanged(prevState, newState); } + if( newState == BluetoothAdapter.STATE_TURNING_ON + && prevState == BluetoothAdapter.STATE_BLE_ON) { + mEnable = true; + } + if (isStandardBroadcast) { if (prevState == BluetoothAdapter.STATE_BLE_ON) { // Show prevState of BLE_ON as OFF to standard users prevState = BluetoothAdapter.STATE_OFF; } + else if (prevState == BluetoothAdapter.STATE_BLE_TURNING_OFF) { + // show prevState to TURNING_OFF + prevState = BluetoothAdapter.STATE_TURNING_OFF; + } Intent intent = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED); intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); mContext.sendBroadcastAsUser(intent, UserHandle.ALL, BLUETOOTH_PERM); } } @@ -1759,6 +1552,48 @@ private boolean waitForOnOff(boolean on, boolean off) { return false; } + /** + * if on is true, wait for state become ON + * if off is true, wait for state become OFF + * if both on and off are false, wait for state not ON + */ + private boolean waitForMonitoredOnOff(boolean on, boolean off) { + int i = 0; + while (i < 10) { + synchronized(mConnection) { + try { + if (mBluetooth == null) break; + if (on) { + if (mBluetooth.getState() == BluetoothAdapter.STATE_ON) return true; + if (mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) { + bluetoothStateChangeHandler(BluetoothAdapter.STATE_BLE_TURNING_ON, + BluetoothAdapter.STATE_BLE_ON); + } + } else if (off) { + if (mBluetooth.getState() == BluetoothAdapter.STATE_OFF) return true; + if (mBluetooth.getState() == BluetoothAdapter.STATE_BLE_ON) { + bluetoothStateChangeHandler(BluetoothAdapter.STATE_TURNING_OFF, + BluetoothAdapter.STATE_BLE_ON); + } + } else { + if (mBluetooth.getState() != BluetoothAdapter.STATE_ON) return true; + } + } catch (RemoteException e) { + Log.e(TAG, "getState()", e); + break; + } + } + if (on || off) { + SystemClock.sleep(800); + } else { + SystemClock.sleep(50); + } + i++; + } + Log.e(TAG,"waitForOnOff time out"); + return false; + } + private void sendDisableMsg() { mHandler.sendMessage(mHandler.obtainMessage(MESSAGE_DISABLE)); } diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 75f5c154003..5d12612d9bb 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -71,6 +71,7 @@ import android.net.RouteInfo; import android.net.UidRange; import android.net.Uri; +import android.net.wifi.WifiDevice; import android.os.Binder; import android.os.Bundle; import android.os.FileUtils; @@ -2593,6 +2594,14 @@ public void handleMessage(Message msg) { } } + public List getTetherConnectedSta() { + if (isTetheringSupported()) { + return mTethering.getTetherConnectedSta(); + } else { + return null; + } + } + // javadoc from interface public int tether(String iface) { ConnectivityManager.enforceTetherChangePermission(mContext); diff --git a/services/core/java/com/android/server/DeviceIdleController.java b/services/core/java/com/android/server/DeviceIdleController.java index a057ac9dea5..71650c36e5a 100644 --- a/services/core/java/com/android/server/DeviceIdleController.java +++ b/services/core/java/com/android/server/DeviceIdleController.java @@ -796,6 +796,12 @@ private final class BinderService extends IDeviceIdleController.Stub { return isPowerSaveWhitelistExceptIdleAppInternal(name); } + @Override public int getIdleStateDetailed() { + getContext().enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, + null); + return mState; + } + @Override public boolean isPowerSaveWhitelistApp(String name) { return isPowerSaveWhitelistAppInternal(name); } @@ -1269,7 +1275,7 @@ void updateChargingLocked(boolean charging) { void scheduleReportActiveLocked(String activeReason, int activeUid) { Message msg = mHandler.obtainMessage(MSG_REPORT_ACTIVE, activeUid, - mState == STATE_IDLE ? 1 : 0, activeReason); + ((mState == STATE_IDLE) || (mState == STATE_IDLE_MAINTENANCE)) ? 1 : 0, activeReason); mHandler.sendMessage(msg); } diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java index 468ead0e9c9..ebe875964ed 100644 --- a/services/core/java/com/android/server/LocationManagerService.java +++ b/services/core/java/com/android/server/LocationManagerService.java @@ -64,6 +64,7 @@ import android.location.IGpsGeofenceHardware; import android.location.IGpsMeasurementsListener; import android.location.IGpsNavigationMessageListener; +import android.location.GeoFenceParams; import android.location.IGpsStatusListener; import android.location.IGpsStatusProvider; import android.location.ILocationListener; @@ -90,6 +91,28 @@ import android.util.Log; import android.util.Slog; +import com.android.internal.content.PackageMonitor; +import com.android.internal.location.ProviderProperties; +import com.android.internal.location.ProviderRequest; +import com.android.internal.os.BackgroundThread; +import com.android.server.location.FlpHardwareProvider; +import com.android.server.location.FusedProxy; +import com.android.server.location.GeocoderProxy; +import com.android.server.location.GeofenceProxy; +import com.android.server.location.GeofenceManager; +import com.android.server.location.GeoFencerBase; +import com.android.server.location.GeoFencerProxy; +import com.android.server.location.GpsLocationProvider; +import com.android.server.location.LocationBlacklist; +import com.android.server.location.LocationFudger; +import com.android.server.location.LocationProviderInterface; +import com.android.server.location.LocationProviderProxy; +import com.android.server.location.LocationRequestStatistics; +import com.android.server.location.LocationRequestStatistics.PackageProviderKey; +import com.android.server.location.LocationRequestStatistics.PackageStatistics; +import com.android.server.location.MockProvider; +import com.android.server.location.PassiveProvider; + import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; @@ -154,6 +177,11 @@ public class LocationManagerService extends ILocationManager.Stub { private LocationFudger mLocationFudger; private GeofenceManager mGeofenceManager; private PackageManager mPackageManager; + private String mComboNlpPackageName; + private String mComboNlpReadyMarker; + private String mComboNlpScreenMarker; + private String mGeoFencerPackageName; + private GeoFencerBase mGeoFencer; private PowerManager mPowerManager; private UserManager mUserManager; private GeocoderProxy mGeocodeProvider; @@ -509,6 +537,15 @@ Load package name(s) containing location provider support. Slog.e(TAG, "no geocoder provider found"); } + mGeoFencerPackageName = resources.getString( + com.android.internal.R.string.config_geofenceProvider); + if (mGeoFencerPackageName != null && + mPackageManager.resolveService(new Intent(mGeoFencerPackageName), 0) != null){ + mGeoFencer = GeoFencerProxy.getGeoFencerProxy(mContext, mGeoFencerPackageName); + } else { + mGeoFencer = null; + } + // bind to fused hardware provider if supported // in devices without support, requesting an instance of FlpHardwareProvider will raise an // exception, so make sure we only do that when supported @@ -562,6 +599,13 @@ Load package name(s) containing location provider support. Slog.e(TAG, "Unable to bind ActivityRecognitionProxy."); } + mComboNlpPackageName = resources.getString( + com.android.internal.R.string.config_comboNetworkLocationProvider); + if (mComboNlpPackageName != null) { + mComboNlpReadyMarker = mComboNlpPackageName + ".nlp:ready"; + mComboNlpScreenMarker = mComboNlpPackageName + ".nlp:screen"; + } + String[] testProviderStrings = resources.getStringArray( com.android.internal.R.array.config_testLocationProviders); for (String testProviderString : testProviderStrings) { @@ -1614,9 +1658,11 @@ public void requestLocationUpdates(LocationRequest request, ILocationListener li checkLocationAccess(pid, uid, packageName, allowedResolutionLevel); synchronized (mLock) { - Receiver recevier = checkListenerOrIntentLocked(listener, intent, pid, uid, + Receiver receiver = checkListenerOrIntentLocked(listener, intent, pid, uid, packageName, workSource, hideFromAppOps); - requestLocationUpdatesLocked(sanitizedRequest, recevier, pid, uid, packageName); + if (receiver != null) { + requestLocationUpdatesLocked(sanitizedRequest, receiver, pid, uid, packageName); + } } } finally { Binder.restoreCallingIdentity(identity); @@ -1675,7 +1721,9 @@ public void removeUpdates(ILocationListener listener, PendingIntent intent, // providers may use public location API's, need to clear identity long identity = Binder.clearCallingIdentity(); try { - removeUpdatesLocked(receiver); + if (receiver != null) { + removeUpdatesLocked(receiver); + } } finally { Binder.restoreCallingIdentity(identity); } @@ -1814,8 +1862,20 @@ public void requestGeofence(LocationRequest request, Geofence geofence, PendingI } long identity = Binder.clearCallingIdentity(); try { - mGeofenceManager.addFence(sanitizedRequest, geofence, intent, allowedResolutionLevel, - uid, packageName); + if (mGeoFencer != null) { + long expiration; + if (sanitizedRequest.getExpireAt() == Long.MAX_VALUE) { + expiration = -1; // -1 means forever + } else { + expiration = sanitizedRequest.getExpireAt() - SystemClock.elapsedRealtime(); + } + mGeoFencer.add(new GeoFenceParams(uid, geofence.getLatitude(), + geofence.getLongitude(), geofence.getRadius(), + expiration, intent, packageName)); + } else { + mGeofenceManager.addFence(sanitizedRequest, geofence, intent, + allowedResolutionLevel, uid, packageName); + } } finally { Binder.restoreCallingIdentity(identity); } @@ -1831,7 +1891,11 @@ public void removeGeofence(Geofence geofence, PendingIntent intent, String packa // geo-fence manager uses the public location API, need to clear identity long identity = Binder.clearCallingIdentity(); try { - mGeofenceManager.removeFence(geofence, intent); + if (mGeoFencer != null) { + mGeoFencer.remove(intent); + } else { + mGeofenceManager.removeFence(geofence, intent); + } } finally { Binder.restoreCallingIdentity(identity); } @@ -2332,6 +2396,70 @@ private boolean isMockProvider(String provider) { synchronized (mLock) { return mMockProviders.containsKey(provider); } + + } + + private Location screenLocationLocked(Location location, String provider) { + if (isMockProvider(LocationManager.NETWORK_PROVIDER)) { + return location; + } + LocationProviderProxy providerProxy = + (LocationProviderProxy)mProvidersByName.get(LocationManager.NETWORK_PROVIDER); + if (mComboNlpPackageName == null || providerProxy == null || + false == provider.equals(LocationManager.NETWORK_PROVIDER) || + isMockProvider(LocationManager.NETWORK_PROVIDER)) { + return location; + } + + String connectedNlpPackage = providerProxy.getConnectedPackageName(); + if (connectedNlpPackage == null || !connectedNlpPackage.equals(mComboNlpPackageName)) { + return location; + } + + Bundle extras = location.getExtras(); + boolean isBeingScreened = false; + if (extras == null) { + extras = new Bundle(); + } + + if (!extras.containsKey(mComboNlpReadyMarker)) { + // see if Combo Nlp is a passive listener + ArrayList records = + mRecordsByProvider.get(LocationManager.PASSIVE_PROVIDER); + if (records != null) { + for (UpdateRecord r : records) { + if (r.mReceiver.mPackageName.equals(mComboNlpPackageName)) { + if (!isBeingScreened) { + isBeingScreened = true; + extras.putBoolean(mComboNlpScreenMarker, true); + } + // send location to Combo Nlp for screening + if (!r.mReceiver.callLocationChangedLocked(location)) { + Slog.w(TAG, "RemoteException calling onLocationChanged on " + + r.mReceiver); + } else { + if (D) { + Log.d(TAG, "Sending location for screening"); + } + } + } + } + } + if (isBeingScreened) { + return null; + } + if (D) { + Log.d(TAG, "Not screening locations"); + } + } else { + if (D) { + Log.d(TAG, "This location is marked as ready for broadcast"); + } + // clear the ready marker + extras.remove(mComboNlpReadyMarker); + } + + return location; } private void handleLocationChanged(Location location, boolean passive) { @@ -2350,6 +2478,10 @@ private void handleLocationChanged(Location location, boolean passive) { synchronized (mLock) { if (isAllowedByCurrentUserSettingsLocked(provider)) { if (!passive) { + location = screenLocationLocked(location, provider); + if (location == null) { + return; + } // notify passive provider of the new location mPassiveProvider.updateLocation(myLocation); } @@ -2655,6 +2787,10 @@ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { mGeofenceManager.dump(pw); + if (mGeoFencer != null) { + mGeoFencer.dump(pw, ""); + } + if (mEnabledProviders.size() > 0) { pw.println(" Enabled Providers:"); for (String i : mEnabledProviders) { diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index 45e7b5eb83d..25fb719f36a 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -58,6 +58,9 @@ import java.util.Arrays; import java.util.List; +import java.util.Timer; +import java.util.TimerTask; + /** * Keeps the lock pattern/password data and related settings for each user. * Used by LockPatternUtils. Needs to be a service because Settings app also needs @@ -70,6 +73,8 @@ public class LockSettingsService extends ILockSettings.Stub { private static final String TAG = "LockSettingsService"; + private static final String DEFAULT_PASSWORD = "default_password"; + private final Context mContext; private final LockSettingsStorage mStorage; @@ -78,6 +83,7 @@ public class LockSettingsService extends ILockSettings.Stub { private LockPatternUtils mLockPatternUtils; private boolean mFirstCallToVold; private IGateKeeperService mGateKeeperService; + private static String mSavePassword = DEFAULT_PASSWORD; private interface CredentialUtil { void setCredential(String credential, String savedCredential, int userId) @@ -371,6 +377,25 @@ public boolean havePattern(int userId) throws RemoteException { return mStorage.hasPattern(userId); } + public void retainPassword(String password) { + if (LockPatternUtils.isDeviceEncryptionEnabled()) { + if (password != null) + mSavePassword = password; + else + mSavePassword = DEFAULT_PASSWORD; + } + } + + public void sanitizePassword() { + if (LockPatternUtils.isDeviceEncryptionEnabled()) { + mSavePassword = DEFAULT_PASSWORD; + } + } + + public String getPassword() { + return mSavePassword; + } + private void setKeystorePassword(String password, int userHandle) { final UserManager um = (UserManager) mContext.getSystemService(USER_SERVICE); final KeyStore ks = KeyStore.getInstance(); @@ -557,6 +582,8 @@ public String adjustForKeystore(String pattern) { && shouldReEnrollBaseZero) { setLockPattern(pattern, patternToVerify, userId); } + if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) + retainPassword(pattern); return response; @@ -565,7 +592,10 @@ public String adjustForKeystore(String pattern) { @Override public VerifyCredentialResponse checkPassword(String password, int userId) throws RemoteException { - return doVerifyPassword(password, false, 0, userId); + VerifyCredentialResponse response = doVerifyPassword(password, false, 0, userId); + if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) + retainPassword(password); + return response; } @Override diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 5e674145da3..8af43ca2d81 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -2400,7 +2400,7 @@ public void run() { } } - public int encryptStorage(int type, String password) { + private int encryptStorageExtended(int type, String password, boolean wipe) { if (TextUtils.isEmpty(password) && type != StorageManager.CRYPT_TYPE_DEFAULT) { throw new IllegalArgumentException("password cannot be empty"); } @@ -2416,10 +2416,10 @@ public int encryptStorage(int type, String password) { try { if (type == StorageManager.CRYPT_TYPE_DEFAULT) { - mCryptConnector.execute("cryptfs", "enablecrypto", "inplace", + mCryptConnector.execute("cryptfs", "enablecrypto", wipe ? "wipe" : "inplace", CRYPTO_TYPES[type]); } else { - mCryptConnector.execute("cryptfs", "enablecrypto", "inplace", + mCryptConnector.execute("cryptfs", "enablecrypto", wipe ? "wipe" : "inplace", CRYPTO_TYPES[type], new SensitiveArg(password)); } } catch (NativeDaemonConnectorException e) { @@ -2430,6 +2430,22 @@ public int encryptStorage(int type, String password) { return 0; } + /** Encrypt Storage given a password. + * @param type The password type. + * @param password The password to be used in encryption. + */ + public int encryptStorage(int type, String password) { + return encryptStorageExtended(type, password, false); + } + + /** Encrypt Storage given a password after wiping it. + * @param type The password type. + * @param password The password to be used in encryption. + */ + public int encryptWipeStorage(int type, String password) { + return encryptStorageExtended(type, password, true); + } + /** Set the password for encrypting the master key. * @param type One of the CRYPTO_TYPE_XXX consts defined in StorageManager. * @param password The password to set. @@ -2444,9 +2460,13 @@ public int changeEncryptionPassword(int type, String password) { Slog.i(TAG, "changing encryption password..."); } + LockSettingsService lockSettings = new LockSettingsService(mContext); + String currentPassword = lockSettings.getPassword(); + try { NativeDaemonEvent event = mCryptConnector.execute("cryptfs", "changepw", CRYPTO_TYPES[type], - new SensitiveArg(password)); + new SensitiveArg(currentPassword), new SensitiveArg(password)); + lockSettings.sanitizePassword(); return Integer.parseInt(event.getMessage()); } catch (NativeDaemonConnectorException e) { // Encryption failed diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java index ba9279c53d7..64083b6f65f 100644 --- a/services/core/java/com/android/server/NetworkManagementService.java +++ b/services/core/java/com/android/server/NetworkManagementService.java @@ -170,6 +170,7 @@ class NetdResponseCode { public static final int InterfaceDnsServerInfo = 615; public static final int RouteChange = 616; public static final int StrictCleartext = 617; + public static final int InterfaceMessage = 618; } static final int DAEMON_MSG_MOBILE_CONN_REAL_TIME_INFO = 1; @@ -519,6 +520,21 @@ private void notifyInterfaceClassActivity(int type, int powerState, long tsNanos } } + /** + * Notify our observers of a change in the data activity state of the interface + */ + private void notifyInterfaceMessage(String message) { + final int length = mObservers.beginBroadcast(); + for (int i = 0; i < length; i++) { + try { + mObservers.getBroadcastItem(i).interfaceMessageRecevied(message); + } catch (RemoteException e) { + } catch (RuntimeException e) { + } + } + mObservers.finishBroadcast(); + } + /** * Prepare native daemon once connected, enabling modules and pushing any * existing in-memory rules. @@ -789,6 +805,22 @@ public boolean onEvent(int code, String raw, String[] cooked) { } throw new IllegalStateException(errorMessage); // break; + case NetdResponseCode.InterfaceMessage: + /* + * An message arrived in network interface. + * Format: "NNN IfaceMessage <3>AP-STA-CONNECTED 00:08:22:64:9d:84 + */ + if (cooked.length < 3 || !cooked[1].equals("IfaceMessage")) { + throw new IllegalStateException(errorMessage); + } + Slog.d(TAG, "onEvent: "+ raw); + if(cooked[4] != null) { + notifyInterfaceMessage(cooked[3] + " " + cooked[4]); + } else { + notifyInterfaceMessage(cooked[3]); + } + return true; + // break; case NetdResponseCode.InterfaceClassActivity: /* * An network interface class state changed (active/idle) diff --git a/services/core/java/com/android/server/PermissionDialog.java b/services/core/java/com/android/server/PermissionDialog.java new file mode 100644 index 00000000000..8f80e684455 --- /dev/null +++ b/services/core/java/com/android/server/PermissionDialog.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution. + * + * Copyright (C) 2006 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 com.android.server; + +import android.app.AppOpsManager; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.Resources; +import android.os.Handler; +import android.os.Message; +import android.view.View; +import android.view.WindowManager; +import android.widget.CheckBox; +import android.widget.TextView; + +public class PermissionDialog extends BasePermissionDialog { + private final static String TAG = "PermissionDialog"; + + private final AppOpsService mService; + private final String mPackageName; + private final int mCode; + private View mView; + private CheckBox mChoice; + private int mUid; + final CharSequence[] mOpLabels; + private Context mContext; + + // Event 'what' codes + static final int ACTION_ALLOWED = 0x2; + static final int ACTION_IGNORED = 0x4; + static final int ACTION_IGNORED_TIMEOUT = 0x8; + + // 15s timeout, then we automatically dismiss the permission + // dialog. Otherwise, it may cause watchdog timeout sometimes. + static final long DISMISS_TIMEOUT = 1000 * 15 * 1; + + public PermissionDialog(Context context, AppOpsService service, + int code, int uid, String packageName) { + super(context); + + mContext = context; + Resources res = context.getResources(); + + mService = service; + mCode = code; + mPackageName = packageName; + mUid = uid; + mOpLabels = res.getTextArray( + com.android.internal.R.array.app_ops_labels); + + setCancelable(false); + + setButton(DialogInterface.BUTTON_POSITIVE, + res.getString(com.android.internal.R.string.allow), + mHandler.obtainMessage(ACTION_ALLOWED)); + + setButton(DialogInterface.BUTTON_NEGATIVE, + res.getString(com.android.internal.R.string.deny), + mHandler.obtainMessage(ACTION_IGNORED)); + + setTitle(res.getString(com.android.internal.R.string.privacy_guard_dialog_title)); + WindowManager.LayoutParams attrs = getWindow().getAttributes(); + attrs.setTitle("Permission info: " + getAppName(mPackageName)); + attrs.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR + | WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; + getWindow().setAttributes(attrs); + + mView = getLayoutInflater().inflate( + com.android.internal.R.layout.permission_confirmation_dialog, + null); + TextView tv = (TextView) mView.findViewById( + com.android.internal.R.id.permission_text); + mChoice = (CheckBox) mView.findViewById( + com.android.internal.R.id.permission_remember_choice_checkbox); + String name = getAppName(mPackageName); + if(name == null) + name = mPackageName; + tv.setText(mContext.getString(com.android.internal.R.string.privacy_guard_dialog_summary, + name, mOpLabels[mCode])); + setView(mView); + + // After the timeout, pretend the user clicked the quit button + mHandler.sendMessageDelayed( + mHandler.obtainMessage(ACTION_IGNORED_TIMEOUT), DISMISS_TIMEOUT); + } + + private String getAppName(String packageName) { + ApplicationInfo appInfo = null; + PackageManager pm = mContext.getPackageManager(); + try { + appInfo = pm.getApplicationInfo(packageName, + PackageManager.GET_DISABLED_COMPONENTS + | PackageManager.GET_UNINSTALLED_PACKAGES); + } catch (final NameNotFoundException e) { + return null; + } + if(appInfo != null) { + return (String)pm.getApplicationLabel(appInfo); + } + return null; + } + + private final Handler mHandler = new Handler() { + public void handleMessage(Message msg) { + int mode; + boolean remember = mChoice.isChecked(); + switch(msg.what) { + case ACTION_ALLOWED: + mode = AppOpsManager.MODE_ALLOWED; + break; + case ACTION_IGNORED: + mode = AppOpsManager.MODE_IGNORED; + break; + default: + mode = AppOpsManager.MODE_IGNORED; + remember = false; + } + mService.notifyOperation(mCode, mUid, mPackageName, mode, + remember); + dismiss(); + } + }; +} diff --git a/services/core/java/com/android/server/PermissionDialogReqQueue.java b/services/core/java/com/android/server/PermissionDialogReqQueue.java new file mode 100644 index 00000000000..ee944271f34 --- /dev/null +++ b/services/core/java/com/android/server/PermissionDialogReqQueue.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution. + * + * Copyright (C) 2006 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 com.android.server; + +import java.util.ArrayList; +import java.util.List; + +public class PermissionDialogReqQueue { + public PermissionDialog getDialog() { + return mDialog; + } + + public void setDialog(PermissionDialog mDialog) { + this.mDialog = mDialog; + } + + public final static class PermissionDialogReq { + public void set(int res) { + synchronized (this) { + mHasResult = true; + mResult = res; + notifyAll(); + } + } + + public int get() { + synchronized (this) { + while (!mHasResult) { + try { + wait(); + } catch (InterruptedException e) { + } + } + } + return mResult; + } + + boolean mHasResult = false; + int mResult; + } + + private PermissionDialog mDialog; + private List resultList; + + public PermissionDialogReqQueue() { + mDialog = null; + resultList = new ArrayList(); + } + + public void register(PermissionDialogReq res) { + synchronized (this) { + resultList.add(res); + } + } + + public void notifyAll(int mode) { + synchronized (this) { + while (resultList.size() != 0) { + PermissionDialogReq res = resultList.get(0); + res.set(mode); + resultList.remove(0); + } + } + } +} diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java index 772a15c1bf6..22529a3799a 100644 --- a/services/core/java/com/android/server/Watchdog.java +++ b/services/core/java/com/android/server/Watchdog.java @@ -42,6 +42,8 @@ import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Date; +import java.text.SimpleDateFormat; /** This class calls its monitor every minute. Killing this process if they don't return **/ public class Watchdog extends Thread { @@ -80,6 +82,7 @@ public class Watchdog extends Thread { int mPhonePid; IActivityController mController; boolean mAllowRestart = true; + SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS"); /** * Used for checking status of handle threads and scheduling monitor callbacks. @@ -428,9 +431,22 @@ public void run() { dumpKernelStackTraces(); } - // Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log - doSysRq('w'); - doSysRq('l'); + String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null); + String traceFileNameAmendment = "_SystemServer_WDT" + mTraceDateFormat.format(new Date()); + + if (tracesPath != null && tracesPath.length() != 0) { + File traceRenameFile = new File(tracesPath); + String newTracesPath; + int lpos = tracesPath.lastIndexOf ("."); + if (-1 != lpos) + newTracesPath = tracesPath.substring (0, lpos) + traceFileNameAmendment + tracesPath.substring (lpos); + else + newTracesPath = tracesPath + traceFileNameAmendment; + traceRenameFile.renameTo(new File(newTracesPath)); + tracesPath = newTracesPath; + } + + final File newFd = new File(tracesPath); // Try to add the error to the dropbox, but assuming that the ActivityManager // itself may be deadlocked. (which has happened, causing this statement to @@ -439,7 +455,7 @@ public void run() { public void run() { mActivity.addErrorToDropBox( "watchdog", null, "system_server", null, null, - subject, null, stack, null); + subject, null, newFd, null); } }; dropboxThread.start(); @@ -447,6 +463,24 @@ public void run() { dropboxThread.join(2000); // wait up to 2 seconds for it to return. } catch (InterruptedException ignored) {} + // Trigger the kernel to dump all blocked threads, and backtraces on all CPUs to the kernel log + Slog.e(TAG, "Triggering SysRq for system_server watchdog"); + doSysRq('w'); + doSysRq('l'); + + // At times, when user space watchdog traces don't give an indication on + // which component held a lock, because of which other threads are blocked, + // (thereby causing Watchdog), crash the device to analyze RAM dumps + boolean crashOnWatchdog = SystemProperties + .getBoolean("persist.sys.crashOnWatchdog", false); + if (crashOnWatchdog) { + // wait until the above blocked threads be dumped into kernel log + SystemClock.sleep(3000); + + // now try to crash the target + doSysRq('c'); + } + IActivityController controller; synchronized (this) { controller = mController; diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java index 3c6de07a33a..1e0cf0a3d35 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java @@ -528,6 +528,7 @@ public void onServiceChanged(AuthenticatorDescription desc, int userId, boolean @Override public String getPassword(Account account) { + android.util.SeempLog.record(14); int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "getPassword: " + account @@ -627,6 +628,7 @@ private String readPreviousNameInternal(UserAccounts accounts, Account account) @Override public String getUserData(Account account, String key) { + android.util.SeempLog.record(15); final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { String msg = String.format("getUserData( account: %s, key: %s, callerUid: %s, pid: %s", @@ -1199,6 +1201,7 @@ private Account renameAccountInternal( @Override public void removeAccount(IAccountManagerResponse response, Account account, boolean expectActivityLaunch) { + android.util.SeempLog.record(17); removeAccountAsUser( response, account, @@ -1587,6 +1590,7 @@ public void setAuthToken(Account account, String authTokenType, String authToken @Override public void setPassword(Account account, String password) { + android.util.SeempLog.record(18); final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "setAuthToken: " + account @@ -1651,6 +1655,7 @@ private void sendAccountsChangedBroadcast(int userId) { @Override public void clearPassword(Account account) { + android.util.SeempLog.record(19); final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "clearPassword: " + account @@ -1677,6 +1682,7 @@ public void clearPassword(Account account) { @Override public void setUserData(Account account, String key, String value) { + android.util.SeempLog.record(20); final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "setUserData: " + account @@ -2116,6 +2122,7 @@ private Integer getSigninRequiredNotificationId(UserAccounts accounts, Account a public void addAccount(final IAccountManagerResponse response, final String accountType, final String authTokenType, final String[] requiredFeatures, final boolean expectActivityLaunch, final Bundle optionsIn) { + android.util.SeempLog.record(16); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "addAccount: accountType " + accountType + ", response " + response @@ -2369,6 +2376,7 @@ protected String toDebugString(long now) { @Override public void editProperties(IAccountManagerResponse response, final String accountType, final boolean expectActivityLaunch) { + android.util.SeempLog.record(21); final int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "editProperties: accountType " + accountType diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 970f1b5f2c8..ffdcd7bf7ce 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -121,6 +121,10 @@ public final class ActiveServices { // at the same time. final int mMaxStartingBackground; + // Flag to reschedule the services during app launch. Disable by default. + private static final boolean SERVICE_RESCHEDULE + = SystemProperties.getBoolean("ro.am.reschedule_service", false); + final SparseArray mServiceMap = new SparseArray<>(); /** @@ -1229,6 +1233,14 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r, r.pendingStarts.add(0, si); long dur = SystemClock.uptimeMillis() - si.deliveredTime; dur *= 2; + if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) { + Slog.w(TAG,"Can add more delay !!!" + +" si.deliveredTime "+si.deliveredTime + +" dur "+dur + +" si.deliveryCount "+si.deliveryCount + +" si.doneExecutingCount "+si.doneExecutingCount + +" allowCancel "+allowCancel); + } if (minDuration < dur) minDuration = dur; if (resetTime < dur) resetTime = dur; } else { @@ -1241,6 +1253,13 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r, } r.totalRestartCount++; + if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) { + Slog.w(TAG,"r.name "+r.name+" N "+N+" minDuration "+minDuration + +" resetTime "+resetTime+" now "+now + +" r.restartDelay "+r.restartDelay + +" r.restartTime+resetTime "+(r.restartTime+resetTime) + +" allowCancel "+allowCancel); + } if (r.restartDelay == 0) { r.restartCount++; r.restartDelay = minDuration; @@ -1262,6 +1281,14 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r, } r.nextRestartTime = now + r.restartDelay; + if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) { + Slog.w(TAG,"r.name "+r.name+" N "+N+" minDuration "+minDuration + +" resetTime "+resetTime+" now "+now + +" r.restartDelay "+r.restartDelay + +" r.restartTime+resetTime "+(r.restartTime+resetTime) + +" r.nextRestartTime "+r.nextRestartTime + +" allowCancel "+allowCancel); + } // Make sure that we don't end up restarting a bunch of services // all at the same time. @@ -1304,6 +1331,15 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r, r.nextRestartTime = SystemClock.uptimeMillis() + r.restartDelay; Slog.w(TAG, "Scheduling restart of crashed service " + r.shortName + " in " + r.restartDelay + "ms"); + + if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) { + for (int i=mRestartingServices.size()-1; i>=0; i--) { + ServiceRecord r2 = mRestartingServices.get(i); + Slog.w(TAG,"Restarting list - i "+i+" r2.nextRestartTime " + +r2.nextRestartTime+" r2.name "+r2.name); + } + } + EventLog.writeEvent(EventLogTags.AM_SCHEDULE_SERVICE_RESTART, r.userId, r.shortName, r.restartDelay); @@ -1324,7 +1360,31 @@ final void performServiceRestartLocked(ServiceRecord r) { return; } try { - bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true); + if(SERVICE_RESCHEDULE == true) { + boolean shouldDelay = false; + ActivityRecord top_rc = null; + ActivityStack stack = mAm.getFocusedStack(); + if(stack != null) { + top_rc = stack.topRunningActivityLocked(null); + } + if(top_rc != null) { + if(!top_rc.nowVisible && !r.shortName.contains(top_rc.packageName)) { + shouldDelay = true; + } + } + if(!shouldDelay) { + bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true); + } else { + if (DEBUG_DELAYED_SERVICE) { + Slog.v(TAG, "Reschedule service restart due to app launch" + +" r.shortName "+r.shortName+" r.app = "+r.app); + } + r.resetRestartCounter(); + scheduleServiceRestartLocked(r, true); + } + } else { + bringUpServiceLocked(r, r.intent.getIntent().getFlags(), r.createdFromFg, true); + } } catch (TransactionTooLargeException e) { // Ignore, it's been logged and nothing upstack cares. } @@ -1547,6 +1607,11 @@ private final void realStartServiceLocked(ServiceRecord r, if (newService) { app.services.remove(r); r.app = null; + if (SERVICE_RESCHEDULE && DEBUG_DELAYED_SERVICE) { + Slog.w(TAG, " Failed to create Service !!!! ." + +"This will introduce huge delay... " + +r.shortName + " in " + r.restartDelay + "ms"); + } } // Retry. diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index ba916ad1496..0bb9eeeb40b 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1,6 +1,7 @@ /* * Copyright (C) 2006-2008 The Android Open Source Project - * + * Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. + * Not a Contribution. * 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 @@ -259,6 +260,8 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import java.util.Date; +import java.text.SimpleDateFormat; public final class ActivityManagerService extends ActivityManagerNative implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback { @@ -292,6 +295,11 @@ public final class ActivityManagerService extends ActivityManagerNative private static final String TAG_VISIBILITY = TAG + POSTFIX_VISIBILITY; private static final String TAG_VISIBLE_BEHIND = TAG + POSTFIX_VISIBLE_BEHIND; + private static final String ACTION_POWER_OFF_ALARM = + "org.codeaurora.alarm.action.POWER_OFF_ALARM"; + + private static final String POWER_OFF_ALARM = "powerOffAlarm"; + /** Control over CPU and battery monitoring */ // write battery stats every 30 minutes. static final long BATTERY_STATS_TIME = 30 * 60 * 1000; @@ -411,6 +419,8 @@ public final class ActivityManagerService extends ActivityManagerNative // Necessary ApplicationInfo flags to mark an app as persistent private static final int PERSISTENT_MASK = ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PERSISTENT; + private boolean mHomeKilled = false; + private String mHomeProcessName = null; // Delay to disable app launch boost @@ -501,6 +511,8 @@ BroadcastQueue broadcastQueueForIntent(Intent intent) { */ String mDeviceOwnerName; + SimpleDateFormat mTraceDateFormat = new SimpleDateFormat("dd_MMM_HH_mm_ss.SSS"); + public class PendingAssistExtras extends Binder implements Runnable { public final ActivityRecord activity; public final Bundle extras; @@ -1381,6 +1393,8 @@ public void binderDied() { static final int SHUTDOWN_UI_AUTOMATION_CONNECTION_MSG = 57; static final int APP_BOOST_DEACTIVATE_MSG = 58; static final int CONTENT_PROVIDER_PUBLISH_TIMEOUT_MSG = 59; + static final int POST_PRIVACY_NOTIFICATION_MSG = 60; + static final int CANCEL_PRIVACY_NOTIFICATION_MSG = 61; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; @@ -1390,6 +1404,16 @@ public void binderDied() { CompatModeDialog mCompatModeDialog; long mLastMemUsageReportTime = 0; + // Min aging threshold in milliseconds to consider a B-service + int mMinBServiceAgingTime = + SystemProperties.getInt("ro.sys.fw.bservice_age", 5000); + // Threshold for B-services when in memory pressure + int mBServiceAppThreshold = + SystemProperties.getInt("ro.sys.fw.bservice_limit", 5); + // Enable B-service aging propagation on memory pressure. + boolean mEnableBServicePropagation = + SystemProperties.getBoolean("ro.sys.fw.bservice_enable", false); + /** * Flag whether the current user is a "monkey", i.e. whether * the UI is driven by a UI automation tool. @@ -2076,6 +2100,69 @@ public void handleMessage(Message msg) { } } } break; + case POST_PRIVACY_NOTIFICATION_MSG: { + INotificationManager inm = NotificationManager.getService(); + if (inm == null) { + return; + } + + ActivityRecord root = (ActivityRecord)msg.obj; + ProcessRecord process = root.app; + if (process == null) { + return; + } + + try { + Context context = mContext.createPackageContext(process.info.packageName, 0); + String text = mContext.getString(R.string.privacy_guard_notification_detail, + context.getApplicationInfo().loadLabel(context.getPackageManager())); + String title = mContext.getString(R.string.privacy_guard_notification); + + Intent infoIntent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, + Uri.fromParts("package", root.packageName, null)); + + Notification notification = new Notification(); + notification.icon = com.android.internal.R.drawable.stat_notify_privacy_guard; + notification.when = 0; + notification.flags = Notification.FLAG_ONGOING_EVENT; + notification.priority = Notification.PRIORITY_LOW; + notification.defaults = 0; + notification.sound = null; + notification.vibrate = null; + notification.setLatestEventInfo(mContext, + title, text, + PendingIntent.getActivityAsUser(mContext, 0, infoIntent, + PendingIntent.FLAG_CANCEL_CURRENT, null, + new UserHandle(root.userId))); + + try { + int[] outId = new int[1]; + inm.enqueueNotificationWithTag("android", "android", null, + R.string.privacy_guard_notification, + notification, outId, root.userId); + } catch (RuntimeException e) { + Slog.w(ActivityManagerService.TAG, + "Error showing notification for privacy guard", e); + } catch (RemoteException e) { + } + } catch (NameNotFoundException e) { + Slog.w(TAG, "Unable to create context for privacy guard notification", e); + } + } break; + case CANCEL_PRIVACY_NOTIFICATION_MSG: { + INotificationManager inm = NotificationManager.getService(); + if (inm == null) { + return; + } + try { + inm.cancelNotificationWithTag("android", null, + R.string.privacy_guard_notification, msg.arg1); + } catch (RuntimeException e) { + Slog.w(ActivityManagerService.TAG, + "Error canceling notification for service", e); + } catch (RemoteException e) { + } + } break; } } }; @@ -3510,6 +3597,15 @@ boolean startHomeActivityLocked(int userId, String reason) { return true; } + /** + * If system is power off alarm boot mode, we need to start alarm UI. + */ + void startAlarmActivityLocked() { + Intent intent = new Intent(ACTION_POWER_OFF_ALARM); + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); + mContext.startActivityAsUser(intent, UserHandle.CURRENT); + } + private ActivityInfo resolveActivityInfo(Intent intent, int flags, int userId) { ActivityInfo ai = null; ComponentName comp = intent.getComponent(); @@ -4719,7 +4815,12 @@ final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread, app.thread.asBinder() == thread.asBinder()) { boolean doLowMem = app.instrumentationClass == null; boolean doOomAdj = doLowMem; + boolean homeRestart = false; if (!app.killedByAm) { + if (mHomeProcessName != null && app.processName.equals(mHomeProcessName)) { + mHomeKilled = true; + homeRestart = true; + } Slog.i(TAG, "Process " + app.processName + " (pid " + pid + ") has died"); mAllowLowerMemLevel = true; @@ -4740,6 +4841,13 @@ final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread, if (doLowMem) { doLowMemReportIfNeededLocked(app); } + if (mHomeKilled && homeRestart) { + Intent intent = getHomeIntent(); + ActivityInfo aInfo = mStackSupervisor.resolveActivity(intent, null, 0, null, 0); + startProcessLocked(aInfo.processName, aInfo.applicationInfo, true, 0, + "activity", null, false, false, true); + homeRestart = false; + } } else if (app.pid != pid) { // A new process has already been started. Slog.i(TAG, "Process " + app.processName + " (pid " + pid @@ -5090,6 +5198,20 @@ final void appNotResponding(ProcessRecord app, ActivityRecord activity, annotation != null ? "ANR " + annotation : "ANR", info.toString()); + //Set the trace file name to app name + current date format to avoid overrinding trace file + String tracesPath = SystemProperties.get("dalvik.vm.stack-trace-file", null); + if (tracesPath != null && tracesPath.length() != 0) { + File traceRenameFile = new File(tracesPath); + String newTracesPath; + int lpos = tracesPath.lastIndexOf ("."); + if (-1 != lpos) + newTracesPath = tracesPath.substring (0, lpos) + "_" + app.processName + "_" + mTraceDateFormat.format(new Date()) + tracesPath.substring (lpos); + else + newTracesPath = tracesPath + "_" + app.processName; + + traceRenameFile.renameTo(new File(newTracesPath)); + } + // Bring up the infamous App Not Responding dialog Message msg = Message.obtain(); HashMap map = new HashMap(); @@ -6447,7 +6569,7 @@ public void performReceive(Intent intent, int resultCode, }, 0, null, null, new String[] {android.Manifest.permission.RECEIVE_BOOT_COMPLETED}, - AppOpsManager.OP_NONE, null, true, false, + AppOpsManager.OP_BOOT_COMPLETED, null, true, false, MY_PID, Process.SYSTEM_UID, userId); } } @@ -11890,6 +12012,12 @@ public void run() { mBooting = true; startHomeActivityLocked(mCurrentUserId, "systemReady"); + // start the power off alarm by boot mode + boolean isAlarmBoot = SystemProperties.getBoolean("ro.alarm_boot", false); + if (isAlarmBoot) { + startAlarmActivityLocked(); + } + try { if (AppGlobals.getPackageManager().hasSystemUidErrors()) { Slog.e(TAG, "UIDs on the system are inconsistent, you need to wipe your" @@ -15669,6 +15797,7 @@ private final boolean cleanUpApplicationRecordLocked(ProcessRecord app, mProcessesOnHold.remove(app); if (app == mHomeProcess) { + mHomeProcessName = mHomeProcess.processName; mHomeProcess = null; } if (app == mPreviousProcess) { @@ -17724,6 +17853,10 @@ private final int computeOomAdjLocked(ProcessRecord app, int cachedAdj, ProcessR app.adjType = "top-activity"; foregroundActivities = true; procState = PROCESS_STATE_TOP; + if(app == mHomeProcess) { + mHomeKilled = false; + mHomeProcessName = mHomeProcess.processName; + } } else if (app.instrumentationClass != null) { // Don't want to kill running instrumentation. adj = ProcessList.FOREGROUND_APP_ADJ; @@ -17759,6 +17892,14 @@ private final int computeOomAdjLocked(ProcessRecord app, int cachedAdj, ProcessR app.cached = true; app.empty = true; app.adjType = "cch-empty"; + + if (mHomeKilled && app.processName.equals(mHomeProcessName)) { + adj = ProcessList.PERSISTENT_PROC_ADJ; + schedGroup = Process.THREAD_GROUP_DEFAULT; + app.cached = false; + app.empty = false; + app.adjType = "top-activity"; + } } // Examine all activities if not already foreground. @@ -18694,6 +18835,18 @@ private final boolean applyOomAdjLocked(ProcessRecord app, boolean doingAll, lon boolean success = true; if (app.curRawAdj != app.setRawAdj) { + String seempStr = "app_uid=" + app.uid + + ",app_pid=" + app.pid + ",oom_adj=" + app.curAdj + + ",setAdj=" + app.setAdj + ",hasShownUi=" + (app.hasShownUi ? 1 : 0) + + ",cached=" + (app.cached ? 1 : 0) + + ",fA=" + (app.foregroundActivities ? 1 : 0) + + ",fS=" + (app.foregroundServices ? 1 : 0) + + ",systemNoUi=" + (app.systemNoUi ? 1 : 0) + + ",curSchedGroup=" + app.curSchedGroup + + ",curProcState=" + app.curProcState + ",setProcState=" + app.setProcState + + ",killed=" + (app.killed ? 1 : 0) + ",killedByAm=" + (app.killedByAm ? 1 : 0) + + ",debugging=" + (app.debugging ? 1 : 0); + android.util.SeempLog.record_str(385, seempStr); app.setRawAdj = app.curRawAdj; } @@ -19148,8 +19301,39 @@ final void updateOomAdjLocked() { int nextCachedAdj = curCachedAdj+1; int curEmptyAdj = ProcessList.CACHED_APP_MIN_ADJ; int nextEmptyAdj = curEmptyAdj+2; + ProcessRecord selectedAppRecord = null; + long serviceLastActivity = 0; + int numBServices = 0; for (int i=N-1; i>=0; i--) { ProcessRecord app = mLruProcesses.get(i); + if (mEnableBServicePropagation && app.serviceb + && (app.curAdj == ProcessList.SERVICE_B_ADJ)) { + numBServices++; + for (int s = app.services.size() - 1; s >= 0; s--) { + ServiceRecord sr = app.services.valueAt(s); + if (DEBUG_OOM_ADJ) Slog.d(TAG,"app.processName = " + app.processName + + " serviceb = " + app.serviceb + " s = " + s + " sr.lastActivity = " + + sr.lastActivity + " packageName = " + sr.packageName + + " processName = " + sr.processName); + if (SystemClock.uptimeMillis() - sr.lastActivity + < mMinBServiceAgingTime) { + if (DEBUG_OOM_ADJ) { + Slog.d(TAG,"Not aged enough!!!"); + } + continue; + } + if (serviceLastActivity == 0) { + serviceLastActivity = sr.lastActivity; + selectedAppRecord = app; + } else if (sr.lastActivity < serviceLastActivity) { + serviceLastActivity = sr.lastActivity; + selectedAppRecord = app; + } + } + } + if (DEBUG_OOM_ADJ && selectedAppRecord != null) Slog.d(TAG, + "Identified app.processName = " + selectedAppRecord.processName + + " app.pid = " + selectedAppRecord.pid); if (!app.killedByAm && app.thread != null) { app.procStateChanged = false; computeOomAdjLocked(app, ProcessList.UNKNOWN_ADJ, TOP_APP, true, now); @@ -19258,6 +19442,14 @@ final void updateOomAdjLocked() { } } } + if ((numBServices > mBServiceAppThreshold) && (true == mAllowLowerMemLevel) + && (selectedAppRecord != null)) { + ProcessList.setOomAdj(selectedAppRecord.pid, selectedAppRecord.info.uid, + ProcessList.CACHED_APP_MAX_ADJ); + selectedAppRecord.setAdj = selectedAppRecord.curAdj; + if (DEBUG_OOM_ADJ) Slog.d(TAG,"app.processName = " + selectedAppRecord.processName + + " app.pid = " + selectedAppRecord.pid + " is moved to higher adj"); + } mNumServiceProcs = mNewNumServiceProcs; @@ -20274,8 +20466,8 @@ void finishUserBoot(UserState uss) { broadcastIntentLocked(null, null, intent, null, null, 0, null, null, new String[] {android.Manifest.permission.RECEIVE_BOOT_COMPLETED}, - AppOpsManager.OP_NONE, null, true, false, MY_PID, Process.SYSTEM_UID, - userId); + AppOpsManager.OP_BOOT_COMPLETED, null, true, false, MY_PID, + Process.SYSTEM_UID, userId); } } } diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 6e348766bfd..218ee02d01e 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -40,6 +40,7 @@ import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.AppGlobals; +import android.app.AppOpsManager; import android.app.IActivityController; import android.app.ResultInfo; import android.app.ActivityManager.RunningTaskInfo; @@ -1130,6 +1131,8 @@ private void completeResumeLocked(ActivityRecord next) { // When resuming an activity, require it to call requestVisibleBehind() again. mActivityContainer.mActivityDisplay.setVisibleBehindActivity(null); } + + updatePrivacyGuardNotificationLocked(next); } private void setVisible(ActivityRecord r, boolean visible) { @@ -2071,6 +2074,29 @@ private void insertTaskAtTop(TaskRecord task, ActivityRecord newActivity) { updateTaskMovement(task, true); } + private final void updatePrivacyGuardNotificationLocked(ActivityRecord next) { + + String privacyGuardPackageName = mStackSupervisor.mPrivacyGuardPackageName; + if (privacyGuardPackageName != null && privacyGuardPackageName.equals(next.packageName)) { + return; + } + + boolean privacy = mService.mAppOpsService.getPrivacyGuardSettingForPackage( + next.app.uid, next.packageName); + + if (privacyGuardPackageName != null && !privacy) { + Message msg = mService.mHandler.obtainMessage( + ActivityManagerService.CANCEL_PRIVACY_NOTIFICATION_MSG, next.userId); + msg.sendToTarget(); + mStackSupervisor.mPrivacyGuardPackageName = null; + } else if (privacy) { + Message msg = mService.mHandler.obtainMessage( + ActivityManagerService.POST_PRIVACY_NOTIFICATION_MSG, next); + msg.sendToTarget(); + mStackSupervisor.mPrivacyGuardPackageName = next.packageName; + } + } + final void startActivityLocked(ActivityRecord r, boolean newTask, boolean doResume, boolean keepCurTransition, Bundle options) { TaskRecord rTask = r.task; diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 17a86caccc4..63a9cb995f9 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -273,6 +273,11 @@ public final class ActivityStackSupervisor implements DisplayListener { * setWindowManager is called. **/ private boolean mLeanbackOnlyDevice; + /** + * Is the privacy guard currently enabled? Shared between ActivityStacks + */ + String mPrivacyGuardPackageName = null; + /** * We don't want to allow the device to go to sleep while in the process * of launching an activity. This is primarily to allow alarm intent diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java index 0e249527a11..8630f0002c9 100644 --- a/services/core/java/com/android/server/am/ProcessList.java +++ b/services/core/java/com/android/server/am/ProcessList.java @@ -32,6 +32,7 @@ import android.content.res.Resources; import android.graphics.Point; import android.os.SystemProperties; +import android.os.Process; import android.net.LocalSocketAddress; import android.net.LocalSocket; import android.util.Slog; @@ -133,7 +134,17 @@ final class ProcessList { // we have no limit on the number of service, visible, foreground, or other such // processes and the number of those processes does not count against the cached // process limit. - static final int MAX_CACHED_APPS = 32; + static final int MAX_CACHED_APPS = SystemProperties.getInt("ro.sys.fw.bg_apps_limit",32); + static final boolean USE_TRIM_SETTINGS = + SystemProperties.getBoolean("ro.sys.fw.use_trim_settings",false); + static final int EMPTY_APP_PERCENT = SystemProperties.getInt("ro.sys.fw.empty_app_percent",50); + static final int TRIM_EMPTY_PERCENT = + SystemProperties.getInt("ro.sys.fw.trim_empty_percent",100); + static final int TRIM_CACHE_PERCENT = + SystemProperties.getInt("ro.sys.fw.trim_cache_percent",100); + static final long TRIM_ENABLE_MEMORY = + SystemProperties.getLong("ro.sys.fw.trim_enable_memory",1073741824); + public static boolean allowTrim() { return Process.getTotalMemory() < TRIM_ENABLE_MEMORY ; } // We allow empty processes to stick around for at most 30 minutes. static final long MAX_EMPTY_TIME = 30*60*1000; @@ -143,11 +154,25 @@ final class ProcessList { // The number of empty apps at which we don't consider it necessary to do // memory trimming. - static final int TRIM_EMPTY_APPS = MAX_EMPTY_APPS/2; + public static int computeTrimEmptyApps() { + if (USE_TRIM_SETTINGS && allowTrim()) { + return MAX_EMPTY_APPS*TRIM_EMPTY_PERCENT/100; + } else { + return MAX_EMPTY_APPS/2; + } + } + static final int TRIM_EMPTY_APPS = computeTrimEmptyApps(); // The number of cached at which we don't consider it necessary to do // memory trimming. - static final int TRIM_CACHED_APPS = (MAX_CACHED_APPS-MAX_EMPTY_APPS)/3; + public static int computeTrimCachedApps() { + if (USE_TRIM_SETTINGS && allowTrim()) { + return MAX_CACHED_APPS*TRIM_CACHE_PERCENT/100; + } else { + return (MAX_CACHED_APPS-MAX_EMPTY_APPS)/3; + } + } + static final int TRIM_CACHED_APPS = computeTrimCachedApps(); // Threshold of number of cached+empty where we consider memory critical. static final int TRIM_CRITICAL_THRESHOLD = 3; @@ -172,6 +197,17 @@ final class ProcessList { FOREGROUND_APP_ADJ, VISIBLE_APP_ADJ, PERCEPTIBLE_APP_ADJ, BACKUP_APP_ADJ, CACHED_APP_MIN_ADJ, CACHED_APP_MAX_ADJ }; + + // These are the low-end OOM level limits for 32bit 1 GB RAM + private final int[] mOomMinFreeLow32Bit = new int[] { + 12288, 18432, 24576, + 36864, 43008, 49152 + }; + // These are the high-end OOM level limits for 32bit 1 GB RAM + private final int[] mOomMinFreeHigh32Bit = new int[] { + 61440, 76800, 92160, + 107520, 137660, 174948 + }; // These are the low-end OOM level limits. This is appropriate for an // HVGA or smaller phone with less than 512MB. Values are in KB. private final int[] mOomMinFreeLow = new int[] { @@ -240,15 +276,24 @@ private void updateOomLevels(int displayWidth, int displayHeight, boolean write) Slog.i("XXXXXX", "minfree_adj=" + minfree_adj + " minfree_abs=" + minfree_abs); } + // We've now baked in the increase to the basic oom values above, since + // they seem to be useful more generally for devices that are tight on + // memory than just for 64 bit. This should probably have some more + // tuning done, so not deleting it quite yet... final boolean is64bit = Build.SUPPORTED_64_BIT_ABIS.length > 0; for (int i=0; i mConnectedBTDevicesList = + new ArrayList(); + // Forced device usage for communications private int mForcedUseForComm; @@ -850,6 +876,100 @@ private void waitForAudioHandlerCreation() { } } + /** + * @hide + */ + public void addMediaPlayerAndUpdateRemoteController (String packageName) { + Log.v(TAG, "addMediaPlayerAndUpdateRemoteController: size of existing list: " + + mMediaPlayers.size()); + boolean playerToAdd = true; + if (mMediaPlayers.size() > 0) { + final Iterator rccIterator = mMediaPlayers.iterator(); + while (rccIterator.hasNext()) { + final MediaPlayerInfo player = rccIterator.next(); + if (packageName.equals(player.getPackageName())) { + Log.e(TAG, "Player entry present, no need to add"); + playerToAdd = false; + player.setFocus(true); + } else { + Log.e(TAG, "Player: " + player.getPackageName()+ "Lost Focus"); + player.setFocus(false); + } + } + } + if (playerToAdd) { + Log.e(TAG, "Adding Player: " + packageName + " to available player list"); + mMediaPlayers.add(new MediaPlayerInfo(packageName, true)); + } + Intent intent = new Intent(AudioManager.RCC_CHANGED_ACTION); + intent.putExtra(AudioManager.EXTRA_CALLING_PACKAGE_NAME, packageName); + intent.putExtra(AudioManager.EXTRA_FOCUS_CHANGED_VALUE, true); + intent.putExtra(AudioManager.EXTRA_AVAILABLITY_CHANGED_VALUE, true); + sendBroadcastToAll(intent); + Log.v(TAG, "updating focussed RCC change to RCD: CallingPackageName:" + + packageName); + } + + /** + * @hide + */ + public void updateRemoteControllerOnExistingMediaPlayers() { + Log.v(TAG, "updateRemoteControllerOnExistingMediaPlayers: size of Player list: " + + mMediaPlayers.size()); + if (mMediaPlayers.size() > 0) { + Log.v(TAG, "Inform RemoteController regarding existing RCC entry"); + final Iterator rccIterator = mMediaPlayers.iterator(); + while (rccIterator.hasNext()) { + final MediaPlayerInfo player = rccIterator.next(); + Intent intent = new Intent(AudioManager.RCC_CHANGED_ACTION); + intent.putExtra(AudioManager.EXTRA_CALLING_PACKAGE_NAME, + player.getPackageName()); + intent.putExtra(AudioManager.EXTRA_FOCUS_CHANGED_VALUE, + player.isFocussed()); + intent.putExtra(AudioManager.EXTRA_AVAILABLITY_CHANGED_VALUE, true); + sendBroadcastToAll(intent); + Log.v(TAG, "updating RCC change: CallingPackageName:" + + player.getPackageName()); + } + } else { + Log.e(TAG, "No RCC entry present to update"); + } + } + + /** + * @hide + */ + public void removeMediaPlayerAndUpdateRemoteController (String packageName) { + Log.v(TAG, "removeMediaPlayerAndUpdateRemoteController: size of existing list: " + + mMediaPlayers.size()); + boolean playerToRemove = false; + int index = -1; + if (mMediaPlayers.size() > 0) { + final Iterator rccIterator = mMediaPlayers.iterator(); + while (rccIterator.hasNext()) { + index++; + final MediaPlayerInfo player = rccIterator.next(); + if (packageName.equals(player.getPackageName())) { + Log.v(TAG, "Player entry present remove and update RemoteController"); + playerToRemove = true; + break; + } else { + Log.v(TAG, "Player entry for " + player.getPackageName()+ " is not present"); + } + } + } + if (playerToRemove) { + Log.e(TAG, "Removing Player: " + packageName + " from index" + index); + mMediaPlayers.remove(index); + } + Intent intent = new Intent(AudioManager.RCC_CHANGED_ACTION); + intent.putExtra(AudioManager.EXTRA_CALLING_PACKAGE_NAME, packageName); + intent.putExtra(AudioManager.EXTRA_FOCUS_CHANGED_VALUE, false); + intent.putExtra(AudioManager.EXTRA_AVAILABLITY_CHANGED_VALUE, false); + sendBroadcastToAll(intent); + Log.v(TAG, "Updated List size: " + mMediaPlayers.size()); + } + private void checkAllAliasStreamVolumes() { synchronized (VolumeStreamState.class) { int numStreamTypes = AudioSystem.getNumStreamTypes(); @@ -2938,9 +3058,18 @@ public void onServiceConnected(int profile, BluetoothProfile proxy) { synchronized (mConnectedDevices) { synchronized (mA2dpAvrcpLock) { mA2dp = (BluetoothA2dp) proxy; + if (mConnectedBTDevicesList.size() > 0) { + Log.d(TAG,"A2dp connection list not empty, purge it, size " + + mConnectedBTDevicesList.size()); + mConnectedBTDevicesList.clear(); + } + //In Dual A2dp, we can have two devices connected deviceList = mA2dp.getConnectedDevices(); - if (deviceList.size() > 0) { - btDevice = deviceList.get(0); + Log.d(TAG, "onServiceConnected: A2dp Service connected: " + + deviceList.size()); + for (int i = 0; i < deviceList.size(); i++) { + //Add the device in Connected list + btDevice = deviceList.get(i); int state = mA2dp.getConnectionState(btDevice); int delay = checkSendBecomingNoisyIntent( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, @@ -3038,6 +3167,10 @@ public void onServiceDisconnected(int profile) { case BluetoothProfile.A2DP: synchronized (mConnectedDevices) { synchronized (mA2dpAvrcpLock) { + Log.d(TAG,"mConnectedBTDevicesList size " + mConnectedBTDevicesList.size()); + if (mConnectedBTDevicesList.size() > 0) { + mConnectedBTDevicesList.clear(); + } // Disconnect ALL DEVICE_OUT_BLUETOOTH_A2DP devices for (int i = 0; i < mConnectedDevices.size(); i++) { DeviceListSpec deviceSpec = mConnectedDevices.valueAt(i); @@ -3593,10 +3726,41 @@ public void setWiredDeviceConnectionState(int type, int state, String address, S public int setBluetoothA2dpDeviceConnectionState(BluetoothDevice device, int state, int profile) { - int delay; + int delay = 0; if (profile != BluetoothProfile.A2DP && profile != BluetoothProfile.A2DP_SINK) { throw new IllegalArgumentException("invalid profile " + profile); } + /*check the state of the currnt device*/ + if (state == BluetoothA2dp.STATE_CONNECTING) { + Log.d(TAG, "Device is still connecting "); + return delay; + } + if ((mConnectedBTDevicesList.contains(device) && + (state == BluetoothA2dp.STATE_CONNECTED))) { + Log.d(TAG, "Device conn is updated again, ignore "); + return delay; + } + if (!mConnectedBTDevicesList.contains(device) && + (state == BluetoothA2dp.STATE_CONNECTED)) { + /*add the device in the list*/ + Log.d(TAG, "Add new connected device in the list: " + device); + mConnectedBTDevicesList.add(device); + if (mConnectedBTDevicesList.size() > 1) { + Log.d(TAG, "Second device connected, add new device "); + return delay; + } + } else if ((state == BluetoothA2dp.STATE_DISCONNECTED) || + (state == BluetoothA2dp.STATE_DISCONNECTING)) { + Log.d(TAG, "Device is getting disconnected: " + device); + if (mConnectedBTDevicesList.contains(device)) { + Log.d(TAG, "Remove the BT device "); + mConnectedBTDevicesList.remove(device); + } + if (mConnectedBTDevicesList.size() > 0) { + Log.d(TAG, "Not all are disconnected "); + return delay; + } + } synchronized (mConnectedDevices) { if (profile == BluetoothProfile.A2DP) { delay = checkSendBecomingNoisyIntent(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, @@ -4610,11 +4774,12 @@ private void onSetA2dpSinkConnectionState(BluetoothDevice btDevice, int state) // introduction of a delay for transient disconnections of docks when // power is rapidly turned off/on, this message will be canceled if // we reconnect the dock under a preset delay - makeA2dpDeviceUnavailableLater(address, BTA2DP_DOCK_TIMEOUT_MILLIS); + makeA2dpDeviceUnavailableLater(btDevice.getAddress(), BTA2DP_DOCK_TIMEOUT_MILLIS); // the next time isConnected is evaluated, it will be false for the dock } } else { - makeA2dpDeviceUnavailableNow(address); + Log.d(TAG, "All devices are disconneted, update Policymanager "); + makeA2dpDeviceUnavailableNow(btDevice.getAddress()); } synchronized (mCurAudioRoutes) { if (mCurAudioRoutes.bluetoothName != null) { @@ -4624,21 +4789,24 @@ private void onSetA2dpSinkConnectionState(BluetoothDevice btDevice, int state) } } } else if (!isConnected && state == BluetoothProfile.STATE_CONNECTED) { + //This function is not implemented + mA2dpConnectedDevice = "BluetoothA2dp"; // Add this String if (btDevice.isBluetoothDock()) { // this could be a reconnection after a transient disconnection cancelA2dpDeviceTimeout(); - mDockAddress = address; + mDockAddress = mA2dpConnectedDevice; } else { // this could be a connection of another A2DP device before the timeout of // a dock: cancel the dock timeout, and make the dock unavailable now if(hasScheduledA2dpDockTimeout()) { cancelA2dpDeviceTimeout(); - makeA2dpDeviceUnavailableNow(mDockAddress); + makeA2dpDeviceUnavailableNow(btDevice.getAddress()); } } - makeA2dpDeviceAvailable(address, btDevice.getName()); + makeA2dpDeviceAvailable(btDevice.getAddress(), btDevice.getName()); + //Updated the Router for a2dp device synchronized (mCurAudioRoutes) { - String name = btDevice.getAliasName(); + String name = mA2dpConnectedDevice; if (!TextUtils.equals(mCurAudioRoutes.bluetoothName, name)) { mCurAudioRoutes.bluetoothName = name; sendMsg(mAudioHandler, MSG_REPORT_NEW_ROUTES, @@ -4655,6 +4823,7 @@ private void onSetA2dpSourceConnectionState(BluetoothDevice btDevice, int state) Log.d(TAG, "onSetA2dpSourceConnectionState btDevice="+btDevice+" state="+state); } if (btDevice == null) { + Log.d(TAG, "onSetA2dpSourceConnectionState device is null"); //gasati return; } String address = btDevice.getAddress(); @@ -4738,8 +4907,14 @@ private boolean handleDeviceConnection(boolean connect, int device, String addre // Called synchronized on mConnectedDevices private int checkSendBecomingNoisyIntent(int device, int state) { int delay = 0; + if (mConnectedBTDevicesList.size() > 1) { + Log.d(TAG, "checkSendBecomingNoisyIntent on state: " + state); + return delay; + } + if ((state == 0) && ((device & mBecomingNoisyIntentDevices) != 0)) { int devices = 0; + Log.d(TAG, "checkSendBecomingNoisyIntent update the noise"); for (int i = 0; i < mConnectedDevices.size(); i++) { int dev = mConnectedDevices.valueAt(i).mDeviceType; if (((dev & AudioSystem.DEVICE_BIT_IN) == 0) @@ -4755,7 +4930,7 @@ private int checkSendBecomingNoisyIntent(int device, int state) { 0, null, 0); - delay = 1000; + delay = 700; } } @@ -5159,6 +5334,18 @@ public void remoteControlDisplayWantsPlaybackPositionSync(IRemoteControlDisplay mMediaFocusControl.remoteControlDisplayWantsPlaybackPositionSync(rcd, wantsSync); } + public void setRemoteControlClientPlayItem(long uid, int scope) { + mMediaFocusControl.setRemoteControlClientPlayItem(uid, scope); + } + + public void getRemoteControlClientNowPlayingEntries() { + mMediaFocusControl.getRemoteControlClientNowPlayingEntries(); + } + + public void setRemoteControlClientBrowsedPlayer() { + mMediaFocusControl.setRemoteControlClientBrowsedPlayer(); + } + @Override public void setRemoteStreamVolume(int index) { enforceVolumeController("set the remote stream volume"); diff --git a/services/core/java/com/android/server/audio/MediaFocusControl.java b/services/core/java/com/android/server/audio/MediaFocusControl.java index f72b5987d7a..af880bd72ee 100644 --- a/services/core/java/com/android/server/audio/MediaFocusControl.java +++ b/services/core/java/com/android/server/audio/MediaFocusControl.java @@ -335,6 +335,9 @@ private boolean isComponentInStringArray(ComponentName comp, String[] enabledArr private static final int MSG_RCDISPLAY_INIT_INFO = 9; private static final int MSG_REEVALUATE_RCD = 10; private static final int MSG_UNREGISTER_MEDIABUTTONINTENT = 11; + private static final int MSG_RCC_SET_BROWSED_PLAYER = 12; + private static final int MSG_RCC_SET_PLAY_ITEM = 13; + private static final int MSG_RCC_GET_NOW_PLAYING_ENTRIES = 14; // sendMsg() flags /** If the msg is already queued, replace it with this one. */ @@ -382,6 +385,22 @@ public void handleMessage(Message msg) { (IRemoteVolumeObserver)msg.obj /* rvo */); break; + case MSG_RCC_SET_PLAY_ITEM: + Log.d(TAG, "MSG_RCC_SET_PLAY_ITEM: "+ ((Long)msg.obj).longValue()); + onSetRemoteControlClientPlayItem(msg.arg2 /* scope */, + ((Long)msg.obj).longValue() /* uid */); + break; + + case MSG_RCC_GET_NOW_PLAYING_ENTRIES: + Log.d(TAG, "MSG_RCC_GET_NOW_PLAYING_ENTRIES: "); + onGetRemoteControlClientNowPlayingEntries(); + break; + + case MSG_RCC_SET_BROWSED_PLAYER: + Log.d(TAG, "MSG_RCC_SET_BROWSED_PLAYER: "); + onSetRemoteControlClientBrowsedPlayer(); + break; + case MSG_RCDISPLAY_INIT_INFO: // msg.obj is guaranteed to be non null onRcDisplayInitInfo((IRemoteControlDisplay)msg.obj /*newRcd*/, @@ -2052,6 +2071,66 @@ protected void remoteControlDisplayWantsPlaybackPositionSync(IRemoteControlDispl } } + public void setRemoteControlClientPlayItem(long uid, int scope) { + sendMsg(mEventHandler, MSG_RCC_SET_PLAY_ITEM, SENDMSG_REPLACE, 0 /* arg1 */, + scope /* arg2*/, new Long(uid) /* obj */, 0 /* delay */); + } + + private void onSetRemoteControlClientPlayItem(int scope, Long uid) { + Log.d(TAG, "onSetRemoteControlClientPlayItem: "+ uid); + synchronized(mCurrentRcLock) { + if (mCurrentRcClient != null) { + try { + mCurrentRcClient.setPlayItem(scope, uid); + } catch (RemoteException e) { + Log.e(TAG, "Current valid remote client is dead: "+e); + mCurrentRcClient = null; + } + } + } + } + + public void getRemoteControlClientNowPlayingEntries() { + sendMsg(mEventHandler, MSG_RCC_GET_NOW_PLAYING_ENTRIES, SENDMSG_REPLACE, + 0 /* arg1 */, 0 /* arg2 ignored*/, 0 /* obj */, 0 /* delay */); + } + + private void onGetRemoteControlClientNowPlayingEntries() { + Log.d(TAG, "onGetRemoteControlClientNowPlayingEntries: "); + synchronized(mCurrentRcLock) { + if (mCurrentRcClient != null) { + try { + mCurrentRcClient.getNowPlayingEntries(); + } catch (RemoteException e) { + Log.e(TAG, "Current valid remote client is dead: "+e); + mCurrentRcClient = null; + } + } + } + } + + public void setRemoteControlClientBrowsedPlayer() { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer: "); + sendMsg(mEventHandler, MSG_RCC_SET_BROWSED_PLAYER, SENDMSG_REPLACE, 0/* arg1 */, + 0 /* arg2 ignored*/, 0 /* obj */, 0 /* delay */); + } + + private void onSetRemoteControlClientBrowsedPlayer() { + Log.d(TAG, "onSetRemoteControlClientBrowsedPlayer: "); + PlayerRecord prse = mPRStack.peek(); + if (prse.getRcc() == null) { + Log.d(TAG, "can not proceed with setBrowsedPlayer"); + } else { + Log.d(TAG, "proceed with setBrowsedPlayer"); + try { + Log.d(TAG, "Calling setBrowsedPlayer"); + prse.getRcc().setBrowsedPlayer(); + } catch (RemoteException e) { + Log.e(TAG, "Current valid remote client is dead: "+ e); + } + } + } + // handler for MSG_RCC_NEW_VOLUME_OBS private void onRegisterVolumeObserverForRcc(int rccId, IRemoteVolumeObserver rvo) { synchronized(mPRStack) { diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java index a9eaeee286b..1ead64deffa 100644 --- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java +++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java @@ -31,6 +31,7 @@ import android.os.Message; import android.os.INetworkManagementService; import android.os.RemoteException; +import android.os.SystemProperties; import android.util.Slog; import com.android.server.net.BaseNetworkObserver; @@ -90,7 +91,12 @@ public static boolean requiresClat(NetworkAgentInfo nai) { (nai.linkProperties != null) ? nai.linkProperties.hasIPv4Address() : false; // Only support clat on mobile and wifi for now, because these are the only IPv6-only // networks we can connect to. - return connected && !hasIPv4Address && (netType == TYPE_MOBILE || netType == TYPE_WIFI); + boolean doXlat = SystemProperties.getBoolean("persist.net.doxlat",true); + if(!doXlat) { + Slog.i(TAG, "Android Xlat is disabled"); + } + return connected && !hasIPv4Address && (((netType == TYPE_MOBILE) && doXlat ) + || netType == TYPE_WIFI); } /** diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index c1aaf078da1..f106b753ad8 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -36,11 +36,13 @@ import android.net.NetworkInfo; import android.net.NetworkUtils; import android.net.RouteInfo; +import android.net.wifi.WifiDevice; import android.os.Binder; import android.os.INetworkManagementService; import android.os.Looper; import android.os.Message; import android.os.UserHandle; +import android.os.SystemProperties; import android.telephony.TelephonyManager; import android.util.Log; @@ -64,9 +66,22 @@ import java.util.Collection; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.File; +import java.io.FileDescriptor; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; + +import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLED; +import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; +import static android.net.wifi.WifiManager.WIFI_AP_STATE_CHANGED_ACTION; + /** * @hide @@ -137,6 +152,17 @@ public class Tethering extends BaseNetworkObserver { private boolean mUsbTetherRequested; // true if USB tethering should be started // when RNDIS is enabled + // Once STA established connection to hostapd, it will be added + // to mL2ConnectedDeviceMap. Then after deviceinfo update from dnsmasq, + // it will be added to mConnectedDeviceMap + private HashMap mL2ConnectedDeviceMap = new HashMap(); + private HashMap mConnectedDeviceMap = new HashMap(); + private static final String dhcpLocation = "/data/misc/dhcp/dnsmasq.leases"; + + // Device name polling interval(ms) and max times + private static final int DNSMASQ_POLLING_INTERVAL = 1000; + private static final int DNSMASQ_POLLING_MAX_TIMES = 10; + public Tethering(Context context, INetworkManagementService nmService, INetworkStatsService statsService, Looper looper) { mContext = context; @@ -158,6 +184,8 @@ public Tethering(Context context, INetworkManagementService nmService, filter.addAction(UsbManager.ACTION_USB_STATE); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); + filter.addAction(WIFI_AP_STATE_CHANGED_ACTION); + mContext.registerReceiver(mStateReceiver, filter); filter = new IntentFilter(); @@ -190,11 +218,17 @@ private ConnectivityManager getConnectivityManager() { void updateConfiguration() { String[] tetherableUsbRegexs = mContext.getResources().getStringArray( com.android.internal.R.array.config_tether_usb_regexs); - String[] tetherableWifiRegexs = mContext.getResources().getStringArray( - com.android.internal.R.array.config_tether_wifi_regexs); + String[] tetherableWifiRegexs; String[] tetherableBluetoothRegexs = mContext.getResources().getStringArray( com.android.internal.R.array.config_tether_bluetooth_regexs); + if (SystemProperties.getInt("persist.fst.rate.upgrade.en", 0) == 1) { + tetherableWifiRegexs = new String[] {"bond0"}; + } else { + tetherableWifiRegexs = mContext.getResources().getStringArray( + com.android.internal.R.array.config_tether_wifi_regexs); + } + int ifaceTypes[] = mContext.getResources().getIntArray( com.android.internal.R.array.config_tether_upstream_types); Collection upstreamIfaceTypes = new ArrayList(); @@ -326,6 +360,168 @@ public void interfaceRemoved(String iface) { } } + public List getTetherConnectedSta() { + Iterator it; + List TetherConnectedStaList = new ArrayList(); + + if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_softap_extention)) { + it = mConnectedDeviceMap.keySet().iterator(); + while(it.hasNext()) { + String key = (String)it.next(); + WifiDevice device = (WifiDevice)mConnectedDeviceMap.get(key); + if (VDBG) { + Log.d(TAG, "getTetherConnectedSta: addr=" + key + " name=" + device.deviceName); + } + TetherConnectedStaList.add(device); + } + } + + return TetherConnectedStaList; + } + + private void sendTetherConnectStateChangedBroadcast() { + if (!getConnectivityManager().isTetheringSupported()) return; + + Intent broadcast = new Intent(ConnectivityManager.TETHER_CONNECT_STATE_CHANGED); + broadcast.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | + Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); + + mContext.sendStickyBroadcastAsUser(broadcast, UserHandle.ALL); + + showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_wifi); + } + + private boolean readDeviceInfoFromDnsmasq(WifiDevice device) { + boolean result = false; + FileInputStream fstream = null; + String line; + + try { + fstream = new FileInputStream(dhcpLocation); + DataInputStream in = new DataInputStream(fstream); + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + + while ((null != (line = br.readLine())) && (line.length() != 0)) { + String[] fields = line.split(" "); + + // 949295 00:0a:f5:6a:bf:70 192.168.43.32 android-93de88df9ec61bac * + if (fields.length > 3) { + String addr = fields[1]; + String name = fields[3]; + + if (addr.equals(device.deviceAddress)) { + device.deviceName = name; + result = true; + break; + } + } + } + } catch (IOException ex) { + Log.e(TAG, "readDeviceNameFromDnsmasq: " + ex); + } finally { + if (fstream != null) { + try { + fstream.close(); + } catch (IOException ex) {} + } + } + + return result; + } + + /* + * DnsmasqThread is used to read the Device info from dnsmasq. + */ + private static class DnsmasqThread extends Thread { + private final Tethering mTethering; + private int mInterval; + private int mMaxTimes; + private WifiDevice mDevice; + + public DnsmasqThread(Tethering tethering, WifiDevice device, + int interval, int maxTimes) { + super("Tethering"); + mTethering = tethering; + mInterval = interval; + mMaxTimes = maxTimes; + mDevice = device; + } + + public void run() { + boolean result = false; + + try { + while (mMaxTimes > 0) { + result = mTethering.readDeviceInfoFromDnsmasq(mDevice); + if (result) { + if (DBG) Log.d(TAG, "Successfully poll device info for " + mDevice.deviceAddress); + break; + } + + mMaxTimes --; + Thread.sleep(mInterval); + } + } catch (Exception ex) { + result = false; + Log.e(TAG, "Pulling " + mDevice.deviceAddress + "error" + ex); + } + + if (!result) { + if (DBG) Log.d(TAG, "Pulling timeout, suppose STA uses static ip " + mDevice.deviceAddress); + } + + // When STA uses static ip, device info will be unavaiable from dnsmasq, + // thus no matter the result is success or failure, we will broadcast the event. + // But if the device is not in L2 connected state, it means the hostapd connection is + // disconnected before dnsmasq get device info, so in this case, don't broadcast + // connection event. + WifiDevice other = mTethering.mL2ConnectedDeviceMap.get(mDevice.deviceAddress); + if (other != null && other.deviceState == WifiDevice.CONNECTED) { + mTethering.mConnectedDeviceMap.put(mDevice.deviceAddress, mDevice); + mTethering.sendTetherConnectStateChangedBroadcast(); + } else { + if (DBG) Log.d(TAG, "Device " + mDevice.deviceAddress + "already disconnected, ignoring"); + } + } + } + + public void interfaceMessageRecevied(String message) { + // if softap extension feature not enabled, do nothing + if (!mContext.getResources().getBoolean(com.android.internal.R.bool.config_softap_extention)) { + return; + } + + if (DBG) Log.d(TAG, "interfaceMessageRecevied: message=" + message); + + try { + WifiDevice device = new WifiDevice(message); + + if (device.deviceState == WifiDevice.CONNECTED) { + mL2ConnectedDeviceMap.put(device.deviceAddress, device); + + // When hostapd reported STA-connection event, it is possible that device + // info can't fetched from dnsmasq, then we start a thread to poll the + // device info, the thread will exit after device info avaiable. + // For static ip case, dnsmasq don't hold the device info, thus thread + // will exit after a timeout. + if (readDeviceInfoFromDnsmasq(device)) { + mConnectedDeviceMap.put(device.deviceAddress, device); + sendTetherConnectStateChangedBroadcast(); + } else { + if (DBG) Log.d(TAG, "Starting poll device info for " + device.deviceAddress); + new DnsmasqThread(this, device, + DNSMASQ_POLLING_INTERVAL, DNSMASQ_POLLING_MAX_TIMES).start(); + } + } else if (device.deviceState == WifiDevice.DISCONNECTED) { + mL2ConnectedDeviceMap.remove(device.deviceAddress); + mConnectedDeviceMap.remove(device.deviceAddress); + sendTetherConnectStateChangedBroadcast(); + } + } catch (IllegalArgumentException ex) { + Log.e(TAG, "WifiDevice IllegalArgument: " + ex); + } + } + public int tether(String iface) { if (DBG) Log.d(TAG, "Tethering " + iface); TetherInterfaceSM sm = null; @@ -469,8 +665,24 @@ private void showTetheredNotification(int icon) { Resources r = Resources.getSystem(); CharSequence title = r.getText(com.android.internal.R.string.tethered_notification_title); - CharSequence message = r.getText(com.android.internal.R.string. - tethered_notification_message); + + CharSequence message; + int size = mConnectedDeviceMap.size(); + + if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_softap_extention) + && icon == com.android.internal.R.drawable.stat_sys_tether_wifi) { + if (size == 0) { + message = r.getText(com.android.internal.R.string.tethered_notification_no_device_message); + } else if (size == 1) { + message = String.format((r.getText(com.android.internal.R.string.tethered_notification_one_device_message)).toString(), + size); + } else { + message = String.format((r.getText(com.android.internal.R.string.tethered_notification_multi_device_message)).toString(), + size); + } + } else { + message = r.getText(com.android.internal.R.string.tethered_notification_message); + } if (mTetheredNotificationBuilder == null) { mTetheredNotificationBuilder = new Notification.Builder(mContext); @@ -485,10 +697,18 @@ private void showTetheredNotification(int icon) { .setContentTitle(title) .setContentText(message) .setContentIntent(pi); + if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_softap_extention) + && icon == com.android.internal.R.drawable.stat_sys_tether_wifi + && size > 0) { + mTetheredNotificationBuilder.setContentText(message); + } else { + mTetheredNotificationBuilder.setContentTitle(title); + } mLastNotificationId = icon; notificationManager.notifyAsUser(null, mLastNotificationId, mTetheredNotificationBuilder.build(), UserHandle.ALL); + } private void clearTetheredNotification() { @@ -526,6 +746,14 @@ public void onReceive(Context content, Intent intent) { } } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) { updateConfiguration(); + } else if(action.equals(WIFI_AP_STATE_CHANGED_ACTION)){ + int wifiApState = intent.getIntExtra("wifi_state", WIFI_AP_STATE_DISABLED); + if (DBG) Log.d(TAG, "WIFI_AP_STATE_CHANGED: wifiApState=" + wifiApState); + if(wifiApState == WIFI_AP_STATE_ENABLED || + wifiApState == WIFI_AP_STATE_DISABLED) { + mConnectedDeviceMap.clear(); + mL2ConnectedDeviceMap.clear(); + } } } } diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java index ef086daa23b..2b88d763d72 100644 --- a/services/core/java/com/android/server/content/SyncManager.java +++ b/services/core/java/com/android/server/content/SyncManager.java @@ -2604,17 +2604,15 @@ private long maybeStartNextSyncH() { } continue; } + String packageName = getPackageName(op.target); ApplicationInfo ai = null; if (packageName != null) { try { ai = mContext.getPackageManager().getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES - | PackageManager.GET_DISABLED_COMPONENTS); + | PackageManager.GET_DISABLED_COMPONENTS); } catch (NameNotFoundException e) { - operationIterator.remove(); - mSyncStorageEngine.deleteFromPending(op.pendingOperation); - continue; } } // If app is considered idle, then skip for now and backoff @@ -2629,24 +2627,7 @@ private long maybeStartNextSyncH() { } else { op.appIdle = false; } - if (!isOperationValidLocked(op)) { - operationIterator.remove(); - mSyncStorageEngine.deleteFromPending(op.pendingOperation); - continue; - } - // If the next run time is in the future, even given the flexible scheduling, - // return the time. - if (op.effectiveRunTime - op.flexTime > now) { - if (nextReadyToRunTime > op.effectiveRunTime) { - nextReadyToRunTime = op.effectiveRunTime; - } - if (isLoggable) { - Log.v(TAG, " Not running sync operation: Sync too far in future." - + "effective: " + op.effectiveRunTime + " flex: " + op.flexTime - + " now: " + now); - } - continue; - } + // Add this sync to be run. operations.add(op); } diff --git a/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java b/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java new file mode 100644 index 00000000000..1be474b09ef --- /dev/null +++ b/services/core/java/com/android/server/display/ExtendedRemoteDisplayHelper.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.android.server.display; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import android.media.RemoteDisplay; +import android.os.Handler; +import android.util.Slog; +import android.content.Context; + +class ExtendedRemoteDisplayHelper { + private static final String TAG = "ExtendedRemoteDisplayHelper"; + + // ExtendedRemoteDisplay class + // ExtendedRemoteDisplay is an enhanced RemoteDisplay. It has + // similar interface as RemoteDisplay class + private static Class sExtRemoteDisplayClass; + + // Method object for the API ExtendedRemoteDisplay.Listen + // ExtendedRemoteDisplay.Listen has the same API signature as + // RemoteDisplay.Listen except for an additional argument to pass the + // Context + private static Method sExtRemoteDisplayListen; + + // Method Object for the API ExtendedRemoteDisplay.Dispose + // ExtendedRemoteDisplay.Dispose follows the same API signature as + // RemoteDisplay.Dispose + private static Method sExtRemoteDisplayDispose; + + static { + //Check availability of ExtendedRemoteDisplay runtime + try { + sExtRemoteDisplayClass = Class.forName("com.qualcomm.wfd.ExtendedRemoteDisplay"); + } catch (Throwable t) { + Slog.i(TAG, "ExtendedRemoteDisplay Not available."); + } + + if(sExtRemoteDisplayClass != null) { + // If ExtendedRemoteDisplay is available find the methods + Slog.i(TAG, "ExtendedRemoteDisplay Is available. Find Methods"); + try { + Class args[] = { + String.class, + RemoteDisplay.Listener.class, + Handler.class, Context.class + }; + sExtRemoteDisplayListen = sExtRemoteDisplayClass.getDeclaredMethod("listen", args); + } catch (Throwable t) { + Slog.i(TAG, "ExtendedRemoteDisplay.listen Not available."); + } + + try { + Class args[] = {}; + sExtRemoteDisplayDispose = sExtRemoteDisplayClass.getDeclaredMethod("dispose", args); + } catch (Throwable t) { + Slog.i(TAG, "ExtendedRemoteDisplay.dispose Not available."); + } + } + } + + /** + * Starts listening for displays to be connected on the specified interface. + * + * @param iface The interface address and port in the form "x.x.x.x:y". + * @param listener The listener to invoke + * when displays are connected or disconnected. + * @param handler The handler on which to invoke the listener. + * @param context The current service context + * */ + public static Object listen(String iface, RemoteDisplay.Listener listener, + Handler handler, Context context) + { + Object extRemoteDisplay = null; + Slog.i(TAG, "ExtendedRemoteDisplay.listen"); + + if(sExtRemoteDisplayListen != null && sExtRemoteDisplayDispose != null){ + try { + extRemoteDisplay = sExtRemoteDisplayListen.invoke(null, + iface, listener, handler, context); + } catch (InvocationTargetException e) { + Slog.i(TAG, "ExtendedRemoteDisplay.listen - InvocationTargetException"); + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { + throw (RuntimeException) cause; + } else if (cause instanceof Error) { + throw (Error) cause; + } else { + throw new RuntimeException(e); + } + } catch (IllegalAccessException e) { + Slog.i(TAG, "ExtendedRemoteDisplay.listen -IllegalAccessException"); + e.printStackTrace(); + } + } + return extRemoteDisplay; + } + + /** + * Disconnects the remote display and stops listening for new connections. + */ + public static void dispose(Object extRemoteDisplay) { + Slog.i(TAG, "ExtendedRemoteDisplay.dispose"); + try{ + sExtRemoteDisplayDispose.invoke(extRemoteDisplay); + } catch (InvocationTargetException e) { + Slog.i(TAG, "ExtendedRemoteDisplay.dispose - InvocationTargetException"); + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { + throw (RuntimeException) cause; + } else if (cause instanceof Error) { + throw (Error) cause; + } else { + throw new RuntimeException(e); + } + } catch (IllegalAccessException e) { + Slog.i(TAG, "ExtendedRemoteDisplay.dispose-IllegalAccessException"); + e.printStackTrace(); + } + } + + /** + * Checks if ExtendedRemoteDisplay is available + */ + public static boolean isAvailable() + { + if(sExtRemoteDisplayClass != null && + sExtRemoteDisplayDispose != null && + sExtRemoteDisplayListen != null) { + Slog.i(TAG, "ExtendedRemoteDisplay isAvailable() : Available."); + return true; + } + Slog.i(TAG, "ExtendedRemoteDisplay isAvailable() : Not Available."); + return false; + } +} diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java index 088d96e4a6e..b2207f315eb 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -58,6 +58,7 @@ final class LocalDisplayAdapter extends DisplayAdapter { private static final int[] BUILT_IN_DISPLAY_IDS_TO_SCAN = new int[] { SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN, SurfaceControl.BUILT_IN_DISPLAY_ID_HDMI, + SurfaceControl.BUILT_IN_DISPLAY_ID_TERTIARY, }; private final SparseArray mDevices = diff --git a/services/core/java/com/android/server/display/WifiDisplayController.java b/services/core/java/com/android/server/display/WifiDisplayController.java index 8932ca0cf85..239f8cd25cc 100644 --- a/services/core/java/com/android/server/display/WifiDisplayController.java +++ b/services/core/java/com/android/server/display/WifiDisplayController.java @@ -137,6 +137,10 @@ final class WifiDisplayController implements DumpUtils.Dump { // Number of connection retries remaining. private int mConnectionRetriesLeft; + // The Extended remote display that is listening on the connection. + // Created after the Wifi P2P network is connected. + private Object mExtRemoteDisplay; + // The remote display that is listening on the connection. // Created after the Wifi P2P network is connected. private RemoteDisplay mRemoteDisplay; @@ -565,11 +569,19 @@ private void updateConnection() { // Step 1. Before we try to connect to a new device, tell the system we // have disconnected from the old one. - if (mRemoteDisplay != null && mConnectedDevice != mDesiredDevice) { - Slog.i(TAG, "Stopped listening for RTSP connection on " + mRemoteDisplayInterface + if ((mRemoteDisplay != null || mExtRemoteDisplay != null) && + mConnectedDevice != mDesiredDevice) { + Slog.i(TAG, "Stopped listening for RTSP connection on " + + mRemoteDisplayInterface + " from Wifi display: " + mConnectedDevice.deviceName); - mRemoteDisplay.dispose(); + if(mRemoteDisplay != null) { + mRemoteDisplay.dispose(); + } else if(mExtRemoteDisplay != null) { + ExtendedRemoteDisplayHelper.dispose(mExtRemoteDisplay); + } + + mExtRemoteDisplay = null; mRemoteDisplay = null; mRemoteDisplayInterface = null; mRemoteDisplayConnected = false; @@ -717,7 +729,8 @@ public void onFailure(int reason) { } // Step 6. Listen for incoming RTSP connection. - if (mConnectedDevice != null && mRemoteDisplay == null) { + if (mConnectedDevice != null && mRemoteDisplay == null && + mExtRemoteDisplay== null) { Inet4Address addr = getInterfaceAddress(mConnectedDeviceGroupInfo); if (addr == null) { Slog.i(TAG, "Failed to get local interface address for communicating " @@ -736,7 +749,7 @@ public void onFailure(int reason) { Slog.i(TAG, "Listening for RTSP connection on " + iface + " from Wifi display: " + mConnectedDevice.deviceName); - mRemoteDisplay = RemoteDisplay.listen(iface, new RemoteDisplay.Listener() { + RemoteDisplay.Listener listener = new RemoteDisplay.Listener() { @Override public void onDisplayConnected(Surface surface, int width, int height, int flags, int session) { @@ -775,7 +788,14 @@ public void onDisplayError(int error) { handleConnectionFailure(false); } } - }, mHandler, mContext.getOpPackageName()); + }; + if(ExtendedRemoteDisplayHelper.isAvailable()){ + mExtRemoteDisplay = ExtendedRemoteDisplayHelper.listen(iface, + listener, mHandler, mContext); + } else { + mRemoteDisplay = RemoteDisplay.listen(iface, listener, + mHandler, mContext.getOpPackageName()); + } // Use extended timeout value for certification, as some tests require user inputs int rtspTimeout = mWifiDisplayCertMode ? @@ -910,7 +930,8 @@ public void run() { @Override public void run() { if (mConnectedDevice != null - && mRemoteDisplay != null && !mRemoteDisplayConnected) { + && (mRemoteDisplay != null || mExtRemoteDisplay != null) + && !mRemoteDisplayConnected) { Slog.i(TAG, "Timed out waiting for Wifi display RTSP connection after " + RTSP_TIMEOUT_SECONDS + " seconds: " + mConnectedDevice.deviceName); diff --git a/services/core/java/com/android/server/location/GeoFencerBase.java b/services/core/java/com/android/server/location/GeoFencerBase.java new file mode 100644 index 00000000000..eec07abbaef --- /dev/null +++ b/services/core/java/com/android/server/location/GeoFencerBase.java @@ -0,0 +1,147 @@ +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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 com.android.server.location; + +import android.os.Binder; +import android.os.Parcelable; +import android.util.Log; +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.location.GeoFenceParams; +import android.location.ILocationListener; +import java.io.PrintWriter; +import java.util.Map; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Collection; +import java.util.ArrayList; + +/** + * This class defines a base class for GeoFencers + * + * @hide + */ +public abstract class GeoFencerBase { + private static final String TAG = "GeoFencerBase"; + private HashMap mGeoFences; + + public GeoFencerBase() { + mGeoFences = new HashMap(); + } + + public void add(double latitude, double longitude, + float radius, long expiration, PendingIntent intent, + String packageName) { + add(new GeoFenceParams(latitude, longitude, radius, + expiration, intent, packageName)); + } + + public void add(GeoFenceParams geoFence) { + synchronized(mGeoFences) { + mGeoFences.put(geoFence.mIntent, geoFence); + } + if (!start(geoFence)) { + synchronized(mGeoFences) { + mGeoFences.remove(geoFence.mIntent); + } + } + } + + public void remove(PendingIntent intent) { + remove(intent, false); + } + + public void remove(PendingIntent intent, boolean localOnly) { + GeoFenceParams geoFence = null; + + synchronized(mGeoFences) { + geoFence = mGeoFences.remove(intent); + } + + if (geoFence != null) { + if (!localOnly && !stop(intent)) { + synchronized(mGeoFences) { + mGeoFences.put(geoFence.mIntent, geoFence); + } + } + } + } + + public int getNumbOfGeoFences() { + return mGeoFences.size(); + } + + public Collection getAllGeoFences() { + return mGeoFences.values(); + } + + public GeoFenceParams getGeoFence(PendingIntent intent) { + return mGeoFences.get(intent); + } + + public boolean hasCaller(int uid) { + for (GeoFenceParams alert : mGeoFences.values()) { + if (alert.mUid == uid) { + return true; + } + } + return false; + } + + public void removeCaller(int uid) { + ArrayList removedFences = null; + for (GeoFenceParams alert : mGeoFences.values()) { + if (alert.mUid == uid) { + if (removedFences == null) { + removedFences = new ArrayList(); + } + removedFences.add(alert.mIntent); + } + } + if (removedFences != null) { + for (int i = removedFences.size()-1; i>=0; i--) { + mGeoFences.remove(removedFences.get(i)); + } + } + } + + public void transferService(GeoFencerBase geofencer) { + for (GeoFenceParams alert : geofencer.mGeoFences.values()) { + geofencer.stop(alert.mIntent); + add(alert); + } + } + + public void dump(PrintWriter pw, String prefix) { + if (mGeoFences.size() > 0) { + pw.println(prefix + " GeoFences:"); + prefix += " "; + for (Map.Entry i + : mGeoFences.entrySet()) { + pw.println(prefix + i.getKey() + ":"); + i.getValue().dump(pw, prefix); + } + } + } + + abstract protected boolean start(GeoFenceParams geoFence); + abstract protected boolean stop(PendingIntent intent); +} diff --git a/services/core/java/com/android/server/location/GeoFencerProxy.java b/services/core/java/com/android/server/location/GeoFencerProxy.java new file mode 100644 index 00000000000..24590800649 --- /dev/null +++ b/services/core/java/com/android/server/location/GeoFencerProxy.java @@ -0,0 +1,148 @@ +/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2007 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 com.android.server.location; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.os.RemoteException; +import android.os.UserHandle; +import android.util.Log; +import android.app.PendingIntent; +import android.location.IGeoFencer; +import android.location.IGeoFenceListener; +import android.location.GeoFenceParams; + +/** + * A class for proxying IGeoFenceProvider implementations. + * + * {@hide} + */ +public class GeoFencerProxy extends GeoFencerBase { + + private static final String TAG = "GeoFencerProxy"; + private static final boolean LOGV_ENABLED = true; + + private final Context mContext; + private final Intent mIntent; + private IGeoFencer mGeoFencer; + + private final ServiceConnection mServiceConnection = new ServiceConnection() { + public void onServiceConnected(ComponentName className, IBinder service) { + synchronized (this) { + mGeoFencer = IGeoFencer.Stub.asInterface(service); + notifyAll(); + } + Log.v(TAG, "onServiceConnected: mGeoFencer - "+mGeoFencer); + } + public void onServiceDisconnected(ComponentName className) { + synchronized (this) { + mGeoFencer = null; + } + Log.v(TAG, "onServiceDisconnected"); + } + }; + + private final IGeoFenceListener.Stub mListener = new IGeoFenceListener.Stub() { + @Override + public void geoFenceExpired(PendingIntent intent) throws RemoteException { + logv("geoFenceExpired - "+intent); + remove(intent, true); + } + }; + + private static GeoFencerProxy mGeoFencerProxy; + public static GeoFencerProxy getGeoFencerProxy(Context context, String serviceName) { + if (mGeoFencerProxy == null) { + mGeoFencerProxy = new GeoFencerProxy(context, serviceName); + } + return mGeoFencerProxy; + } + + private GeoFencerProxy(Context context, String serviceName) { + mContext = context; + mIntent = new Intent(serviceName); + mContext.bindService(mIntent, mServiceConnection, + Context.BIND_AUTO_CREATE | Context.BIND_NOT_FOREGROUND + | Context.BIND_ALLOW_OOM_MANAGEMENT); + } + + public void removeCaller(int uid) { + super.removeCaller(uid); + if(mGeoFencer != null) { + try { + mGeoFencer.clearGeoFenceUser(uid); + } catch (RemoteException re) { + } + } + else + Log.e(TAG, "removeCaller - mGeoFencer is null"); + } + + private boolean ensureGeoFencer() { + if (mGeoFencer == null) { + try { + synchronized(mServiceConnection) { + logv("waiting..."); + mServiceConnection.wait(60000); + logv("woke up!!!"); + } + } catch (InterruptedException ie) { + Log.w(TAG, "Interrupted while waiting for GeoFencer"); + return false; + } + + if (mGeoFencer == null) { + Log.w(TAG, "Timed out. No GeoFencer connection"); + return false; + } + } + + return true; + } + + protected boolean start(GeoFenceParams geofence) { + if (ensureGeoFencer()) { + try { + return mGeoFencer.setGeoFence(mListener, geofence); + } catch (RemoteException re) { + } + } + return false; + } + + protected boolean stop(PendingIntent intent) { + if (ensureGeoFencer()) { + try { + mGeoFencer.clearGeoFence(mListener, intent); + return true; + } catch (RemoteException re) { + } + } + return false; + } + + private void logv(String s) { + if (LOGV_ENABLED) Log.v(TAG, s); + } +} diff --git a/services/core/java/com/android/server/media/MediaSessionRecord.java b/services/core/java/com/android/server/media/MediaSessionRecord.java index f92f631a06d..bc830f026ea 100644 --- a/services/core/java/com/android/server/media/MediaSessionRecord.java +++ b/services/core/java/com/android/server/media/MediaSessionRecord.java @@ -106,6 +106,9 @@ public class MediaSessionRecord implements IBinder.DeathRecipient { private CharSequence mQueueTitle; private int mRatingType; private long mLastActiveTime; + private String mBrowsedPlayerURI; + private boolean mPlayItemStatus; + private long[] mNowPlayingList; // End TransportPerformer fields // Volume handling fields @@ -518,6 +521,86 @@ private void pushMetadataUpdate() { } } + private void pushBrowsePlayerInfo() { + synchronized (mLock) { + if (mDestroyed) { + return; + } + for (int i = mControllerCallbacks.size() - 1; i >= 0; i--) { + ISessionControllerCallback cb = mControllerCallbacks.get(i); + try { + Log.d(TAG, "pushBrowsePlayerInfo"); + cb.onUpdateFolderInfoBrowsedPlayer(mBrowsedPlayerURI); + } catch (DeadObjectException e) { + Log.w(TAG, "Removing dead callback in pushBrowsePlayerInfo. ", e); + mControllerCallbacks.remove(i); + } catch (RemoteException e) { + Log.w(TAG, "unexpected exception in pushBrowsePlayerInfo. ", e); + } + } + } + } + + private void pushNowPlayingEntries() { + synchronized (mLock) { + if (mDestroyed) { + return; + } + for (int i = mControllerCallbacks.size() - 1; i >= 0; i--) { + ISessionControllerCallback cb = mControllerCallbacks.get(i); + try { + Log.d(TAG, "pushNowPlayingEntries"); + cb.onUpdateNowPlayingEntries(mNowPlayingList); + } catch (DeadObjectException e) { + Log.w(TAG, "Removing dead callback in pushNowPlayingEntries. ", e); + mControllerCallbacks.remove(i); + } catch (RemoteException e) { + Log.w(TAG, "unexpected exception in pushNowPlayingEntries. ", e); + } + } + } + } + + private void pushNowPlayingContentChange() { + synchronized (mLock) { + if (mDestroyed) { + return; + } + for (int i = mControllerCallbacks.size() - 1; i >= 0; i--) { + ISessionControllerCallback cb = mControllerCallbacks.get(i); + try { + Log.d(TAG, "pushNowPlayingContentChange"); + cb.onUpdateNowPlayingContentChange(); + } catch (DeadObjectException e) { + Log.w(TAG, "Removing dead callback in pushNowPlayingContentChange. ", e); + mControllerCallbacks.remove(i); + } catch (RemoteException e) { + Log.w(TAG, "unexpected exception in pushNowPlayingContentChange. ", e); + } + } + } + } + + private void pushPlayItemResponse() { + synchronized (mLock) { + if (mDestroyed) { + return; + } + for (int i = mControllerCallbacks.size() - 1; i >= 0; i--) { + ISessionControllerCallback cb = mControllerCallbacks.get(i); + try { + Log.d(TAG, "pushPlayItemResponse"); + cb.onPlayItemResponse(mPlayItemStatus); + } catch (DeadObjectException e) { + Log.w(TAG, "Removing dead callback in pushPlayItemResponse. ", e); + mControllerCallbacks.remove(i); + } catch (RemoteException e) { + Log.w(TAG, "unexpected exception in pushPlayItemResponse. ", e); + } + } + } + } + private void pushQueueUpdate() { synchronized (mLock) { if (mDestroyed) { @@ -774,6 +857,33 @@ public void setQueue(ParceledListSlice queue) { mHandler.post(MessageHandler.MSG_UPDATE_QUEUE); } + @Override + public void updateFolderInfoBrowsedPlayer(String stringUri) { + Log.d(TAG, "SessionStub: updateFolderInfoBrowsedPlayer"); + mBrowsedPlayerURI = stringUri; + mHandler.post(MessageHandler.MSG_FOLDER_INFO_BROWSED_PLAYER); + } + + @Override + public void updateNowPlayingEntries(long[] playList) { + Log.d(TAG, "SessionStub: updateNowPlayingEntries"); + mNowPlayingList = playList; + mHandler.post(MessageHandler.MSG_UPDATE_NOWPLAYING_ENTRIES); + } + + @Override + public void updateNowPlayingContentChange() { + Log.d(TAG, "SessionStub: updateNowPlayingContentChange"); + mHandler.post(MessageHandler.MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE); + } + + @Override + public void playItemResponse(boolean success) { + Log.d(TAG, "SessionStub: playItemResponse"); + mPlayItemStatus = success; + mHandler.post(MessageHandler.MSG_PLAY_ITEM_RESPONSE); + } + @Override public void setQueueTitle(CharSequence title) { mQueueTitle = title; @@ -957,6 +1067,7 @@ public void rewind() { } public void seekTo(long pos) { + Slog.d(TAG, "seekTo in SessionCb"); try { mCb.onSeekTo(pos); } catch (RemoteException e) { @@ -964,6 +1075,42 @@ public void seekTo(long pos) { } } + /** + * @hide + */ + public void setRemoteControlClientBrowsedPlayer() { + Slog.d(TAG, "setRemoteControlClientBrowsedPlayer in SessionCb"); + try { + mCb.setRemoteControlClientBrowsedPlayer(); + } catch (RemoteException e) { + Slog.e(TAG, "Remote failure in setRemoteControlClientBrowsedPlayer.", e); + } + } + + /** + * @hide + */ + public void setRemoteControlClientPlayItem(long uid, int scope) throws RemoteException { + Slog.d(TAG, "setRemoteControlClientPlayItem in SessionCb"); + try { + mCb.setRemoteControlClientPlayItem(uid, scope); + } catch (RemoteException e) { + Slog.e(TAG, "Remote failure in setRemoteControlClientPlayItem.", e); + } + } + + /** + * @hide + */ + public void getRemoteControlClientNowPlayingEntries() throws RemoteException { + Slog.d(TAG, "getRemoteControlClientNowPlayingEntries in SessionCb"); + try { + mCb.getRemoteControlClientNowPlayingEntries(); + } catch (RemoteException e) { + Slog.e(TAG, "Remote failure in getRemoteControlClientNowPlayingEntries.", e); + } + } + public void rate(Rating rating) { try { mCb.onRate(rating); @@ -1157,9 +1304,28 @@ public void rewind() throws RemoteException { @Override public void seekTo(long pos) throws RemoteException { + Log.d(TAG, "seekTo in ControllerStub"); mSessionCb.seekTo(pos); } + @Override + public void setRemoteControlClientBrowsedPlayer() throws RemoteException { + Log.d(TAG, "setRemoteControlClientBrowsedPlayer in ControllerStub"); + mSessionCb.setRemoteControlClientBrowsedPlayer(); + } + + @Override + public void setRemoteControlClientPlayItem(long uid, int scope) throws RemoteException { + Log.d(TAG, "setRemoteControlClientPlayItem in ControllerStub"); + mSessionCb.setRemoteControlClientPlayItem(uid, scope); + } + + @Override + public void getRemoteControlClientNowPlayingEntries() throws RemoteException { + Log.d(TAG, "getRemoteControlClientNowPlayingEntries in ControllerStub"); + mSessionCb.getRemoteControlClientNowPlayingEntries(); + } + @Override public void rate(Rating rating) throws RemoteException { mSessionCb.rate(rating); @@ -1224,6 +1390,10 @@ private class MessageHandler extends Handler { private static final int MSG_UPDATE_SESSION_STATE = 7; private static final int MSG_UPDATE_VOLUME = 8; private static final int MSG_DESTROYED = 9; + private static final int MSG_FOLDER_INFO_BROWSED_PLAYER = 10; + private static final int MSG_UPDATE_NOWPLAYING_ENTRIES = 11; + private static final int MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE = 12; + private static final int MSG_PLAY_ITEM_RESPONSE = 13; public MessageHandler(Looper looper) { super(looper); @@ -1257,6 +1427,18 @@ public void handleMessage(Message msg) { break; case MSG_DESTROYED: pushSessionDestroyed(); + case MSG_FOLDER_INFO_BROWSED_PLAYER: + pushBrowsePlayerInfo(); + break; + case MSG_UPDATE_NOWPLAYING_ENTRIES: + pushNowPlayingEntries(); + break; + case MSG_UPDATE_NOWPLAYING_CONTENT_CHANGE: + pushNowPlayingContentChange(); + break; + case MSG_PLAY_ITEM_RESPONSE: + pushPlayItemResponse(); + break; } } diff --git a/services/core/java/com/android/server/net/NetPluginDelegate.java b/services/core/java/com/android/server/net/NetPluginDelegate.java new file mode 100644 index 00000000000..6716a6b6c29 --- /dev/null +++ b/services/core/java/com/android/server/net/NetPluginDelegate.java @@ -0,0 +1,101 @@ +/* + *Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + *Redistribution and use in source and binary forms, with or without + *modification, are permitted provided that the following conditions are + *met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + *ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + *BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + *IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.android.server.net; + +import dalvik.system.PathClassLoader; + +import java.lang.reflect.Constructor; + +import android.util.Slog; +import android.net.NetworkStats; +import android.util.Log; + +class NetPluginDelegate { + + private static final String TAG = "ConnectivityExtension"; + private static final boolean LOGV = false; + + private static Class tetherExtensionClass = null; + private static Object tetherExtensionObj = null; + + private static boolean extensionFailed; + + static void getTetherStats(NetworkStats uidStats, NetworkStats devStats, + NetworkStats xtStats) { + if (!loadTetherExtJar()) { + return; + } + try { + tetherExtensionClass.getMethod("getTetherStats", NetworkStats.class, + NetworkStats.class, NetworkStats.class).invoke(tetherExtensionObj, uidStats, + devStats, xtStats); + } catch (Exception e) { + e.printStackTrace(); + Log.w(TAG, "error in invoke method"); + } + } + + static void setQuota(String iface, long quota) { + if (!loadTetherExtJar()) { + return; + } + try { + tetherExtensionClass.getMethod("setQuota", String.class, long.class).invoke( + tetherExtensionObj, iface, quota); + } catch (Exception ex) { + Log.w(TAG, "Error calling setQuota Method on extension jar"); + } + } + + + + private static boolean loadTetherExtJar() { + final String realProvider = "com.qualcomm.qti.tetherstatsextension.TetherStatsReporting"; + final String realProviderPath = "/system/framework/ConnectivityExt.jar"; + if (!extensionFailed && tetherExtensionClass == null && tetherExtensionObj == null) { + if (LOGV) Slog.v(TAG, "loading ConnectivityExt jar"); + try { + + PathClassLoader classLoader = new PathClassLoader(realProviderPath, + ClassLoader.getSystemClassLoader()); + + tetherExtensionClass = classLoader.loadClass(realProvider); + tetherExtensionObj = tetherExtensionClass.newInstance(); + if (LOGV) + Slog.v(TAG, "ConnectivityExt jar loaded"); + extensionFailed = false; + } catch (Exception e) { + Log.w(TAG, "Connectivity extension is not available"); + extensionFailed = true; + } + } + return !extensionFailed; + } +} diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index 1b08c2fcb65..bfe01c06d21 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -2526,6 +2526,7 @@ public boolean handleMessage(Message msg) { private void setInterfaceQuota(String iface, long quotaBytes) { try { mNetworkManager.setInterfaceQuota(iface, quotaBytes); + NetPluginDelegate.setQuota(iface, quotaBytes); } catch (IllegalStateException e) { Log.wtf(TAG, "problem setting interface quota", e); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java index 844934846f0..acd05f7b304 100644 --- a/services/core/java/com/android/server/net/NetworkStatsService.java +++ b/services/core/java/com/android/server/net/NetworkStatsService.java @@ -971,7 +971,7 @@ private void recordSnapshotLocked(long currentTime) throws RemoteException { final NetworkStats uidSnapshot = getNetworkStatsUidDetail(); final NetworkStats xtSnapshot = mNetworkManager.getNetworkStatsSummaryXt(); final NetworkStats devSnapshot = mNetworkManager.getNetworkStatsSummaryDev(); - + NetPluginDelegate.getTetherStats(uidSnapshot, xtSnapshot, devSnapshot); VpnInfo[] vpnArray = mConnManager.getAllVpnInfo(); mDevRecorder.recordSnapshotLocked(devSnapshot, mActiveIfaces, null, currentTime); mXtRecorder.recordSnapshotLocked(xtSnapshot, mActiveIfaces, null, currentTime); diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 288810c5bd8..d70b8b14f75 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -2340,7 +2340,9 @@ private void buzzBeepBlinkLocked(NotificationRecord record) { if (disableEffects != null) { ZenLog.traceDisableEffects(record, disableEffects); } - if (disableEffects == null + boolean smsRingtone = getContext().getResources().getBoolean( + com.android.internal.R.bool.config_sms_ringtone_incall); + if ((disableEffects == null || (smsRingtone && mInCall)) && (!(record.isUpdate && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 )) && (record.getUserId() == UserHandle.USER_ALL || diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index c1d091b04c1..480a79eafea 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -87,6 +87,7 @@ import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.AppGlobals; +import android.app.AppOpsManager; import android.app.IActivityManager; import android.app.admin.IDevicePolicyManager; import android.app.backup.IBackupManager; @@ -172,6 +173,7 @@ import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.os.storage.VolumeRecord; +import android.provider.Settings.Secure; import android.security.KeyStore; import android.security.SystemKeyStore; import android.system.ErrnoException; @@ -819,6 +821,8 @@ private static boolean hasValidDomains(ActivityIntentInfo filter) { private IntentFilterVerifier mIntentFilterVerifier; + private AppOpsManager mAppOps; + // Set of pending broadcasts for aggregating enable/disable of components. static class PendingPackageBroadcasts { // for each user id, a map of components within that package> @@ -1432,6 +1436,17 @@ void doHandleMessage(Message msg) { } } } + if (!update && !isSystemApp(res.pkg)) { + boolean privacyGuard = Secure.getIntForUser( + mContext.getContentResolver(), + android.provider.Settings.Secure.PRIVACY_GUARD_DEFAULT, + 0, UserHandle.USER_CURRENT) == 1; + if (privacyGuard) { + mAppOps.setPrivacyGuardSettingForPackage( + res.pkg.applicationInfo.uid, + res.pkg.applicationInfo.packageName, true); + } + } // Log current value of "unknown sources" setting EventLog.writeEvent(EventLogTags.UNKNOWN_SOURCES_ENABLED, getUnknownSourcesSettings()); @@ -1835,6 +1850,8 @@ public PackageManagerService(Context context, Installer installer, } mDexOptLRUThresholdInMills = dexOptLRUThresholdInMinutes * 60 * 1000; + mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); + String separateProcesses = SystemProperties.get("debug.separate_processes"); if (separateProcesses != null && separateProcesses.length() > 0) { if ("*".equals(separateProcesses)) { @@ -9513,6 +9530,7 @@ void startCleaningPackages() { public void installPackage(String originPath, IPackageInstallObserver2 observer, int installFlags, String installerPackageName, VerificationParams verificationParams, String packageAbiOverride) { + android.util.SeempLog.record(90); installPackageAsUser(originPath, observer, installFlags, installerPackageName, verificationParams, packageAbiOverride, UserHandle.getCallingUserId()); } diff --git a/services/core/java/com/android/server/policy/GlobalActions.java b/services/core/java/com/android/server/policy/GlobalActions.java index 3cee9279c01..8e73495b1ba 100644 --- a/services/core/java/com/android/server/policy/GlobalActions.java +++ b/services/core/java/com/android/server/policy/GlobalActions.java @@ -40,6 +40,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.os.IPowerManager; import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; @@ -93,6 +94,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac /* Valid settings for global actions keys. * see config.xml config_globalActionList */ private static final String GLOBAL_ACTION_KEY_POWER = "power"; + private static final String GLOBAL_ACTION_KEY_REBOOT = "reboot"; private static final String GLOBAL_ACTION_KEY_AIRPLANE = "airplane"; private static final String GLOBAL_ACTION_KEY_BUGREPORT = "bugreport"; private static final String GLOBAL_ACTION_KEY_SILENT = "silent"; @@ -273,6 +275,8 @@ public boolean showBeforeProvisioning() { } if (GLOBAL_ACTION_KEY_POWER.equals(actionKey)) { mItems.add(new PowerAction()); + } else if (GLOBAL_ACTION_KEY_REBOOT.equals(actionKey)) { + mItems.add(new RebootAction()); } else if (GLOBAL_ACTION_KEY_AIRPLANE.equals(actionKey)) { mItems.add(mAirplaneModeOn); } else if (GLOBAL_ACTION_KEY_BUGREPORT.equals(actionKey)) { @@ -367,6 +371,35 @@ public void onPress() { } } + private final class RebootAction extends SinglePressAction { + private RebootAction() { + super(com.android.internal.R.drawable.ic_lock_power_reboot, + R.string.global_action_reboot); + } + + @Override + public boolean showDuringKeyguard() { + return true; + } + + @Override + public boolean showBeforeProvisioning() { + return true; + } + + @Override + public void onPress() { + try { + IPowerManager pm = IPowerManager.Stub.asInterface(ServiceManager + .getService(Context.POWER_SERVICE)); + pm.reboot(true, null, false); + } catch (RemoteException e) { + Log.e(TAG, "PowerManager service died!", e); + return; + } + } + } + private Action getBugReportAction() { return new SinglePressAction(com.android.internal.R.drawable.ic_lock_bugreport, R.string.bugreport_title) { diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 0cbf614e45a..bfa746a9f64 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -217,6 +217,19 @@ public class PhoneWindowManager implements WindowManagerPolicy { .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION) .build(); + /** + * Broadcast Action: WiFi Display video is enabled or disabled + * + *

The intent will have the following extra values:

+ *
    + *
  • state - 0 for disabled, 1 for enabled.
  • + *
+ */ + + private static final String ACTION_WIFI_DISPLAY_VIDEO = + "org.codeaurora.intent.action.WIFI_DISPLAY_VIDEO"; + + // The panic gesture may become active only after the keyguard is dismissed and the immersive // app shows again. If that doesn't happen for 30s we drop the gesture. private static final long PANIC_GESTURE_EXPIRATION = 30000; @@ -568,6 +581,9 @@ public void onDrawn() { int mOverscanRight = 0; int mOverscanBottom = 0; + // Panel Orientation default portrait + private int mPanelOrientation = Surface.ROTATION_0; + // What we do when the user long presses on home private int mLongPressOnHomeBehavior; @@ -637,6 +653,8 @@ public void onDrawn() { private static final int MSG_POWER_DELAYED_PRESS = 13; private static final int MSG_POWER_LONG_PRESS = 14; private static final int MSG_UPDATE_DREAMING_SLEEP_TOKEN = 15; + boolean mWifiDisplayConnected = false; + int mWifiDisplayCustomRotation = -1; private class PolicyHandler extends Handler { @Override @@ -1535,6 +1553,11 @@ public void onUpOrCancel() { mWindowManagerFuncs.registerPointerEventListener(mSystemGestures); mVibrator = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE); + + /* Register for WIFI Display Intents */ + IntentFilter wifiDisplayFilter = new IntentFilter(ACTION_WIFI_DISPLAY_VIDEO); + Intent wifidisplayIntent = context.registerReceiver( + mWifiDisplayReceiver, wifiDisplayFilter); mLongPressVibePattern = getLongIntArray(mContext.getResources(), com.android.internal.R.array.config_longPressVibePattern); mVirtualKeyVibePattern = getLongIntArray(mContext.getResources(), @@ -1599,7 +1622,8 @@ public void setInitialDisplaySize(Display display, int width, int height, int de return; } mDisplay = display; - + mPanelOrientation = + SystemProperties.getInt("persist.panel.orientation", 0) / 90; final Resources res = mContext.getResources(); int shortSize, longSize; if (width > height) { @@ -2665,6 +2689,19 @@ public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int p + " canceled=" + canceled); } + // If the boot mode is power off alarm, we should not dispatch the several physical keys + // in power off alarm UI to avoid pausing power off alarm UI. + int isPowerOffAlarmMode = Settings.System.getInt(mContext.getContentResolver(), + Settings.System.POWER_OFF_ALARM_MODE, 0); + if (DEBUG_INPUT) { Log.d(TAG, "intercept Dispatching isPowerOffAlarmMode = " + + isPowerOffAlarmMode); } + + if (isPowerOffAlarmMode == 1 && (keyCode == KeyEvent.KEYCODE_HOME + || keyCode == KeyEvent.KEYCODE_SEARCH + || keyCode == KeyEvent.KEYCODE_MENU)) { + return -1; // ignore the physical key here + } + // If we think we might have a volume down & power key chord on the way // but we're not sure, then tell the dispatcher to wait a little while and // try again later before dispatching. @@ -5485,6 +5522,24 @@ private void requestTransientBars(WindowState swipeTarget) { } } + + BroadcastReceiver mWifiDisplayReceiver = new BroadcastReceiver() { + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (action.equals(ACTION_WIFI_DISPLAY_VIDEO)) { + int state = intent.getIntExtra("state", 0); + if(state == 1) { + mWifiDisplayConnected = true; + } else { + mWifiDisplayConnected = false; + } + mWifiDisplayCustomRotation = + intent.getIntExtra("wfd_UIBC_rot", -1); + updateRotation(true); + } + } + }; + // Called on the PowerManager's Notifier thread. @Override public void startedGoingToSleep(int why) { @@ -5856,10 +5911,13 @@ public int rotationForOrientationLw(int orientation, int lastRotation) { // enable 180 degree rotation while docked. preferredRotation = mDeskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation; - } else if (mHdmiPlugged && mDemoHdmiRotationLock) { + } else if ((mHdmiPlugged || mWifiDisplayConnected) && mDemoHdmiRotationLock) { // Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled. // Note that the dock orientation overrides the HDMI orientation. preferredRotation = mDemoHdmiRotation; + } else if (mWifiDisplayConnected && (mWifiDisplayCustomRotation > -1)) { + // Ignore sensor when WFD is active and UIBC rotation is enabled + preferredRotation = mWifiDisplayCustomRotation; } else if (mHdmiPlugged && mDockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED && mUndockedHdmiRotation >= 0) { // Ignore sensor when plugged into HDMI and an undocked orientation has @@ -5897,7 +5955,7 @@ public int rotationForOrientationLw(int orientation, int lastRotation) { mAllowAllRotations = mContext.getResources().getBoolean( com.android.internal.R.bool.config_allowAllRotations) ? 1 : 0; } - if (sensorRotation != Surface.ROTATION_180 + if (sensorRotation != mUpsideDownRotation || mAllowAllRotations == 1 || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER) { @@ -5975,7 +6033,7 @@ public int rotationForOrientationLw(int orientation, int lastRotation) { if (preferredRotation >= 0) { return preferredRotation; } - return Surface.ROTATION_0; + return mPanelOrientation; } } } diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 1f45896400f..f6b67865699 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -461,6 +461,9 @@ public final class PowerManagerService extends SystemService private final ArrayList mLowPowerModeListeners = new ArrayList(); + //track the blocked uids. + private final ArrayList mBlockedUids = new ArrayList(); + private native void nativeInit(); private static native void nativeAcquireSuspendBlocker(String name); @@ -808,6 +811,15 @@ private void acquireWakeLockInternal(IBinder lock, int flags, String tag, String } mWakeLocks.add(wakeLock); setWakeLockDisabledStateLocked(wakeLock); + if(mBlockedUids.contains(new Integer(uid)) && uid != Process.myUid()) { + //wakelock acquisition for blocked uid, disable it. + if (DEBUG_SPEW) { + Slog.d(TAG, "uid is blocked disabling wakeLock flags=0x" + + Integer.toHexString(flags) + " tag=" + tag + " uid=" + uid + + " pid =" + pid); + } + updateBlockedWakelock(wakeLock, true); + } notifyAcquire = true; } @@ -3503,6 +3515,43 @@ protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { Binder.restoreCallingIdentity(ident); } } + + /* updates the blocked uids, so if a wake lock is acquired for it + * can be released. + */ + public void updateBlockedUids(int uid, boolean isBlocked) { + boolean changed = false; + if (DEBUG_SPEW) Slog.v(TAG, "updateBlockedUids: uid = " + uid + + "isBlocked = " + isBlocked); + if (Binder.getCallingUid() != Process.SYSTEM_UID) { + if (DEBUG_SPEW) Slog.v(TAG, "UpdateBlockedUids is not allowed"); + return; + } + synchronized(mLock) { + for (int index = 0; index < mWakeLocks.size(); index++) { + WakeLock wl = mWakeLocks.get(index); + if(wl != null) { + // update the wakelock for the blocked uid + if ((wl.mOwnerUid == uid || checkWorkSourceObjectId(uid, wl)) || + (wl.mTag.startsWith("*sync*") && wl.mOwnerUid == Process.SYSTEM_UID)) { + if(updateBlockedWakelock(wl, isBlocked)){ + changed = true; + } + } + } + } + if(isBlocked) { + mBlockedUids.add(new Integer(uid)); + } + else { + mBlockedUids.clear(); + } + } + if(changed){ + mDirty |= DIRTY_WAKE_LOCKS; + updatePowerStateLocked(); + } + } } private final class LocalService extends PowerManagerInternal { @@ -3600,4 +3649,36 @@ public void powerHint(int hintId, int data) { powerHintInternal(hintId, data); } } + + private boolean updateBlockedWakelock(WakeLock wakeLock, boolean update) { + if (wakeLock != null && ((wakeLock.mFlags & PowerManager.WAKE_LOCK_LEVEL_MASK) + == PowerManager.PARTIAL_WAKE_LOCK )) { + if(wakeLock.mDisabled != update){ + wakeLock.mDisabled = update; + if (wakeLock.mDisabled) { + // This wake lock is no longer being respected. + notifyWakeLockReleasedLocked(wakeLock); + } else { + notifyWakeLockAcquiredLocked(wakeLock); + } + return true; + } + } + return false; + } + + private boolean checkWorkSourceObjectId(int uid, WakeLock wl) { + try { + for (int index = 0; index < wl.mWorkSource.size(); index++) { + if (uid == wl.mWorkSource.get(index)) { + if (DEBUG_SPEW) Slog.v(TAG, "WS uid matched"); + return true; + } + } + } + catch (Exception e) { + return false; + } + return false; + } } diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java index dd8648d60d8..d5ad30cdd7f 100644 --- a/services/core/java/com/android/server/power/ShutdownThread.java +++ b/services/core/java/com/android/server/power/ShutdownThread.java @@ -52,6 +52,8 @@ import android.util.Log; import android.view.WindowManager; +import java.lang.reflect.Method; +import dalvik.system.PathClassLoader; import java.io.BufferedReader; import java.io.File; @@ -142,13 +144,25 @@ static void shutdownInner(final Context context, boolean confirm) { } } + boolean showRebootOption = false; + String[] defaultActions = context.getResources().getStringArray( + com.android.internal.R.array.config_globalActionsList); + for (int i = 0; i < defaultActions.length; i++) { + if (defaultActions[i].equals("reboot")) { + showRebootOption = true; + break; + } + } final int longPressBehavior = context.getResources().getInteger( com.android.internal.R.integer.config_longPressOnPowerBehavior); - final int resourceId = mRebootSafeMode + int resourceId = mRebootSafeMode ? com.android.internal.R.string.reboot_safemode_confirm : (longPressBehavior == 2 ? com.android.internal.R.string.shutdown_confirm_question : com.android.internal.R.string.shutdown_confirm); + if (showRebootOption && !mRebootSafeMode) { + resourceId = com.android.internal.R.string.reboot_confirm; + } Log.d(TAG, "Notifying thread to start shutdown longPressBehavior=" + longPressBehavior); @@ -160,7 +174,9 @@ static void shutdownInner(final Context context, boolean confirm) { sConfirmDialog = new AlertDialog.Builder(context) .setTitle(mRebootSafeMode ? com.android.internal.R.string.reboot_safemode_title - : com.android.internal.R.string.power_off) + : showRebootOption + ? com.android.internal.R.string.reboot_title + : com.android.internal.R.string.power_off) .setMessage(resourceId) .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { @@ -619,6 +635,7 @@ public void run() { * @param reason reason for reboot */ public static void rebootOrShutdown(final Context context, boolean reboot, String reason) { + deviceRebootOrShutdown(reboot, reason); if (reboot) { Log.i(TAG, "Rebooting, reason: " + reason); PowerManagerService.lowLevelReboot(reason); @@ -722,4 +739,25 @@ public void run() { Log.w(TAG, "Timed out waiting for uncrypt."); } } + + private static void deviceRebootOrShutdown(boolean reboot, String reason) { + Class cl; + String deviceShutdownClassName = "com.qti.server.power.ShutdownOem"; + try { + cl = Class.forName(deviceShutdownClassName); + Method m; + try { + m = cl.getMethod("rebootOrShutdown", new Class[] {boolean.class, String.class}); + m.invoke(cl.newInstance(), reboot, reason); + } catch (NoSuchMethodException ex) { + Log.e(TAG, "rebootOrShutdown method not found in class " + deviceShutdownClassName); + } catch (Exception ex) { + Log.e(TAG, "Unknown exception hit while trying to invode rebootOrShutdown"); + } + } catch (ClassNotFoundException e) { + Log.e(TAG, "Unable to find class " + deviceShutdownClassName); + } catch (Exception e) { + Log.e(TAG, "Unknown exception while trying to invoke rebootOrShutdown"); + } + } } diff --git a/services/core/java/com/android/server/tv/TvInputHal.java b/services/core/java/com/android/server/tv/TvInputHal.java index a035826c770..a775c5ab04c 100644 --- a/services/core/java/com/android/server/tv/TvInputHal.java +++ b/services/core/java/com/android/server/tv/TvInputHal.java @@ -146,7 +146,7 @@ private void streamConfigsChangedFromNative(int deviceId) { private void firstFrameCapturedFromNative(int deviceId, int streamId) { mHandler.sendMessage( - mHandler.obtainMessage(EVENT_STREAM_CONFIGURATION_CHANGED, deviceId, streamId)); + mHandler.obtainMessage(EVENT_FIRST_FRAME_CAPTURED, deviceId, streamId)); } // Handler.Callback implementation diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index c40947b99aa..114681984a7 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -467,7 +467,7 @@ public void onReceive(Context context, Intent intent) { /** All DisplayContents in the world, kept here */ SparseArray mDisplayContents = new SparseArray<>(2); - int mRotation = 0; + int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; boolean mAltOrientation = false; diff --git a/services/core/jni/Android.mk b/services/core/jni/Android.mk index 98d8d086e51..0496592a411 100644 --- a/services/core/jni/Android.mk +++ b/services/core/jni/Android.mk @@ -72,3 +72,13 @@ LOCAL_SHARED_LIBRARIES += \ libGLESv2 \ libnetutils \ +ifeq ($(BOARD_USES_QC_TIME_SERVICES),true) +LOCAL_CFLAGS += -DHAVE_QC_TIME_SERVICES=1 +LOCAL_SHARED_LIBRARIES += libtime_genoff +$(shell mkdir -p $(OUT)/obj/SHARED_LIBRARIES/libtime_genoff_intermediates/) +$(shell touch $(OUT)/obj/SHARED_LIBRARIES/libtime_genoff_intermediates/export_includes) +endif + +ifeq ($(BOARD_HAVE_TIMERFD_POWEROFF_ALARM),true) +LOCAL_CFLAGS += -DWITH_TIMERFD_POWEROFF_ALARM +endif diff --git a/services/core/jni/com_android_server_AlarmManagerService.cpp b/services/core/jni/com_android_server_AlarmManagerService.cpp index 3fd0f84f595..80b89239d15 100644 --- a/services/core/jni/com_android_server_AlarmManagerService.cpp +++ b/services/core/jni/com_android_server_AlarmManagerService.cpp @@ -40,17 +40,26 @@ #include #include +#if HAVE_QC_TIME_SERVICES +extern "C" { +#include +} +#endif + namespace android { -static const size_t N_ANDROID_TIMERFDS = ANDROID_ALARM_TYPE_COUNT + 1; -static const clockid_t android_alarm_to_clockid[N_ANDROID_TIMERFDS] = { +static const clockid_t android_alarm_to_clockid[] = { CLOCK_REALTIME_ALARM, CLOCK_REALTIME, CLOCK_BOOTTIME_ALARM, CLOCK_BOOTTIME, CLOCK_MONOTONIC, +#ifdef WITH_TIMERFD_POWEROFF_ALARM + CLOCK_POWEROFF_ALARM, +#endif CLOCK_REALTIME, }; +static const size_t N_ANDROID_TIMERFDS = sizeof(android_alarm_to_clockid)/sizeof(clockid_t); /* to match the legacy alarm driver implementation, we need an extra CLOCK_REALTIME fd which exists specifically to be canceled on RTC changes */ @@ -61,6 +70,7 @@ class AlarmImpl virtual ~AlarmImpl(); virtual int set(int type, struct timespec *ts) = 0; + virtual int clear(int type, struct timespec *ts) = 0; virtual int setTime(struct timeval *tv) = 0; virtual int waitForAlarm() = 0; @@ -75,6 +85,7 @@ class AlarmImplAlarmDriver : public AlarmImpl AlarmImplAlarmDriver(int fd) : AlarmImpl(&fd, 1) { } int set(int type, struct timespec *ts); + int clear(int type, struct timespec *ts); int setTime(struct timeval *tv); int waitForAlarm(); }; @@ -87,6 +98,7 @@ class AlarmImplTimerFd : public AlarmImpl ~AlarmImplTimerFd(); int set(int type, struct timespec *ts); + int clear(int type, struct timespec *ts); int setTime(struct timeval *tv); int waitForAlarm(); @@ -114,6 +126,30 @@ int AlarmImplAlarmDriver::set(int type, struct timespec *ts) return ioctl(fds[0], ANDROID_ALARM_SET(type), ts); } +int AlarmImplAlarmDriver::clear(int type, struct timespec *ts) +{ + return ioctl(fds[0], ANDROID_ALARM_CLEAR(type), ts); +} + +#if HAVE_QC_TIME_SERVICES +static int setTimeServicesTime(time_bases_type base, long int secs) +{ + int rc = 0; + time_genoff_info_type time_set; + uint64_t value = secs; + time_set.base = base; + time_set.unit = TIME_SECS; + time_set.operation = T_SET; + time_set.ts_val = &value; + rc = time_genoff_operation(&time_set); + if (rc) { + ALOGE("Error setting generic offset: %d. Still setting system time\n", rc); + rc = -1; + } + return rc; +} +#endif + int AlarmImplAlarmDriver::setTime(struct timeval *tv) { struct timespec ts; @@ -122,6 +158,10 @@ int AlarmImplAlarmDriver::setTime(struct timeval *tv) ts.tv_sec = tv->tv_sec; ts.tv_nsec = tv->tv_usec * 1000; res = ioctl(fds[0], ANDROID_ALARM_SET_RTC, &ts); +#if HAVE_QC_TIME_SERVICES + setTimeServicesTime(ATS_USER, (tv->tv_sec)); +#endif + if (res < 0) ALOGV("ANDROID_ALARM_SET_RTC ioctl failed: %s\n", strerror(errno)); return res; @@ -142,7 +182,7 @@ AlarmImplTimerFd::~AlarmImplTimerFd() int AlarmImplTimerFd::set(int type, struct timespec *ts) { - if (type > ANDROID_ALARM_TYPE_COUNT) { + if (type >= static_cast(N_ANDROID_TIMERFDS)) { errno = EINVAL; return -1; } @@ -160,6 +200,23 @@ int AlarmImplTimerFd::set(int type, struct timespec *ts) return timerfd_settime(fds[type], TFD_TIMER_ABSTIME, &spec, NULL); } +int AlarmImplTimerFd::clear(int type, struct timespec *ts) +{ + if (type >= static_cast(N_ANDROID_TIMERFDS)) { + errno = EINVAL; + return -1; + } + + ts->tv_sec = 0; + ts->tv_nsec = 0; + + struct itimerspec spec; + memset(&spec, 0, sizeof(spec)); + memcpy(&spec.it_value, ts, sizeof(spec.it_value)); + + return timerfd_settime(fds[type], TFD_TIMER_ABSTIME, &spec, NULL); +} + int AlarmImplTimerFd::setTime(struct timeval *tv) { struct rtc_time rtc; @@ -226,7 +283,7 @@ int AlarmImplTimerFd::waitForAlarm() uint64_t unused; ssize_t err = read(fds[alarm_idx], &unused, sizeof(unused)); if (err < 0) { - if (alarm_idx == ANDROID_ALARM_TYPE_COUNT && errno == ECANCELED) { + if (alarm_idx == (N_ANDROID_TIMERFDS - 1) && errno == ECANCELED) { result |= ANDROID_ALARM_TIME_CHANGE_MASK; } else { return err; @@ -398,7 +455,7 @@ static jlong init_timerfd() /* 0 = disarmed; the timerfd doesn't need to be armed to get RTC change notifications, just set up as cancelable */ - int err = timerfd_settime(fds[ANDROID_ALARM_TYPE_COUNT], + int err = timerfd_settime(fds[N_ANDROID_TIMERFDS - 1], TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET, &spec, NULL); if (err < 0) { ALOGV("timerfd_settime() failed: %s", strerror(errno)); @@ -441,6 +498,23 @@ static void android_server_AlarmManagerService_set(JNIEnv*, jobject, jlong nativ } } +static void android_server_AlarmManagerService_clear(JNIEnv*, jobject, jlong nativeData, jint type, +jlong seconds, jlong nanoseconds) +{ + AlarmImpl *impl = reinterpret_cast(nativeData); + struct timespec ts; + ts.tv_sec = seconds; + ts.tv_nsec = nanoseconds; + + int result = impl->clear(type, &ts); + if (result < 0) + { + ALOGE("Unable to clear alarm %lld.%09lld: %s\n", + static_cast(seconds), + static_cast(nanoseconds), strerror(errno)); + } +} + static jint android_server_AlarmManagerService_waitForAlarm(JNIEnv*, jobject, jlong nativeData) { AlarmImpl *impl = reinterpret_cast(nativeData); @@ -465,6 +539,7 @@ static JNINativeMethod sMethods[] = { {"init", "()J", (void*)android_server_AlarmManagerService_init}, {"close", "(J)V", (void*)android_server_AlarmManagerService_close}, {"set", "(JIJJ)V", (void*)android_server_AlarmManagerService_set}, + {"clear", "(JIJJ)V", (void*)android_server_AlarmManagerService_clear}, {"waitForAlarm", "(J)I", (void*)android_server_AlarmManagerService_waitForAlarm}, {"setKernelTime", "(JJ)I", (void*)android_server_AlarmManagerService_setKernelTime}, {"setKernelTimezone", "(JI)I", (void*)android_server_AlarmManagerService_setKernelTimezone}, diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp index 64514a9f72e..3f46ec6bf5a 100644 --- a/services/core/jni/com_android_server_SystemServer.cpp +++ b/services/core/jni/com_android_server_SystemServer.cpp @@ -25,12 +25,24 @@ namespace android { +void* sensorInit(void *arg) { + ALOGI("System server: starting sensor init.\n"); + // Start the sensor service + SensorService::instantiate(); + ALOGI("System server: sensor init done.\n"); + return NULL; +} + static void android_server_SystemServer_startSensorService(JNIEnv* /* env */, jobject /* clazz */) { char propBuf[PROPERTY_VALUE_MAX]; + pthread_t sensor_init_thread; + property_get("system_init.startsensorservice", propBuf, "1"); if (strcmp(propBuf, "1") == 0) { - // Start the sensor service - SensorService::instantiate(); + // We are safe to move this to a new thread because + // Android frame work has taken care to check whether the + // service is started or not before using it. + pthread_create( &sensor_init_thread, NULL, &sensorInit, NULL); } } diff --git a/services/core/jni/com_android_server_tv_TvInputHal.cpp b/services/core/jni/com_android_server_tv_TvInputHal.cpp index 507bc9cb526..b7c19db0d3f 100644 --- a/services/core/jni/com_android_server_tv_TvInputHal.cpp +++ b/services/core/jni/com_android_server_tv_TvInputHal.cpp @@ -32,6 +32,8 @@ #include #include +#include + namespace android { static struct { @@ -71,37 +73,6 @@ static struct { //////////////////////////////////////////////////////////////////////////////// -class BufferProducerThread : public Thread { -public: - BufferProducerThread(tv_input_device_t* device, int deviceId, const tv_stream_t* stream); - - virtual status_t readyToRun(); - - void setSurface(const sp& surface); - void onCaptured(uint32_t seq, bool succeeded); - void shutdown(); - -private: - Mutex mLock; - Condition mCondition; - sp mSurface; - tv_input_device_t* mDevice; - int mDeviceId; - tv_stream_t mStream; - sp mBuffer; - enum { - CAPTURING, - CAPTURED, - RELEASED, - } mBufferState; - uint32_t mSeq; - bool mShutdown; - - virtual bool threadLoop(); - - void setSurfaceLocked(const sp& surface); -}; - BufferProducerThread::BufferProducerThread( tv_input_device_t* device, int deviceId, const tv_stream_t* stream) : Thread(false), @@ -132,14 +103,14 @@ status_t BufferProducerThread::readyToRun() { return NO_ERROR; } -void BufferProducerThread::setSurface(const sp& surface) { +int BufferProducerThread::setSurface(const sp& surface) { Mutex::Autolock autoLock(&mLock); - setSurfaceLocked(surface); + return setSurfaceLocked(surface); } -void BufferProducerThread::setSurfaceLocked(const sp& surface) { +int BufferProducerThread::setSurfaceLocked(const sp& surface) { if (surface == mSurface) { - return; + return NO_ERROR; } if (mBufferState == CAPTURING) { @@ -157,6 +128,8 @@ void BufferProducerThread::setSurfaceLocked(const sp& surface) { mSurface = surface; mCondition.broadcast(); + + return NO_ERROR; } void BufferProducerThread::onCaptured(uint32_t seq, bool succeeded) { @@ -390,15 +363,37 @@ int JTvInputHal::addOrUpdateStream(int deviceId, int streamId, const sp if (connection.mThread != NULL) { connection.mThread->shutdown(); } - connection.mThread = new BufferProducerThread(mDevice, deviceId, &stream); - connection.mThread->run(); + + connection.mThread = TvInputHalFactory::get()->createBufferProducerThread(mDevice, deviceId, &stream); + if (connection.mThread == NULL) { + ALOGE("No memory for BufferProducerThread"); + + // clean up + if (mDevice->close_stream(mDevice, deviceId, streamId) != 0) { + ALOGE("Couldn't remove stream"); + } + return NO_MEMORY; + } } } connection.mSurface = surface; if (connection.mStreamType == TV_STREAM_TYPE_INDEPENDENT_VIDEO_SOURCE) { connection.mSurface->setSidebandStream(connection.mSourceHandle); } else if (connection.mStreamType == TV_STREAM_TYPE_BUFFER_PRODUCER) { - connection.mThread->setSurface(surface); + if (NO_ERROR != connection.mThread->setSurface(surface)) + { + ALOGE("failed to setSurface"); + // clean up + connection.mThread.clear(); + if (mDevice->close_stream(mDevice, deviceId, streamId) != 0) { + ALOGE("Couldn't remove stream"); + } + if (connection.mSurface != NULL) { + connection.mSurface.clear(); + } + return UNKNOWN_ERROR; + } + connection.mThread->run(); } return NO_ERROR; } @@ -413,13 +408,6 @@ int JTvInputHal::removeStream(int deviceId, int streamId) { // Nothing to do return NO_ERROR; } - if (Surface::isValid(connection.mSurface)) { - connection.mSurface.clear(); - } - if (connection.mSurface != NULL) { - connection.mSurface->setSidebandStream(NULL); - connection.mSurface.clear(); - } if (connection.mThread != NULL) { connection.mThread->shutdown(); connection.mThread.clear(); @@ -431,6 +419,13 @@ int JTvInputHal::removeStream(int deviceId, int streamId) { if (connection.mSourceHandle != NULL) { connection.mSourceHandle.clear(); } + if (Surface::isValid(connection.mSurface)) { + connection.mSurface.clear(); + } + if (connection.mSurface != NULL) { + connection.mSurface->setSidebandStream(NULL); + connection.mSurface.clear(); + } return NO_ERROR; } diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 08816b929d9..f092bf106b7 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -438,6 +438,7 @@ private void startOtherServices() { boolean disableNetwork = SystemProperties.getBoolean("config.disable_network", false); boolean disableNetworkTime = SystemProperties.getBoolean("config.disable_networktime", false); boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1"); + boolean disableAtlas = SystemProperties.getBoolean("config.disable_atlas", true); try { Slog.i(TAG, "Reading configuration..."); @@ -937,7 +938,7 @@ private void startOtherServices() { mSystemServiceManager.startService(DreamManagerService.class); } - if (!disableNonCoreServices) { + if (!disableNonCoreServices && !disableAtlas) { try { Slog.i(TAG, "Assets Atlas Service"); atlas = new AssetAtlasService(context); diff --git a/services/libtvextensions/Android.mk b/services/libtvextensions/Android.mk new file mode 100644 index 00000000000..0a9e9bf8cf5 --- /dev/null +++ b/services/libtvextensions/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:= \ + jni/TvInputHalFactory.cpp \ + +LOCAL_C_INCLUDES:= \ + $(TOP)/frameworks/base/services/libtvextensions \ + +LOCAL_CFLAGS += -Wno-multichar + +ifeq ($(TARGET_ENABLE_QC_TVINPUT_HAL_EXTENSIONS),true) + LOCAL_CFLAGS += -DENABLE_TVINPUT_HAL_EXTENSIONS +endif + +LOCAL_MODULE:= libTvInputHalExtensions + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_STATIC_LIBRARY) + diff --git a/services/libtvextensions/common/ExtensionsLoader.hpp b/services/libtvextensions/common/ExtensionsLoader.hpp new file mode 100644 index 00000000000..010e61432fe --- /dev/null +++ b/services/libtvextensions/common/ExtensionsLoader.hpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include + +namespace android { + +/* + * Create strongly-typed objects of type T + * If the customization library exists and does contain a "named" constructor, + * invoke and create an instance + * Else create the object of type T itself + * + * Contains a static instance to dlopen'd library, But may end up + * opening the library mutiple times. Following snip from dlopen man page is + * reassuring "...Only a single copy of an object file is brought into the + * address space, even if dlopen() is invoked multiple times in reference to + * the file, and even if different pathnames are used to reference the file.." + */ + +template +T *ExtensionsLoader::createInstance(const char *createFunctionName) { + ALOGV("createInstance(%dbit) : %s", sizeof(intptr_t)*8, createFunctionName); + // create extended object if extensions-lib is available and + // TVINPUT_HAL_EXTENSIONS is enabled +#if ENABLE_TVINPUT_HAL_EXTENSIONS + createFunction_t createFunc = loadCreateFunction(createFunctionName); + if (createFunc) { + return reinterpret_cast((*createFunc)()); + } +#endif + // Else, create the default object + return new T; +} + +template +void ExtensionsLoader::loadLib() { + if (!mLibHandle) { + mLibHandle = ::dlopen(CUSTOMIZATION_LIB_NAME, RTLD_LAZY); + if (!mLibHandle) { + ALOGV("%s", dlerror()); + return; + } + ALOGV("Opened %s", CUSTOMIZATION_LIB_NAME); + } +} + +template +createFunction_t ExtensionsLoader::loadCreateFunction(const char *createFunctionName) { + loadLib(); + if (!mLibHandle) { + return NULL; + } + createFunction_t func = (createFunction_t)dlsym(mLibHandle, createFunctionName); + if (!func) { + ALOGW("symbol %s not found: %s",createFunctionName, dlerror()); + } + return func; +} + +//static +template +void *ExtensionsLoader::mLibHandle = NULL; + +} //namespace android diff --git a/services/libtvextensions/common/TvInputHalExtensionsCommon.h b/services/libtvextensions/common/TvInputHalExtensionsCommon.h new file mode 100644 index 00000000000..3db4c7be3d8 --- /dev/null +++ b/services/libtvextensions/common/TvInputHalExtensionsCommon.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TVINPUTHAL_EXTENSIONS_COMMON_H_ +#define _TVINPUTHAL_EXTENSIONS_COMMON_H_ + +namespace android { + +static const char * CUSTOMIZATION_LIB_NAME = "libTvInputHalEnhancements.so"; + +typedef void *(*createFunction_t)(void); + +template +struct ExtensionsLoader { + + static T *createInstance(const char *createFunctionName); + +private: + static void loadLib(); + static createFunction_t loadCreateFunction(const char *createFunctionName); + static void *mLibHandle; +}; + +/* + * Boiler-plate to declare the class as a singleton (with a static getter) + * which can be loaded (dlopen'd) via ExtensionsLoader + */ +#define DECLARE_LOADABLE_SINGLETON(className) \ +protected: \ + className(); \ + virtual ~className(); \ + static className *sInst; \ +private: \ + className(const className&); \ + className &operator=(className &); \ +public: \ + static className *get() { \ + return sInst; \ + } \ + friend struct ExtensionsLoader; + +} //namespace android + +#endif // _TVINPUTHAL_EXTENSIONS_COMMON_H_ diff --git a/services/libtvextensions/jni/BufferProducerThread.h b/services/libtvextensions/jni/BufferProducerThread.h new file mode 100644 index 00000000000..6699edc0855 --- /dev/null +++ b/services/libtvextensions/jni/BufferProducerThread.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Not a contribution. + */ +/* + * Copyright 2014 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. + */ + +#ifndef TVINPUT_HAL_INTERFACE_H_ +#define TVINPUT_HAL_INTERFACE_H_ + +#include "jni.h" + +#include +#include + +namespace android { + +class BufferProducerThread : public Thread { +public: + BufferProducerThread(tv_input_device_t* device, int deviceId, const tv_stream_t* stream); + + virtual status_t readyToRun(); + + virtual int setSurface(const sp& surface); + virtual void onCaptured(uint32_t seq, bool succeeded); + virtual void shutdown(); + +protected: + Mutex mLock; + Condition mCondition; + sp mSurface; + tv_input_device_t* mDevice; + int mDeviceId; + tv_stream_t mStream; + sp mBuffer; + enum { + CAPTURING, + CAPTURED, + RELEASED, + } mBufferState; + uint32_t mSeq; + bool mShutdown; + + virtual bool threadLoop(); + + virtual int setSurfaceLocked(const sp& surface); +}; + +} // namespace android + +#endif // TVINPUT_HAL_INTERFACE_H_ diff --git a/services/libtvextensions/jni/TvInputHalExtensions.h b/services/libtvextensions/jni/TvInputHalExtensions.h new file mode 100644 index 00000000000..479e5446b4b --- /dev/null +++ b/services/libtvextensions/jni/TvInputHalExtensions.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _TVINPUTHAL_EXTENSIONS_H_ +#define _TVINPUTHAL_EXTENSIONS_H_ + +#include +#include +#include + +namespace android { + +class BufferProducerThread; + +/* + * Factory to create objects of base-classes in libstagefright + */ +struct TvInputHalFactory { + virtual sp createBufferProducerThread(tv_input_device_t* device, + int deviceId, + const tv_stream_t* stream); + + // ----- NO TRESSPASSING BEYOND THIS LINE ------ + DECLARE_LOADABLE_SINGLETON(TvInputHalFactory); +}; + +} + +#endif // _TVINPUTHAL_EXTENSIONS_H_ diff --git a/services/libtvextensions/jni/TvInputHalFactory.cpp b/services/libtvextensions/jni/TvInputHalFactory.cpp new file mode 100644 index 00000000000..b752066a98c --- /dev/null +++ b/services/libtvextensions/jni/TvInputHalFactory.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2013 - 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define LOG_TAG "TvInputHalFactory" +#include + +#include "common/ExtensionsLoader.hpp" +#include "jni/TvInputHalExtensions.h" + +namespace android { + + sp TvInputHalFactory::createBufferProducerThread(tv_input_device_t* device, + int deviceId, + const tv_stream_t* stream) { + return new BufferProducerThread(device, deviceId, stream); +} + +// ----- NO TRESSPASSING BEYOND THIS LINE ------ +TvInputHalFactory::TvInputHalFactory() { +} + +TvInputHalFactory::~TvInputHalFactory() { +} + +//static +TvInputHalFactory *TvInputHalFactory::sInst = + ExtensionsLoader::createInstance("createExtendedFactory"); + +} //namespace android + diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index 65117055045..732d8c212b4 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -206,6 +206,30 @@ public static class Details { */ public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000; + /** + * Call has voice privacy capability. + * @hide + */ + public static final int CAPABILITY_VOICE_PRIVACY = 0x00400000; + + /** + * Local device supports downgrading a video call to a voice-only call. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL = 0x00800000; + + /** + * Remote device supports downgrading a video call to a voice-only call. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE = 0x01000000; + + /** + * Add participant in an active or conference call option + * @hide + */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; + /** * Call sends responses through connection. * @hide @@ -327,6 +351,12 @@ public static String capabilitiesToString(int capabilities) { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_TX)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_TX"); } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL"); + } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE"); + } if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } @@ -339,6 +369,12 @@ public static String capabilitiesToString(int capabilities) { if (can(capabilities, CAPABILITY_CAN_PAUSE_VIDEO)) { builder.append(" CAPABILITY_CAN_PAUSE_VIDEO"); } + if (can(capabilities, CAPABILITY_VOICE_PRIVACY)) { + builder.append(" CAPABILITY_VOICE_PRIVACY"); + } + if (can(capabilities, CAPABILITY_ADD_PARTICIPANT)) { + builder.append(" CAPABILITY_ADD_PARTICIPANT"); + } builder.append("]"); return builder.toString(); } @@ -687,6 +723,28 @@ public static abstract class Listener extends Callback { } private InCallService.VideoCall mVideoCall; private Details mDetails; + /** + * when mIsActiveSub True indicates this call belongs to active subscription + * Calls belonging to active subscription are shown to user. + */ + private boolean mIsActiveSub = false; + + /** + * Set this call object as active subscription. + * @hide + */ + public void setActive() { + mIsActiveSub = true; + } + + /** + * return if this call object belongs to active subscription. + * @hide + */ + public boolean isActive() { + return mIsActiveSub; + } + /** * Obtains the post-dial sequence remaining to be emitted by this {@code Call}, if any. * @@ -977,11 +1035,22 @@ public void removeListener(Listener listener) { } /** {@hide} */ - Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter) { + Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, boolean isActiveSub) { mPhone = phone; mTelecomCallId = telecomCallId; mInCallAdapter = inCallAdapter; mState = STATE_NEW; + mIsActiveSub = isActiveSub; + } + + /** {@hide} */ + Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state, + boolean isActiveSub) { + mPhone = phone; + mTelecomCallId = telecomCallId; + mInCallAdapter = inCallAdapter; + mState = state; + mIsActiveSub = isActiveSub; } /** {@hide} */ @@ -1034,9 +1103,10 @@ final void internalUpdate(ParcelableCall parcelableCall, Map callI } int state = parcelableCall.getState(); - boolean stateChanged = mState != state; + boolean stateChanged = (mState != state) || (mIsActiveSub != parcelableCall.isActive()); if (stateChanged) { mState = state; + mIsActiveSub = parcelableCall.isActive(); } String parentId = parcelableCall.getParentCallId(); @@ -1113,6 +1183,11 @@ final void internalSetDisconnected() { } } + /** {@hide} */ + final void onMergeFailed() { + fireStateChanged(mState); + } + private void fireStateChanged(final int newState) { for (CallbackRecord record : mCallbackRecords) { final Call call = this; diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 77fdb65f638..f6a6dccb37c 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -160,7 +160,10 @@ public boolean can(int capability) { * @hide */ public void removeCapability(int capability) { - mConnectionCapabilities &= ~capability; + int newCapabilities = mConnectionCapabilities; + newCapabilities &= ~capability; + + setConnectionCapabilities(newCapabilities); } /** @@ -170,7 +173,10 @@ public void removeCapability(int capability) { * @hide */ public void addCapability(int capability) { - mConnectionCapabilities |= capability; + int newCapabilities = mConnectionCapabilities; + newCapabilities |= capability; + + setConnectionCapabilities(newCapabilities); } /** @@ -221,6 +227,14 @@ public void onDisconnect() {} */ public void onSeparate(Connection connection) {} + /** + * Invoked when the conference adds a participant to the conference call. + * + * @param participant The participant to be added with conference call. + * @hide + */ + public void onAddParticipant(String participant) {} + /** * Invoked when the specified {@link Connection} should merged with the conference call. * @@ -559,6 +573,7 @@ final void setCallAudioState(CallAudioState state) { private void setState(int newState) { if (newState != Connection.STATE_ACTIVE && + newState != Connection.STATE_DIALING && newState != Connection.STATE_HOLDING && newState != Connection.STATE_DISCONNECTED) { Log.w(this, "Unsupported state transition for Conference call.", diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 520a1d7254e..23fa7d9d170 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -226,6 +226,13 @@ public abstract class Connection extends Conferenceable { */ public static final int CAPABILITY_CAN_PAUSE_VIDEO = 0x00100000; + /** + * Add participant in an active or conference call option + * + * @hide + */ + public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000; + /** * For a conference, indicates the conference will not have child connections. *

@@ -247,6 +254,23 @@ public abstract class Connection extends Conferenceable { * @hide */ public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 0x00200000; + /** + * Call has voice privacy capability. + * @hide + */ + public static final int CAPABILITY_VOICE_PRIVACY = 0x00400000; + + /** + * Local device supports voice telephony. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL = 0x00800000; + + /** + * Remote device supports voice telephony. + * @hide + */ + public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE = 0x01000000; /** * Indicates that the connection itself wants to handle any sort of reply response, rather than @@ -282,6 +306,13 @@ public abstract class Connection extends Conferenceable { */ public static final String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; + /** + * Call extras key to pack/unpack call history info. + * The value for this key should be an ArrayList of Strings. + * @hide + */ + public static final String EXTRA_CALL_HISTORY_INFO = "EXTRA_CALL_HISTORY_INFO"; + // Flag controlling whether PII is emitted into the logs private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); @@ -371,6 +402,12 @@ public static String capabilitiesToString(int capabilities) { if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL)) { builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL"); } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL"); + } + if (can(capabilities, CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE)) { + builder.append(" CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE"); + } if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); } @@ -429,6 +466,7 @@ public void onConferenceParticipantsChanged(Connection c, public void onConferenceStarted() {} public void onConferenceMergeFailed(Connection c) {} public void onExtrasChanged(Connection c, Bundle extras) {} + public void onCdmaConnectionTimeReset(Connection c) {} } /** @@ -1592,6 +1630,16 @@ public final void setConferenceables(List conferenceables) { fireOnConferenceableConnectionsChanged(); } + /** + *@hide + * Resets the cdma connection time. + */ + public final void resetCdmaConnectionTime() { + for (Listener l : mListeners) { + l.onCdmaConnectionTimeReset(this); + } + } + /** * Returns the connections or conferences with which this connection can be conferenced. */ @@ -1717,6 +1765,12 @@ public void onPlayDtmfTone(char c) {} */ public void onStopDtmfTone() {} + /** + * Notifies this to set local call hold. + * {@hide} + */ + public void setLocalCallHold(boolean lchState) {} + /** * Notifies this Connection of a request to disconnect. */ diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java index 686321476bd..2e8f8fdb415 100644 --- a/telecomm/java/android/telecom/ConnectionRequest.java +++ b/telecomm/java/android/telecom/ConnectionRequest.java @@ -28,7 +28,7 @@ public final class ConnectionRequest implements Parcelable { // TODO: Token to limit recursive invocations - private final PhoneAccountHandle mAccountHandle; + private PhoneAccountHandle mAccountHandle; private final Uri mAddress; private final Bundle mExtras; private final int mVideoState; @@ -74,6 +74,9 @@ private ConnectionRequest(Parcel in) { */ public PhoneAccountHandle getAccountHandle() { return mAccountHandle; } + /** {@hide} */ + public void setAccountHandle(PhoneAccountHandle acc) { mAccountHandle = acc; } + /** * The handle (e.g., phone number) to which the {@link Connection} is to connect. */ diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index ceaa1bfb275..08f34b5a203 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -101,8 +101,12 @@ public abstract class ConnectionService extends Service { private static final int MSG_ANSWER_VIDEO = 17; private static final int MSG_MERGE_CONFERENCE = 18; private static final int MSG_SWAP_CONFERENCE = 19; - private static final int MSG_REJECT_WITH_MESSAGE = 20; - private static final int MSG_SILENCE = 21; + private static final int MSG_SET_LOCAL_HOLD = 20; + private static final int MSG_REJECT_WITH_MESSAGE = 21; + private static final int MSG_SILENCE = 22; + + //Proprietary values starts after this. + private static final int MSG_ADD_PARTICIPANT_WITH_CONFERENCE = 30; private static Connection sNullConnection; @@ -213,6 +217,14 @@ public void stopDtmfTone(String callId) { mHandler.obtainMessage(MSG_STOP_DTMF_TONE, callId).sendToTarget(); } + @Override + public void setLocalCallHold(String callId, boolean lchState) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.argi1 = lchState ? 1 : 0; + mHandler.obtainMessage(MSG_SET_LOCAL_HOLD, args).sendToTarget(); + } + @Override public void conference(String callId1, String callId2) { SomeArgs args = SomeArgs.obtain(); @@ -226,6 +238,14 @@ public void splitFromConference(String callId) { mHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, callId).sendToTarget(); } + @Override + public void addParticipantWithConference(String callId, String participant) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = participant; + mHandler.obtainMessage(MSG_ADD_PARTICIPANT_WITH_CONFERENCE, args).sendToTarget(); + } + @Override public void mergeConference(String callId) { mHandler.obtainMessage(MSG_MERGE_CONFERENCE, callId).sendToTarget(); @@ -349,6 +369,17 @@ public void run() { case MSG_STOP_DTMF_TONE: stopDtmfTone((String) msg.obj); break; + case MSG_SET_LOCAL_HOLD: { + SomeArgs args = (SomeArgs) msg.obj; + try { + String callId = (String) args.arg1; + boolean lchStatus = (args.argi1 == 1); + setLocalCallHold(callId, lchStatus); + } finally { + args.recycle(); + } + break; + } case MSG_CONFERENCE: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -363,6 +394,17 @@ public void run() { case MSG_SPLIT_FROM_CONFERENCE: splitFromConference((String) msg.obj); break; + case MSG_ADD_PARTICIPANT_WITH_CONFERENCE: { + SomeArgs args = (SomeArgs) msg.obj; + try { + String callId = (String) args.arg1; + String participant = (String) args.arg2; + addParticipantWithConference(callId, participant); + } finally { + args.recycle(); + } + break; + } case MSG_MERGE_CONFERENCE: mergeConference((String) msg.obj); break; @@ -611,6 +653,12 @@ public void onExtrasChanged(Connection connection, Bundle extras) { mAdapter.setExtras(id, extras); } } + + @Override + public void onCdmaConnectionTimeReset(Connection c) { + String id = mIdByConnection.get(c); + mAdapter.resetCdmaConnectionTime(id); + } }; /** {@inheritDoc} */ @@ -774,6 +822,11 @@ private void stopDtmfTone(String callId) { } } + private void setLocalCallHold(String callId, boolean lchStatus) { + Log.d(this, "setLocalCallHold %s", callId); + findConnectionForAction(callId, "setLocalCallHold").setLocalCallHold(lchStatus); + } + private void conference(String callId1, String callId2) { Log.d(this, "conference %s, %s", callId1, callId2); @@ -836,6 +889,17 @@ private void splitFromConference(String callId) { } } + private void addParticipantWithConference(String callId, String participant) { + Log.d(this, "ConnectionService addParticipantWithConference(%s, %s)", participant, callId); + Conference conference = findConferenceForAction(callId, "addParticipantWithConference"); + Connection connection = findConnectionForAction(callId, "addParticipantWithConnection"); + if (connection != getNullConnection()) { + onAddParticipant(connection, participant); + } else if (conference != getNullConference()) { + conference.onAddParticipant(participant); + } + } + private void mergeConference(String callId) { Log.d(this, "mergeConference(%s)", callId); Conference conference = findConferenceForAction(callId, "mergeConference"); @@ -1121,6 +1185,19 @@ public Connection onCreateUnknownConnection(PhoneAccountHandle connectionManager */ public void onConference(Connection connection1, Connection connection2) {} + /** + * Add participant with connection. Invoked when user has made a request to add + * participant with specified connection. In response, the participant should add with + * the connection. + * + * @param connection A connection where participant need to add. + * @param participant Address of participant which will be added. + * @return + * + * @hide + */ + public void onAddParticipant(Connection connection, String participant) {} + /** * Indicates that a remote conference has been created for existing {@link RemoteConnection}s. * When this method is invoked, this {@link ConnectionService} should create its own diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index 45625147686..30bd3730c16 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -229,6 +229,18 @@ void onConferenceMergeFailed(String callId) { } } + /** + * Resets the cdma connection time. + */ + void resetCdmaConnectionTime(String callId) { + for (IConnectionServiceAdapter adapter : mAdapters) { + try { + adapter.resetCdmaConnectionTime(callId); + } catch (RemoteException e) { + } + } + } + /** * Indicates that the call no longer exists. Can be used with either a call or a conference * call. diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index 293dc119992..b8e7c22fd74 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -419,6 +419,10 @@ public final void setExtras(String connectionId, Bundle extras) { args.arg2 = extras; mHandler.obtainMessage(MSG_SET_EXTRAS, args).sendToTarget(); } + + @Override + public void resetCdmaConnectionTime(String callId) { + } }; public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) { diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java index 0cf7212ba55..7d0f5a72d03 100644 --- a/telecomm/java/android/telecom/InCallAdapter.java +++ b/telecomm/java/android/telecom/InCallAdapter.java @@ -273,4 +273,17 @@ public void turnProximitySensorOff(boolean screenOnImmediately) { } catch (RemoteException ignored) { } } + + /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subid switch to subscription denoted by subId + * {@hide} + */ + public void switchToOtherActiveSub(String subId) { + try { + mAdapter.switchToOtherActiveSub(subId); + } catch (RemoteException e) { + } + } } diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index 19c613d3104..1b6a98f0bc3 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -73,6 +73,7 @@ public abstract class InCallService extends Service { private static final int MSG_ON_CALL_AUDIO_STATE_CHANGED = 5; private static final int MSG_BRING_TO_FOREGROUND = 6; private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7; + private static final int MSG_ON_MERGE_FAILED = 8; /** Default Handler used to consolidate binder method calls onto a single thread. */ private final Handler mHandler = new Handler(Looper.getMainLooper()) { @@ -91,6 +92,9 @@ public void handleMessage(Message msg) { case MSG_ADD_CALL: mPhone.internalAddCall((ParcelableCall) msg.obj); break; + case MSG_ON_MERGE_FAILED: + mPhone.onMergeFailed((ParcelableCall) msg.obj); + break; case MSG_UPDATE_CALL: mPhone.internalUpdateCall((ParcelableCall) msg.obj); break; @@ -155,6 +159,11 @@ public void onCallAudioStateChanged(CallAudioState callAudioState) { mHandler.obtainMessage(MSG_ON_CALL_AUDIO_STATE_CHANGED, callAudioState).sendToTarget(); } + @Override + public void onMergeFailed(ParcelableCall call) { + mHandler.obtainMessage(MSG_ON_MERGE_FAILED, call).sendToTarget(); + } + @Override public void bringToForeground(boolean showDialpad) { mHandler.obtainMessage(MSG_BRING_TO_FOREGROUND, showDialpad ? 1 : 0, 0).sendToTarget(); @@ -300,6 +309,18 @@ public final void setMuted(boolean state) { } } + /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subId switch to this subscription + * @hide + */ + public void switchToOtherActiveSub(String subId) { + if (mPhone != null) { + mPhone.switchToOtherActiveSub(subId); + } + } + /** * Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will * be change to the {@link #getCallAudioState()}. diff --git a/telecomm/java/android/telecom/ParcelableCall.java b/telecomm/java/android/telecom/ParcelableCall.java index 8cf4aebe840..20a445526bc 100644 --- a/telecomm/java/android/telecom/ParcelableCall.java +++ b/telecomm/java/android/telecom/ParcelableCall.java @@ -56,6 +56,7 @@ public final class ParcelableCall implements Parcelable { private final List mConferenceableCallIds; private final Bundle mIntentExtras; private final Bundle mExtras; + private final boolean mIsActiveSub; public ParcelableCall( String id, @@ -79,7 +80,8 @@ public ParcelableCall( int videoState, List conferenceableCallIds, Bundle intentExtras, - Bundle extras) { + Bundle extras, + boolean isActiveSub) { mId = id; mState = state; mDisconnectCause = disconnectCause; @@ -102,6 +104,7 @@ public ParcelableCall( mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); mIntentExtras = intentExtras; mExtras = extras; + mIsActiveSub = isActiveSub; } /** The unique ID of the call. */ @@ -259,6 +262,13 @@ public boolean isVideoCallProviderChanged() { return mIsVideoCallProviderChanged; } + /** + * return if this call object belongs to active subscription. + */ + public boolean isActive() { + return mIsActiveSub; + } + /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator () { @@ -291,6 +301,7 @@ public ParcelableCall createFromParcel(Parcel source) { source.readList(conferenceableCallIds, classLoader); Bundle intentExtras = source.readBundle(classLoader); Bundle extras = source.readBundle(classLoader); + boolean isActiveSub = (source.readInt() == 1) ? true : false; return new ParcelableCall( id, state, @@ -313,7 +324,8 @@ public ParcelableCall createFromParcel(Parcel source) { videoState, conferenceableCallIds, intentExtras, - extras); + extras, + isActiveSub); } @Override @@ -354,6 +366,7 @@ public void writeToParcel(Parcel destination, int flags) { destination.writeList(mConferenceableCallIds); destination.writeBundle(mIntentExtras); destination.writeBundle(mExtras); + destination.writeInt(mIsActiveSub ? 1 : 0); } @Override diff --git a/telecomm/java/android/telecom/Phone.java b/telecomm/java/android/telecom/Phone.java index 47154da242f..0fd124d7a3d 100644 --- a/telecomm/java/android/telecom/Phone.java +++ b/telecomm/java/android/telecom/Phone.java @@ -123,7 +123,7 @@ public void onCanAddCallChanged(Phone phone, boolean canAddCall) { } final void internalAddCall(ParcelableCall parcelableCall) { Call call = new Call(this, parcelableCall.getId(), mInCallAdapter, - parcelableCall.getState()); + parcelableCall.getState(), parcelableCall.isActive()); mCallByTelecomCallId.put(parcelableCall.getId(), call); mCalls.add(call); checkCallTree(parcelableCall); @@ -179,6 +179,12 @@ final void internalSetCanAddCall(boolean canAddCall) { } } + final void onMergeFailed(ParcelableCall parcelableCall) { + Call call = mCallByTelecomCallId.get(parcelableCall.getId()); + if (call != null) { + call.onMergeFailed(); + } + } /** * Called to destroy the phone and cleanup any lingering calls. */ @@ -279,6 +285,16 @@ public final void setProximitySensorOff(boolean screenOnImmediately) { mInCallAdapter.turnProximitySensorOff(screenOnImmediately); } + /** + * Instructs Telecomm to switch to other active subscripion + * + * @param subId switch to this subscription + * {@hide} + */ + public void switchToOtherActiveSub(String subId) { + mInCallAdapter.switchToOtherActiveSub(subId); + } + /** * Obtains the current phone call audio state of the {@code Phone}. * diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index b64043c6e07..635a48be6fe 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -34,6 +34,7 @@ import java.lang.String; import java.util.ArrayList; +import java.util.BitSet; import java.util.Collections; import java.util.List; import java.util.MissingResourceException; @@ -373,6 +374,43 @@ public static Builder builder( return new Builder(accountHandle, label); } + /** + * Contains information related to + * LCH and ACTIVE. + */ + private BitSet callsStatus = new BitSet(); + + /** + * {@hide} + */ + public static final int LCH = 1; + + /** + * {@hide} + */ + public static final int ACTIVE = 2; + + /** + * {@hide} + */ + public void setBit(int bit) { + callsStatus.set(bit); + } + + /** + * {@hide} + */ + public void unSetBit(int bit) { + callsStatus.set(bit, false); + } + + /** + * {@hide} + */ + public boolean isSet(int bit) { + return callsStatus.get(bit); + } + /** * Returns a builder initialized with the current {@link PhoneAccount} instance. * diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index dc0de0c462c..372d7368408 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -330,6 +330,10 @@ public void setExtras(String callId, Bundle extras) { .setExtras(extras); } } + + @Override + public void resetCdmaConnectionTime(String callId) { + } }; private final ConnectionServiceAdapterServant mServant = diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index b07b018f5a1..ae7c18eaa08 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; +import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -1089,6 +1090,37 @@ public int getCurrentTtyMode() { return TTY_MODE_OFF; } + /** + * Returns current active subscription. + * Active subscription is the one from which calls are displayed to user when there are actve + * calls on both subscriptions. + * @hide + */ + public int getActiveSubscription() { + try { + if (isServiceConnected()) { + return getTelecomService().getActiveSubscription(); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to get the active subsription.", e); + } + return SubscriptionManager.INVALID_SUBSCRIPTION_ID; + } + + /** + * switches to other active subscription. + * @hide + */ + public void switchToOtherActiveSub(int subId) { + try { + if (isServiceConnected()) { + getTelecomService().switchToOtherActiveSub(subId); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to switchToOtherActiveSub.", e); + } + } + /** * Registers a new incoming call. A {@link ConnectionService} should invoke this method when it * has an incoming call. The specified {@link PhoneAccountHandle} must have been registered diff --git a/telecomm/java/android/telecom/VideoCallImpl.java b/telecomm/java/android/telecom/VideoCallImpl.java index c8072d13d62..93484cd291d 100644 --- a/telecomm/java/android/telecom/VideoCallImpl.java +++ b/telecomm/java/android/telecom/VideoCallImpl.java @@ -57,13 +57,20 @@ public void binderDied() { private final class VideoCallListenerBinder extends IVideoCallback.Stub { @Override public void receiveSessionModifyRequest(VideoProfile videoProfile) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_RECEIVE_SESSION_MODIFY_REQUEST, videoProfile).sendToTarget(); + } @Override public void receiveSessionModifyResponse(int status, VideoProfile requestProfile, VideoProfile responseProfile) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = status; args.arg2 = requestProfile; @@ -74,12 +81,18 @@ public void receiveSessionModifyResponse(int status, VideoProfile requestProfile @Override public void handleCallSessionEvent(int event) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_HANDLE_CALL_SESSION_EVENT, event) .sendToTarget(); } @Override public void changePeerDimensions(int width, int height) { + if (mHandler == null) { + return; + } SomeArgs args = SomeArgs.obtain(); args.arg1 = width; args.arg2 = height; @@ -88,18 +101,27 @@ public void changePeerDimensions(int width, int height) { @Override public void changeVideoQuality(int videoQuality) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_VIDEO_QUALITY, videoQuality, 0) .sendToTarget(); } @Override public void changeCallDataUsage(long dataUsage) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CALL_DATA_USAGE, dataUsage) .sendToTarget(); } @Override public void changeCameraCapabilities(VideoProfile.CameraCapabilities cameraCapabilities) { + if (mHandler == null) { + return; + } mHandler.obtainMessage(MessageHandler.MSG_CHANGE_CAMERA_CAPABILITIES, cameraCapabilities).sendToTarget(); } diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index 8a54addcf06..e152c5d8fa5 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -75,4 +75,8 @@ oneway interface IConnectionService { void swapConference(String conferenceCallId); void onPostDialContinue(String callId, boolean proceed); + + void setLocalCallHold(String callId, boolean lchState); + + void addParticipantWithConference(String callId, String recipients); } diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl index 76474447d19..ef4915c5952 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl @@ -86,4 +86,6 @@ oneway interface IConnectionServiceAdapter { void addExistingConnection(String callId, in ParcelableConnection connection); void setExtras(String callId, in Bundle extras); + + void resetCdmaConnectionTime(String callId); } diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl index 863fff29d56..ee51efa6915 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl @@ -60,4 +60,6 @@ oneway interface IInCallAdapter { void turnOnProximitySensor(); void turnOffProximitySensor(boolean screenOnImmediately); + + void switchToOtherActiveSub(String subId); } diff --git a/telecomm/java/com/android/internal/telecom/IInCallService.aidl b/telecomm/java/com/android/internal/telecom/IInCallService.aidl index ded47d5a056..f4ba9a0e811 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallService.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallService.aidl @@ -45,4 +45,6 @@ oneway interface IInCallService { void bringToForeground(boolean showDialpad); void onCanAddCallChanged(boolean canAddCall); + + void onMergeFailed(in ParcelableCall call); } diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 2e07759f09f..cad8c5d3394 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -232,4 +232,14 @@ interface ITelecomService { * @see TelecomServiceImpl#setDefaultDialer */ boolean setDefaultDialer(in String packageName); + + /** + * @see TelecommManager#getActiveSubscription + */ + int getActiveSubscription(); + + /** + * @see TelecommManager#switchToOtherActiveSub + */ + void switchToOtherActiveSub(int subId); } diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index e1deb98cef5..60a70157af8 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -540,7 +540,7 @@ public CarrierConfigManager() { sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true); sDefaults.putBoolean(KEY_PREFER_2G_BOOL, true); sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false); - sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false); + sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, true); sDefaults.putBoolean(KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL, true); sDefaults.putBoolean(KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL, true); sDefaults.putBoolean(KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL, true); @@ -549,7 +549,7 @@ public CarrierConfigManager() { sDefaults.putBoolean(KEY_USE_OTASP_FOR_PROVISIONING_BOOL, false); sDefaults.putBoolean(KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL, false); sDefaults.putBoolean(KEY_VOICE_PRIVACY_DISABLE_UI_BOOL, false); - sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, false); + sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, true); sDefaults.putBoolean(KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL, true); sDefaults.putInt(KEY_VOLTE_REPLACEMENT_RAT_INT, 0); sDefaults.putString(KEY_DEFAULT_SIM_CALL_MANAGER_STRING, ""); diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java index 8443490feb0..139ea07479c 100644 --- a/telephony/java/android/telephony/DisconnectCause.java +++ b/telephony/java/android/telephony/DisconnectCause.java @@ -187,6 +187,63 @@ public class DisconnectCause { */ public static final int CDMA_ALREADY_ACTIVATED = 49; + /** call failed due to LTE to 3G/2G handover not feasible */ + public static final int HO_NOT_FEASIBLE = 50; + + public static final int NO_CIRCUIT_AVAIL = 51; + public static final int NO_ROUTE_TO_DESTINAON = 52; + public static final int OPERATOR_DETERMINED_BARRING = 53; + public static final int CALL_FAIL_NO_USER_RESPONDING = 54; + public static final int CALL_FAIL_NO_ANSWER_FROM_USER = 55; + public static final int CALL_FAIL_DESTINATION_OUT_OF_ORDER = 56; + public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 57; + public static final int CHANNEL_UNACCEPTABLE = 58; + public static final int CALL_REJECTED = 59; + public static final int NUMBER_CHANGED = 60; + public static final int PREEMPTION = 61; + public static final int FACILITY_REJECTED = 62; + public static final int RESP_TO_STATUS_ENQUIRY = 63; + public static final int NORMAL_UNSPECIFIED = 64; + public static final int NETWORK_OUT_OF_ORDER = 65; + public static final int TEMPORARY_FAILURE = 66; + public static final int SWITCHING_EQUIPMENT_CONGESTION = 67; + public static final int ACCESS_INFORMATION_DISCARDED = 68; + public static final int REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 69; + public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 70; + public static final int QOS_UNAVAILABLE = 71; + public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 72; + public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 73; + public static final int BEARER_CAPABILITY_UNAVAILABLE = 74; + public static final int SERVICE_OPTION_NOT_AVAILABLE = 75; + public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 76; + public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 77; + public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 78; + public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79; + public static final int INVALID_TRANSACTION_IDENTIFIER = 80; + public static final int USER_NOT_MEMBER_OF_CUG = 81; + public static final int INCOMPATIBLE_DESTINATION = 82; + public static final int INVALID_TRANSIT_NW_SELECTION = 83; + public static final int SEMANTICALLY_INCORRECT_MESSAGE = 84; + public static final int INVALID_MANDATORY_INFORMATION = 85; + public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 86; + public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 87; + public static final int INFORMATION_ELEMENT_NON_EXISTENT = 88; + public static final int CONDITIONAL_IE_ERROR = 89; + public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 90; + public static final int RECOVERY_ON_TIMER_EXPIRED = 91; + public static final int PROTOCOL_ERROR_UNSPECIFIED = 92; + public static final int INTERWORKING_UNSPECIFIED = 93; + public static final int LOCAL_LOW_BATTERY = 94; + public static final int LOW_BATTERY = 95; + + /** EMERGENCY call failed with temporary fail cause */ + public static final int EMERGENCY_TEMP_FAILURE = 96; + /** EMERGENCY call failed with permanent fail cause */ + public static final int EMERGENCY_PERM_FAILURE = 97; + + public static final int NON_SELECTED_USER_CLEARING = 98; + + //********************************************************************************************* // When adding a disconnect type: // 1) Please assign the new type the next id value below. @@ -195,14 +252,14 @@ public class DisconnectCause { // 4) Update toString() with the newly added disconnect type. // 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause. // - // NextId: 50 + // NextId: 99 //********************************************************************************************* /** Smallest valid value for call disconnect codes. */ public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED; /** Largest valid value for call disconnect codes. */ - public static final int MAXIMUM_VALID_VALUE = CDMA_ALREADY_ACTIVATED; + public static final int MAXIMUM_VALID_VALUE = NON_SELECTED_USER_CLEARING; /** Private constructor to avoid class instantiation. */ private DisconnectCause() { @@ -310,6 +367,104 @@ public static String toString(int cause) { return "IMS_MERGED_SUCCESSFULLY"; case CDMA_ALREADY_ACTIVATED: return "CDMA_ALREADY_ACTIVATED"; + case NON_SELECTED_USER_CLEARING: + return "NON_SELECTED_USER_CLEARING"; + case HO_NOT_FEASIBLE: + return "HO_NOT_FEASIBLE"; + case NO_CIRCUIT_AVAIL: + return "NO_CIRCUIT_AVAIL"; + case NO_ROUTE_TO_DESTINAON: + return "NO_ROUTE_TO_DESTINAON"; + case OPERATOR_DETERMINED_BARRING: + return "OPERATOR_DETERMINED_BARRING"; + case CALL_FAIL_NO_USER_RESPONDING: + return "CALL_FAIL_NO_USER_RESPONDING"; + case CALL_FAIL_NO_ANSWER_FROM_USER: + return "CALL_FAIL_NO_ANSWER_FROM_USER"; + case CALL_FAIL_DESTINATION_OUT_OF_ORDER: + return "CALL_FAIL_DESTINATION_OUT_OF_ORDER"; + case BEARER_CAPABILITY_NOT_AUTHORIZED: + return "BEARER_CAPABILITY_NOT_AUTHORIZED"; + case CHANNEL_UNACCEPTABLE: + return "CHANNEL_UNACCEPTABLE"; + case CALL_REJECTED: + return "CALL_REJECTED"; + case NUMBER_CHANGED: + return "NUMBER_CHANGED"; + case PREEMPTION: + return "PREEMPTION"; + case FACILITY_REJECTED: + return "FACILITY_REJECTED"; + case RESP_TO_STATUS_ENQUIRY: + return "RESP_TO_STATUS_ENQUIRY"; + case NORMAL_UNSPECIFIED: + return "NORMAL_UNSPECIFIED"; + case NETWORK_OUT_OF_ORDER: + return "NETWORK_OUT_OF_ORDER"; + case TEMPORARY_FAILURE: + return "TEMPORARY_FAILURE"; + case SWITCHING_EQUIPMENT_CONGESTION: + return "SWITCHING_EQUIPMENT_CONGESTION"; + case ACCESS_INFORMATION_DISCARDED: + return "ACCESS_INFORMATION_DISCARDED"; + case REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE: + return "REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE"; + case RESOURCES_UNAVAILABLE_OR_UNSPECIFIED: + return "RESOURCES_UNAVAILABLE_OR_UNSPECIFIED"; + case QOS_UNAVAILABLE: + return "QOS_UNAVAILABLE"; + case REQUESTED_FACILITY_NOT_SUBSCRIBED: + return "REQUESTED_FACILITY_NOT_SUBSCRIBED"; + case INCOMING_CALLS_BARRED_WITHIN_CUG: + return "INCOMING_CALLS_BARRED_WITHIN_CUG"; + case BEARER_CAPABILITY_UNAVAILABLE: + return "BEARER_CAPABILITY_UNAVAILABLE"; + case SERVICE_OPTION_NOT_AVAILABLE: + return "SERVICE_OPTION_NOT_AVAILABLE"; + case BEARER_SERVICE_NOT_IMPLEMENTED: + return "BEARER_SERVICE_NOT_IMPLEMENTED"; + case REQUESTED_FACILITY_NOT_IMPLEMENTED: + return "REQUESTED_FACILITY_NOT_IMPLEMENTED"; + case ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE: + return "ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE"; + case SERVICE_OR_OPTION_NOT_IMPLEMENTED: + return "SERVICE_OR_OPTION_NOT_IMPLEMENTED"; + case INVALID_TRANSACTION_IDENTIFIER: + return "INVALID_TRANSACTION_IDENTIFIER"; + case USER_NOT_MEMBER_OF_CUG: + return "USER_NOT_MEMBER_OF_CUG"; + case INCOMPATIBLE_DESTINATION: + return "INCOMPATIBLE_DESTINATION"; + case INVALID_TRANSIT_NW_SELECTION: + return "INVALID_TRANSIT_NW_SELECTION"; + case SEMANTICALLY_INCORRECT_MESSAGE: + return "SEMANTICALLY_INCORRECT_MESSAGE"; + case INVALID_MANDATORY_INFORMATION: + return "INVALID_MANDATORY_INFORMATION"; + case MESSAGE_TYPE_NON_IMPLEMENTED: + return "MESSAGE_TYPE_NON_IMPLEMENTED"; + case MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE: + return "MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE"; + case INFORMATION_ELEMENT_NON_EXISTENT: + return "INFORMATION_ELEMENT_NON_EXISTENT"; + case CONDITIONAL_IE_ERROR: + return "CONDITIONAL_IE_ERROR"; + case MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE: + return "MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE"; + case RECOVERY_ON_TIMER_EXPIRED: + return "RECOVERY_ON_TIMER_EXPIRED"; + case PROTOCOL_ERROR_UNSPECIFIED: + return "PROTOCOL_ERROR_UNSPECIFIED"; + case INTERWORKING_UNSPECIFIED: + return "INTERWORKING_UNSPECIFIED"; + case LOCAL_LOW_BATTERY: + return "LOCAL_LOW_BATTERY"; + case LOW_BATTERY: + return "LOW_BATTERY"; + case EMERGENCY_TEMP_FAILURE: + return "EMERGENCY_TEMP_FAILURE"; + case EMERGENCY_PERM_FAILURE: + return "EMERGENCY_PERM_FAILURE"; default: return "INVALID: " + cause; } diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index b430340a896..17f47087051 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -25,6 +25,7 @@ import android.content.Context; import android.content.Intent; import android.database.Cursor; +import android.location.Country; import android.location.CountryDetector; import android.net.Uri; import android.os.SystemProperties; @@ -77,6 +78,7 @@ public class PhoneNumberUtils static final String LOG_TAG = "PhoneNumberUtils"; private static final boolean DBG = false; + private static Country sCountryDetector = null; /* * global-phone-number = ["+"] 1*( DIGIT / written-sep ) * written-sep = ("-"/".") @@ -2057,12 +2059,9 @@ private static boolean isLocalEmergencyNumberInternal(String number, private static boolean isLocalEmergencyNumberInternal(int subId, String number, Context context, boolean useExactMatch) { - String countryIso; - CountryDetector detector = (CountryDetector) context.getSystemService( - Context.COUNTRY_DETECTOR); - if (detector != null && detector.detectCountry() != null) { - countryIso = detector.detectCountry().getCountryIso(); - } else { + String countryIso = getCountryIso(context); + Rlog.w(LOG_TAG, "isLocalEmergencyNumberInternal" + countryIso); + if (countryIso == null) { Locale locale = context.getResources().getConfiguration().locale; countryIso = locale.getCountry(); Rlog.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: " @@ -2071,6 +2070,28 @@ private static boolean isLocalEmergencyNumberInternal(int subId, String number, return isEmergencyNumberInternal(subId, number, countryIso, useExactMatch); } + private static String getCountryIso(Context context) { + Rlog.w(LOG_TAG, "getCountryIso " + sCountryDetector); + if (sCountryDetector == null) { + CountryDetector detector = (CountryDetector) context.getSystemService( + Context.COUNTRY_DETECTOR); + if (detector != null) { + sCountryDetector = detector.detectCountry(); + } + } + + if (sCountryDetector == null) { + return null; + } else { + return sCountryDetector.getCountryIso(); + } + } + + /** @hide */ + public static void resetCountryDetectorInfo() { + sCountryDetector = null; + } + /** * isVoiceMailNumber: checks a given number against the voicemail * number provided by the RIL and SIM card. The caller must have diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java old mode 100644 new mode 100755 index 2bfaf1bfd86..c079eae8949 --- a/telephony/java/android/telephony/RadioAccessFamily.java +++ b/telephony/java/android/telephony/RadioAccessFamily.java @@ -47,6 +47,7 @@ public class RadioAccessFamily implements Parcelable { public static final int RAF_HSPAP = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP); public static final int RAF_GSM = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_GSM); public static final int RAF_TD_SCDMA = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_TD_SCDMA); + public static final int RAF_LTE_CA = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA); // Grouping of RAFs private static final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE; @@ -54,6 +55,7 @@ public class RadioAccessFamily implements Parcelable { private static final int CDMA = RAF_IS95A | RAF_IS95B | RAF_1xRTT; private static final int EVDO = RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B | RAF_EHRPD; private static final int WCDMA = HS | RAF_UMTS; + private static final int LTE = RAF_LTE | RAF_LTE_CA; /* Phone ID of phone */ private int mPhoneId; @@ -162,19 +164,19 @@ public static int getRafFromNetworkType(int type) { raf = CDMA | EVDO; break; case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO: - raf = RAF_LTE | CDMA | EVDO; + raf = LTE | CDMA | EVDO; break; case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA: - raf = RAF_LTE | GSM | WCDMA; + raf = LTE | GSM | WCDMA; break; case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: - raf = RAF_LTE | CDMA | EVDO | GSM | WCDMA; + raf = LTE | CDMA | EVDO | GSM | WCDMA; break; case RILConstants.NETWORK_MODE_LTE_ONLY: - raf = RAF_LTE; + raf = LTE; break; case RILConstants.NETWORK_MODE_LTE_WCDMA: - raf = RAF_LTE | WCDMA; + raf = LTE | WCDMA; break; case RILConstants.NETWORK_MODE_CDMA_NO_EVDO: raf = CDMA; @@ -185,35 +187,35 @@ public static int getRafFromNetworkType(int type) { case RILConstants.NETWORK_MODE_GLOBAL: raf = GSM | WCDMA | CDMA | EVDO; break; - case RILConstants.NETWORK_MODE_TDSCDMA_ONLY: + case RILConstants.NETWORK_MODE_TD_SCDMA_ONLY: raf = RAF_TD_SCDMA; break; - case RILConstants.NETWORK_MODE_TDSCDMA_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA: raf = RAF_TD_SCDMA | WCDMA; break; - case RILConstants.NETWORK_MODE_LTE_TDSCDMA: - raf = RAF_LTE | RAF_TD_SCDMA; + case RILConstants.NETWORK_MODE_TD_SCDMA_LTE: + raf = RAF_TD_SCDMA | LTE; break; - case RILConstants.NETWORK_MODE_TDSCDMA_GSM: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM: raf = RAF_TD_SCDMA | GSM; break; - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM: - raf = RAF_LTE | RAF_TD_SCDMA | GSM; + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_LTE: + raf = RAF_TD_SCDMA | GSM | LTE; break; - case RILConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA: raf = RAF_TD_SCDMA | GSM | WCDMA; break; - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA: - raf = RAF_LTE | RAF_TD_SCDMA | WCDMA; + case RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA_LTE: + raf = RAF_TD_SCDMA | WCDMA | LTE; break; - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA: - raf = RAF_LTE | RAF_TD_SCDMA | GSM | WCDMA; + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE: + raf = RAF_TD_SCDMA | GSM | WCDMA | LTE; break; - case RILConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: - raf = RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA; + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO: + raf = RAF_TD_SCDMA | GSM | WCDMA | CDMA | EVDO; break; - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: - raf = RAF_LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA; + case RILConstants.NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA: + raf = RAF_TD_SCDMA | LTE | CDMA | EVDO | GSM | WCDMA; break; default: raf = RAF_UNKNOWN; @@ -232,6 +234,7 @@ private static int getAdjustedRaf(int raf) { raf = ((WCDMA & raf) > 0) ? (WCDMA | raf) : raf; raf = ((CDMA & raf) > 0) ? (CDMA | raf) : raf; raf = ((EVDO & raf) > 0) ? (EVDO | raf) : raf; + raf = ((LTE & raf) > 0) ? (LTE | raf) : raf; return raf; } @@ -254,19 +257,19 @@ public static int getNetworkTypeFromRaf(int raf) { case (CDMA | EVDO): type = RILConstants.NETWORK_MODE_CDMA; break; - case (RAF_LTE | CDMA | EVDO): + case (LTE | CDMA | EVDO): type = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO; break; - case (RAF_LTE | GSM | WCDMA): + case (LTE | GSM | WCDMA): type = RILConstants.NETWORK_MODE_LTE_GSM_WCDMA; break; - case (RAF_LTE | CDMA | EVDO | GSM | WCDMA): + case (LTE | CDMA | EVDO | GSM | WCDMA): type = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA; break; - case RAF_LTE: + case LTE: type = RILConstants.NETWORK_MODE_LTE_ONLY; break; - case (RAF_LTE | WCDMA): + case (LTE | WCDMA): type = RILConstants.NETWORK_MODE_LTE_WCDMA; break; case CDMA: @@ -279,34 +282,34 @@ public static int getNetworkTypeFromRaf(int raf) { type = RILConstants.NETWORK_MODE_GLOBAL; break; case RAF_TD_SCDMA: - type = RILConstants.NETWORK_MODE_TDSCDMA_ONLY; + type = RILConstants.NETWORK_MODE_TD_SCDMA_ONLY; break; case (RAF_TD_SCDMA | WCDMA): - type = RILConstants.NETWORK_MODE_TDSCDMA_WCDMA; + type = RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA; break; - case (RAF_LTE | RAF_TD_SCDMA): - type = RILConstants.NETWORK_MODE_LTE_TDSCDMA; + case (RAF_TD_SCDMA | LTE): + type = RILConstants.NETWORK_MODE_TD_SCDMA_LTE; break; case (RAF_TD_SCDMA | GSM): - type = RILConstants.NETWORK_MODE_TDSCDMA_GSM; + type = RILConstants.NETWORK_MODE_TD_SCDMA_GSM; break; - case (RAF_LTE | RAF_TD_SCDMA | GSM): - type = RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM; + case (RAF_TD_SCDMA | GSM | LTE): + type = RILConstants.NETWORK_MODE_TD_SCDMA_GSM_LTE; break; case (RAF_TD_SCDMA | GSM | WCDMA): - type = RILConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA; + type = RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA; break; - case (RAF_LTE | RAF_TD_SCDMA | WCDMA): - type = RILConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA; + case (RAF_TD_SCDMA | WCDMA | LTE): + type = RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA_LTE; break; - case (RAF_LTE | RAF_TD_SCDMA | GSM | WCDMA): - type = RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA; + case (RAF_TD_SCDMA | GSM | WCDMA | LTE): + type = RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE; break; - case (RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA): - type = RILConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA; + case (RAF_TD_SCDMA| GSM | WCDMA | CDMA | EVDO): + type = RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO; break; - case (RAF_LTE | RAF_TD_SCDMA | RAF_LTE | CDMA | EVDO | GSM | WCDMA): - type = RILConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA; + case (RAF_TD_SCDMA| LTE | CDMA | EVDO | GSM | WCDMA): + type = RILConstants.NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA; break; default: type = RILConstants.PREFERRED_NETWORK_MODE ; @@ -339,6 +342,7 @@ public static int singleRafTypeFromString(String rafString) { case "CDMA": return CDMA; case "EVDO": return EVDO; case "WCDMA": return WCDMA; + case "LTE_CA": return RAF_LTE_CA; default: return RAF_UNKNOWN; } } diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 13374879f09..d4113767822 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -153,6 +153,12 @@ public class ServiceState implements Parcelable { * @hide */ public static final int RIL_RADIO_TECHNOLOGY_IWLAN = 18; + /** + * LTE_CA + * @hide + */ + public static final int RIL_RADIO_TECHNOLOGY_LTE_CA = 19; + /** * Available registration states for GSM, UMTS and CDMA. */ @@ -728,11 +734,14 @@ public static String rilRadioTechnologyToString(int rt) { case RIL_RADIO_TECHNOLOGY_GSM: rtString = "GSM"; break; + case RIL_RADIO_TECHNOLOGY_TD_SCDMA: + rtString = "TD-SCDMA"; + break; case RIL_RADIO_TECHNOLOGY_IWLAN: rtString = "IWLAN"; break; - case RIL_RADIO_TECHNOLOGY_TD_SCDMA: - rtString = "TD-SCDMA"; + case RIL_RADIO_TECHNOLOGY_LTE_CA: + rtString = "LTE_CA"; break; default: rtString = "Unexpected"; @@ -1075,6 +1084,8 @@ private int rilRadioTechnologyToNetworkType(int rt) { return TelephonyManager.NETWORK_TYPE_TD_SCDMA; case ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN: return TelephonyManager.NETWORK_TYPE_IWLAN; + case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA: + return TelephonyManager.NETWORK_TYPE_LTE_CA; default: return TelephonyManager.NETWORK_TYPE_UNKNOWN; } @@ -1126,7 +1137,9 @@ public static boolean isGsm(int radioTechnology) { || radioTechnology == RIL_RADIO_TECHNOLOGY_HSPAP || radioTechnology == RIL_RADIO_TECHNOLOGY_GSM || radioTechnology == RIL_RADIO_TECHNOLOGY_TD_SCDMA - || radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN; + || radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN + || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA; + } /** @hide */ diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index fced6670f6a..6b59c1f6533 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -933,7 +933,7 @@ public int getTdScdmaAsuLevel() { return tdScdmaAsuLevel; } - /** + /** * @return hash code */ @Override diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 32b7383ff9a..9904a4ac508 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -310,6 +310,14 @@ public class SubscriptionManager { */ public static final String CB_CHANNEL_50_ALERT = "enable_channel_50_alerts"; + + + /** + * TelephonyProvider column name for enable channel60 alert in CB settings + *@hide + */ + public static final String CB_CHANNEL_60_ALERT = "enable_channel_60_alerts"; + /** * TelephonyProvider column name for CMAS test alert in CB settings *@hide diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 72769803792..6fe3a3eb9c7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,6 +25,7 @@ import android.annotation.SdkConstant.SdkConstantType; import android.app.ActivityThread; import android.content.ContentResolver; +import android.app.AppOpsManager; import android.content.Context; import android.content.Intent; import android.provider.Settings; @@ -684,6 +688,9 @@ public boolean isMultiSimEnabled() { */ public static final String VVM_TYPE_CVVM = "vvm_type_cvvm"; + /** {@hide} */ + public static final String EMR_DIAL_ACCOUNT = "emr_dial_account"; + // // // Device Info @@ -761,6 +768,7 @@ public String getDeviceId() { * @param slotId of which deviceID is returned */ public String getDeviceId(int slotId) { + android.util.SeempLog.record_str(8, ""+slotId); // FIXME this assumes phoneId == slotId try { IPhoneSubInfo info = getSubscriberInfo(); @@ -857,6 +865,7 @@ public String getNai(int slotId) { * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION}. */ public CellLocation getCellLocation() { + android.util.SeempLog.record(49); try { ITelephony telephony = getITelephony(); if (telephony == null) { @@ -954,6 +963,7 @@ public void disableLocationUpdates(int subId) { */ @Deprecated public List getNeighboringCellInfo() { + android.util.SeempLog.record(50); try { ITelephony telephony = getITelephony(); if (telephony == null) @@ -1098,22 +1108,22 @@ public static int getPhoneType(int networkMode) { case RILConstants.NETWORK_MODE_GSM_UMTS: case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA: case RILConstants.NETWORK_MODE_LTE_WCDMA: - case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: - case RILConstants.NETWORK_MODE_TDSCDMA_ONLY: - case RILConstants.NETWORK_MODE_TDSCDMA_WCDMA: - case RILConstants.NETWORK_MODE_LTE_TDSCDMA: - case RILConstants.NETWORK_MODE_TDSCDMA_GSM: - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM: - case RILConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA: - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA: - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA: - case RILConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_ONLY: + case RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_LTE: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_LTE: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_WCDMA_LTE: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE: return PhoneConstants.PHONE_TYPE_GSM; // Use CDMA Phone for the global mode including CDMA case RILConstants.NETWORK_MODE_GLOBAL: case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO: - case RILConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA: + case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA: + case RILConstants.NETWORK_MODE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO: + case RILConstants.NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA: return PhoneConstants.PHONE_TYPE_CDMA; case RILConstants.NETWORK_MODE_LTE_ONLY: @@ -1380,11 +1390,12 @@ public String getNetworkCountryIsoForPhone(int phoneId) { public static final int NETWORK_TYPE_HSPAP = 15; /** Current network is GSM {@hide} */ public static final int NETWORK_TYPE_GSM = 16; - /** Current network is TD_SCDMA {@hide} */ + /** Current network is TD_SCDMA {@hide} */ public static final int NETWORK_TYPE_TD_SCDMA = 17; /** Current network is IWLAN {@hide} */ public static final int NETWORK_TYPE_IWLAN = 18; - + /** Current network is LTE_CA {@hide} */ + public static final int NETWORK_TYPE_LTE_CA = 19; /** * @return the NETWORK_TYPE_xxxx for current data connection. */ @@ -1429,10 +1440,12 @@ public int getNetworkType() { * @see #NETWORK_TYPE_LTE * @see #NETWORK_TYPE_EHRPD * @see #NETWORK_TYPE_HSPAP + * @see #NETWORK_TYPE_TD_SCDMA * *

* Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + * @hide */ /** {@hide} */ public int getNetworkType(int subId) { @@ -1552,6 +1565,21 @@ public int getVoiceNetworkType(int subId) { } } + /** + * Returns the icc operator numeric for a given subId + * + */ + /** {@hide} */ + public String getIccOperatorNumericForData(int subId) { + try{ + return getITelephony().getIccOperatorNumericForData(subId); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + return null; + } + } + /** Unknown network class. {@hide} */ public static final int NETWORK_CLASS_UNKNOWN = 0; /** Class of broadly defined "2G" networks. {@hide} */ @@ -1589,6 +1617,7 @@ public static int getNetworkClass(int networkType) { return NETWORK_CLASS_3_G; case NETWORK_TYPE_LTE: case NETWORK_TYPE_IWLAN: + case NETWORK_TYPE_LTE_CA: return NETWORK_CLASS_4_G; default: return NETWORK_CLASS_UNKNOWN; @@ -1652,6 +1681,8 @@ public static String getNetworkTypeName(int type) { return "TD_SCDMA"; case NETWORK_TYPE_IWLAN: return "IWLAN"; + case NETWORK_TYPE_LTE_CA: + return "LTE_CA"; default: return "UNKNOWN"; } @@ -1957,6 +1988,7 @@ public String getSimSerialNumber() { */ /** {@hide} */ public String getSimSerialNumber(int subId) { + android.util.SeempLog.record_str(388, ""+subId); try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) @@ -2046,6 +2078,7 @@ public String getSubscriberId() { */ /** {@hide} */ public String getSubscriberId(int subId) { + android.util.SeempLog.record_str(389, ""+subId); try { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) @@ -2134,6 +2167,7 @@ public String getLine1Number() { */ /** {@hide} */ public String getLine1NumberForSubscriber(int subId) { + android.util.SeempLog.record_str(9, ""+subId); String number = null; try { ITelephony telephony = getITelephony(); @@ -3396,13 +3430,7 @@ public static String getTelephonyProperty(int phoneId, String property, String d /** @hide */ public int getSimCount() { - // FIXME Need to get it from Telephony Dev Controller when that gets implemented! - // and then this method shouldn't be used at all! - if(isMultiSimEnabled()) { - return 2; - } else { - return 1; - } + return getPhoneCount(); } /** @@ -4198,11 +4226,19 @@ public void setDataEnabled(boolean enable) { public void setDataEnabled(int subId, boolean enable) { try { Log.d(TAG, "setDataEnabled: enabled=" + enable); + AppOpsManager appOps = (AppOpsManager)mContext.getSystemService(Context.APP_OPS_SERVICE); + if (enable) { + if (appOps.noteOp(AppOpsManager.OP_DATA_CONNECT_CHANGE) + != AppOpsManager.MODE_ALLOWED) { + Log.w(TAG, "Permission denied by user."); + return; + } + } ITelephony telephony = getITelephony(); if (telephony != null) telephony.setDataEnabled(subId, enable); } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelephony#setDataEnabled", e); + Log.e(TAG, "Error calling setDataEnabled", e); } } diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 5f84e0ce353..50ee5438d39 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -188,6 +188,7 @@ public class ImsCallProfile implements Parcelable { public static final String EXTRA_CODEC = "Codec"; public static final String EXTRA_DISPLAY_TEXT = "DisplayText"; public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; + public static final String EXTRA_IS_CALL_PULL = "CallPull"; /** * Extra key which the RIL can use to indicate the radio technology used for a call. diff --git a/telephony/java/com/android/ims/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java index 2769a2b2796..85ec16298da 100644 --- a/telephony/java/com/android/ims/ImsReasonInfo.java +++ b/telephony/java/com/android/ims/ImsReasonInfo.java @@ -84,6 +84,8 @@ public class ImsReasonInfo implements Parcelable { public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147; // IMS call is already terminated (in TERMINATED state) public static final int CODE_LOCAL_CALL_TERMINATED = 148; + // Handover not feasible + public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149; /** * TIMEOUT (IMS -> Telephony) @@ -153,6 +155,9 @@ public class ImsReasonInfo implements Parcelable { public static final int CODE_SIP_USER_REJECTED = 361; // Others public static final int CODE_SIP_GLOBAL_ERROR = 362; + // Emergency failure + public static final int CODE_EMERGENCY_TEMP_FAILURE = 363; + public static final int CODE_EMERGENCY_PERM_FAILURE = 364; /** * MEDIA (IMS -> Telephony) @@ -235,6 +240,24 @@ public class ImsReasonInfo implements Parcelable { */ public static final int CODE_ANSWERED_ELSEWHERE = 1014; + /** + * For VICE - Call Pull request has failed + */ + public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015; + + /** + * For VICE - Call has been pulled from primary to secondary + */ + public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016; + + /** + * Supplementary services (HOLD/RESUME) failure error codes. + * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision. + */ + public static final int CODE_SUPP_SVC_FAILED = 1201; + public static final int CODE_SUPP_SVC_CANCELLED = 1202; + public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203; + /** * Network string error messages. * mExtraMessage may have these values. diff --git a/telephony/java/com/android/ims/ImsStreamMediaProfile.java b/telephony/java/com/android/ims/ImsStreamMediaProfile.java index 359b2707658..216cef59f30 100644 --- a/telephony/java/com/android/ims/ImsStreamMediaProfile.java +++ b/telephony/java/com/android/ims/ImsStreamMediaProfile.java @@ -51,6 +51,16 @@ public class ImsStreamMediaProfile implements Parcelable { public static final int AUDIO_QUALITY_GSM_EFR = 8; public static final int AUDIO_QUALITY_GSM_FR = 9; public static final int AUDIO_QUALITY_GSM_HR = 10; + public static final int AUDIO_QUALITY_G711U = 11; + public static final int AUDIO_QUALITY_G723 = 12; + public static final int AUDIO_QUALITY_G711A = 13; + public static final int AUDIO_QUALITY_G722 = 14; + public static final int AUDIO_QUALITY_G711AB = 15; + public static final int AUDIO_QUALITY_G729 = 16; + public static final int AUDIO_QUALITY_EVS_NB = 17; + public static final int AUDIO_QUALITY_EVS_WB = 18; + public static final int AUDIO_QUALITY_EVS_SWB = 19; + public static final int AUDIO_QUALITY_EVS_FB = 20; /** * Video information @@ -76,7 +86,7 @@ public ImsStreamMediaProfile(Parcel in) { } public ImsStreamMediaProfile() { - mAudioQuality = AUDIO_QUALITY_AMR_WB; + mAudioQuality = AUDIO_QUALITY_NONE; mAudioDirection = DIRECTION_SEND_RECEIVE; mVideoQuality = VIDEO_QUALITY_NONE; mVideoDirection = DIRECTION_INVALID; diff --git a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl index 23a69d10aa7..8fa50295da4 100644 --- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl +++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl @@ -17,6 +17,7 @@ package com.android.ims.internal; import com.android.ims.ImsReasonInfo; + /** * A listener type for receiving notifications about the changes to * the IMS connection(registration). @@ -26,13 +27,19 @@ import com.android.ims.ImsReasonInfo; interface IImsRegistrationListener { /** * Notifies the application when the device is connected to the IMS network. + * + * @param imsRadioTech the radio access technology. Valid values are {@code + * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}. */ - void registrationConnected(); + void registrationConnected(int imsRadioTech); /** * Notifies the application when the device is trying to connect the IMS network. + * + * @param imsRadioTech the radio access technology. Valid values are {@code + * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}. */ - void registrationProgressing(); + void registrationProgressing(int imsRadioTech); /** * Notifies the application when the device is disconnected from the IMS network. diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java index be7e7029115..6e1a00480ce 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfo.java +++ b/telephony/java/com/android/internal/telephony/CallerInfo.java @@ -165,6 +165,7 @@ public CallerInfo() { * number. The returned CallerInfo is null if no number is supplied. */ public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) { + android.util.SeempLog.record_uri(12, contactRef); CallerInfo info = new CallerInfo(); info.photoResource = 0; info.phoneLabel = null; @@ -325,6 +326,7 @@ public static CallerInfo getCallerInfo(Context context, String number) { * with all relevant fields empty or null. */ public static CallerInfo getCallerInfo(Context context, String number, int subId) { + android.util.SeempLog.record_str(12, "number="+number+",subId="+subId); if (TextUtils.isEmpty(number)) { return null; diff --git a/telephony/java/com/android/internal/telephony/IExtTelephony.aidl b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl new file mode 100644 index 00000000000..f98a0d883f4 --- /dev/null +++ b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +package com.android.internal.telephony; + + +/** + * Interface used to interact with the telephony framework for + * Telephony value adds. + * {@hide} + */ +interface IExtTelephony { + + /** + * Returns the current SIM Manual provision status. + * @param slotId user preferred slotId. + * @return Card provision status as integer, below are + * possible return values. + * '0' - returned if Uicc Card is not provisioned. + * '1' - returned if Uicc Card provisioned. + * '-1'- returned if there is an error @ below layers OR + * if framework does not received info from Modem yet. + * '-2' returned when SIM card is not present in slot. + * Requires Permission: android.Manifest.permission.READ_PHONE_STATE + */ + int getCurrentUiccCardProvisioningStatus(int slotId); + + /** + * Returns the user preferred Uicc card provision status. + * @param slotId user preferred slotId. + * @return User preference value as integer, below are + * possible return values. + * '0' - returned if Uicc Card is not provisioned. + * '1' - returned if Uicc Card provisioned. + * '-1'- returned if there is an error @ below layers OR + * if framework does not received info from Modem yet. + * '-2' returned when SIM card is not present in slot. + * Requires Permission: android.Manifest.permission.READ_PHONE_STATE + */ + int getUiccCardProvisioningUserPreference(int slotId); + + /** + * Activates the Uicc card. + * @param slotId user preferred slotId. + * @return Uicc card activation result as Integer, below are + * supported return values: + * '0' - Success + * '-1' -Generic Failure + * '-2' -Invalid input + * '-3 -Another request in progress + * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE + */ + int activateUiccCard(int slotId); + + /** + * Deactivates UICC card. + * @param slotId user preferred slotId. + * @return Uicc card deactivation result as Integer, below are + * supported return values: + * '0' - Success + * '-1' -Generic Failure + * '-2' -Invalid input + * '-3 -Another request in progress + * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE + */ + int deactivateUiccCard(int slotId); + + /** + * Check for Sms Prompt is Enabled or Not. + * @return + * true - Sms Prompt is Enabled + * false - Sms prompt is Disabled + * Requires Permission: android.Manifest.permission.READ_PHONE_STATE + */ + boolean isSMSPromptEnabled(); + + /** + * Enable/Disable Sms prompt option. + * @param - enabled + * true - to enable Sms prompt + * false - to disable Sms prompt + * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE + */ + void setSMSPromptEnabled(boolean enabled); + + /** + * Get logical phone id for Emergency call. + * @param - void + * @return phone id + */ + int getPhoneIdForECall(); + + /** + * Check is FDN is enabled or not. + * @param - void + * @return true or false + */ + boolean isFdnEnabled(); +} diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl index 70a8653135c..13777348a09 100644 --- a/telephony/java/com/android/internal/telephony/ISms.aidl +++ b/telephony/java/com/android/internal/telephony/ISms.aidl @@ -186,6 +186,53 @@ interface ISms { in String destAddr, in String scAddr, in String text, in PendingIntent sentIntent, in PendingIntent deliveryIntent); + /** + * Send an SMS with options using Subscription Id. + * + * @param subId the subId on which the SMS has to be sent. + * @param destAddr the address to send the message to + * @param scAddr the SMSC to send the message through, or NULL for the + * default SMSC + * @param text the body of the message to send + * @param sentIntent if not NULL this PendingIntent is + * broadcast when the message is sucessfully sent, or failed. + * The result code will be Activity.RESULT_OK for success, + * or one of these errors:
+ * RESULT_ERROR_GENERIC_FAILURE
+ * RESULT_ERROR_RADIO_OFF
+ * RESULT_ERROR_NULL_PDU
+ * For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include + * the extra "errorCode" containing a radio technology specific value, + * generally only useful for troubleshooting.
+ * The per-application based SMS control checks sentIntent. If sentIntent + * is NULL the caller will be checked against all unknown applications, + * which cause smaller number of SMS to be sent in checking period. + * @param deliveryIntent if not NULL this PendingIntent is + * broadcast when the message is delivered to the recipient. The + * raw pdu of the status report is in the extended data ("pdu"). + * @param priority Priority level of the message + * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 + * --------------------------------- + * PRIORITY | Level of Priority + * --------------------------------- + * '00' | Normal + * '01' | Interactive + * '10' | Urgent + * '11' | Emergency + * ---------------------------------- + * Any Other values included Negative considered as Invalid Priority Indicator of the message. + * @param isExpectMore is a boolean to indicate the sending message is multi segmented or not. + * @param validityPeriod Validity Period of the message in mins. + * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. + * Validity Period(Minimum) -> 5 mins + * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). + * Any Other values included Negative considered as Invalid Validity Period of the message. + */ + void sendTextForSubscriberWithOptions(in int subId, String callingPkg, in String destAddr, + in String scAddr, in String text, in PendingIntent sentIntent, + in PendingIntent deliveryIntent, in int priority, in boolean isExpectMore, + in int validityPeriod); + /** * Inject an SMS PDU into the android platform. * @@ -233,6 +280,51 @@ interface ISms { in List parts, in List sentIntents, in List deliveryIntents, in boolean persistMessageForNonDefaultSmsApp); + /** + * Send a multi-part text based SMS with options using Subscription Id. + * + * @param subId the subId on which the SMS has to be sent. + * @param destinationAddress the address to send the message to + * @param scAddress is the service center address or null to use + * the current default SMSC + * @param parts an ArrayList of strings that, in order, + * comprise the original message + * @param sentIntents if not null, an ArrayList of + * PendingIntents (one for each message part) that is + * broadcast when the corresponding message part has been sent. + * The result code will be Activity.RESULT_OK for success, + * or one of these errors: + * RESULT_ERROR_GENERIC_FAILURE + * RESULT_ERROR_RADIO_OFF + * RESULT_ERROR_NULL_PDU. + * @param deliveryIntents if not null, an ArrayList of + * PendingIntents (one for each message part) that is + * broadcast when the corresponding message part has been delivered + * to the recipient. The raw pdu of the status report is in the + * extended data ("pdu"). + * @param priority Priority level of the message + * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1 + * --------------------------------- + * PRIORITY | Level of Priority + * --------------------------------- + * '00' | Normal + * '01' | Interactive + * '10' | Urgent + * '11' | Emergency + * ---------------------------------- + * Any Other values included Negative considered as Invalid Priority Indicator of the message. + * @param isExpectMore is a boolean to indicate the sending message is multi segmented or not. + * @param validityPeriod Validity Period of the message in mins. + * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1. + * Validity Period(Minimum) -> 5 mins + * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks). + * Any Other values included Negative considered as Invalid Validity Period of the message. + */ + void sendMultipartTextForSubscriberWithOptions(in int subId, String callingPkg, + in String destinationAddress, in String scAddress, in List parts, + in List sentIntents, in List deliveryIntents, + in int priority, in boolean isExpectMore, in int validityPeriod); + /** * Enable reception of cell broadcast (SMS-CB) messages with the given * message identifier and RAN type. The RAN type specify this message ID @@ -447,4 +539,12 @@ interface ISms { void sendStoredMultipartText(int subId, String callingPkg, in Uri messageUri, String scAddress, in List sentIntents, in List deliveryIntents); + + /** + * Get the capacity count of sms on Icc card. + * + * @param subId for subId which getSmsCapacityOnIcc is queried. + * @return capacity of ICC + */ + int getSmsCapacityOnIccForSubscriber(int subId); } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index dcece26d6c2..0c42cdc9041 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -487,6 +487,13 @@ interface ITelephony { */ int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage); + /** + * Return icc operator numeric for given subId + * @param subId user preferred subId. + * Returns icc operator numeric + */ + String getIccOperatorNumericForData(int subId); + /** * Return true if an ICC card is present */ @@ -547,6 +554,18 @@ interface ITelephony { */ IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID); + + /** + * Opens a logical channel to the ICC card for a particular subId. + * + * Input parameters equivalent to TS 27.007 AT+CCHO command. + * + * @param subId user preferred subId. + * @param AID Application id. See ETSI 102.221 and 101.220. + * @return an IccOpenLogicalChannelResponse object. + */ + IccOpenLogicalChannelResponse iccOpenLogicalChannelUsingSubId(int subId, String AID); + /** * Closes a previously opened logical channel to the ICC card. * @@ -558,6 +577,19 @@ interface ITelephony { */ boolean iccCloseLogicalChannel(int channel); + /** + * Closes a previously opened logical channel to the ICC card for a + * particular subId. + * + * Input parameters equivalent to TS 27.007 AT+CCHC command. + * + * @param subId user preferred subId. + * @param channel is the channel id to be closed as retruned by a + * successful iccOpenLogicalChannel. + * @return true if the channel was closed successfully. + */ + boolean iccCloseLogicalChannelUsingSubId(int subId, int channel); + /** * Transmit an APDU to the ICC card over a logical channel. * @@ -578,6 +610,28 @@ interface ITelephony { String iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data); + /** + * Transmit an APDU to the ICC card over a logical channel for a + * particular subId. + * + * Input parameters equivalent to TS 27.007 AT+CGLA command. + * + * @param subId user preferred subId. + * @param channel is the channel id to be closed as retruned by a + * successful iccOpenLogicalChannel. + * @param cla Class of the APDU command. + * @param instruction Instruction of the APDU command. + * @param p1 P1 value of the APDU command. + * @param p2 P2 value of the APDU command. + * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU + * is sent to the SIM. + * @param data Data to be sent with the APDU. + * @return The APDU response from the ICC card with the status appended at + * the end. + */ + String iccTransmitApduLogicalChannelUsingSubId(int subId, int channel, int cla, + int instruction, int p1, int p2, int p3, String data); + /** * Transmit an APDU to the ICC card over the basic channel. * @@ -596,6 +650,26 @@ interface ITelephony { String iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data); + /** + * Transmit an APDU to the ICC card over the basic channel for a particular + * subId. + * + * Input parameters equivalent to TS 27.007 AT+CSIM command. + * + * @param subId user preferred subId. + * @param cla Class of the APDU command. + * @param instruction Instruction of the APDU command. + * @param p1 P1 value of the APDU command. + * @param p2 P2 value of the APDU command. + * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU + * is sent to the SIM. + * @param data Data to be sent with the APDU. + * @return The APDU response from the ICC card with the status appended at + * the end. + */ + String iccTransmitApduBasicChannelUsingSubId(int subId, int cla, int instruction, + int p1, int p2, int p3, String data); + /** * Returns the response APDU for a command APDU sent through SIM_IO. * @@ -610,6 +684,22 @@ interface ITelephony { byte[] iccExchangeSimIO(int fileID, int command, int p1, int p2, int p3, String filePath); + /** + * Returns the response APDU for a command APDU sent through SIM_IO + * for a particular subId. + * + * @param subId user preferred subId. + * @param fileID + * @param command + * @param p1 P1 value of the APDU command. + * @param p2 P2 value of the APDU command. + * @param p3 P3 value of the APDU command. + * @param filePath + * @return The APDU response. + */ + byte[] iccExchangeSimIOUsingSubId(int subId, int fileID, int command, int p1, int p2, + int p3, String filePath); + /** * Send ENVELOPE to the SIM and returns the response. * @@ -1005,4 +1095,15 @@ interface ITelephony { * Return the modem activity info. */ ModemActivityInfo getModemActivityInfo(); + + /** + * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card + */ + byte[] getAtr(); + + /** + * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card + * for a particular subId. + */ + byte[] getAtrUsingSubId(int subId); } diff --git a/telephony/java/com/android/internal/telephony/OperatorInfo.java b/telephony/java/com/android/internal/telephony/OperatorInfo.java index a29d7c16199..7db660066eb 100644 --- a/telephony/java/com/android/internal/telephony/OperatorInfo.java +++ b/telephony/java/com/android/internal/telephony/OperatorInfo.java @@ -33,6 +33,7 @@ public enum State { private String mOperatorAlphaLong; private String mOperatorAlphaShort; private String mOperatorNumeric; + private String mRadioTech; private State mState = State.UNKNOWN; @@ -57,6 +58,11 @@ public enum State { return mState; } + public String + getRadioTech() { + return mRadioTech; + } + OperatorInfo(String operatorAlphaLong, String operatorAlphaShort, String operatorNumeric, @@ -65,6 +71,14 @@ public enum State { mOperatorAlphaLong = operatorAlphaLong; mOperatorAlphaShort = operatorAlphaShort; mOperatorNumeric = operatorNumeric; + mRadioTech = ""; + /* operatorNumeric format: PLMN+RAT or PLMN */ + if (null != operatorNumeric) { + String values[] = operatorNumeric.split("\\+"); + mOperatorNumeric = values[0]; + if (values.length > 1) + mRadioTech = values[1]; + } mState = state; } @@ -108,6 +122,7 @@ public String toString() { return "OperatorInfo " + mOperatorAlphaLong + "/" + mOperatorAlphaShort + "/" + mOperatorNumeric + + "/" + mRadioTech + "/" + mState; } @@ -132,7 +147,7 @@ public int describeContents() { public void writeToParcel(Parcel dest, int flags) { dest.writeString(mOperatorAlphaLong); dest.writeString(mOperatorAlphaShort); - dest.writeString(mOperatorNumeric); + dest.writeString(mOperatorNumeric + "+" + mRadioTech); dest.writeSerializable(mState); } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java old mode 100644 new mode 100755 index 7088be82840..6154969422a --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -77,7 +77,7 @@ class C */ int SIM_SAP_MSG_SIZE_TOO_SMALL = 34; int SIM_SAP_CONNECT_OK_CALL_ONGOING = 35; int LCE_NOT_SUPPORTED = 36; /* Link Capacity Estimation (LCE) not supported */ - + int INVALID_PARAMETER = 37; /* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */ int NETWORK_MODE_WCDMA_PREF = 0; /* GSM/WCDMA (WCDMA preferred) */ @@ -96,16 +96,17 @@ class C */ int NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = 10; /* LTE, CDMA, EvDo, GSM/WCDMA */ int NETWORK_MODE_LTE_ONLY = 11; /* LTE Only mode. */ int NETWORK_MODE_LTE_WCDMA = 12; /* LTE/WCDMA */ - int NETWORK_MODE_TDSCDMA_ONLY = 13; /* TD-SCDMA only */ - int NETWORK_MODE_TDSCDMA_WCDMA = 14; /* TD-SCDMA and WCDMA */ - int NETWORK_MODE_LTE_TDSCDMA = 15; /* TD-SCDMA and LTE */ - int NETWORK_MODE_TDSCDMA_GSM = 16; /* TD-SCDMA and GSM */ - int NETWORK_MODE_LTE_TDSCDMA_GSM = 17; /* TD-SCDMA,GSM and LTE */ - int NETWORK_MODE_TDSCDMA_GSM_WCDMA = 18; /* TD-SCDMA, GSM/WCDMA */ - int NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19; /* TD-SCDMA, WCDMA and LTE */ - int NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = 20; /* TD-SCDMA, GSM/WCDMA and LTE */ - int NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 21; /*TD-SCDMA,EvDo,CDMA,GSM/WCDMA*/ - int NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = 22; /* TD-SCDMA/LTE/GSM/WCDMA, CDMA, and EvDo */ + int NETWORK_MODE_TD_SCDMA_ONLY = 13; /* TD-SCDMA only */ + int NETWORK_MODE_TD_SCDMA_WCDMA = 14; /* TD-SCDMA and WCDMA */ + int NETWORK_MODE_TD_SCDMA_LTE = 15; /* TD-SCDMA and LTE */ + int NETWORK_MODE_TD_SCDMA_GSM = 16; /* TD-SCDMA and GSM */ + int NETWORK_MODE_TD_SCDMA_GSM_LTE = 17; /* TD-SCDMA,GSM and LTE */ + int NETWORK_MODE_TD_SCDMA_GSM_WCDMA = 18; /* TD-SCDMA, GSM/WCDMA */ + int NETWORK_MODE_TD_SCDMA_WCDMA_LTE = 19; /* TD-SCDMA, WCDMA and LTE */ + int NETWORK_MODE_TD_SCDMA_GSM_WCDMA_LTE = 20; /* TD-SCDMA, GSM/WCDMA and LTE */ + int NETWORK_MODE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO = 21; /*TD-SCDMA,EvDo,CDMA,GSM/WCDMA*/ + int NETWORK_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22; /* TD-SCDMA/LTE/GSM/WCDMA, CDMA, and + EvDo */ int PREFERRED_NETWORK_MODE = SystemProperties.getInt("ro.telephony.default_network", NETWORK_MODE_WCDMA_PREF); @@ -334,6 +335,7 @@ class C */ int RIL_REQUEST_STOP_LCE = 133; int RIL_REQUEST_PULL_LCEDATA = 134; int RIL_REQUEST_GET_ACTIVITY_INFO = 135; + int RIL_REQUEST_SIM_GET_ATR = 136; int RIL_UNSOL_RESPONSE_BASE = 1000; int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000; diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index 645c3a17db1..f2cc775cb73 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -217,4 +217,44 @@ public interface TelephonyProperties * or Earpiece, based on the default audio routing strategy. */ static final String PROPERTY_VIDEOCALL_AUDIO_OUTPUT = "persist.radio.call.audio.output"; + + /** + * Used when Presence app sends Dial intent with specific schema + * If true: skip schema parsing and use Tel schema + * If false: parse schema + */ + static final String EXTRA_SKIP_SCHEMA_PARSING = + "org.codeaurora.extra.SKIP_SCHEMA_PARSING"; + + /** + * For Group Conference Calling + * If true: isConferenceUri in Dial is set to true, + * which indicates that Dial is for Conference Calling + * If false: above is set to false + */ + static final String EXTRAS_IS_CONFERENCE_URI = "isConferenceUri"; + + /** + * For Group Conference Dialing Feature + * If true: Dial intent triggered from Group Conference Calling screen + * if false: normal dial + */ + static final String EXTRA_DIAL_CONFERENCE_URI = + "org.codeaurora.extra.DIAL_CONFERENCE_URI"; + + /** + * For Add Participant Feature + * If true: Dial intent triggered from Dialpad is for AddParticipant + * if false: normal dial + */ + static final String ADD_PARTICIPANT_KEY = "add_participant"; + + /** + * For VICE Feature + * If true: Dial intent is for call pull functionality + * if false: normal dial + */ + static final String EXTRA_IS_CALL_PULL = + "org.codeaurora.extra.IS_CALL_PULL"; + } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java index 895f9c9eaea..45c062435b2 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java @@ -155,4 +155,9 @@ public boolean isDeviceIdleMode() throws RemoteException { public boolean isScreenBrightnessBoosted() throws RemoteException { return false; } + + @Override + public void updateBlockedUids(int uid, boolean isBlocked) throws RemoteException { + // pass for now. + } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/view/WindowManagerImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/view/WindowManagerImpl.java index 7e5ae8d8c75..face7ca3f0f 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/view/WindowManagerImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/view/WindowManagerImpl.java @@ -45,6 +45,7 @@ public Display getDefaultDisplay() { @Override public void addView(View arg0, android.view.ViewGroup.LayoutParams arg1) { + android.util.SeempLog.record_vg_layout(383, arg1); // pass } @@ -55,6 +56,7 @@ public void removeView(View arg0) { @Override public void updateViewLayout(View arg0, android.view.ViewGroup.LayoutParams arg1) { + android.util.SeempLog.record_vg_layout(384, arg1); // pass } diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index dc329e2a481..2bd1de90125 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -60,6 +60,9 @@ public class WifiConfiguration implements Parcelable { public static final String updateIdentiferVarName = "update_identifier"; /** {@hide} */ public static final int INVALID_NETWORK_ID = -1; + /** {@hide} */ + public static final String SIMNumVarName = "sim_num"; + /** * Recognized key management schemes. @@ -425,6 +428,12 @@ private Status() { } */ public String autoJoinBSSID; + /** + * @hide + * sim number selected + */ + public int SIMNum; + /** * @hide * Status of user approval for connection @@ -929,6 +938,7 @@ public WifiConfiguration() { mIpConfiguration = new IpConfiguration(); lastUpdateUid = -1; creatorUid = -1; + SIMNum = 0; } /** @@ -1088,6 +1098,10 @@ public String toString() { if (this.preSharedKey != null) { sbuf.append('*'); } + sbuf.append('\n').append(" sim_num "); + if (this.SIMNum > 0 ) { + sbuf.append('*'); + } sbuf.append("\nEnterprise config:\n"); sbuf.append(enterpriseConfig); @@ -1325,14 +1339,14 @@ public String configKey(boolean allowCached) { key = FQDN + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } else { if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { - key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK]; + key = SSID + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK]; } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) || allowedKeyManagement.get(KeyMgmt.IEEE8021X)) { - key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP]; + key = SSID + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP]; } else if (wepKeys[0] != null) { - key = SSID + "WEP"; + key = SSID + "-WEP"; } else { - key = SSID + KeyMgmt.strings[KeyMgmt.NONE]; + key = SSID + "-" + KeyMgmt.strings[KeyMgmt.NONE]; } mCachedConfigKey = key; } @@ -1354,17 +1368,16 @@ static public String configKey(ScanResult result) { if (result.capabilities.contains("WEP")) { key = key + "-WEP"; - } - - if (result.capabilities.contains("PSK")) { + } else if (result.capabilities.contains("PSK")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK]; - } - - if (result.capabilities.contains("EAP")) { + } else if (result.capabilities.contains("EAP")|| + result.capabilities.contains("IEEE8021X")) { key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP]; + } else { + key = key +"-" + KeyMgmt.strings[KeyMgmt.NONE]; } - return key; + return key; } /** @hide */ @@ -1522,6 +1535,7 @@ public WifiConfiguration(WifiConfiguration source) { noInternetAccessExpected = source.noInternetAccessExpected; creationTime = source.creationTime; updateTime = source.updateTime; + SIMNum = source.SIMNum; } } @@ -1601,6 +1615,7 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(userApproved); dest.writeInt(numNoInternetAccessReports); dest.writeInt(noInternetAccessExpected ? 1 : 0); + dest.writeInt(SIMNum); } /** Implement the Parcelable interface {@hide} */ @@ -1677,6 +1692,7 @@ public WifiConfiguration createFromParcel(Parcel in) { config.userApproved = in.readInt(); config.numNoInternetAccessReports = in.readInt(); config.noInternetAccessExpected = in.readInt() != 0; + config.SIMNum = in.readInt(); return config; } diff --git a/wifi/java/android/net/wifi/WifiDevice.aidl b/wifi/java/android/net/wifi/WifiDevice.aidl new file mode 100755 index 00000000000..c1b186cb7d7 --- /dev/null +++ b/wifi/java/android/net/wifi/WifiDevice.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package android.net.wifi; + +parcelable WifiDevice; diff --git a/wifi/java/android/net/wifi/WifiDevice.java b/wifi/java/android/net/wifi/WifiDevice.java new file mode 100755 index 00000000000..163b5598e34 --- /dev/null +++ b/wifi/java/android/net/wifi/WifiDevice.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package android.net.wifi; + +import android.os.Parcelable; +import android.os.Parcel; + +/** + * Describes information about a detected Wi-Fi STA. + * {@hide} + */ +public class WifiDevice implements Parcelable { + /** + * The device MAC address is the unique id of a Wi-Fi STA + */ + public String deviceAddress = ""; + + /** + * The device name is a readable string of a Wi-Fi STA + */ + public String deviceName = ""; + + /** + * The device state is the state of a Wi-Fi STA + */ + public int deviceState = 0; + + /** + * These definitions are for deviceState + */ + public static final int DISCONNECTED = 0; + public static final int CONNECTED = 1; + public static final int BLACKLISTED = 2; + + private static final String AP_STA_CONNECTED_STR = "AP-STA-CONNECTED"; + private static final String AP_STA_DISCONNECTED_STR = "AP-STA-DISCONNECTED"; + + /** {@hide} */ + public WifiDevice() {} + + /** + * @param string formats supported include + * + * AP-STA-CONNECTED 42:fc:89:a8:96:09 + * AP-STA-DISCONNECTED 42:fc:89:a8:96:09 + * + * Note: The events formats can be looked up in the hostapd code + * @hide + */ + public WifiDevice(String dataString) throws IllegalArgumentException { + String[] tokens = dataString.split(" "); + + if (tokens.length < 2) { + throw new IllegalArgumentException(); + } + + if (tokens[0].indexOf(AP_STA_CONNECTED_STR) != -1) { + deviceState = CONNECTED; + } else if (tokens[0].indexOf(AP_STA_DISCONNECTED_STR) != -1) { + deviceState = DISCONNECTED; + } else { + throw new IllegalArgumentException(); + } + + deviceAddress = tokens[1]; + } + + @Override + public boolean equals(Object obj) { + if (obj == null || !(obj instanceof WifiDevice)) { + return false; + } + + WifiDevice other = (WifiDevice) obj; + + if (deviceAddress == null) { + return (other.deviceAddress == null); + } else { + return deviceAddress.equals(other.deviceAddress); + } + } + + /** Implement the Parcelable interface {@hide} */ + public int describeContents() { + return 0; + } + + /** Implement the Parcelable interface {@hide} */ + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(deviceAddress); + dest.writeString(deviceName); + dest.writeInt(deviceState); + } + + /** Implement the Parcelable interface {@hide} */ + public static final Creator CREATOR = + new Creator() { + public WifiDevice createFromParcel(Parcel in) { + WifiDevice device = new WifiDevice(); + device.deviceAddress = in.readString(); + device.deviceName = in.readString(); + device.deviceState = in.readInt(); + return device; + } + + public WifiDevice[] newArray(int size) { + return new WifiDevice[size]; + } + }; +} diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index cf88df42f8d..5a6db16f837 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +22,7 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; +import android.app.AppOpsManager; import android.content.Context; import android.net.ConnectivityManager; import android.net.ConnectivityManager.NetworkCallback; @@ -623,6 +627,7 @@ public class WifiManager { private static final Object sThreadRefLock = new Object(); private static int sThreadRefCount; private static HandlerThread sHandlerThread; + private final AppOpsManager mAppOps; @GuardedBy("sCM") // TODO: Introduce refcounting and make this a per-process static callback, instead of a @@ -644,6 +649,7 @@ public WifiManager(Context context, IWifiManager service) { mService = service; mTargetSdkVersion = context.getApplicationInfo().targetSdkVersion; init(); + mAppOps = (AppOpsManager)context.getSystemService(Context.APP_OPS_SERVICE); } /** @@ -1307,6 +1313,7 @@ public WifiInfo getConnectionInfo() { * in order to get valid results. */ public List getScanResults() { + android.util.SeempLog.record(55); try { return mService.getScanResults(mContext.getOpPackageName()); } catch (RemoteException e) { @@ -1440,6 +1447,9 @@ public DhcpInfo getDhcpInfo() { * is the same as the requested state). */ public boolean setWifiEnabled(boolean enabled) { + if (mAppOps.noteOp(AppOpsManager.OP_WIFI_CHANGE) != + AppOpsManager.MODE_ALLOWED) + return false; try { return mService.setWifiEnabled(enabled); } catch (RemoteException e) {