Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f31a6400 authored by Steve Kondik's avatar Steve Kondik
Browse files

Merge branch 'eclair' of git://android.git.kernel.org/platform/frameworks/base into eclair

parents c542e08f 3359fc2b
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ static jmethodID method_reportNiNotification;
static const GpsInterface* sGpsInterface = NULL;
static const GpsXtraInterface* sGpsXtraInterface = NULL;
static const AGpsInterface* sAGpsInterface = NULL;
static const GpsPrivacyInterface* sGpsPrivacyInterface = NULL;
static const GpsNiInterface* sGpsNiInterface = NULL;

// data written to by GPS callbacks
@@ -226,11 +227,23 @@ static jboolean android_location_GpsLocationProvider_init(JNIEnv* env, jobject o
    if (sGpsNiInterface)
        sGpsNiInterface->init(&sGpsNiCallbacks);

    // Clear privacy lock while enabled
    if (!sGpsPrivacyInterface)
        sGpsPrivacyInterface = (const GpsPrivacyInterface*)sGpsInterface->get_extension(GPS_PRIVACY_INTERFACE);
    if (sGpsPrivacyInterface)
        sGpsPrivacyInterface->set_privacy_lock(0);

    return true;
}

static void android_location_GpsLocationProvider_disable(JNIEnv* env, jobject obj)
{
    // Enable privacy lock while disabled
    if (!sGpsPrivacyInterface)
        sGpsPrivacyInterface = (const GpsPrivacyInterface*)sGpsInterface->get_extension(GPS_PRIVACY_INTERFACE);
    if (sGpsPrivacyInterface)
        sGpsPrivacyInterface->set_privacy_lock(1);

    pthread_mutex_lock(&sEventMutex);
    sPendingCallbacks |= kDisableRequest;
    pthread_cond_signal(&sEventCond);
@@ -474,10 +487,9 @@ static void android_location_GpsLocationProvider_send_ni_response(JNIEnv* env, j
{
    if (!sGpsNiInterface)
        sGpsNiInterface = (const GpsNiInterface*)sGpsInterface->get_extension(GPS_NI_INTERFACE);
   if (sGpsNiInterface) {
    if (sGpsNiInterface)
        sGpsNiInterface->respond(notifId, response);
}
}

static JNINativeMethod sMethods[] = {
     /* name, signature, funcPtr */
+55 −0
Original line number Diff line number Diff line
/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You 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.net.http;

import android.net.http.SslCertificate;
import android.test.suitebuilder.annotation.LargeTest;
import java.io.ByteArrayInputStream;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import junit.framework.TestCase;

public class SslCertificateTest extends TestCase {

    /**
     * Problematic certificate from Issue 1597
     * http://code.google.com/p/android/issues/detail?id=1597
     */
    private static final String Issue1597Certificate =
        "-----BEGIN CERTIFICATE-----\n"+
        "MIIBnjCCAQegAwIBAgIFAKvN774wDQYJKoZIhvcNAQEFBQAwADAeFw0yNzA5MjQw\n"+
        "MDAwMDFaFw0zNzA5MjQwMDAwMDFaMAAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ\n"+
        "AoGBAMNAaUSKw3stg6UHx6bWHNn0T5WR39UB43EZqdhhM0hnfpzwAzNs1T3jOAzF\n"+
        "OtgcX/XVt2Exc1vnwwuiJfvtPtBtQVsNu7wfk45cTUF45axBr4v8oFq7DOHCvs2C\n"+
        "pBDnw/v9PoOihuBamOjzRPL+oVhVfzEqEOILnZD1qEeVJn4RAgMBAAGjJDAiMCAG\n"+
        "A1UdEQQZMBeGD2h0dHBzOi8vMS4xLjEuMYcEAQEBATANBgkqhkiG9w0BAQUFAAOB\n"+
        "gQA7CMJylEjCR9CjztZUMLOutLe64RNhMq9iKgbDfJwYrcgvUNOxjrCdFW66lE9N\n"+
        "TDscc4zS2kpV41vcVYiGwabCNUPi2P6zfFSpYmGqwwu1NoEayqGPdDMrgCnMXVYV\n"+
        "X7HoVif4IdGvjFQrYcyU2VWSWBq6IGMVCR6RkC2YWnnNhw==\n"+
        "-----END CERTIFICATE-----\n";

    @LargeTest
    public void testSslCertificateWithEmptyIssuer() throws Exception {
        CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
        X509Certificate x509Certificate = (X509Certificate)
            certificateFactory.generateCertificate(new ByteArrayInputStream(Issue1597Certificate.getBytes()));
        assertEquals(x509Certificate.getIssuerDN().getName(), "");
        SslCertificate sslCertificate = new SslCertificate(x509Certificate);
        assertEquals(sslCertificate.getIssuedBy().getDName(), "");
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ private final IRemoteService.Stub mBinder = new IRemoteService.Stub(){
<p>A few rules about implementing your interface: </p>
<ul>
    <li>No exceptions that you throw will be sent back to the caller.</li>
    <li>IPC calls are synchronous. If you know that an IPC service takes more than
    <li>By default, IPC calls are synchronous. If you know that an IPC service takes more than
        a few milliseconds to complete, you should not call it in the Activity/View thread,
        because it might hang the application (Android might display an &quot;Application
        is Not Responding&quot; dialog). 
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ page.title=Android Emulator
that runs on your computer. The emulator lets you prototype, develop, and test 
Android applications without using a physical device. </p>

<p>The Android emulator mimics all of the typical hardware and software features 
<p>The Android emulator all of the hardware and software features 
of a typical mobile device, except that it can not receive or place actual phone 
calls. It provides a variety of navigation and control keys, which you can "press" 
using your mouse or keyboard to generate events for your application. It also 
+3 −3
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ screen. </p>
generalized densities: high, medium, and low. Applications can provide custom
resources for each of these three densities &mdash; the platform handles the
scaling of the resources up or down to meet the actual screen density. </p></dd>
<dt><em>Density independent pixel (dip)</em></dt>
<dt><em>Density-independent pixel (dip)</em></dt>
  <dd>A virtual pixel unit that applications can use in defining their UI, to
express layout dimensions or position in a density-independent way. 
  <p>The density-independent pixel is equivalent to one physical pixel on a 160
@@ -432,7 +432,7 @@ does this in three ways: </p>
<ul>
<li>Through pre-scaling of drawable resources (scaled at resource loading
time)</li>
<li>Through auto-scaling of device-independent pixel (dip) values used in
<li>Through auto-scaling of density-independent pixel (dip) values used in
layouts</li>
<li>Through auto-scaling of absolute pixel values used in the application (only
needed if the application has set <code>android:anyDensity="false"</code> in its
@@ -573,7 +573,7 @@ installing the application on small-screen devices. </li>
are signaling to the platform that your application wants to manage its UI by
itself, for all screen densities, using the actual screen dimensions and pixels.
In this case, the application must ensure that it declares its UI dimensions
using device-independent pixels and scales any actual pixel values or math by
using density-independent pixels and scales any actual pixel values or math by
the scaling factor available from 
{@link android.util.DisplayMetrics#density android.util.DisplayMetrics.density}.</p>

Loading