Merge "Fixing random crash when transitioning to Recents, ensuring we don't update the TextView unnecessarily."
diff --git a/api/current.txt b/api/current.txt
index 1aac2fd..95ef7f0 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5689,6 +5689,9 @@
method public int getState();
method public boolean isDiscovering();
method public boolean isEnabled();
+ method public boolean isMultipleAdvertisementSupported();
+ method public boolean isOffloadedFilteringSupported();
+ method public boolean isOffloadedScanBatchingSupported();
method public android.bluetooth.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID) throws java.io.IOException;
method public android.bluetooth.BluetoothServerSocket listenUsingRfcommWithServiceRecord(java.lang.String, java.util.UUID) throws java.io.IOException;
method public boolean setName(java.lang.String);
@@ -6448,6 +6451,8 @@
public abstract class ScanCallback {
ctor public ScanCallback();
+ method public abstract void onAdvertisementFound(android.bluetooth.le.ScanResult);
+ method public abstract void onAdvertisementLost(android.bluetooth.le.ScanResult);
method public abstract void onAdvertisementUpdate(android.bluetooth.le.ScanResult);
method public abstract void onScanFailed(int);
field public static final int SCAN_FAILED_ALREADY_STARTED = 1; // 0x1
@@ -6518,6 +6523,8 @@
method public int getScanMode();
method public int getScanResultType();
method public void writeToParcel(android.os.Parcel, int);
+ field public static final int CALLBACK_TYPE_ON_FOUND = 1; // 0x1
+ field public static final int CALLBACK_TYPE_ON_LOST = 2; // 0x2
field public static final int CALLBACK_TYPE_ON_UPDATE = 0; // 0x0
field public static final android.os.Parcelable.Creator CREATOR;
field public static final int SCAN_MODE_BALANCED = 1; // 0x1
@@ -21797,6 +21804,8 @@
public final class PhoneManager {
method public void cancelMissedCallsNotification();
method public boolean handlePinMmi(java.lang.String);
+ method public boolean isInAPhoneCall();
+ method public void showCallScreen(boolean);
}
}
@@ -24506,6 +24515,7 @@
field public static final java.lang.String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS";
field public static final java.lang.String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS";
field public static final java.lang.String ACTION_SETTINGS = "android.settings.SETTINGS";
+ field public static final java.lang.String ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
field public static final java.lang.String ACTION_SOUND_SETTINGS = "android.settings.SOUND_SETTINGS";
field public static final java.lang.String ACTION_SYNC_SETTINGS = "android.settings.SYNC_SETTINGS";
field public static final java.lang.String ACTION_USER_DICTIONARY_SETTINGS = "android.settings.USER_DICTIONARY_SETTINGS";
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 35e5050..be14504 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -1031,7 +1031,6 @@
/**
* Return true if the multi advertisement is supported by the chipset
*
- * @hide
* @return true if Multiple Advertisement feature is supported
*/
public boolean isMultipleAdvertisementSupported() {
@@ -1047,7 +1046,6 @@
/**
* Return true if offloaded filters are supported
*
- * @hide
* @return true if chipset supports on-chip filtering
*/
public boolean isOffloadedFilteringSupported() {
@@ -1063,7 +1061,6 @@
/**
* Return true if offloaded scan batching is supported
*
- * @hide
* @return true if chipset supports on-chip scan batching
*/
public boolean isOffloadedScanBatchingSupported() {
@@ -2132,5 +2129,11 @@
public void onBatchScanResults(List<ScanResult> results) {
// no op
}
+
+ @Override
+ public void onFoundOrLost(boolean onFound, String address,int rssi,
+ byte[] advData) {
+ // no op
+ }
}
}
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index 8b7b0af9..a287b3c 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -631,6 +631,15 @@
public void onBatchScanResults(List<ScanResult> results) {
// no op
}
+
+ /**
+ * @hide
+ */
+ @Override
+ public void onFoundOrLost(boolean onFound, String address, int rssi,
+ byte[] advData) {
+ // no op.
+ }
};
/*package*/ BluetoothGatt(Context context, IBluetoothGatt iGatt, BluetoothDevice device,
diff --git a/core/java/android/bluetooth/IBluetoothGattCallback.aidl b/core/java/android/bluetooth/IBluetoothGattCallback.aidl
index c18d357..af218eb 100644
--- a/core/java/android/bluetooth/IBluetoothGattCallback.aidl
+++ b/core/java/android/bluetooth/IBluetoothGattCallback.aidl
@@ -68,4 +68,6 @@
void onMultiAdvertiseCallback(in int status);
void onConfigureMTU(in String address, in int mtu, in int status);
void onConnectionCongested(in String address, in boolean congested);
+ void onFoundOrLost(in boolean onFound, in String address, in int rssi,
+ in byte[] advData);
}
diff --git a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
index 6b21ce2..d395d43 100644
--- a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
+++ b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
@@ -386,6 +386,12 @@
public void onBatchScanResults(List<ScanResult> results) {
// no op
}
+
+ @Override
+ public void onFoundOrLost(boolean onFound, String address, int rssi,
+ byte[] advData) {
+ // no op
+ }
}
private void postCallbackFailure(final AdvertiseCallback callback, final int error) {
diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java
index 863282a..d5a4728 100644
--- a/core/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -421,6 +421,25 @@
public void onConnectionCongested(String address, boolean congested) {
// no op
}
+
+ @Override
+ public void onFoundOrLost(boolean onFound, String address, int rssi,
+ byte[] advData) {
+ if (DBG) {
+ Log.d(TAG, "onFoundOrLost() - Device=" + address);
+ }
+ // ToDo: Fix issue with underlying reporting from chipset
+ BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(
+ address);
+ long scanNanos = SystemClock.elapsedRealtimeNanos();
+ ScanResult result = new ScanResult(device, advData, rssi,
+ scanNanos);
+ if (onFound) {
+ mScanCallback.onAdvertisementFound(result);
+ } else {
+ mScanCallback.onAdvertisementLost(result);
+ }
+ }
}
private void postCallbackError(final ScanCallback callback, final int errorCode) {
diff --git a/core/java/android/bluetooth/le/ScanCallback.java b/core/java/android/bluetooth/le/ScanCallback.java
index f5d7a9a..593f7f8 100644
--- a/core/java/android/bluetooth/le/ScanCallback.java
+++ b/core/java/android/bluetooth/le/ScanCallback.java
@@ -56,7 +56,6 @@
* Callback when the BLE advertisement is found for the first time.
*
* @param result The Bluetooth LE scan result when the onFound event is triggered.
- * @hide
*/
public abstract void onAdvertisementFound(ScanResult result);
@@ -65,7 +64,6 @@
* lost.
*
* @param result The Bluetooth scan result that was last found.
- * @hide
*/
public abstract void onAdvertisementLost(ScanResult result);
diff --git a/core/java/android/bluetooth/le/ScanSettings.java b/core/java/android/bluetooth/le/ScanSettings.java
index 3bb39b3..7c0f9e1 100644
--- a/core/java/android/bluetooth/le/ScanSettings.java
+++ b/core/java/android/bluetooth/le/ScanSettings.java
@@ -44,13 +44,10 @@
public static final int CALLBACK_TYPE_ON_UPDATE = 0;
/**
* Callback when a bluetooth advertisement is found for the first time.
- * @hide
*/
public static final int CALLBACK_TYPE_ON_FOUND = 1;
/**
* Callback when a bluetooth advertisement is found for the first time, then lost.
- *
- * @hide
*/
public static final int CALLBACK_TYPE_ON_LOST = 2;
diff --git a/core/java/android/hardware/hdmi/HdmiClient.java b/core/java/android/hardware/hdmi/HdmiClient.java
index 7bdcca2..bb0f4ba 100644
--- a/core/java/android/hardware/hdmi/HdmiClient.java
+++ b/core/java/android/hardware/hdmi/HdmiClient.java
@@ -12,6 +12,7 @@
*
* @hide
*/
+@SystemApi
public abstract class HdmiClient {
private static final String TAG = "HdmiClient";
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 206b75d..99e108f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -764,7 +764,16 @@
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_ZEN_MODE_SETTINGS = "android.settings.ZEN_MODE_SETTINGS";
- /** {@hide} */
+ /**
+ * Activity Action: Show the regulatory information screen for the device.
+ * <p>
+ * In some cases, a matching Activity may not exist, so ensure you safeguard
+ * against this.
+ * <p>
+ * Input: Nothing.
+ * <p>
+ * Output: Nothing.
+ */
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String
ACTION_SHOW_REGULATORY_INFO = "android.settings.SHOW_REGULATORY_INFO";
diff --git a/core/java/android/widget/ActivityChooserModel.java b/core/java/android/widget/ActivityChooserModel.java
index 61df922..51174c3 100644
--- a/core/java/android/widget/ActivityChooserModel.java
+++ b/core/java/android/widget/ActivityChooserModel.java
@@ -979,9 +979,6 @@
}
}
- /**
- * Command for reading the historical records from a file off the UI thread.
- */
private void readHistoricalDataImpl() {
FileInputStream fis = null;
try {
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 916586c..5409de7 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -26,7 +26,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
-import android.net.Uri;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -34,8 +33,8 @@
import android.os.UserHandle;
import android.os.storage.IMountService;
import android.os.storage.StorageManager;
+import android.phone.PhoneManager;
import android.provider.Settings;
-import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.IWindowManager;
@@ -1323,19 +1322,11 @@
* to indicate what action will be taken.
*
* If there's currently a call in progress, the button will take them to the call
- * @param button the button to update
- * @param the phone state:
- * {@link TelephonyManager#CALL_STATE_IDLE}
- * {@link TelephonyManager#CALL_STATE_RINGING}
- * {@link TelephonyManager#CALL_STATE_OFFHOOK}
- * @param shown indicates whether the given screen wants the emergency button to show at all
- * @param button
- * @param phoneState
- * @param shown shown if true; hidden if false
- * @param upperCase if true, converts button label string to upper case
+ * @param button The button to update
+ * @param shown Indicates whether the given screen wants the emergency button to show at all
+ * @param showIcon Indicates whether to show a phone icon for the button.
*/
- public void updateEmergencyCallButtonState(Button button, int phoneState, boolean shown,
- boolean showIcon) {
+ public void updateEmergencyCallButtonState(Button button, boolean shown, boolean showIcon) {
if (isEmergencyCallCapable() && shown) {
button.setVisibility(View.VISIBLE);
} else {
@@ -1344,7 +1335,7 @@
}
int textId;
- if (phoneState == TelephonyManager.CALL_STATE_OFFHOOK) {
+ if (getPhoneManager().isInAPhoneCall()) {
// show "return to call" text and show phone icon
textId = R.string.lockscreen_return_to_call;
int phoneCallIcon = showIcon ? R.drawable.stat_sys_phone_call : 0;
@@ -1362,9 +1353,11 @@
* on various lockscreens.
*/
public void resumeCall() {
- TelephonyManager telephonyManager =
- (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
- telephonyManager.showCallScreen();
+ getPhoneManager().showCallScreen(false);
+ }
+
+ private PhoneManager getPhoneManager() {
+ return (PhoneManager) mContext.getSystemService(Context.PHONE_SERVICE);
}
private void finishBiometricWeak() {
diff --git a/core/jni/android_text_StaticLayout.cpp b/core/jni/android_text_StaticLayout.cpp
index 696926c..9e20d18 100644
--- a/core/jni/android_text_StaticLayout.cpp
+++ b/core/jni/android_text_StaticLayout.cpp
@@ -63,7 +63,7 @@
jcharArray inputText, jint length,
jintArray recycle) {
jintArray ret;
- std::vector<jint> breaks(16);
+ std::vector<jint> breaks;
ScopedIcuLocale icuLocale(env, javaLocaleName);
if (icuLocale.valid()) {
@@ -84,7 +84,7 @@
breaks.push_back(-1); // sentinel terminal value
- if (recycle != NULL && env->GetArrayLength(recycle) >= breaks.size()) {
+ if (recycle != NULL && static_cast<size_t>(env->GetArrayLength(recycle)) >= breaks.size()) {
ret = recycle;
} else {
ret = env->NewIntArray(breaks.size());
diff --git a/docs/html/preview/images/notifications/ProductIcons.png b/docs/html/preview/images/notifications/ProductIcons.png
index f120fbd..ae3bb03 100644
--- a/docs/html/preview/images/notifications/ProductIcons.png
+++ b/docs/html/preview/images/notifications/ProductIcons.png
Binary files differ
diff --git a/docs/html/training/wearables/apps/creating.jd b/docs/html/training/wearables/apps/creating.jd
index fa4913f..49f8b0e7 100644
--- a/docs/html/training/wearables/apps/creating.jd
+++ b/docs/html/training/wearables/apps/creating.jd
@@ -48,7 +48,7 @@
<li>Click <b>Create...</b>.</li>
<li>Fill in the following details for the AVD you want to specify and leave the rest
of the fields with their default values:
- <ol>
+ <ul>
<li><b>AVD Name</b> - A name for your AVD</li>
<li><b>Device</b> - Android Wear Round or Square device types</li>
<li><b>Target</b> - Android 4.4W - API Level 20</li>
@@ -57,7 +57,7 @@
<li><b>Skin</b> - AndroidWearRound or AndroidWearSquare depending on the selected device type</li>
<li><b>Snapshot</b> - Not selected</li>
<li><b>Use Host GPU</b> - Selected, to support custom activities for wearable notifications</li>
- </ol>
+ </ul>
</li>
<li>Click <b>OK</b>.</li>
<li>Start the emulator:
@@ -119,8 +119,8 @@
</ul>
</li>
<li>In the first <b>Add an Activity</b> window, add a blank activity for mobile.</li>
- <li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.
-
+ <li>In the second <b>Add an Activity</b> window, add a blank activity for Wear.</li>
+</ol>
<p>When the wizard completes, Android Studio creates a new project with two modules, <b>mobile</b> and
<b>wear</b>. You now have a project for both your handheld and wearable apps that you can create activities,
services, custom layouts, and much more in. On the handheld app, you do most of the heavy lifting,
@@ -135,7 +135,7 @@
by the <a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">wearable support library</a>.</p>
</li>
-<h2 id="Install">Install the Wearable app</h2>
+<h2 id="Install">Install the Wearable App</h2>
<p>When developing, you install apps directly to the wearable like with handheld apps. Use
either <code>adb install</code> or the <b>Play</b> button on Android Studio.</p>
@@ -178,12 +178,13 @@
If you're not using these APIs, remove the dependency from both modules.</p>
<b>Wearable UI support library</b>
-<p>This is an unofficial library that includes UI widgets designed for wearables. We encourage you
-to use them in your apps, because they exemplify best practices, but they can still
-change at any time. However, if the libraries are updated, your apps won't break since they are compiled
-into your app. To get new features from an updated library, you just need to
-statically link the new version and update your app accordingly.
-This library is only applicable if you create wearable apps.
+<p>This is an unofficial library that includes
+<a href="{@docRoot}training/wearables/apps/layouts.html#UiLibrary">UI widgets designed for
+wearables</a>. We encourage you to use them in your apps, because they exemplify best practices,
+but they can still change at any time. However, if the libraries are updated, your apps won't
+break since they are compiled into your app. To get new features from an updated library, you just
+need to statically link the new version and update your app accordingly. This library is only
+applicable if you create wearable apps.
</p>
<p>In the next lessons, you'll learn how to create layouts designed for wearables as well as how
diff --git a/docs/html/training/wearables/apps/packaging.jd b/docs/html/training/wearables/apps/packaging.jd
index d09cd08..480f712 100644
--- a/docs/html/training/wearables/apps/packaging.jd
+++ b/docs/html/training/wearables/apps/packaging.jd
@@ -78,7 +78,6 @@
</p>
</ol>
-
<h3>Signing the wearable and handheld app separately</h3>
<p>If your build process requires signing the wearable app separately from the handheld app,
you can declare the following Gradle rule in the handheld module's <code>build.gradle</code> to
@@ -105,9 +104,9 @@
<li>Copy the signed wearable app to your handheld project's <code>res/raw</code> directory. We'll
refer to the APK as <code>wearable_app.apk</code>.</li>
<li>Create a <code>res/xml/wearable_app_desc.xml</code> file that contains the version and
- path information of the wearable app:
+ path information of the wearable app. For example:
<pre>
-<wearableApp package="com.google.android.wearable.myapp">
+<wearableApp package="wearable.app.package.name">
<versionCode>1</versionCode>
<versionName>1.0</versionName>
<rawPathResId>wearable_app</rawPathResId> <!-- Do not include the .apk extension -->
@@ -125,7 +124,7 @@
Add a <code>meta-data</code> tag to your handheld app's <code><application></code> tag to
reference the <code>wearable_app_desc.xml</code> file.
<pre>
- <meta-data android:name="com.google.android.wearable.myapp"
+ <meta-data android:name="com.google.android.wearable.beta.app"
android:resource="@xml/wearable_app_desc"/>
</pre>
</li>
@@ -133,25 +132,14 @@
</ol>
<h2 id="AssetCompression">Turn off Asset Compression</h2>
-<p>
-Many build tools automatically compress any files added to the <code>assets/</code>
+<p>Many build tools automatically compress any files added to the <code>res/raw</code>
directory of an Android app. Because the wearable APK is already zipped, these tools re-compress the
wearable APK and the wearable app installer can no longer read the wearable app.
</p>
-<p> When this happens, the installation fails. On the handheld app, the <code>PackageUpdateService</code>
+<p>When this happens, the installation fails. On the handheld app, the <code>PackageUpdateService</code>
logs the following error: "this file cannot be opened as a file descriptor; it is probably compressed."
-
-<p> To prevent this error in Android Studio, update your handheld app's <code>build.gradle</code> file
-with the following declaration:
</p>
-<pre>
-android {
- aaptOptions {
- noCompress "apk"
- }
-}
-</pre>
-
-<p>If you are using another build process, ensure that you don't doubly compress the wearable app.</p>
\ No newline at end of file
+<p>Android Studio doesn't compress your APK by default, but if you are using another build process,
+ensure that you don't doubly compress the wearable app.</p>
\ No newline at end of file
diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
index 4ed37d4..73b11f3 100644
--- a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
+++ b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
@@ -128,7 +128,7 @@
enabled = mLockPatternUtils.isSecure();
}
}
- mLockPatternUtils.updateEmergencyCallButtonState(this, phoneState, enabled, false);
+ mLockPatternUtils.updateEmergencyCallButtonState(this, enabled, false);
}
}
diff --git a/phone/java/android/phone/PhoneManager.java b/phone/java/android/phone/PhoneManager.java
index 244916f..360565e 100644
--- a/phone/java/android/phone/PhoneManager.java
+++ b/phone/java/android/phone/PhoneManager.java
@@ -22,7 +22,6 @@
import android.util.Log;
import com.android.internal.telecomm.ITelecommService;
-import com.android.internal.telephony.ITelephony;
/**
* Exposes call-related functionality for use by phone and dialer apps.
@@ -49,15 +48,18 @@
/**
* Processes the specified dial string as an MMI code.
+ * <p>
+ * Requires that the method-caller be set as the system dialer app.
+ * </p>
*
* @param dialString The digits to dial.
* @return True if the digits were processed as an MMI code, false otherwise.
*/
public boolean handlePinMmi(String dialString) {
try {
- return getITelephony().handlePinMmi(dialString);
+ return mService.handlePinMmi(dialString);
} catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelephony#handlePinMmi", e);
+ Log.e(TAG, "Error calling ITelecommService#handlePinMmi", e);
}
return false;
}
@@ -65,7 +67,7 @@
/**
* Removes the missed-call notification if one is present.
* <p>
- * Requires that the caller be set at the system dialer app.
+ * Requires that the method-caller be set as the system dialer app.
* </p>
*/
public void cancelMissedCallsNotification() {
@@ -76,7 +78,36 @@
}
}
- private ITelephony getITelephony() {
- return ITelephony.Stub.asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE));
+ /**
+ * Brings the in-call screen to the foreground if there is an ongoing call. If there is
+ * currently no ongoing call, then this method does nothing.
+ * <p>
+ * Requires that the method-caller be set as the system dialer app or have the
+ * {@link android.Manifest.permission#READ_PHONE_STATE} permission.
+ * </p>
+ *
+ * @param showDialpad Brings up the in-call dialpad as part of showing the in-call screen.
+ */
+ public void showCallScreen(boolean showDialpad) {
+ try {
+ mService.showCallScreen(showDialpad);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#showCallScreen", e);
+ }
+ }
+
+ /**
+ * Returns whether there is an ongoing phone call.
+ * <p>
+ * Requires permission: {@link android.Manifest.permission#READ_PHONE_STATE}
+ * </p>
+ */
+ public boolean isInAPhoneCall() {
+ try {
+ return mService.isInAPhoneCall();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error caling ITelecommService#isInAPhoneCall", e);
+ }
+ return false;
}
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index f8235e1..0a201f9 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -6151,8 +6151,11 @@
File packLib64 = new File(lib64, apkName);
File libDir = (packLib64.exists()) ? lib64 : new File(apkRoot, LIB_DIR_NAME);
nativeLibraryPath = (new File(libDir, apkName)).getAbsolutePath();
+ } else if (isApkFile(codeFile)) {
+ // Monolithic install
+ nativeLibraryPath = (new File(mAppLibInstallDir, apkName)).getAbsolutePath();
} else {
- // Upgraded system app; derive its library path by inspecting.
+ // Cluster install
// TODO: pipe through abiOverride
String[] abiList = Build.SUPPORTED_ABIS;
NativeLibraryHelper.Handle handle = null;
diff --git a/services/core/java/com/android/server/power/Notifier.java b/services/core/java/com/android/server/power/Notifier.java
index e244bde..e272f38 100644
--- a/services/core/java/com/android/server/power/Notifier.java
+++ b/services/core/java/com/android/server/power/Notifier.java
@@ -243,7 +243,7 @@
/**
* Notifies that the device is changing interactive state.
*/
- public void onInteractiveStateChangeStarted(boolean interactive, int reason) {
+ public void onInteractiveStateChangeStarted(boolean interactive, final int reason) {
if (DEBUG) {
Slog.d(TAG, "onInteractiveChangeStarted: interactive=" + interactive
+ ", reason=" + reason);
@@ -259,6 +259,14 @@
mScreenOnBlockerAcquired = true;
mScreenOnBlocker.acquire();
}
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 1, 0, 0, 0);
+ mPolicy.wakingUp(mScreenOnListener);
+ mActivityManagerInternal.wakingUp();
+ }
+ });
updatePendingBroadcastLocked();
}
} else {
@@ -298,6 +306,23 @@
mUserActivityPending = false;
mHandler.removeMessages(MSG_USER_ACTIVITY);
}
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ int why = WindowManagerPolicy.OFF_BECAUSE_OF_USER;
+ switch (mLastGoToSleepReason) {
+ case PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN:
+ why = WindowManagerPolicy.OFF_BECAUSE_OF_ADMIN;
+ break;
+ case PowerManager.GO_TO_SLEEP_REASON_TIMEOUT:
+ why = WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT;
+ break;
+ }
+ EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 0, why, 0, 0);
+ mPolicy.goingToSleep(why);
+ mActivityManagerInternal.goingToSleep();
+ }
+ });
updatePendingBroadcastLocked();
}
}
@@ -409,7 +434,6 @@
mBroadcastStartTime = SystemClock.uptimeMillis();
powerState = mBroadcastedPowerState;
- goToSleepReason = mLastGoToSleepReason;
}
EventLog.writeEvent(EventLogTags.POWER_SCREEN_BROADCAST_SEND, 1);
@@ -417,7 +441,7 @@
if (powerState == POWER_STATE_AWAKE) {
sendWakeUpBroadcast();
} else {
- sendGoToSleepBroadcast(goToSleepReason);
+ sendGoToSleepBroadcast();
}
}
@@ -426,11 +450,6 @@
Slog.d(TAG, "Sending wake up broadcast.");
}
- EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 1, 0, 0, 0);
-
- mPolicy.wakingUp(mScreenOnListener);
- mActivityManagerInternal.wakingUp();
-
if (ActivityManagerNative.isSystemReady()) {
mContext.sendOrderedBroadcastAsUser(mScreenOnIntent, UserHandle.ALL, null,
mWakeUpBroadcastDone, mHandler, 0, null, null);
@@ -462,26 +481,11 @@
}
};
- private void sendGoToSleepBroadcast(int reason) {
+ private void sendGoToSleepBroadcast() {
if (DEBUG) {
Slog.d(TAG, "Sending go to sleep broadcast.");
}
- int why = WindowManagerPolicy.OFF_BECAUSE_OF_USER;
- switch (reason) {
- case PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN:
- why = WindowManagerPolicy.OFF_BECAUSE_OF_ADMIN;
- break;
- case PowerManager.GO_TO_SLEEP_REASON_TIMEOUT:
- why = WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT;
- break;
- }
-
- EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 0, why, 0, 0);
-
- mPolicy.goingToSleep(why);
- mActivityManagerInternal.goingToSleep();
-
if (ActivityManagerNative.isSystemReady()) {
mContext.sendOrderedBroadcastAsUser(mScreenOffIntent, UserHandle.ALL, null,
mGoToSleepBroadcastDone, mHandler, 0, null, null);
diff --git a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
index d151d09..30e4bdc 100644
--- a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
@@ -85,4 +85,9 @@
* @see PhoneManager#cancelMissedCallsNotification
*/
void cancelMissedCallsNotification();
+
+ /**
+ * @see PhoneManager#handlePinMmi
+ */
+ boolean handlePinMmi(String dialString);
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index e4885a1..15320e6 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2890,30 +2890,6 @@
/** @hide */
@SystemApi
- public boolean showCallScreen() {
- try {
- getTelecommService().showCallScreen(false);
- return true;
- } catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelecommService#showCallScreen", e);
- }
- return false;
- }
-
- /** @hide */
- @SystemApi
- public boolean showCallScreenWithDialpad(boolean showDialpad) {
- try {
- getTelecommService().showCallScreen(showDialpad);
- return true;
- } catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelecommService#showCallScreen(" + showDialpad + ")", e);
- }
- return false;
- }
-
- /** @hide */
- @SystemApi
public boolean endCall() {
try {
return getITelephony().endCall();