Skip to content

Commit

Permalink
Merge pull request iqiyi#11 from iqiyi/fixCursorCache
Browse files Browse the repository at this point in the history
fixed cursor-cache bug and upgrade core lib version to 1.1.2
  • Loading branch information
HiWong authored May 29, 2018
2 parents a270b2d + 29ddfb6 commit f5dc9aa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*
* Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
*
*/
* Copyright (c) 2018-present, iQIYI, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. Neither the name of the copyright holder 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 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.qiyi.video.svg.cursor;

import android.database.Cursor;
Expand All @@ -43,7 +43,7 @@ public class DispatcherCursor extends MatrixCursor {

public static final String KEY_BINDER_WRAPPER = "KeyBinderWrapper";

private static Map<String, DispatcherCursor> cursorMap = new ConcurrentHashMap<>();
private static Map<String, DispatcherCursor> cursorCache = new ConcurrentHashMap<>();

public static final String[] DEFAULT_COLUMNS = {"col"};

Expand All @@ -61,9 +61,13 @@ public Bundle getExtras() {

public static DispatcherCursor generateCursor(IBinder binder) {
try {
DispatcherCursor cursor = cursorMap.get(binder.getInterfaceDescriptor());
DispatcherCursor cursor;
cursor = cursorCache.get(binder.getInterfaceDescriptor());
if (cursor != null) {
return cursor;
}
cursor = new DispatcherCursor(DEFAULT_COLUMNS, binder);
cursorMap.put(binder.getInterfaceDescriptor(), cursor);
cursorCache.put(binder.getInterfaceDescriptor(), cursor);
return cursor;
} catch (RemoteException ex) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {

implementation 'com.android.support:design:26.0.2'

implementation "org.qiyi.video.svg:core:$maven_config.build_version"
implementation "org.qiyi.video.svg:core:$maven_config.core_build_version"
//implementation "org.qiyi.video.svg:core:1.0.6"

//implementation project(":Andromeda-Plugin")
Expand Down
2 changes: 1 addition & 1 deletion applemodule/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {

api project(":moduleexportlib")
//api project(':Andromeda-Lib')
implementation "org.qiyi.video.svg:core:$maven_config.build_version"
implementation "org.qiyi.video.svg:core:$maven_config.core_build_version"

implementation 'com.android.support:appcompat-v7:26.0.2'
testImplementation 'junit:junit:4.12'
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ buildscript {
'userName':USER_NAME,
'groupId':GROUP_ID,
'passWord':PASS_WORD,
'version_code':111,
'version_name':'1.1.1',
'build_version':'1.1.0'
'version_code':112,
'version_name':'1.1.2',
'core_build_version':'1.1.2',
'plugin_build_version':'1.1.1'
]

repositories {
Expand All @@ -18,7 +19,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.qiyi.video.svg:plugin:$maven_config.build_version"
classpath "org.qiyi.video.svg:plugin:$maven_config.plugin_build_version"

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
Expand Down
2 changes: 1 addition & 1 deletion cherrymodule/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {

api project(":moduleexportlib")
//api project(':Andromeda-Lib')
implementation "org.qiyi.video.svg:core:$maven_config.build_version"
implementation "org.qiyi.video.svg:core:$maven_config.core_build_version"

implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
Expand Down
2 changes: 1 addition & 1 deletion moduleexportlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

//compile project(':Andromeda-Lib')
implementation "org.qiyi.video.svg:core:$maven_config.build_version"
implementation "org.qiyi.video.svg:core:$maven_config.core_build_version"


compileOnly 'com.android.support:appcompat-v7:26.0.2'
Expand Down

0 comments on commit f5dc9aa

Please sign in to comment.